OSDN Git Service

minigbm: cros_gralloc: support GRALLOC_MODULE_API_VERSION_0_3
[android-x86/external-minigbm.git] / mediatek.c
index d2e9f53..3d2702f 100644 (file)
@@ -73,7 +73,7 @@ static int mediatek_bo_create(struct bo *bo, uint32_t width, uint32_t height, ui
        return 0;
 }
 
-static void *mediatek_bo_map(struct bo *bo, struct map_info *data, size_t plane)
+static void *mediatek_bo_map(struct bo *bo, struct map_info *data, size_t plane, int prot)
 {
        int ret;
        struct drm_mtk_gem_map_off gem_map;
@@ -89,11 +89,10 @@ static void *mediatek_bo_map(struct bo *bo, struct map_info *data, size_t plane)
 
        data->length = bo->total_size;
 
-       return mmap(0, bo->total_size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->drv->fd,
-                   gem_map.offset);
+       return mmap(0, bo->total_size, prot, MAP_SHARED, bo->drv->fd, gem_map.offset);
 }
 
-static uint32_t mediatek_resolve_format(uint32_t format)
+static uint32_t mediatek_resolve_format(uint32_t format, uint64_t usage)
 {
        switch (format) {
        case DRM_FORMAT_FLEX_IMPLEMENTATION_DEFINED: