xf86-video-intel: 2 commits - src/intel_module.c src/sna/sna_display.c src/sna/sna_driver.c src/sna/sna.h src/uxa/intel_driver.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Jul 23 03:05:08 PDT 2014


 src/intel_module.c     |    2 -
 src/sna/sna.h          |   23 +++++++++---------
 src/sna/sna_display.c  |   60 +++++++++++++++++++++++++++----------------------
 src/sna/sna_driver.c   |   18 ++++++++------
 src/uxa/intel_driver.c |    6 ++--
 5 files changed, 60 insertions(+), 49 deletions(-)

New commits:
commit 95c059b330e705ecd0e575e98d8edf5707e84a05
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jul 23 11:01:07 2014 +0100

    sna: Reorder disabling scanout pixmap when updating slave
    
    The assertion caught that we would unregister an invalid drawable on
    older Xorg.
    
    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 6952d55..d479c4a 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2178,13 +2178,17 @@ sna_crtc_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr pixmap)
 	if (sna_crtc == NULL)
 		return FALSE;
 
+	if (pixmap == sna_crtc->slave_pixmap)
+		return TRUE;
+
 	DBG(("%s: CRTC:%d, pipe=%d setting scanout pixmap=%ld\n",
 	     __FUNCTION__, sna_crtc->id,  sna_crtc->pipe,
 	     pixmap ? pixmap->drawable.serialNumber : 0));
 
+	/* Disable first so that we can unregister the damage tracking */
+	sna_crtc_disable_shadow(to_sna(crtc->scrn), sna_crtc);
+
 	sna_crtc->slave_pixmap = pixmap;
-	if (pixmap == NULL)
-		sna_crtc_disable(crtc);
 
 	return TRUE;
 }
commit d6830190bc9956f485db6c3420f7a4a79793a693
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jul 23 10:53:40 2014 +0100

    sna: Disable all outputs when initializing as a slaved output provider
    
    When we are constructed as a slaved device, we need to disable all
    outputs or else they are not correctly hooked into the master device
    upon startup.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/intel_module.c b/src/intel_module.c
