diff options
author | Kristian Høgsberg <[email protected]> | 2012-12-13 23:30:45 -0500 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2013-01-14 16:39:15 -0500 |
commit | 90804e886de892cfedb8248a4f5700fd7422b94a (patch) | |
tree | 4da3086f840f2297bd37dc65f44fb6e94dd848d9 /src/egl/drivers/dri2/egl_dri2.h | |
parent | dc473c5f0a2f0dafd85a1b7bef22b3f4f39596bb (diff) |
egl/wayland: Pull color buffers from dri2_surf->color_buffers pool
We used to keep the color buffers in the dri_buffers array and
swap __DRI_BUFFER_BACK_LEFT and __DRI_BUFFER_FRONT_LEFT around there
and swap third_buffer in in case we needed to triple buffer. That
gets a little fidgety with all the swaps, so lets use the
color_buffers pool like the gbm platform does. We track the color buffers,
their corresponding wl_buffer and locked status here and just plug
a free one into dri2_surf->buffers when we need to.
This is a nice clean-up in itself, but it also sets us up to track
buffer age in the color_buffers structs.
Reviewed-by: Ander Conselvan de Oliveira <[email protected]>
Diffstat (limited to 'src/egl/drivers/dri2/egl_dri2.h')
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index eb8c06e08a0..84ea2a6027b 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -172,28 +172,29 @@ struct dri2_egl_surface #ifdef HAVE_WAYLAND_PLATFORM struct wl_egl_window *wl_win; - struct wl_egl_pixmap *wl_pix; - struct wl_buffer *wl_drm_buffer[WL_BUFFER_COUNT]; - int wl_buffer_lock[WL_BUFFER_COUNT]; int dx; int dy; - __DRIbuffer *dri_buffers[__DRI_BUFFER_COUNT]; - __DRIbuffer *third_buffer; - __DRIbuffer *pending_buffer; struct wl_callback *frame_callback; int format; #endif #ifdef HAVE_DRM_PLATFORM struct gbm_dri_surface *gbm_surf; +#endif + +#if defined(HAVE_WAYLAND_PLATFORM) || defined(HAVE_DRM_PLATFORM) + __DRIbuffer *dri_buffers[__DRI_BUFFER_COUNT]; struct { +#ifdef HAVE_WAYLAND_PLATFORM + struct wl_buffer *wl_buffer; + __DRIbuffer *dri_buffer; +#endif +#ifdef HAVE_DRM_PLATFORM struct gbm_bo *bo; - int locked; - int age; - } color_buffers[3], *back, *current; -#ifndef HAVE_WAYLAND_PLATFORM - __DRIbuffer *dri_buffers[__DRI_BUFFER_COUNT]; #endif + int locked; + int age; + } color_buffers[3], *back, *current; #endif #ifdef HAVE_ANDROID_PLATFORM |