summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorJerome Glisse <[email protected]>2013-02-27 10:49:35 -0500
committerRob Clark <[email protected]>2013-07-25 13:59:55 -0400
commitd1444225d3a600be77602af35d1e9879e469c70e (patch)
tree36f31f62bfb3544feaf26c3456b3ce211ac5c7ae /src/gallium
parent984da462190af5946e49462805d1e741a00d0688 (diff)
xa: add handle type parameter to get handle
Allow to retrieve non shared handle. Signed-off-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/xa/xa_tracker.c11
-rw-r--r--src/gallium/state_trackers/xa/xa_tracker.h9
2 files changed, 18 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/xa/xa_tracker.c b/src/gallium/state_trackers/xa/xa_tracker.c
index b49f0d9e18d..945ed36a292 100644
--- a/src/gallium/state_trackers/xa/xa_tracker.c
+++ b/src/gallium/state_trackers/xa/xa_tracker.c
@@ -468,6 +468,7 @@ xa_tracker_version(int *major, int *minor, int *patch)
XA_EXPORT int
xa_surface_handle(struct xa_surface *srf,
+ enum xa_handle_type type,
uint32_t * handle, unsigned int *stride)
{
struct winsys_handle whandle;
@@ -476,7 +477,15 @@ xa_surface_handle(struct xa_surface *srf,
boolean res;
memset(&whandle, 0, sizeof(whandle));
- whandle.type = DRM_API_HANDLE_TYPE_SHARED;
+ switch (type) {
+ case xa_handle_type_kms:
+ whandle.type = DRM_API_HANDLE_TYPE_KMS;
+ break;
+ case xa_handle_type_shared:
+ default:
+ whandle.type = DRM_API_HANDLE_TYPE_SHARED;
+ break;
+ }
res = screen->resource_get_handle(screen, srf->tex, &whandle);
if (!res)
return -XA_ERR_INVAL;
diff --git a/src/gallium/state_trackers/xa/xa_tracker.h b/src/gallium/state_trackers/xa/xa_tracker.h
index 13486219562..4d2452e9286 100644
--- a/src/gallium/state_trackers/xa/xa_tracker.h
+++ b/src/gallium/state_trackers/xa/xa_tracker.h
@@ -142,6 +142,11 @@ struct xa_box {
uint16_t x1, y1, x2, y2;
};
+enum xa_handle_type {
+ xa_handle_type_shared,
+ xa_handle_type_kms,
+};
+
extern void xa_tracker_version(int *major, int *minor, int *patch);
extern struct xa_tracker *xa_tracker_create(int drm_fd);
@@ -183,6 +188,8 @@ extern int xa_surface_redefine(struct xa_surface *srf,
int copy_contents);
extern int xa_surface_handle(struct xa_surface *srf,
- uint32_t * handle, unsigned int *byte_stride);
+ enum xa_handle_type type,
+ uint32_t * handle,
+ unsigned int *byte_stride);
#endif