index c884603..969f2a7 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -543,7 +543,7 @@ intel_scrn_create(DriverPtr		driver,
 	scrn->driverVersion = INTEL_VERSION;
 	scrn->driverName = (char *)INTEL_DRIVER_NAME;
 	scrn->name = (char *)INTEL_NAME;
-	scrn->driverPrivate = (void *)(match_data | 1);
+	scrn->driverPrivate = (void *)(match_data | (flags & XF86_ALLOCATE_GPU_SCREEN) | 2);
 	scrn->Probe = NULL;
 
 	if (xf86IsEntitySharable(entity_num))
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 6e70c56..281418b 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -241,17 +241,18 @@ struct sna {
 	ScrnInfoPtr scrn;
 
 	unsigned flags;
-#define SNA_NO_WAIT		0x1
-#define SNA_NO_FLIP		0x2
-#define SNA_NO_VSYNC		0x4
-#define SNA_TRIPLE_BUFFER	0x8
-#define SNA_TEAR_FREE		0x10
-#define SNA_FORCE_SHADOW	0x20
-#define SNA_FLUSH_GTT		0x40
-#define SNA_IS_HOSTED		0x80
-#define SNA_PERFORMANCE		0x100
-#define SNA_POWERSAVE		0x200
-#define SNA_REMOVE_OUTPUTS	0x400
+#define SNA_IS_SLAVED		0x1
+#define SNA_IS_HOSTED		0x2
+#define SNA_NO_WAIT		0x10
+#define SNA_NO_FLIP		0x20
+#define SNA_NO_VSYNC		0x40
+#define SNA_TRIPLE_BUFFER	0x80
+#define SNA_TEAR_FREE		0x100
+#define SNA_FORCE_SHADOW	0x200
+#define SNA_FLUSH_GTT		0x400
+#define SNA_PERFORMANCE		0x1000
+#define SNA_POWERSAVE		0x2000
+#define SNA_REMOVE_OUTPUTS	0x4000
 #define SNA_HAS_FLIP		0x10000
 #define SNA_HAS_ASYNC_FLIP	0x20000
 #define SNA_LINEAR_FB		0x40000
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index af884c4..6952d55 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -5189,36 +5189,38 @@ static bool sna_probe_initial_configuration(struct sna *sna)
 {
 	ScrnInfoPtr scrn = sna->scrn;
 	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
-	const int user_overrides[] = {
-		OPTION_POSITION,
-		OPTION_BELOW,
-		OPTION_RIGHT_OF,
-		OPTION_ABOVE,
-		OPTION_LEFT_OF,
-		OPTION_ROTATE,
-		OPTION_PANNING,
-	};
 	int width, height;
 	int i, j;
 
 	assert((sna->flags & SNA_IS_HOSTED) == 0);
 
-	if (xf86ReturnOptValBool(sna->Options, OPTION_REPROBE, FALSE)) {
-		DBG(("%s: user requests reprobing\n", __FUNCTION__));
-		return false;
-	}
+	if ((sna->flags & SNA_IS_SLAVED) == 0) {
+		const int user_overrides[] = {
+			OPTION_POSITION,
+			OPTION_BELOW,
+			OPTION_RIGHT_OF,
+			OPTION_ABOVE,
+			OPTION_LEFT_OF,
+			OPTION_ROTATE,
+			OPTION_PANNING,
+		};
+		if (xf86ReturnOptValBool(sna->Options, OPTION_REPROBE, FALSE)) {
+			DBG(("%s: user requests reprobing\n", __FUNCTION__));
+			return false;
+		}
 
-	/* First scan through all outputs and look for user overrides */
-	for (i = 0; i < sna->mode.num_real_output; i++) {
-		xf86OutputPtr output = config->output[i];
+		/* First scan through all outputs and look for user overrides */
+		for (i = 0; i < sna->mode.num_real_output; i++) {
+			xf86OutputPtr output = config->output[i];
 
-		for (j = 0; j < ARRAY_SIZE(user_overrides); j++) {
-			if (xf86GetOptValString(output->options, user_overrides[j])) {
-				DBG(("%s: user placement [%d] for %s\n",
-				     __FUNCTION__,
-				     user_overrides[j],
-				     output->name));
-				return false;
+			for (j = 0; j < ARRAY_SIZE(user_overrides); j++) {
+				if (xf86GetOptValString(output->options, user_overrides[j])) {
+					DBG(("%s: user placement [%d] for %s\n",
+					     __FUNCTION__,
+					     user_overrides[j],
+					     output->name));
+					return false;
+				}
 			}
 		}
 	}
@@ -5263,6 +5265,8 @@ static bool sna_probe_initial_configuration(struct sna *sna)
 
 		crtc_id = (uintptr_t)output->crtc;
 		output->crtc = NULL;
+		if (sna->flags & SNA_IS_SLAVED)
+			continue;
 
 		if (crtc_id == 0) {
 			DBG(("%s: not using output %s, disconnected\n",
@@ -5331,7 +5335,7 @@ static bool sna_probe_initial_configuration(struct sna *sna)
 	}
 
 	width = height = 0;
-	for (i = 0; i < config->num_crtc; i++) {
+	for (i = 0; i < sna->mode.num_real_crtc; i++) {
 		xf86CrtcPtr crtc = config->crtc[i];
 		int w, h;
 
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index e5e7783..7f4540d 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -540,7 +540,7 @@ done:
  * As a result, we want to set up that server initialization once rather
  * that doing it per generation.
  */
-static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
+static Bool sna_pre_init(ScrnInfoPtr scrn, int probe)
 {
 	struct sna *sna;
 	char buf[1024];
@@ -550,7 +550,7 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
 	int fd;
 
 	DBG(("%s flags=%x, numEntities=%d\n",
-	     __FUNCTION__, flags, scrn->numEntities));
+	     __FUNCTION__, probe, scrn->numEntities));
 
 	if (scrn->numEntities != 1)
 		return FALSE;
@@ -566,17 +566,19 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
 		)
 		return FALSE;
 
-	if (flags & PROBE_DETECT)
+	if (probe & PROBE_DETECT)
 		return TRUE;
 
 	sna_selftest();
 
-	if (((uintptr_t)scrn->driverPrivate) & 1) {
+	probe = 0;
+	if (((uintptr_t)scrn->driverPrivate) & 3) {
 		if (posix_memalign((void **)&sna, 4096, sizeof(*sna)))
 			return FALSE;
 
 		memset(sna, 0, sizeof(*sna)); /* should be unnecessary */
-		sna->info = (void *)((uintptr_t)scrn->driverPrivate & ~1);
+		probe = (uintptr_t)scrn->driverPrivate & 1;
+		sna->info = (void *)((uintptr_t)scrn->driverPrivate & ~3);
 		scrn->driverPrivate = sna;
 
 		sna->cpu_features = sna_cpu_detect();
@@ -585,7 +587,7 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
 	sna = to_sna(scrn);
 	sna->scrn = scrn;
 	sna->pEnt = pEnt;
-	sna->flags = 0;
+	sna->flags = probe;
 
 	scrn->displayWidth = 640;	/* default it */
 
@@ -710,7 +712,7 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
 	return TRUE;
 
 cleanup:
-	scrn->driverPrivate = (void *)((uintptr_t)sna->info | 1);
+	scrn->driverPrivate = (void *)((uintptr_t)sna->info | (sna->flags & SNA_IS_SLAVED) | 2);
 	free(sna);
 	return FALSE;
 }
@@ -1180,7 +1182,7 @@ static void sna_free_screen(FREE_SCREEN_ARGS_DECL)
 	if ((uintptr_t)sna & 1)
 		return;
 
-	scrn->driverPrivate = (void *)((uintptr_t)sna->info | 1);
+	scrn->driverPrivate = (void *)((uintptr_t)sna->info | (sna->flags & SNA_IS_SLAVED) | 2);
 
 	sna_mode_fini(sna);
 	sna_acpi_fini(sna);
diff --git a/src/uxa/intel_driver.c b/src/uxa/intel_driver.c
index c73d831..a7ca906 100644
--- a/src/uxa/intel_driver.c
+++ b/src/uxa/intel_driver.c
@@ -447,12 +447,12 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags)
 	if (flags & PROBE_DETECT)
 		return TRUE;
 
-	if (((uintptr_t)scrn->driverPrivate) & 1) {
+	if (((uintptr_t)scrn->driverPrivate) & 3) {
 		intel = xnfcalloc(sizeof(*intel), 1);
 		if (intel == NULL)
 			return FALSE;
 
-		intel->info = (void *)((uintptr_t)scrn->driverPrivate & ~1);
+		intel->info = (void *)((uintptr_t)scrn->driverPrivate & ~3);
 		scrn->driverPrivate = intel;
 	}
 	intel = intel_get_screen_private(scrn);
@@ -1069,7 +1069,7 @@ static void I830FreeScreen(FREE_SCREEN_ARGS_DECL)
 	SCRN_INFO_PTR(arg);
 	intel_screen_private *intel = intel_get_screen_private(scrn);
 
-	if (intel && !((uintptr_t)intel & 1)) {
+	if (intel && !((uintptr_t)intel & 3)) {
 		intel_mode_fini(intel);
 		intel_bufmgr_fini(intel);
 		intel_put_device(scrn);


More information about the xorg-commit mailing list