xf86-video-intel: 3 commits - src/sna/sna_blt.c src/sna/sna_display.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Feb 14 00:08:54 CET 2014


 src/sna/sna_blt.c     |   12 ++++++------
 src/sna/sna_display.c |    6 +++++-
 2 files changed, 11 insertions(+), 7 deletions(-)

New commits:
commit 3a893d14cd227454826a9a86cb3ce227d04bc352
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Feb 13 22:46:22 2014 +0000

    sna: Increase the acceptable screen size range
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 70673b0..521d4ef 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -3448,7 +3448,7 @@ static void set_size_range(struct sna *sna)
 	 * crtc limits, so if the mode exceeds the scanout restrictions,
 	 * we will quietly convert that to per-crtc pixmaps.
 	 */
-	xf86CrtcSetSizeRange(sna->scrn, 320, 200, INT16_MAX, INT16_MAX);
+	xf86CrtcSetSizeRange(sna->scrn, 8, 8, INT16_MAX, INT16_MAX);
 }
 
 enum { /* XXX copied from hw/xfree86/modes/xf86Crtc.c */
commit 2d9fcb3f729e3959dd30b7d7859438894b806b34
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Feb 13 22:36:36 2014 +0000

    sna: Filter out requests to create a 0x0 frontbuffer
    
    Attempting to create a 0x0 frontbuffer results in erroneous pixmap
    generation, and is liable to explode at a random point in future, so
    just reject it outright.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 54e45ff..70673b0 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -3273,6 +3273,10 @@ sna_mode_resize(ScrnInfoPtr scrn, int width, int height)
 	if (scrn->virtualX == width && scrn->virtualY == height)
 		return TRUE;
 
+	/* Paranoid defense against rogue internal calls by Xorg */
+	if (width == 0 || height == 0)
+		return FALSE;
+
 	assert(sna->front);
 	assert(screen->GetScreenPixmap(screen) == sna->front);
 
commit 1037a1a3f6a8dbde017a28a7b59ef5398c84dba1
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Feb 13 21:36:26 2014 +0000

    sna: Fix comparison of previous BLT commands
    
    After altering the command bits to accommodate Broadwell, we needed to
    fixup the comparison of previous BLT commands to detect overwritten
    commands.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index 61e8672..c02f8c7 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -521,7 +521,7 @@ static void sna_blt_copy_one(struct sna *sna,
 	    kgem->reloc[kgem->nreloc-1].target_handle == blt->bo[1]->target_handle) {
 		if (sna->kgem.gen >= 0100) {
 			if (kgem->nbatch >= 7 &&
-			    kgem->batch[kgem->nbatch-7] == (XY_COLOR_BLT | (blt->cmd & (BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 5) &&
+			    kgem->batch[kgem->nbatch-7] == (XY_COLOR_BLT | (blt->cmd & (BLT_DST_TILED | BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 5) &&
 			    kgem->batch[kgem->nbatch-5] == ((uint32_t)dst_y << 16 | (uint16_t)dst_x) &&
 			    kgem->batch[kgem->nbatch-4] == ((uint32_t)(dst_y+height) << 16 | (uint16_t)(dst_x+width))) {
 				DBG(("%s: replacing last fill\n", __FUNCTION__));
@@ -546,7 +546,7 @@ static void sna_blt_copy_one(struct sna *sna,
 			}
 		} else {
 			if (kgem->nbatch >= 6 &&
-			    kgem->batch[kgem->nbatch-6] == (XY_COLOR_BLT | (blt->cmd & (BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 4) &&
+			    kgem->batch[kgem->nbatch-6] == (XY_COLOR_BLT | (blt->cmd & (BLT_DST_TILED | BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 4) &&
 			    kgem->batch[kgem->nbatch-4] == ((uint32_t)dst_y << 16 | (uint16_t)dst_x) &&
 			    kgem->batch[kgem->nbatch-3] == ((uint32_t)(dst_y+height) << 16 | (uint16_t)(dst_x+width))) {
 				DBG(("%s: replacing last fill\n", __FUNCTION__));
@@ -2931,7 +2931,7 @@ static bool sna_blt_fill_box(struct sna *sna, uint8_t alu,
 				return true;
 			}
 			if (kgem->nbatch >= 10 &&
-			    (kgem->batch[kgem->nbatch-10] & 0xffc0000f) == XY_SRC_COPY_BLT_CMD &&
+			    (kgem->batch[kgem->nbatch-10] & 0xffc00000) == XY_SRC_COPY_BLT_CMD &&
 			    *(uint64_t *)&kgem->batch[kgem->nbatch-8] == *(const uint64_t *)box &&
 			    kgem->reloc[kgem->nreloc-2].target_handle == bo->target_handle) {
 				DBG(("%s: replacing last copy\n", __FUNCTION__));
@@ -2956,7 +2956,7 @@ static bool sna_blt_fill_box(struct sna *sna, uint8_t alu,
 				return true;
 			}
 			if (kgem->nbatch >= 8 &&
-			    (kgem->batch[kgem->nbatch-8] & 0xffc0000f) == XY_SRC_COPY_BLT_CMD &&
+			    (kgem->batch[kgem->nbatch-8] & 0xffc00000) == XY_SRC_COPY_BLT_CMD &&
 			    *(uint64_t *)&kgem->batch[kgem->nbatch-6] == *(const uint64_t *)box &&
 			    kgem->reloc[kgem->nreloc-2].target_handle == bo->target_handle) {
 				DBG(("%s: replacing last copy\n", __FUNCTION__));
@@ -3292,7 +3292,7 @@ bool sna_blt_copy_boxes(struct sna *sna, uint8_t alu,
 	    kgem->reloc[kgem->nreloc-1].target_handle == dst_bo->target_handle) {
 		if (kgem->gen >= 0100) {
 			if (kgem->nbatch >= 7 &&
-			    kgem->batch[kgem->nbatch-7] == (XY_COLOR_BLT | (cmd & (BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 5) &&
+			    kgem->batch[kgem->nbatch-7] == (XY_COLOR_BLT | (cmd & (BLT_DST_TILED | BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 5) &&
 			    kgem->batch[kgem->nbatch-5] == ((uint32_t)(box->y1 + dst_dy) << 16 | (uint16_t)(box->x1 + dst_dx)) &&
 			    kgem->batch[kgem->nbatch-4] == ((uint32_t)(box->y2 + dst_dy) << 16 | (uint16_t)(box->x2 + dst_dx))) {
 				DBG(("%s: deleting last fill\n", __FUNCTION__));
@@ -3301,7 +3301,7 @@ bool sna_blt_copy_boxes(struct sna *sna, uint8_t alu,
 			}
 		} else {
 			if (kgem->nbatch >= 6 &&
-			    kgem->batch[kgem->nbatch-6] == (XY_COLOR_BLT | (cmd & (BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 4) &&
+			    kgem->batch[kgem->nbatch-6] == (XY_COLOR_BLT | (cmd & (BLT_DST_TILED | BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 4) &&
 			    kgem->batch[kgem->nbatch-4] == ((uint32_t)(box->y1 + dst_dy) << 16 | (uint16_t)(box->x1 + dst_dx)) &&
 			    kgem->batch[kgem->nbatch-3] == ((uint32_t)(box->y2 + dst_dy) << 16 | (uint16_t)(box->x2 + dst_dx))) {
 				DBG(("%s: deleting last fill\n", __FUNCTION__));


More information about the xorg-commit mailing list