summaryrefslogtreecommitdiff
path: root/hw/xfree86
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2016-01-06 09:04:15 -0500
committerAdam Jackson <ajax@redhat.com>2016-04-18 11:23:10 -0400
commite89c7f1c2a0ea3480b21446e413073c1427285ae (patch)
tree69297e8ddab8be82927d552c56324f869fa4fc38 /hw/xfree86
parent8e3010d7d8e8c49c8859b576de1808ae7b2859be (diff)
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>
Diffstat (limited to 'hw/xfree86')
-rw-r--r--hw/xfree86/ddc/ddcProperty.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c
index 53446b8d6..e68672e43 100644
--- a/hw/xfree86/ddc/ddcProperty.c
+++ b/hw/xfree86/ddc/ddcProperty.c
@@ -57,29 +57,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
@@ -90,7 +74,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;
}