xf86-video-intel: 2 commits - src/sna/sna_accel.c src/sna/sna_reg.h src/sna/sna_render.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 15 19:21:36 UTC 2019


 src/sna/sna_accel.c  |    8 +++++---
 src/sna/sna_reg.h    |    1 +
 src/sna/sna_render.c |    3 +++
 3 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit cb6bff95ed900ffed99750dba9b9605581805904
Author: Peter Wu <peter at lekensteyn.nl>
Date:   Fri Nov 15 16:32:47 2019 +0100

    sn: fix PRIME output support since xserver 1.20
    
    Since "Make PixmapDirtyUpdateRec::src a DrawablePtr" in xserver, the
    "src" pointer might point to the root window (created by the server)
    instead of a pixmap (as created by xf86-video-intel). Use
    get_drawable_pixmap to handle both cases.
    
    When built with -fsanitize=address, the following test on a hybrid
    graphics laptop will trigger a heap-buffer-overflow error due to
    to_sna_from_pixmap receiving a window instead of a pixmap:
    
        xrandr --setprovideroutputsource modesetting Intel
        xrandr --output DP-1-1 --mode 2560x1440  # should not crash
        glxgears  # should display gears on both screens
    
    With nouveau instead of modesetting, it does not crash but the external
    monitor remains blank aside from a mouse cursor. This patch fixes both.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100086
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111976
    Signed-off-by: Peter Wu <peter at lekensteyn.nl>
    Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index a464f4b4..98084bb0 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -17686,10 +17686,10 @@ static void sna_accel_post_damage(struct sna *sna)
 			continue;
 
 #ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC
-		assert(dirty->src->type == DRAWABLE_PIXMAP);
+		src = get_drawable_pixmap(dirty->src);
+#else
+		src = dirty->src;
 #endif
-
-		src = (PixmapPtr)dirty->src;
 		dst = dirty->slave_dst->master_pixmap;
 
 		region.extents.x1 = dirty->x;
commit b5ac286c9bb0e13c5c23b2f76c7b9445587371df
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sat Nov 2 19:19:20 2019 +0000

    sna: Close each client op with an arbitrartion check
    
    Minimise preemption latency by frequently checking for pending preemption
    events in between X11 client requests.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index fa386ff6..a464f4b4 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -5302,6 +5302,8 @@ inline static void blt_done(struct sna *sna)
 		DBG(("%s: flushing BLT operation on empty ring\n",
 		     __FUNCTION__));
 		_kgem_submit(&sna->kgem);
+	} else {
+		sna->kgem.batch[sna->kgem.nbatch++] = MI_ARB_CHECK;
 	}
 }
 
diff --git a/src/sna/sna_reg.h b/src/sna/sna_reg.h
index 92a1ae57..0531fabf 100644
--- a/src/sna/sna_reg.h
+++ b/src/sna/sna_reg.h
@@ -14,6 +14,7 @@
 /* broadwater flush bits */
 #define BRW_MI_GLOBAL_SNAPSHOT_RESET   (1 << 3)
 
+#define MI_ARB_CHECK		(0x5 << 23)
 #define MI_BATCH_BUFFER_END	(0xA << 23)
 
 /* Noop */
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 904d4400..7145da90 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -32,6 +32,7 @@
 #include "sna.h"
 #include "sna_render.h"
 #include "sna_render_inline.h"
+#include "sna_reg.h"
 #include "fb/fbpict.h"
 
 #define NO_REDIRECT 0
@@ -2129,6 +2130,8 @@ sna_render_composite_redirect_done(struct sna *sna,
 
 		kgem_bo_destroy(&sna->kgem, op->dst.bo);
 	}
+
+	batch_emit(sna, MI_ARB_CHECK);
 }
 
 static bool


More information about the xorg-commit mailing list