From 640b8f16644d56ca53d1130e026c9c2098574bfe Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Tue, 13 Dec 2016 09:37:06 -0600 Subject: 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 --- gralloc_gbm.cpp | 4 ++-- 1 file 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; -- cgit v1.2.3