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

Chris Wilson ickle at kemper.freedesktop.org
Mon Jun 23 14:53:39 PDT 2014


 src/sna/sna_display.c |   51 ++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 39 insertions(+), 12 deletions(-)

New commits:
commit 706480bde6120f84388a99085ed3d1cc3b759697
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 23 22:50:23 2014 +0100

    sna: Disable CRTC after MST topology change
    
    In order to disable CRTC after marking outputs as removed after probing
    MST topology updates, we must manually mark the CRTCs as no longer
    enabled.
    
    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 59691ee..cb2fcc3 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -3544,6 +3544,35 @@ static void sort_randr_outputs(struct sna *sna, ScreenPtr screen)
 	}
 }
 
+static void disable_unused_crtc(struct sna *sna)
+{
+	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
+	bool update = false;
+	int o, c;
+
+	for (c = 0; c < sna->mode.num_real_crtc; c++) {
+		xf86CrtcPtr crtc = config->crtc[c];
+
+		if (!crtc->enabled)
+			continue;
+
+
+		for (o = 0; o < sna->mode.num_real_output; o++) {
+			xf86OutputPtr output = config->output[o];
+			if (output->crtc == crtc)
+				break;
+		}
+
+		if (o == sna->mode.num_real_output) {
+			crtc->enabled = false;
+			update = true;
+		}
+	}
+
+	if (update)
+		xf86DisableUnusedFunctions(sna->scrn);
+}
+
 void sna_mode_discover(struct sna *sna)
 {
 	ScreenPtr screen = xf86ScrnToScreen(sna->scrn);
@@ -3609,7 +3638,7 @@ void sna_mode_discover(struct sna *sna)
 		sort_randr_outputs(sna, screen);
 
 		if (changed & 2)
-			xf86DisableUnusedFunctions(sna->scrn);
+			disable_unused_crtc(sna);
 
 		xf86RandR12TellChanged(screen);
 	}
commit 5530cb4165da60f7b929b84d733d5eefcf4ec5fe
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 23 15:47:13 2014 +0100

    sna: Silence compiler warning for shadowed variable
    
    sna_display.c: In function 'sna_mode_redisplay':
    sna_display.c:6322:12: warning: declaration of 'fb_id' shadows a global declaration [-Wshadow]
    sna_display.c:223:24: warning: shadowed declaration is here [-Wshadow]
      CC     sna_display_fake.lo
    
    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 ecec052..59691ee 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -318,7 +318,7 @@ static void assert_scanout(struct kgem *kgem, struct kgem_bo *bo,
 	assert(bo->scanout);
 
 	VG_CLEAR(info);
-	info.fb_id = bo->delta;
+	info.fb_id = fb_id(bo);
 
 	assert(drmIoctl(kgem->fd, DRM_IOCTL_MODE_GETFB, &info) == 0);
 	gem_close(kgem->fd, info.handle);
@@ -340,11 +340,11 @@ static unsigned get_fb(struct sna *sna, struct kgem_bo *bo,
 	assert(!bo->snoop);
 	assert(8*bo->pitch >= width * scrn->bitsPerPixel);
 	assert(height * bo->pitch <= kgem_bo_size(bo)); /* XXX crtc offset */
-	if (bo->delta) {
+	if (fb_id(bo)) {
 		DBG(("%s: reusing fb=%d for handle=%d\n",
-		     __FUNCTION__, bo->delta, bo->handle));
+		     __FUNCTION__, fb_id(bo), bo->handle));
 		assert_scanout(&sna->kgem, bo, width, height);
-		return bo->delta;
+		return fb_id(bo);
 	}
 
 	DBG(("%s: create fb %dx%d@%d/%d\n",
@@ -1543,7 +1543,7 @@ void sna_copy_fbcon(struct sna *sna)
 		return;
 	}
 
-	if (fbcon.fb_id == priv->gpu_bo->delta) {
+	if (fbcon.fb_id == fb_id(priv->gpu_bo)) {
 		DBG(("%s: fb already installed as scanout\n", __FUNCTION__));
 		return;
 	}
@@ -6319,7 +6319,7 @@ disable1:
 		struct kgem_bo *new = __sna_pixmap_get_bo(sna->front);
 		struct kgem_bo *old = sna->mode.shadow;
 		struct drm_mode_crtc_page_flip arg;
-		uint32_t fb_id;
+		uint32_t fb;
 
 		DBG(("%s: flipping tear-free outputs, current scanout handle=%d [active?=%d], new handle=%d [active=%d]\n",
 		     __FUNCTION__, old->handle, old->active_scanout, new->handle, new->active_scanout));
@@ -6327,10 +6327,8 @@ disable1:
 		assert(new != old);
 		assert(new->refcnt);
 
-		fb_id = get_fb(sna, new,
-			       sna->scrn->virtualX,
-			       sna->scrn->virtualY);
-		if (fb_id == 0) {
+		fb = get_fb(sna, new, sna->scrn->virtualX, sna->scrn->virtualY);
+		if (fb == 0) {
 fixup_shadow:
 			if (sna_pixmap_move_to_gpu(sna->front, MOVE_READ | MOVE_ASYNC_HINT)) {
 				BoxRec box;
@@ -6383,7 +6381,7 @@ fixup_shadow:
 				flip_bo = crtc->shadow_bo;
 				x = y = 0;
 			} else {
-				arg.fb_id = fb_id;
+				arg.fb_id = fb;
 				flip_bo = new;
 				x = crtc->base->x;
 				y = crtc->base->y;


More information about the xorg-commit mailing list