xf86-video-intel: 4 commits - configure.ac src/sna/sna_display.c src/uxa/intel_display.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Jun 9 13:47:49 PDT 2014


 configure.ac            |   11 ++++
 src/sna/sna_display.c   |  111 +++++++++++++++++++++++++++++++-----------------
 src/uxa/intel_display.c |    4 +
 3 files changed, 86 insertions(+), 40 deletions(-)

New commits:
commit fdb8f490441b0ba91fdf530b982cedc2f2acf122
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 9 21:46:37 2014 +0100

    sna: Add an extra error message before disabling a CRTC
    
    One of the error paths to disable a pipe was lacking a log message.
    
    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 943118b..3c9156b 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2001,18 +2001,17 @@ sna_crtc_dpms(xf86CrtcPtr crtc, int mode)
 		return;
 
 	assert(priv);
+	priv->dpms_mode = mode;
 
-	if (mode == DPMSModeOn) {
-		if (priv->bo == NULL &&
-		    !sna_crtc_set_mode_major(crtc,
-					     &crtc->mode, crtc->rotation,
-					     crtc->x, crtc->y))
-			sna_crtc_disable(crtc);
-	} else
-		sna_crtc_disable(crtc);
+	if (mode == DPMSModeOn &&
+	    priv->bo == NULL &&
+	    !sna_crtc_set_mode_major(crtc,
+				     &crtc->mode, crtc->rotation,
+				     crtc->x, crtc->y))
+		mode = DPMSModeOff;
 
-	if (priv->bo != NULL)
-		priv->dpms_mode = mode;
+	if (mode != DPMSModeOn)
+		sna_crtc_disable(crtc);
 }
 
 void sna_mode_adjust_frame(struct sna *sna, int x, int y)
@@ -5553,8 +5552,12 @@ void sna_mode_check(struct sna *sna)
 		     mode.crtc_id, mode.mode_valid,
 		     mode.fb_id, expected[0], expected[1]));
 
-		if (mode.fb_id != expected[0] && mode.fb_id != expected[1])
+		if (mode.fb_id != expected[0] && mode.fb_id != expected[1]) {
+			xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
+				   "%s: invalid state found on pipe %d, disabling CRTC:%d\n",
+				   __FUNCTION__, sna_ctrtc->pipe, sna_crtc->id);
 			sna_crtc_disable(crtc);
