summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian König <[email protected]>2012-02-26 00:34:11 +0100
committerChristian König <[email protected]>2012-03-02 13:14:22 +0100
commit2ec6af0c638da5ebd196e8071630f09a5472b9e4 (patch)
tree0a73e4e610487f7de8a66c23cd1be62f87207f53
parente44731265dbfde75f955283f2f720a1917da120b (diff)
st/vdpau: implement BitmapSurfaceGetParameters
Signed-off-by: Christian König <[email protected]>
-rw-r--r--src/gallium/state_trackers/vdpau/bitmap.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/vdpau/bitmap.c b/src/gallium/state_trackers/vdpau/bitmap.c
index c2c8a448ce6..0b885c8af7c 100644
--- a/src/gallium/state_trackers/vdpau/bitmap.c
+++ b/src/gallium/state_trackers/vdpau/bitmap.c
@@ -136,10 +136,23 @@ vlVdpBitmapSurfaceGetParameters(VdpBitmapSurface surface,
uint32_t *width, uint32_t *height,
VdpBool *frequently_accessed)
{
+ vlVdpBitmapSurface *vlsurface;
+ struct pipe_resource *res;
+
+ vlsurface = vlGetDataHTAB(surface);
+ if (!vlsurface)
+ return VDP_STATUS_INVALID_HANDLE;
+
if (!(rgba_format && width && height && frequently_accessed))
return VDP_STATUS_INVALID_POINTER;
- return VDP_STATUS_NO_IMPLEMENTATION;
+ res = vlsurface->sampler_view->texture;
+ *rgba_format = PipeToFormatRGBA(res->format);
+ *width = res->width0;
+ *height = res->height0;
+ *frequently_accessed = res->usage == PIPE_USAGE_DYNAMIC;
+
+ return VDP_STATUS_OK;
}
/**