OSDN Git Service

minigbm: cros_gralloc: support GRALLOC_MODULE_API_VERSION_0_3
[android-x86/external-minigbm.git] / gbm.c
diff --git a/gbm.c b/gbm.c
index ab576cf..37fb1d9 100644 (file)
--- a/gbm.c
+++ b/gbm.c
@@ -233,7 +233,10 @@ PUBLIC void *gbm_bo_map(struct gbm_bo *bo, uint32_t x, uint32_t y, uint32_t widt
                return NULL;
 
        *stride = gbm_bo_get_plane_stride(bo, plane);
-       return drv_bo_map(bo->bo, x, y, width, height, 0, (struct map_info **)map_data, plane);
+       uint32_t drv_flags = flags & GBM_BO_TRANSFER_READ ? BO_TRANSFER_READ : BO_TRANSFER_NONE;
+       drv_flags |= flags & GBM_BO_TRANSFER_WRITE ? BO_TRANSFER_WRITE : BO_TRANSFER_NONE;
+       return drv_bo_map(bo->bo, x, y, width, height, drv_flags, (struct map_info **)map_data,
+                         plane);
 }
 
 PUBLIC void gbm_bo_unmap(struct gbm_bo *bo, void *map_data)