[PATCH xserver v2 6/9] xfree86: Make xf86SetDDCproperties work more than once per generation
Michel Dänzer
michel at daenzer.net
Thu Apr 14 09:16:44 UTC 2016
On 06.04.2016 02:54, Adam Jackson wrote:
> We can call this more than once via xf86OutputSetEDID since hotplug is
> actually a thing in RANDR 1.2, but xf86RegisterRootWindowProperty merely
> adds the data to a list to be applied to the root at CreateWindow time,
> so calls past the first (for a given screen) would have no effect until
> server regen.
>
> Once we've initialised pScrn->pScreen is filled in, so we can just set
> the property directly.
>
> Signed-off-by: Adam Jackson <ajax at redhat.com>
> ---
> hw/xfree86/ddc/ddcProperty.c | 34 ++++++++++++++++++++++++++++------
> 1 file changed, 28 insertions(+), 6 deletions(-)
>
> diff --git a/hw/xfree86/ddc/ddcProperty.c b/hw/xfree86/ddc/ddcProperty.c
> index c51c3e6..a31e9c7 100644
> --- a/hw/xfree86/ddc/ddcProperty.c
> +++ b/hw/xfree86/ddc/ddcProperty.c
[...]
> @@ -34,17 +35,38 @@
>
> #define EDID1_ATOM_NAME "XFree86_DDC_EDID1_RAWDATA"
>
> +static int
> +edidSize(const xf86MonPtr DDC)
> +{
> + if (DDC->ver.version != 1)
> + return 0;
I'd like to see you address Walter's question about this check.
> static void
> -edidMakeAtom(int i, const char *name, CARD8 *data, int size)
> +setRootWindowEDID(ScreenPtr pScreen, xf86MonPtr DDC)
> +{
> + Atom atom = MakeAtom(EDID1_ATOM_NAME, strlen(EDID1_ATOM_NAME), TRUE);
> +
> + dixChangeWindowProperty(serverClient, pScreen->root, atom, XA_INTEGER,
> + 8, PropModeReplace, edidSize(DDC), DDC->rawData,
> + FALSE);
> +}
Also, if edidSize can return 0 (at least in theory, can't happen in
practice according to patch 7), does dixChangeWindowProperty handle that
gracefully?
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
More information about the xorg-devel
mailing list