OSDN Git Service

Update sw usage flags handling marshmallow-x86
authorMauro Rossi <issor.oruam@gmail.com>
Sun, 14 May 2017 20:28:33 +0000 (22:28 +0200)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 15 May 2017 01:50:02 +0000 (09:50 +0800)
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

index 16de013..dda4705 100644 (file)
@@ -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)