summaryrefslogtreecommitdiffstats
path: root/src/gbm/main
diff options
context:
space:
mode:
authorBen Widawsky <[email protected]>2016-10-20 18:21:24 -0700
committerBen Widawsky <[email protected]>2017-03-15 10:36:05 -0700
commit8378c576abd3b84aacfa854c9d110c36f10ac6a2 (patch)
treeb0f13c53f0cf660893fa0550c17644d9305e47d0 /src/gbm/main
parent5c6e0d1c7dd63df00c83e16ce6ba878fe345513a (diff)
gbm: Export a get modifiers
This patch originally had i965 specific code and was named: commit 61cd3c52b868cf8cb90b06e53a382a921eb42754 Author: Ben Widawsky <[email protected]> Date: Thu Oct 20 18:21:24 2016 -0700 gbm: Get modifiers from DRI To accomplish this, two new query tokens are added to the extension: __DRI_IMAGE_ATTRIB_MODIFIER_UPPER __DRI_IMAGE_ATTRIB_MODIFIER_LOWER The query extension only supported 32b queries, and modifiers are 64b, so we needed two of them. NOTE: The extension version is still set to 13, so none of this will actually be called. v2: Error handling of queryImage (Emil) Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gbm/main')
-rw-r--r--src/gbm/main/gbm.c19
-rw-r--r--src/gbm/main/gbm.h3
-rw-r--r--src/gbm/main/gbmint.h1
3 files changed, 23 insertions, 0 deletions
diff --git a/src/gbm/main/gbm.c b/src/gbm/main/gbm.c
index 7bacd8b86a6..19dc5db901a 100644
--- a/src/gbm/main/gbm.c
+++ b/src/gbm/main/gbm.c
@@ -280,6 +280,25 @@ gbm_bo_get_handle_for_plane(struct gbm_bo *bo, int plane)
return bo->gbm->bo_get_handle(bo, plane);
}
+/**
+ * Get the chosen modifier for the buffer object
+ *
+ * This function returns the modifier that was chosen for the object. These
+ * properties may be generic, or platform/implementation dependent.
+ *
+ * \param bo The buffer object
+ * \return Returns the selected modifier (chosen by the implementation) for the
+ * BO.
+ * \sa gbm_bo_create_with_modifiers() where possible modifiers are set
+ * \sa gbm_surface_create_with_modifiers() where possible modifiers are set
+ * \sa define DRM_FORMAT_MOD_* in drm_fourcc.h for possible modifiers
+ */
+GBM_EXPORT uint64_t
+gbm_bo_get_modifier(struct gbm_bo *bo)
+{
+ return bo->gbm->bo_get_modifier(bo);
+}
+
/** Write data into the buffer object
*
* If the buffer object was created with the GBM_BO_USE_WRITE flag,
diff --git a/src/gbm/main/gbm.h b/src/gbm/main/gbm.h
index 5f588dab58d..a774b509510 100644
--- a/src/gbm/main/gbm.h
+++ b/src/gbm/main/gbm.h
@@ -327,6 +327,9 @@ gbm_bo_get_handle(struct gbm_bo *bo);
int
gbm_bo_get_fd(struct gbm_bo *bo);
+uint64_t
+gbm_bo_get_modifier(struct gbm_bo *bo);
+
int
gbm_bo_get_plane_count(struct gbm_bo *bo);
diff --git a/src/gbm/main/gbmint.h b/src/gbm/main/gbmint.h
index d8c9f6e5d7e..5ad85cc80ff 100644
--- a/src/gbm/main/gbmint.h
+++ b/src/gbm/main/gbmint.h
@@ -82,6 +82,7 @@ struct gbm_device {
union gbm_bo_handle (*bo_get_handle)(struct gbm_bo *bo, int plane);
uint32_t (*bo_get_stride)(struct gbm_bo *bo, int plane);
int64_t (*bo_get_offset)(struct gbm_bo *bo, int plane);
+ uint64_t (*bo_get_modifier)(struct gbm_bo *bo);
void (*bo_destroy)(struct gbm_bo *bo);
struct gbm_surface *(*surface_create)(struct gbm_device *gbm,