summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2017-07-10 15:30:07 +0200
committerLucas Stach <l.stach@pengutronix.de>2017-07-10 15:30:07 +0200
commit2c4b6d0912e12dc35071912d17b639092412087e (patch)
tree0ab40c5bda97414fc9c52ff1c1b5411a44467fa4
parentf310a14e09fd587f47971de99b92e8a2bdbf46fa (diff)
use experimental GBM usage flags to better describe BO usagesoftware-clients
This allows the GPU driver to optimize the buffer allocation. Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
-rw-r--r--gralloc_gbm.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/gralloc_gbm.cpp b/gralloc_gbm.cpp
index 8f9bfc4..5ce5611 100644
--- a/gralloc_gbm.cpp
+++ b/gralloc_gbm.cpp
@@ -86,12 +86,16 @@ static unsigned int get_pipe_bind(int usage)
{
unsigned int bind = 0;
- if (usage & (GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN))
- bind |= GBM_BO_USE_LINEAR;
+ if (usage & (GRALLOC_USAGE_SW_READ_OFTEN)
+ bind |= GBM_BO_USE_MAP_READ;
+ if (usage & GRALLOC_USAGE_SW_WRITE_OFTEN)
+ bind |= GBM_BO_USE_MAP_WRITE;
if (usage & GRALLOC_USAGE_CURSOR)
;//bind |= GBM_BO_USE_CURSOR;
- if (usage & (GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE))
+ if (usage & GRALLOC_USAGE_HW_RENDER)
bind |= GBM_BO_USE_RENDERING;
+ if (usage & GRALLOC_USAGE_HW_TEXTURE)
+ bind |= GBM_BO_USE_TEXTURING;
if (usage & GRALLOC_USAGE_HW_FB)
bind |= GBM_BO_USE_SCANOUT;