+		}
 	}
 
 	for (i = 0; i < config->num_output; i++) {
commit c1154ae1070806b8da1aad29f75c9659f2a403df
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 9 17:04:47 2014 +0100

    configure: Allow disabling control over the backlight
    
    Some OS prefer to control the backlight themselves through another
    daemon and so do not want X interfering.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/configure.ac b/configure.ac
index 8e3dbf7..fdadf4b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,11 +69,20 @@ case $host_os in
     ;;
 esac
 
+AC_ARG_ENABLE(backlight,
+              AS_HELP_STRING([--disable-backlight],
+			     [Enable control over the backlight [default=yes]]),
+              [backlight="$enableval"],
+              [backlight="yes"])
+if test "x$backlight" = "xyes"; then
+	AC_DEFINE(USE_BACKLIGHT, 1, [Enable control of the backlight])
+fi
+
 AC_ARG_ENABLE(backlight-helper,
               AS_HELP_STRING([--disable-backlight-helper],
 			     [Enable building the backlight helper executable for running X under a normal user [default=auto]]),
               [backlight_helper="$enableval"],)
-AM_CONDITIONAL(BUILD_BACKLIGHT_HELPER, [test "x$backlight_helper" = "xyes"])
+AM_CONDITIONAL(BUILD_BACKLIGHT_HELPER, [test "x$backlight" = "xyes" -a "x$backlight_helper" = "xyes"])
 if test "x$backlight_helper" = "xyes"; then
 	tools_msg="$tools_msg xf86-video-intel-backlight-helper"
 	AC_DEFINE(USE_BACKLIGHT_HELPER, 1, [Enable use of the backlight helper interfaces])
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 34e31ec..943118b 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -478,6 +478,10 @@ static void sna_backlight_pre_init(struct sna *sna)
 	struct udev *u;
 	struct udev_monitor *mon;
 
+#if !USE_BACKLIGHT
+	return;
+#endif
+
 	u = udev_new();
 	if (!u)
 		return;
@@ -606,6 +610,10 @@ sna_output_backlight_init(xf86OutputPtr output)
 	MessageType from;
 	char *best_iface;
 
+#if !USE_BACKLIGHT
+	return;
+#endif
+
 	from = X_CONFIG;
 	best_iface = has_user_backlight_override(output);
 	if (best_iface)
diff --git a/src/uxa/intel_display.c b/src/uxa/intel_display.c
index 95ddcc8..5bb9d72 100644
--- a/src/uxa/intel_display.c
+++ b/src/uxa/intel_display.c
@@ -186,6 +186,10 @@ intel_output_backlight_init(xf86OutputPtr output)
 	intel_screen_private *intel = intel_get_screen_private(output->scrn);
 	char *str;
 
+#if !USE_BACKLIGHT
+	return;
+#endif
+
 	str = xf86GetOptValString(intel->Options, OPTION_BACKLIGHT);
 	if (str != NULL) {
 		if (backlight_exists(str) != BL_NONE) {
commit bb2d5e3696b52835770a62a951f7ed7e51291f88
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 9 16:30:15 2014 +0100

    sna: Defer the copy back from the shadow CRTC bo until we allocate the target
    
    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 aeafeea..34e31ec 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1044,36 +1044,32 @@ static bool wait_for_shadow(struct sna *sna, struct sna_pixmap *priv, unsigned f
 	if (flags == 0 || pixmap != sna->front || !sna->mode.shadow_damage)
 		goto done;
 
-	if ((flags & __MOVE_SCANOUT) == 0) {
-		while (!list_is_empty(&sna->mode.shadow_crtc)) {
-			struct sna_crtc *crtc =
-				list_first_entry(&sna->mode.shadow_crtc, struct sna_crtc, shadow_link);
-			RegionRec region;
+	if ((flags & MOVE_WRITE) == 0) {
+		if ((flags & __MOVE_SCANOUT) == 0) {
+			while (!list_is_empty(&sna->mode.shadow_crtc)) {
+				struct sna_crtc *crtc =
+					list_first_entry(&sna->mode.shadow_crtc, struct sna_crtc, shadow_link);
 
-			DBG(("%s: copying replaced CRTC: (%d, %d), (%d, %d)\n",
-			     __FUNCTION__,
-			     crtc->base->bounds.x1,
-			     crtc->base->bounds.y1,
-			     crtc->base->bounds.x2,
-			     crtc->base->bounds.y2));
-			ret = sna->render.copy_boxes(sna, GXcopy,
-						     pixmap, crtc->shadow_bo, -crtc->base->bounds.x1, -crtc->base->bounds.y1,
-						     pixmap, priv->gpu_bo, 0, 0,
-						     &crtc->base->bounds, 1,
-						     0);
-
-			kgem_bo_destroy(&sna->kgem, crtc->shadow_bo);
-			crtc->shadow_bo = NULL;
-			list_del(&crtc->shadow_link);
-
-			region.extents = crtc->base->bounds;
-			region.data = NULL;
-			RegionSubtract(&sna->mode.shadow_region, &sna->mode.shadow_region, &region);
+				DBG(("%s: copying replaced CRTC: (%d, %d), (%d, %d)\n",
+				     __FUNCTION__,
+				     crtc->base->bounds.x1,
+				     crtc->base->bounds.y1,
+				     crtc->base->bounds.x2,
+				     crtc->base->bounds.y2));
+				ret &= sna->render.copy_boxes(sna, GXcopy,
+							      pixmap, crtc->shadow_bo, -crtc->base->bounds.x1, -crtc->base->bounds.y1,
+							      pixmap, priv->gpu_bo, 0, 0,
+							      &crtc->base->bounds, 1,
+							      0);
+
+				kgem_bo_destroy(&sna->kgem, crtc->shadow_bo);
+				crtc->shadow_bo = NULL;
+				list_del(&crtc->shadow_link);
+			}
 		}
-	}
 
-	if ((flags & MOVE_WRITE) == 0)
-		return true;
+		return ret;
+	}
 
 	assert(sna->mode.shadow_active);
 
@@ -1133,6 +1129,32 @@ static bool wait_for_shadow(struct sna *sna, struct sna_pixmap *priv, unsigned f
 
 	sna->mode.shadow_damage = damage;
 
+	while (!list_is_empty(&sna->mode.shadow_crtc)) {
+		struct sna_crtc *crtc =
+			list_first_entry(&sna->mode.shadow_crtc, struct sna_crtc, shadow_link);
+		RegionRec region;
+
+		DBG(("%s: copying replaced CRTC: (%d, %d), (%d, %d)\n",
+		     __FUNCTION__,
+		     crtc->base->bounds.x1,
+		     crtc->base->bounds.y1,
+		     crtc->base->bounds.x2,
+		     crtc->base->bounds.y2));
+		ret = sna->render.copy_boxes(sna, GXcopy,
+					     pixmap, crtc->shadow_bo, -crtc->base->bounds.x1, -crtc->base->bounds.y1,
+					     pixmap, bo, 0, 0,
+					     &crtc->base->bounds, 1,
+					     0);
+
+		kgem_bo_destroy(&sna->kgem, crtc->shadow_bo);
+		crtc->shadow_bo = NULL;
+		list_del(&crtc->shadow_link);
+
+		region.extents = crtc->base->bounds;
+		region.data = NULL;
+		RegionSubtract(&sna->mode.shadow_region, &sna->mode.shadow_region, &region);
+	}
+
 	if (flags & MOVE_READ && RegionNotEmpty(&sna->mode.shadow_region)) {
 		DBG(("%s: copying existing GPU damage: %ldx(%d, %d), (%d, %d)\n",
 		     __FUNCTION__, (long)REGION_NUM_RECTS(&sna->mode.shadow_region),
commit b00a60b41736c399f849217626f246e6e7d1f7eb
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 9 15:03:23 2014 +0100

    sna: Fix cut'n'paste DBG error
    
    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 876884f..aeafeea 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -4462,7 +4462,7 @@ static int do_page_flip(struct sna *sna, struct kgem_bo *bo,
 		if (bo->pitch != crtc->bo->pitch || crtc_offset != crtc->offset) {
 			DBG(("%s: changing pitch (%d == %d) or offset (%x == %x)\n",
 			     __FUNCTION__,
-			     flip_bo->pitch, crtc->bo->pitch,
+			     bo->pitch, crtc->bo->pitch,
 			     crtc_offset, crtc->offset));
 fixup_flip:
 			if (sna_crtc_flip(sna, crtc)) {


More information about the xorg-commit mailing list