xfree86: Create EDID atom from the root window callback (v2)
v2: Fix swapped callback args Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
8e3010d7d8
commit
e89c7f1c2a
|
@ -57,29 +57,13 @@ setRootWindowEDID(ScreenPtr pScreen, xf86MonPtr DDC)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
edidMakeAtom(int i, const char *name, xf86MonPtr DDC)
|
addEDIDProp(CallbackListPtr *pcbl, void *scrn, void *screen)
|
||||||
{
|
{
|
||||||
Atom atom;
|
ScreenPtr pScreen = screen;
|
||||||
unsigned char *atom_data;
|
ScrnInfoPtr pScrn = scrn;
|
||||||
int size = edidSize(DDC);
|
|
||||||
|
|
||||||
if (!(atom_data = malloc(size * sizeof(CARD8))))
|
if (xf86ScreenToScrn(pScreen) == pScrn)
|
||||||
return;
|
setRootWindowEDID(pScreen, pScrn->monitor->DDC);
|
||||||
|
|
||||||
atom = MakeAtom(name, strlen(name), TRUE);
|
|
||||||
memcpy(atom_data, DDC->rawData, size);
|
|
||||||
xf86RegisterRootWindowProperty(i, atom, XA_INTEGER, 8, size, atom_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
addRootWindowProperties(ScrnInfoPtr pScrn, xf86MonPtr DDC)
|
|
||||||
{
|
|
||||||
int scrnIndex = pScrn->scrnIndex;
|
|
||||||
|
|
||||||
if (xf86Initialising)
|
|
||||||
edidMakeAtom(scrnIndex, EDID1_ATOM_NAME, DDC);
|
|
||||||
else
|
|
||||||
setRootWindowEDID(pScrn->pScreen, DDC);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
|
@ -90,7 +74,10 @@ xf86SetDDCproperties(ScrnInfoPtr pScrn, xf86MonPtr DDC)
|
||||||
|
|
||||||
xf86EdidMonitorSet(pScrn->scrnIndex, pScrn->monitor, DDC);
|
xf86EdidMonitorSet(pScrn->scrnIndex, pScrn->monitor, DDC);
|
||||||
|
|
||||||
addRootWindowProperties(pScrn, DDC);
|
if (xf86Initialising)
|
||||||
|
AddCallback(&RootWindowFinalizeCallback, addEDIDProp, pScrn);
|
||||||
|
else
|
||||||
|
setRootWindowEDID(pScrn->pScreen, DDC);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue