minigbm: standardize naming of map flags
It's helpful to differentiate map flags from normal buffer creation
flags. Note gralloc doesn't differentiate between map flags and buffer
creation flags. However, since flags are passed in with gralloc
(*lock)(), we can use a separate conversion function there.
BUG=chromium:764871
TEST=Boot Android and play games on Eve
Change-Id: Ic8aee84d9ac945abf93d9a9bda78fe3f77711cc3
Reviewed-on: https://chromium-review.googlesource.com/691424
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
diff --git a/drv.c b/drv.c
index 339aac1..fc8132a 100644
--- a/drv.c
+++ b/drv.c
@@ -361,7 +361,7 @@
}
void *drv_bo_map(struct bo *bo, uint32_t x, uint32_t y, uint32_t width, uint32_t height,
- uint32_t flags, struct map_info **map_data, size_t plane)
+ uint32_t map_flags, struct map_info **map_data, size_t plane)
{
void *ptr;
uint8_t *addr;
@@ -373,7 +373,7 @@
assert(height > 0);
assert(x + width <= drv_bo_get_width(bo));
assert(y + height <= drv_bo_get_height(bo));
- assert(BO_TRANSFER_READ_WRITE & flags);
+ assert(BO_MAP_READ_WRITE & map_flags);
pthread_mutex_lock(&bo->drv->driver_lock);
@@ -384,7 +384,7 @@
}
data = calloc(1, sizeof(*data));
- prot = BO_TRANSFER_WRITE & flags ? PROT_WRITE | PROT_READ : PROT_READ;
+ prot = BO_MAP_WRITE & map_flags ? PROT_WRITE | PROT_READ : PROT_READ;
addr = bo->drv->backend->bo_map(bo, data, plane, prot);
if (addr == MAP_FAILED) {
*map_data = NULL;