summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2016-12-13 09:37:06 -0600
committerRob Herring <robh@kernel.org>2016-12-13 09:44:56 -0600
commit640b8f16644d56ca53d1130e026c9c2098574bfe (patch)
tree4e597a29f941f1150ba6e85d668d08fded56d787
parentff66db2e495ee96a82aaf55dfbb058ebb7df2c95 (diff)
downloadgbm_gralloc-640b8f16644d56ca53d1130e026c9c2098574bfe.tar.gz
gbm_gralloc-640b8f16644d56ca53d1130e026c9c2098574bfe.tar.xz
Fix mapping for non-zero starting coordinates
While the gralloc API allows for specifying the starting coordinates (L,T), it seems this doesn't really work. No other gralloc implementations found use the rectangle bounds. Not exactly sure how this ever worked, but it broke recently with AOSP master. Signed-off-by: Rob Herring <robh@kernel.org>
-rw-r--r--gralloc_gbm.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/gralloc_gbm.cpp b/gralloc_gbm.cpp
index 7e0dbda..6b7c0b5 100644
--- a/gralloc_gbm.cpp
+++ b/gralloc_gbm.cpp
@@ -227,8 +227,8 @@ static int gbm_map(struct gralloc_gbm_bo_t *bo, int x, int y, int w, int h,
if (enable_write)
flags |= GBM_BO_TRANSFER_WRITE;
- *addr = gbm_bo_map(bo->bo, x, y, w, h, flags, &stride, &bo->map_data);
- ALOGE("mapped bo %p at %p", bo, *addr);
+ *addr = gbm_bo_map(bo->bo, 0, 0, x + w, y + h, flags, &stride, &bo->map_data);
+ ALOGE("mapped bo %p (%d, %d)-(%d, %d) at %p", bo, x, y, w, h, *addr);
if (*addr == NULL)
return -ENOMEM;