diff options
author | Chia-I Wu <olv@lunarg.com> | 2010-11-03 15:22:36 +0800 |
---|---|---|
committer | Chia-I Wu <olv@lunarg.com> | 2010-11-03 16:04:59 +0800 |
commit | 94bf657b2390a1cb72d748047e5c7014e4bc1752 (patch) | |
tree | 3b204d554ccec7b2406a58bab74bf2494c661f2f /src/gallium/state_trackers/egl/drm | |
parent | c9186bd5886f4e05fd62a98d42404eda2a99416c (diff) |
st/egl: Add native_surface::present callback.
The callback presents the given attachment to the native engine. It
allows the swap behavior and interval to be controlled. It will replace
native_surface::flush_frontbuffer and native_surface::swap_buffers
shortly.
Diffstat (limited to 'src/gallium/state_trackers/egl/drm')
-rw-r--r-- | src/gallium/state_trackers/egl/drm/modeset.c | 27 | ||||
-rw-r--r-- | src/gallium/state_trackers/egl/drm/native_drm.c | 3 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/egl/drm/modeset.c b/src/gallium/state_trackers/egl/drm/modeset.c index 5ed22f7b9d..453730ffa5 100644 --- a/src/gallium/state_trackers/egl/drm/modeset.c +++ b/src/gallium/state_trackers/egl/drm/modeset.c @@ -167,6 +167,32 @@ drm_surface_swap_buffers(struct native_surface *nsurf) return TRUE; } +static boolean +drm_surface_present(struct native_surface *nsurf, + enum native_attachment natt, + boolean preserve, + uint swap_interval) +{ + boolean ret; + + if (preserve || swap_interval) + return FALSE; + + switch (natt) { + case NATIVE_ATTACHMENT_FRONT_LEFT: + ret = drm_surface_flush_frontbuffer(nsurf); + break; + case NATIVE_ATTACHMENT_BACK_LEFT: + ret = drm_surface_swap_buffers(nsurf); + break; + default: + ret = FALSE; + break; + } + + return ret; +} + static void drm_surface_wait(struct native_surface *nsurf) { @@ -227,6 +253,7 @@ drm_display_create_surface(struct native_display *ndpy, drmsurf->base.destroy = drm_surface_destroy; drmsurf->base.swap_buffers = drm_surface_swap_buffers; drmsurf->base.flush_frontbuffer = drm_surface_flush_frontbuffer; + drmsurf->base.present = drm_surface_present; drmsurf->base.validate = drm_surface_validate; drmsurf->base.wait = drm_surface_wait; diff --git a/src/gallium/state_trackers/egl/drm/native_drm.c b/src/gallium/state_trackers/egl/drm/native_drm.c index f6dc558437..21555dcd0e 100644 --- a/src/gallium/state_trackers/egl/drm/native_drm.c +++ b/src/gallium/state_trackers/egl/drm/native_drm.c @@ -103,6 +103,9 @@ drm_display_get_param(struct native_display *ndpy, int val; switch (param) { + case NATIVE_PARAM_USE_NATIVE_BUFFER: + case NATIVE_PARAM_PRESERVE_BUFFER: + case NATIVE_PARAM_MAX_SWAP_INTERVAL: default: val = 0; break; |