From c1827f654e32078421bc75e56d335c85c596e24c Mon Sep 17 00:00:00 2001 From: Mauro Rossi Date: Sun, 14 May 2017 22:28:33 +0200 Subject: [PATCH] Update sw usage flags handling Inspired by Rob Herring suggestion and gbm_gralloc implementation Add missing support for GRALLOC_USAGE_SW_READ_OFTEN, GRALLOC_USAGE_SW_WRITE_OFTEN usage flags mapping them to PIPE_BIND_LINEAR Fixes the mouse cursor and message panes artifacts happening with gralloc_drm_pipe, tested with amdgpudrmfb No observed regression on swrast llvmpipe --- gralloc_drm_pipe.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gralloc_drm_pipe.c b/gralloc_drm_pipe.c index 16de013..dda4705 100644 --- a/gralloc_drm_pipe.c +++ b/gralloc_drm_pipe.c @@ -98,6 +98,8 @@ static unsigned get_pipe_bind(int usage) { unsigned bind = PIPE_BIND_SHARED; + if (usage & (GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN)) + bind |= PIPE_BIND_LINEAR; if (usage & GRALLOC_USAGE_HW_TEXTURE) bind |= PIPE_BIND_SAMPLER_VIEW; if (usage & GRALLOC_USAGE_HW_RENDER) -- 2.11.0