[Xcb] [PATCH] XVMC: Use XCB DRI2 instead of cargo-culting our own copy of the protocol.

Julien Cristau jcristau at debian.org
Thu Oct 15 14:56:27 PDT 2009


On Thu, Oct 15, 2009 at 14:25:49 -0700, Eric Anholt wrote:

> +static int
> +dri2_connect(Display *display)
> +{
> +	xcb_dri2_query_version_cookie_t query_version_cookie;
> +	xcb_dri2_query_version_reply_t *query_version_reply;
> +	xcb_dri2_connect_cookie_t connect_cookie;
> +	xcb_dri2_connect_reply_t *connect_reply;
> +	xcb_dri2_authenticate_cookie_t auth_cookie;
> +	xcb_dri2_authenticate_reply_t *auth_reply;
> +	xcb_screen_t *root;
> +	xcb_connection_t *c = XGetXCBConnection(display);
> +	drm_magic_t magic;
> +
> +	root = xcb_aux_get_screen(c, DefaultScreen(display));
> +
> +	query_version_cookie = xcb_dri2_query_version(c, 1, 0);
> +	query_version_reply =
> +		xcb_dri2_query_version_reply(c, query_version_cookie, NULL);
> +
> +	if (!query_version_reply) {
> +		XVMC_ERR("DRI2 required");
> +		return BadValue;
> +	}
> +	free(query_version_reply);
> +

maybe use xcb_get_extension_data() before xcb_dri2_query_version()?

Cheers,
Julien


More information about the Xcb mailing list