Commit 17b27725 authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Dave Airlie

drisw: use getImageShm() if available

Reviewed-by: default avatarDave Airlie <>
Reviewed-by: default avatarAdam Jackson <>
parent 9feaf333
......@@ -117,6 +117,26 @@ get_image2(__DRIdrawable *dPriv, int x, int y, int width, int height, int stride
data, dPriv->loaderPrivate);
static inline bool
get_image_shm(__DRIdrawable *dPriv, int x, int y, int width, int height,
struct pipe_resource *res)
__DRIscreen *sPriv = dPriv->driScreenPriv;
const __DRIswrastLoaderExtension *loader = sPriv->swrast_loader;
struct winsys_handle whandle;
if (loader->base.version < 4 || !loader->getImageShm)
return FALSE;
if (!res->screen->resource_get_handle(res->screen, NULL, res, &whandle, PIPE_HANDLE_USAGE_WRITE))
return FALSE;
loader->getImageShm(dPriv, x, y, width, height, whandle.handle, dPriv->loaderPrivate);
return TRUE;
static void
drisw_update_drawable_info(struct dri_drawable *drawable)
......@@ -364,6 +384,7 @@ drisw_update_tex_buffer(struct dri_drawable *drawable,
x, y, w, h, &transfer);
/* Copy the Drawable content to the mapped texture buffer */
if (!get_image_shm(dPriv, x, y, w, h, res))
get_image(dPriv, x, y, w, h, map);
/* The pipe transfer has a pitch rounded up to the nearest 64 pixels.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment