diff options
author | Chia-I Wu <olv@lunarg.com> | 2010-03-05 11:00:15 +0800 |
---|---|---|
committer | Chia-I Wu <olv@lunarg.com> | 2010-03-05 11:32:29 +0800 |
commit | fade8a6eb639d633cfdbba4a3ba3aa3cc5c04fa6 (patch) | |
tree | e856f498737a728917b31901fa43f21ed065a96f /src/gallium/state_trackers/egl/x11/native_dri2.c | |
parent | 89a75b763467d83d4d402c91db55548682be14f0 (diff) |
st/egl: Add get_param to native display interface.
get_param can be used to query the parameters of a native display.
There is only NATIVE_PARAM_USE_NATIVE_BUFFER right now. It queries
whether the window/pixmap surfaces use the native buffers instead of
private buffers.
Diffstat (limited to 'src/gallium/state_trackers/egl/x11/native_dri2.c')
-rw-r--r-- | src/gallium/state_trackers/egl/x11/native_dri2.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c index 858033e1c1..8d2a8b1dff 100644 --- a/src/gallium/state_trackers/egl/x11/native_dri2.c +++ b/src/gallium/state_trackers/egl/x11/native_dri2.c @@ -707,6 +707,25 @@ dri2_display_is_pixmap_supported(struct native_display *ndpy, return (depth == nconf_depth || (depth == 24 && depth + 8 == nconf_depth)); } +static int +dri2_display_get_param(struct native_display *ndpy, + enum native_param_type param) +{ + int val; + + switch (param) { + case NATIVE_PARAM_USE_NATIVE_BUFFER: + /* DRI2GetBuffers use the native buffers */ + val = TRUE; + break; + default: + val = 0; + break; + } + + return val; +} + static void dri2_display_destroy(struct native_display *ndpy) { @@ -850,6 +869,7 @@ x11_create_dri2_display(EGLNativeDisplayType dpy, } dri2dpy->base.destroy = dri2_display_destroy; + dri2dpy->base.get_param = dri2_display_get_param; dri2dpy->base.get_configs = dri2_display_get_configs; dri2dpy->base.is_pixmap_supported = dri2_display_is_pixmap_supported; dri2dpy->base.create_window_surface = dri2_display_create_window_surface; |