summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-06-10 15:17:18 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-06-10 19:12:58 +0100
commit9e9c628708ae838e5df3df89331243f84b297e8e (patch)
tree523dec871600dbd7da21a342efea26e17b3e7ae0
parentb22de0b01453884d5018e7e0faef439421fa63a0 (diff)
sna/dri: Create pixmap suitable for the framebuffer for fullscreen buffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c3
-rw-r--r--src/sna/sna_accel.c3
-rw-r--r--src/sna/sna_dri.c11
3 files changed, 15 insertions, 2 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 436b69b1..d6009368 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1141,6 +1141,9 @@ int kgem_choose_tiling(struct kgem *kgem, int tiling, int width, int height, int
}
}
+ if (tiling < 0)
+ return tiling;
+
if (tiling == I915_TILING_Y && height < 16) {
DBG(("%s: too short [%d] for TILING_Y\n",
__FUNCTION__,height));
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 64927497..d84d7031 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -127,6 +127,9 @@ static uint32_t sna_pixmap_choose_tiling(PixmapPtr pixmap)
if ((sna->tiling && (1 << bit)) == 0)
tiling = I915_TILING_NONE;
+ if (pixmap->usage_hint == SNA_CREATE_FB)
+ tiling = -tiling;
+
/* Also adjust tiling if it is not supported or likely to
* slow us down,
*/
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 9abc66d0..ad282026 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -135,8 +135,9 @@ static struct kgem_bo *sna_pixmap_set_dri(struct sna *sna,
}
static DRI2Buffer2Ptr
-sna_dri_create_buffer(DrawablePtr drawable, unsigned int attachment,
- unsigned int format)
+sna_dri_create_buffer(DrawablePtr drawable,
+ unsigned int attachment,
+ unsigned int format)
{
ScreenPtr screen = drawable->pScreen;
ScrnInfoPtr scrn = xf86Screens[screen->myNum];
@@ -172,7 +173,13 @@ sna_dri_create_buffer(DrawablePtr drawable, unsigned int attachment,
case DRI2BufferBackLeft:
case DRI2BufferBackRight:
case DRI2BufferFrontRight:
+ /* Allocate a normal window, perhaps flippable */
usage = 0;
+ if (drawable->width == sna->front->drawable.width &&
+ drawable->height == sna->front->drawable.height &&
+ drawable->bitsPerPixel == sna->front->drawable.bitsPerPixel)
+ usage = SNA_CREATE_FB;
+
case DRI2BufferFakeFrontLeft:
case DRI2BufferFakeFrontRight:
pixmap = screen->CreatePixmap(screen,