diff options
author | Benjamin Franzke <[email protected]> | 2011-05-30 11:40:52 +0200 |
---|---|---|
committer | Benjamin Franzke <[email protected]> | 2011-06-23 21:07:17 +0200 |
commit | 737bd7367e5a99cf64ec4bfc4420e3380b60878f (patch) | |
tree | 9db6f5323ffe9fddc3117a35e1970dc7e4ac8746 /src/gallium/state_trackers/egl/common | |
parent | e5fc4c81ce5aa261e330977f1a672838cd186cdb (diff) |
st/egl: Hookup gbm for drm backend
Diffstat (limited to 'src/gallium/state_trackers/egl/common')
-rw-r--r-- | src/gallium/state_trackers/egl/common/egl_g3d.c | 18 | ||||
-rw-r--r-- | src/gallium/state_trackers/egl/common/native.h | 3 |
2 files changed, 20 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c index 29dbbefbf48..6a40f4d2a4b 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d.c @@ -72,10 +72,26 @@ egl_g3d_new_sw_screen(struct native_display *ndpy, struct sw_winsys *ws) return gdpy->loader->create_sw_screen(ws); } +static struct pipe_resource * +egl_g3d_lookup_egl_image(struct native_display *ndpy, void *egl_image) +{ + _EGLDisplay *dpy = (_EGLDisplay *) ndpy->user_data; + struct egl_g3d_display *gdpy = egl_g3d_display(dpy); + struct st_egl_image img; + struct pipe_resource *resource = NULL; + + memset(&img, 0, sizeof(img)); + if (gdpy->smapi->get_egl_image(gdpy->smapi, egl_image, &img)) + resource = img.texture; + + return resource; +} + static struct native_event_handler egl_g3d_native_event_handler = { egl_g3d_invalid_surface, egl_g3d_new_drm_screen, - egl_g3d_new_sw_screen + egl_g3d_new_sw_screen, + egl_g3d_lookup_egl_image }; /** diff --git a/src/gallium/state_trackers/egl/common/native.h b/src/gallium/state_trackers/egl/common/native.h index 8646e52ed7c..cb261964864 100644 --- a/src/gallium/state_trackers/egl/common/native.h +++ b/src/gallium/state_trackers/egl/common/native.h @@ -219,6 +219,9 @@ struct native_event_handler { const char *name, int fd); struct pipe_screen *(*new_sw_screen)(struct native_display *ndpy, struct sw_winsys *ws); + + struct pipe_resource *(*lookup_egl_image)(struct native_display *ndpy, + void *egl_image); }; /** |