external/drm_gralloc
Revision | c1827f654e32078421bc75e56d335c85c596e24c (tree) |
---|---|
Time | 2017-05-15 10:50:02 |
Author | Mauro Rossi <issor.oruam@gmai...> |
Commiter | Chih-Wei Huang |
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
@@ -98,6 +98,8 @@ static unsigned get_pipe_bind(int usage) | ||
98 | 98 | { |
99 | 99 | unsigned bind = PIPE_BIND_SHARED; |
100 | 100 | |
101 | + if (usage & (GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN)) | |
102 | + bind |= PIPE_BIND_LINEAR; | |
101 | 103 | if (usage & GRALLOC_USAGE_HW_TEXTURE) |
102 | 104 | bind |= PIPE_BIND_SAMPLER_VIEW; |
103 | 105 | if (usage & GRALLOC_USAGE_HW_RENDER) |