summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/dri/common
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2010-04-24 12:35:56 +0100
committerJakob Bornecrantz <[email protected]>2010-04-26 00:40:17 +0100
commitab12d4f647702f0063c41dd090cef762aa95a0f9 (patch)
treefea3d2e536d69a5aa5cd551772f79313c559d214 /src/gallium/state_trackers/dri/common
parent0c572c6828b6a338b07a6860280b3a314a81662e (diff)
st/dri: Make lookup_egl_image a hook
Diffstat (limited to 'src/gallium/state_trackers/dri/common')
-rw-r--r--src/gallium/state_trackers/dri/common/dri_screen.h5
-rw-r--r--src/gallium/state_trackers/dri/common/dri_st_api.c12
2 files changed, 11 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/dri/common/dri_screen.h b/src/gallium/state_trackers/dri/common/dri_screen.h
index 8ab7d439191..d84ce1bf48e 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.h
+++ b/src/gallium/state_trackers/dri/common/dri_screen.h
@@ -41,6 +41,8 @@
#include "state_tracker/st_api.h"
#include "state_tracker/drm_api.h"
+struct dri_context;
+
struct dri_screen
{
/* dri */
@@ -55,6 +57,9 @@ struct dri_screen
int fd;
drmLock *drmLock;
+ /* hooks filled in by dri1, dri2 & drisw */
+ __DRIimage * (*lookup_egl_image)(struct dri_context *ctx, void *handle);
+
/* gallium */
struct drm_api *api;
struct pipe_winsys *pipe_winsys;
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 f9295cb4ca8..cbcb149b0a2 100644
--- a/src/gallium/state_trackers/dri/common/dri_st_api.c
+++ b/src/gallium/state_trackers/dri/common/dri_st_api.c
@@ -229,15 +229,15 @@ static boolean
dri_st_manager_get_egl_image(struct st_manager *smapi,
struct st_egl_image *stimg)
{
+ struct dri_context *ctx =
+ (struct dri_context *)stimg->stctxi->st_manager_private;
+ struct dri_screen *screen = dri_screen(ctx->sPriv);
__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);
+ if (screen->lookup_egl_image) {
+ img = screen->lookup_egl_image(ctx, stimg->egl_image);
}
-#endif
+
if (!img)
return FALSE;