summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Rossi <issor.oruam@gmail.com>2017-05-14 22:28:33 +0200
committerChih-Wei Huang <cwhuang@linux.org.tw>2017-05-15 09:50:02 +0800
commitc1827f654e32078421bc75e56d335c85c596e24c (patch)
tree054d67203fae12fb3d959ae49269c7b15f2ebce4
parenta3701d20a58a9f1716776b1c3234f5452b7c8823 (diff)
downloadexternal_drm_gralloc-c1827f654e32078421bc75e56d335c85c596e24c.tar.gz
external_drm_gralloc-c1827f654e32078421bc75e56d335c85c596e24c.tar.bz2
external_drm_gralloc-c1827f654e32078421bc75e56d335c85c596e24c.zip
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
-rw-r--r--gralloc_drm_pipe.c2
1 files changed, 2 insertions, 0 deletions
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)