[Mesa-dev] [PATCH] x11: Only report supported DRI3/Present versions

Emil Velikov emil.l.velikov at gmail.com
Fri Mar 23 13:03:53 UTC 2018


On 22 March 2018 at 15:27, Daniel Stone <daniels at collabora.com> wrote:
> The version passed to QueryVersion requests is the version that the
> client supports. We were just passing in whatever version of XCB was
> present on the system, which may not be a version that Mesa actually
> explicitly supports, e.g. it might bring unwanted semantics.
>
> Set specific protocol versions which we support, and only pass those.
>
> Signed-off-by: Daniel Stone <daniels at collabora.com>
Thanks for sorting this out Dan. With the small nitpicks, patch is

Fixes: 7aeef2d4efd ("dri3: allow building against older xcb (v3)")
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

> ---
>  src/egl/drivers/dri2/platform_x11_dri3.c | 19 +++++++++++++++----
>  src/glx/dri3_glx.c                       | 21 +++++++++++++++------
>  2 files changed, 30 insertions(+), 10 deletions(-)
>
> diff --git a/src/egl/drivers/dri2/platform_x11_dri3.c b/src/egl/drivers/dri2/platform_x11_dri3.c
> index 5e531e21cb0..254c4441ef5 100644
> --- a/src/egl/drivers/dri2/platform_x11_dri3.c
> +++ b/src/egl/drivers/dri2/platform_x11_dri3.c
> @@ -520,6 +520,17 @@ struct dri2_egl_display_vtbl dri3_x11_display_vtbl = {
>     .close_screen_notify = dri3_close_screen_notify,
>  };
>
> +/* Only advertise versions of these protocols which we actually support. */
s/advertise/request/  - here + dri3_glx.c

> +#define DRI3_SUPPORTED_MAJOR 1
> +#define PRESENT_SUPPORTED_MAJOR 1
Please add a blank line - here + dri3_glx.c

> +#ifdef HAVE_DRI3_MODIFIERS
> +#define DRI3_SUPPORTED_MINOR 2
> +#define PRESENT_SUPPORTED_MINOR 2
> +#else
> +#define PRESENT_SUPPORTED_MINOR 0
> +#define DRI3_SUPPORTED_MINOR 0
> +#endif
> +

At a later stage we could simplify the ifdef the way it's handled in Vulkan.

-Emil


More information about the mesa-dev mailing list