From 7915151f2d05e175d00e739e9a3fead922e60096 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 6 Apr 2010 18:55:40 +0800 Subject: st/dri: Implement DRI image extension. --- src/gallium/state_trackers/dri/common/dri_st_api.c | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/gallium/state_trackers/dri/common/dri_st_api.c') diff --git a/src/gallium/state_trackers/dri/common/dri_st_api.c b/src/gallium/state_trackers/dri/common/dri_st_api.c index 1a5259c68b..561e6aa3b6 100644 --- a/src/gallium/state_trackers/dri/common/dri_st_api.c +++ b/src/gallium/state_trackers/dri/common/dri_st_api.c @@ -224,6 +224,31 @@ _dri_put_st_api(void) } } +static boolean +dri_st_manager_get_egl_image(struct st_manager *smapi, + struct st_egl_image *stimg) +{ + __DRIimage *img = NULL; + +#ifndef __NOT_HAVE_DRM_H + if (!__dri1_api_hooks) { + struct dri_context *ctx = (struct dri_context *) + stimg->stctxi->st_manager_private; + img = dri2_lookup_egl_image(ctx, stimg->egl_image); + } +#endif + if (!img) + return FALSE; + + stimg->texture = NULL; + pipe_texture_reference(&stimg->texture, img->texture); + stimg->face = img->face; + stimg->level = img->level; + stimg->zslice = img->zslice; + + return TRUE; +} + /** * Create a state tracker manager from the given screen. */ @@ -235,6 +260,7 @@ dri_create_st_manager(struct dri_screen *screen) smapi = CALLOC_STRUCT(st_manager); if (smapi) { smapi->screen = screen->pipe_screen; + smapi->get_egl_image = dri_st_manager_get_egl_image; _dri_get_st_api(); } -- cgit v1.2.3