diff options
author | Gurchetan Singh <gurchetansingh@chromium.org> | 2016-10-06 10:58:00 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-10-13 04:32:23 -0700 |
commit | 1a31e609770088ad0e5abb49678174e4c6393d34 (patch) | |
tree | 10cc530d21282f1e6381b661ad567a7f3b62b49c /drv_priv.h | |
parent | 602bd16a60a01ebb0ce911712256047df18acaa5 (diff) |
minigbm: More sophisticated gbm_bo_map/gbm_bo_unmap
We previously added the gbm_bo_map/gbm_bo_unmap (see CL:393927)
entry points since we wanted to do driver-specific detiling during
screenshot capture tests. We ignored most the parameters and mapped
the entire buffer. This CL adds the ability to:
1) Return the starting address within a byte given a specific x, y
in the buffer.
2) Handle the case where there are more than one kernel buffers
per buffer object. Currently, only the Exynos driver would use
this capability.
BUG=chromium:653284
TEST=Ran cros_gralloc with modified code
CQ-DEPEND=CL:393927
Change-Id: I19d75d2f16489c0184e96305fb643f18477e1cdb
Reviewed-on: https://chromium-review.googlesource.com/395066
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Diffstat (limited to 'drv_priv.h')
-rw-r--r-- | drv_priv.h | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -28,7 +28,6 @@ struct bo uint64_t format_modifiers[DRV_MAX_PLANES]; size_t total_size; void *priv; - void *map_data; }; struct driver { @@ -36,9 +35,17 @@ struct driver { struct backend *backend; void *priv; void *buffer_table; + void *map_table; pthread_mutex_t table_lock; }; +struct map_info { + void *addr; + size_t length; + uint32_t handle; + int32_t refcount; +}; + struct backend { char *name; @@ -46,7 +53,7 @@ struct backend void (*close)(struct driver *drv); int (*bo_create)(struct bo *bo, uint32_t width, uint32_t height, drv_format_t format, uint32_t flags); - void* (*bo_map)(struct bo *bo); + void* (*bo_map)(struct bo *bo, struct map_info *data, size_t plane); int (*bo_destroy)(struct bo *bo); drv_format_t (*resolve_format)(drv_format_t format); struct format_supported { |