diff options
author | Ben Widawsky <[email protected]> | 2016-11-29 21:53:52 -0800 |
---|---|---|
committer | Ben Widawsky <[email protected]> | 2017-03-09 15:35:44 -0800 |
commit | 42eacddfc027dd8668956dd836b85e16bab4f9f4 (patch) | |
tree | bb004208cfb66fc50a515f3c56e8a0514b949704 /src/gbm/main | |
parent | 770b06588f79abe44d4fa1128759c45d0496362e (diff) |
gbm: Export a plane getter function
This will be used by clients that need to know the number of planes
allocated for them on behalf of the GL or other API. The best current
example of this is when an extra "plane" is allocated to store
compression data for the primary plane.
v2: Return 1 for cases where there is no image, ie. dumb bo (Daniel)
Signed-off-by: Ben Widawsky <[email protected]>
Reviewed-by: Eric Engestrom <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Acked-by: Daniel Stone <[email protected]>
Diffstat (limited to 'src/gbm/main')
-rw-r--r-- | src/gbm/main/gbm.c | 10 | ||||
-rw-r--r-- | src/gbm/main/gbm.h | 3 | ||||
-rw-r--r-- | src/gbm/main/gbmint.h | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/src/gbm/main/gbm.c b/src/gbm/main/gbm.c index e96297ec52e..37795175644 100644 --- a/src/gbm/main/gbm.c +++ b/src/gbm/main/gbm.c @@ -223,6 +223,16 @@ gbm_bo_get_fd(struct gbm_bo *bo) return bo->gbm->bo_get_fd(bo); } +/** Get the number of planes for the given bo. + * + * \param bo The buffer object + * \return The number of planes + */ +GBM_EXPORT int +gbm_bo_get_plane_count(struct gbm_bo *bo) +{ + return bo->gbm->bo_get_planes(bo); +} /** Write data into the buffer object * diff --git a/src/gbm/main/gbm.h b/src/gbm/main/gbm.h index 59daaa164d1..203a2363579 100644 --- a/src/gbm/main/gbm.h +++ b/src/gbm/main/gbm.h @@ -316,6 +316,9 @@ int gbm_bo_get_fd(struct gbm_bo *bo); int +gbm_bo_get_plane_count(struct gbm_bo *bo); + +int gbm_bo_write(struct gbm_bo *bo, const void *buf, size_t count); void diff --git a/src/gbm/main/gbmint.h b/src/gbm/main/gbmint.h index cfef5eea291..c6a6701464a 100644 --- a/src/gbm/main/gbmint.h +++ b/src/gbm/main/gbmint.h @@ -76,6 +76,7 @@ struct gbm_device { void (*bo_unmap)(struct gbm_bo *bo, void *map_data); int (*bo_write)(struct gbm_bo *bo, const void *buf, size_t data); int (*bo_get_fd)(struct gbm_bo *bo); + int (*bo_get_planes)(struct gbm_bo *bo); void (*bo_destroy)(struct gbm_bo *bo); struct gbm_surface *(*surface_create)(struct gbm_device *gbm, |