summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_texture.c
diff options
context:
space:
mode:
authorBenjamin Franzke <[email protected]>2010-11-03 21:41:48 +0100
committerJerome Glisse <[email protected]>2010-11-08 13:44:54 -0500
commit46c19700676e17bfaa0a88346d512449fbeede79 (patch)
tree68b51735e4fc4ade14fcb79e78a56c24e339bc2a /src/gallium/drivers/r600/r600_texture.c
parent10b9e018ca4b37c66a6e0215d4551ed74b4981a6 (diff)
r600g: implement texture_get_handle (needed for eglExportDRMImageMESA)
Diffstat (limited to 'src/gallium/drivers/r600/r600_texture.c')
-rw-r--r--src/gallium/drivers/r600/r600_texture.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index a63990fbffe..0c9b9993756 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -341,6 +341,18 @@ static void r600_texture_destroy(struct pipe_screen *screen,
FREE(rtex);
}
+static boolean r600_texture_get_handle(struct pipe_screen* screen,
+ struct pipe_resource *ptex,
+ struct winsys_handle *whandle)
+{
+ struct r600_resource_texture *rtex = (struct r600_resource_texture*)ptex;
+ struct r600_resource *resource = &rtex->resource;
+ struct radeon *radeon = (struct radeon *)screen->winsys;
+
+ return r600_bo_get_winsys_handle(radeon, resource->bo,
+ rtex->pitch_in_bytes[0], whandle);
+}
+
static struct pipe_surface *r600_get_tex_surface(struct pipe_screen *screen,
struct pipe_resource *texture,
unsigned face, unsigned level,
@@ -655,7 +667,7 @@ void r600_texture_transfer_unmap(struct pipe_context *ctx,
struct u_resource_vtbl r600_texture_vtbl =
{
- u_default_resource_get_handle, /* get_handle */
+ r600_texture_get_handle, /* get_handle */
r600_texture_destroy, /* resource_destroy */
r600_texture_is_referenced, /* is_resource_referenced */
r600_texture_get_transfer, /* get_transfer */