[PATCH xserver v2 8/9] xfree86: Create EDID atom from the root window callback (v2)
Adam Jackson
ajax at redhat.com
Tue Apr 5 17:54:32 UTC 2016
v2: Fix swapped callback args
Signed-off-by: Adam Jackson <ajax at redhat.com>
---
hw/xfree86/ddc/ddcProperty.c | 31 +++++++++----------------------
1 file changed, 9 insertions(+), 22 deletions(-)
diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c
index 66e7ba8..40391c2 100644
--- a/hw/xfree86/ddc/ddcProperty.c
+++ b/hw/xfree86/ddc/ddcProperty.c
@@ -56,29 +56,13 @@ setRootWindowEDID(ScreenPtr pScreen, xf86MonPtr DDC)
}
static void
-edidMakeAtom(int i, const char *name, xf86MonPtr DDC)
+addEDIDProp(CallbackListPtr *pcbl, void *scrn, void *screen)
{
- Atom atom;
- unsigned char *atom_data;
- int size = edidSize(DDC);
+ ScreenPtr pScreen = screen;
+ ScrnInfoPtr pScrn = scrn;
- if (!(atom_data = malloc(size * sizeof(CARD8))))
- return;
-
- 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);
+ if (xf86ScreenToScrn(pScreen) == pScrn)
+ setRootWindowEDID(pScreen, pScrn->monitor->DDC);
}
Bool
@@ -89,7 +73,10 @@ xf86SetDDCproperties(ScrnInfoPtr pScrn, xf86MonPtr DDC)
xf86EdidMonitorSet(pScrn->scrnIndex, pScrn->monitor, DDC);
- addRootWindowProperties(pScrn, DDC);
+ if (xf86Initialising)
+ AddCallback(&RootWindowFinalizeCallback, addEDIDProp, pScrn);
+ else
+ setRootWindowEDID(pScrn->pScreen, DDC);
return TRUE;
}
--
2.5.0
More information about the xorg-devel
mailing list