xf86-video-intel: 2 commits - src/sna/sna_dri2.c src/sna/sna_driver.c src/sna/sna.h

Chris Wilson ickle at kemper.freedesktop.org
Thu Nov 3 10:25:26 UTC 2016


 src/sna/sna.h        |   12 ++++++++----
 src/sna/sna_dri2.c   |    4 ----
 src/sna/sna_driver.c |   17 +++++++++++++----
 3 files changed, 21 insertions(+), 12 deletions(-)

New commits:
commit 40e3be34367141c952678f456f0e0d4632b6c266
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Nov 3 10:18:32 2016 +0000

    sna/dri2: Complete the final flip in a chain after the window is destroyed
    
    When the pending flip is queued, we update all the Windows to use the
    next bo as their rendering target. However, that bo is not yet the
    scanout until the future flip is performed. If the current fullscreen
    Window is destroyed, we still must allow that flip to proceed or else
    the old bo is left on the scanout.
    
    And yes, this is indeed a fix to one of the debug patches that intended
    to detect the error causing #93844. Irony.
    
    Fixes: 7817949314a2 ("sna/dri2: Avoiding marking a pending-signal on a dead Drawable")
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93844
    Reported-by: Diego Viola <diego.viola at gmail.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c
index 72cb128..22a6f6c 100644
--- a/src/sna/sna_dri2.c
+++ b/src/sna/sna_dri2.c
@@ -2845,9 +2845,6 @@ sna_dri2_flip_continue(struct sna_dri2_event *info)
 	info->type = info->flip_continue;
 	info->flip_continue = 0;
 
-	if (info->draw == NULL)
-		return false;
-
 	assert(!info->signal);
 	info->signal = info->type == FLIP_THROTTLE;
 
@@ -2866,7 +2863,6 @@ sna_dri2_flip_continue(struct sna_dri2_event *info)
 	       info->sna->dri2.flip_pending == info);
 	info->sna->dri2.flip_pending = info;
 	info->queued = true;
-	assert(info->draw);
 
 	return true;
 }
commit 47da17fe745efeef61a6f5106f5b888fd7abfb06
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Oct 27 18:13:31 2016 +0100

    sna: Load DRI3 if try to load DRI2 and fail
    
    As a backup in case DRI2 is disabled due to the presence of vgaarb, make
    sure we have DRI3 loaded.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna.h b/src/sna/sna.h
index 4f9fc89..072c34f 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -362,8 +362,9 @@ struct sna {
 	} cursor;
 
 	struct sna_dri2 {
-		bool available;
-		bool open;
+		bool available : 1;
+		bool enable : 1;
+		bool open : 1;
 
 #if HAVE_DRI2
 		void *flip_pending;
@@ -372,8 +373,11 @@ struct sna {
 	} dri2;
 
 	struct sna_dri3 {
-		bool available;
-		bool open;
+		bool available :1;
+		bool override : 1;
+		bool enable : 1;
+		bool open :1;
+
 #if HAVE_DRI3
 		SyncScreenCreateFenceFunc create_fence;
 		struct list pixmaps;
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index aa637c0..5170439 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -433,16 +433,24 @@ static void setup_dri(struct sna *sna)
 	unsigned level;
 
 	sna->dri2.available = false;
+	sna->dri2.enable = false;
 	sna->dri3.available = false;
+	sna->dri3.enable = false;
+	sna->dri3.override = false;
 
 	level = intel_option_cast_to_unsigned(sna->Options, OPTION_DRI, DEFAULT_DRI_LEVEL);
 #if HAVE_DRI3
+	sna->dri3.available = !!xf86LoadSubModule(sna->scrn, "dri3");
+	sna->dri3.override =
+		!sna->dri3.available ||
+		xf86IsOptionSet(sna->Options, OPTION_DRI);
 	if (level >= 3 && sna->kgem.gen >= 040)
-		sna->dri3.available = !!xf86LoadSubModule(sna->scrn, "dri3");
+		sna->dri3.enable = sna->dri3.available;
 #endif
 #if HAVE_DRI2
+	sna->dri2.available = !!xf86LoadSubModule(sna->scrn, "dri2");
 	if (level >= 2)
-		sna->dri2.available = !!xf86LoadSubModule(sna->scrn, "dri2");
+		sna->dri2.enable = sna->dri2.available;
 #endif
 }
 
@@ -1059,12 +1067,13 @@ static void sna_dri_init(struct sna *sna, ScreenPtr screen)
 {
 	char str[128] = "";
 
-	if (sna->dri2.available)
+	if (sna->dri2.enable)
 		sna->dri2.open = sna_dri2_open(sna, screen);
 	if (sna->dri2.open)
 		strcat(str, "DRI2 ");
 
-	if (sna->dri3.available)
+	/* Load DRI3 in case DRI2 doesn't work, e.g. vgaarb */
+	if (sna->dri3.enable || (!sna->dri2.open && !sna->dri3.override))
 		sna->dri3.open = sna_dri3_open(sna, screen);
 	if (sna->dri3.open)
 		strcat(str, "DRI3 ");


More information about the xorg-commit mailing list