From 82db518f1519cec9e3842f23455a105e2006afbd Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 24 Feb 2016 18:51:15 +0100 Subject: gallium: add external usage flags to resource_from(get)_handle (v2) This will allow drivers to make better decisions about texture sharing for DRI2, DRI3, Wayland, and OpenCL. v2: add read/write flags, take advantage of __DRI_IMAGE_USE_BACKBUFFER Reviewed-by: Axel Davy --- src/gallium/state_trackers/xa/xa_tracker.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/gallium/state_trackers/xa') diff --git a/src/gallium/state_trackers/xa/xa_tracker.c b/src/gallium/state_trackers/xa/xa_tracker.c index d57464b7d60..f09baed1d84 100644 --- a/src/gallium/state_trackers/xa/xa_tracker.c +++ b/src/gallium/state_trackers/xa/xa_tracker.c @@ -362,7 +362,8 @@ surface_create(struct xa_tracker *xa, template->bind |= PIPE_BIND_SCANOUT; if (whandle) - srf->tex = xa->screen->resource_from_handle(xa->screen, template, whandle); + srf->tex = xa->screen->resource_from_handle(xa->screen, template, whandle, + PIPE_HANDLE_USAGE_READ_WRITE); else srf->tex = xa->screen->resource_create(xa->screen, template); if (!srf->tex) @@ -548,7 +549,8 @@ xa_surface_handle(struct xa_surface *srf, memset(&whandle, 0, sizeof(whandle)); whandle.type = handle_type(type); - res = screen->resource_get_handle(screen, srf->tex, &whandle); + res = screen->resource_get_handle(screen, srf->tex, &whandle, + PIPE_HANDLE_USAGE_READ_WRITE); if (!res) return -XA_ERR_INVAL; -- cgit v1.2.3