struct dri_drawable *drawable = dri_drawable(dPriv);
struct pipe_surface *surface = NULL;
- struct pipe_screen *screen = dri_screen(drawable->sPriv)->pipe_screen;
+ struct dri_screen *st_screen = dri_screen(drawable->sPriv);
+ struct pipe_screen *screen = st_screen->pipe_screen;
__DRIbuffer *buffers = NULL;
__DRIscreen *dri_screen = drawable->sPriv;
__DRIdrawable *dri_drawable = drawable->dPriv;
- struct drm_api *api = ((struct dri_screen*)(dri_screen->private))->api;
+ struct drm_api *api = st_screen->api;
boolean have_depth = FALSE;
int i, count;
switch (buffers[i].attachment) {
case __DRI_BUFFER_FRONT_LEFT:
- continue;
+ if (!st_screen->auto_fake_front)
+ continue;
case __DRI_BUFFER_FAKE_FRONT_LEFT:
index = ST_SURFACE_FRONT_LEFT;
format = drawable->color_format;
/* TODO incase of double buffer visual, delay fake creation */
i = 0;
drawable->attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
- drawable->attachments[i++] = __DRI_BUFFER_FAKE_FRONT_LEFT;
-
+ if (!screen->auto_fake_front)
+ drawable->attachments[i++] = __DRI_BUFFER_FAKE_FRONT_LEFT;
if (visual->doubleBufferMode)
drawable->attachments[i++] = __DRI_BUFFER_BACK_LEFT;
if (visual->depthBits && visual->stencilBits)
{
struct dri_screen *screen;
struct drm_create_screen_arg arg;
+ const __DRIdri2LoaderExtension *dri2_ext =
+ sPriv->dri2.loader;
screen = CALLOC_STRUCT(dri_screen);
if (!screen)
driParseOptionInfo(&screen->optionCache,
__driConfigOptions, __driNConfigOptions);
+ screen->auto_fake_front = dri2_ext->base.version >= 3 &&
+ dri2_ext->getBuffersWithFormat != NULL;
+
return dri_fill_in_modes(screen, 32);
fail:
return NULL;