summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/egl/drm
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-10-10 20:47:02 +0800
committerChia-I Wu <[email protected]>2010-11-03 17:50:25 +0800
commit3f7876d76f0dabfe0be7a7edb44946334a6fedc2 (patch)
tree34ea4eaaa839e67ba5d5e9a04874a13857890eff /src/gallium/state_trackers/egl/drm
parentaf977b53826695afcdcfe900816a93671aec00f5 (diff)
st/egl: Use native_display_buffer for EGL_MESA_drm_image.
native_display_buffer is just a wrapper to resource_{from,get}_handle for drm backend.
Diffstat (limited to 'src/gallium/state_trackers/egl/drm')
-rw-r--r--src/gallium/state_trackers/egl/drm/native_drm.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/egl/drm/native_drm.c b/src/gallium/state_trackers/egl/drm/native_drm.c
index 21555dcd0ed..3759c2a26dd 100644
--- a/src/gallium/state_trackers/egl/drm/native_drm.c
+++ b/src/gallium/state_trackers/egl/drm/native_drm.c
@@ -185,6 +185,29 @@ drm_display_init_screen(struct native_display *ndpy)
return TRUE;
}
+static struct pipe_resource *
+drm_display_import_buffer(struct native_display *ndpy,
+ const struct pipe_resource *templ,
+ void *buf)
+{
+ return ndpy->screen->resource_from_handle(ndpy->screen,
+ templ, (struct winsys_handle *) buf);
+}
+
+static boolean
+drm_display_export_buffer(struct native_display *ndpy,
+ struct pipe_resource *res,
+ void *buf)
+{
+ return ndpy->screen->resource_get_handle(ndpy->screen,
+ res, (struct winsys_handle *) buf);
+}
+
+static struct native_display_buffer drm_display_buffer = {
+ drm_display_import_buffer,
+ drm_display_export_buffer
+};
+
static struct native_display *
drm_create_display(int fd, struct native_event_handler *event_handler,
void *user_data)
@@ -208,6 +231,7 @@ drm_create_display(int fd, struct native_event_handler *event_handler,
drmdpy->base.get_param = drm_display_get_param;
drmdpy->base.get_configs = drm_display_get_configs;
+ drmdpy->base.buffer = &drm_display_buffer;
drm_display_init_modeset(&drmdpy->base);
return &drmdpy->base;