[PATCH] render: return the supported version rather than just passing the proto's version

Peter Hutterer peter.hutterer at who-t.net
Mon Sep 14 20:30:54 PDT 2009


On Sun, Sep 13, 2009 at 12:00:12PM +0200, Julien Cristau wrote:
> ---
>  render/render.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> The spec says "the server sends the highest version it supports, but no
> higher than the requested version".
> 
> This patch makes us send the highest version we support, rather than
> whatever renderproto version was used when building the server.  Should
> we start checking the client's version as well?  (the randr spec has the
> same language, and the code just returns SERVER_RANDR_M{AJ,IN}OR)

IMO either the documentation or the behaviour should for this should be
fixed (for both randr and render).

Keith?

> diff --git a/render/render.c b/render/render.c
> index 995ebd9..03bc94a 100644
> --- a/render/render.c
> +++ b/render/render.c
> @@ -52,6 +52,9 @@
>  #define UINT32_MAX 0xffffffffU
>  #endif
>  
> +#define SERVER_RENDER_MAJOR 0
> +#define SERVER_RENDER_MINOR 11
> +

This is a problem that affects a number of protocols:
- updating the protocol and recompiling the server makes it announce a
  false version.
- updating the server but not the protocol makes it announces a false
  version.
- having a separate server define means over time we will forget to update
  it (libXcomposite has seen this effect already).

only the second issue is currently prevented by pkgconfig.
This define only fixes the issue for now, I'd rather see a solution that
addresses this issue properly and for all protocol repos.
Though I'm not sure yet how that solution should look like.

Cheers,
  Peter

>  static int ProcRenderQueryVersion (ClientPtr pClient);
>  static int ProcRenderQueryPictFormats (ClientPtr pClient);
>  static int ProcRenderQueryPictIndexValues (ClientPtr pClient);
> @@ -270,8 +273,8 @@ ProcRenderQueryVersion (ClientPtr client)
>      rep.type = X_Reply;
>      rep.length = 0;
>      rep.sequenceNumber = client->sequence;
> -    rep.majorVersion = RENDER_MAJOR;
> -    rep.minorVersion = RENDER_MINOR;
> +    rep.majorVersion = SERVER_RENDER_MAJOR;
> +    rep.minorVersion = SERVER_RENDER_MINOR;
>      if (client->swapped) {
>      	swaps(&rep.sequenceNumber, n);
>      	swapl(&rep.length, n);
> -- 
> 1.6.3.3


More information about the xorg-devel mailing list