xf86-video-intel: 5 commits - src/sna/kgem.c src/sna/sna_display.c src/sna/sna_driver.c src/sna/sna_video.h src/sna/sna_video_sprite.c

Chris Wilson ickle at kemper.freedesktop.org
Fri Apr 18 03:40:16 PDT 2014


 src/sna/kgem.c             |   11 ++++++++++-
 src/sna/sna_display.c      |   12 ++++++------
 src/sna/sna_driver.c       |   10 +++++++++-
 src/sna/sna_video.h        |    3 ++-
 src/sna/sna_video_sprite.c |   13 ++++++++-----
 5 files changed, 35 insertions(+), 14 deletions(-)

New commits:
commit fdc28205d590d560a6f3886189ef974d1d00f2cd
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Apr 18 11:34:07 2014 +0100

    sna: Always flush the shadow scanout
    
    When the shadow scanout is active, make sure we call the BlockHandler
    every time, not just when we about to sleep. This is in case we are
    swamped by clients trying to render and forgo the important step of
    ensuring that their output reaches the screen.
    
    Reported-by: Ildar Nurislamov <absorbb at gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77436
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 42065f1..51f224e 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -627,6 +627,14 @@ cleanup:
 	return FALSE;
 }
 
+static bool has_shadow(struct sna *sna)
+{
+	if (!sna->mode.shadow_damage)
+		return false;
+
+	return RegionNotEmpty(DamageRegion(sna->mode.shadow_damage));
+}
+
 static void
 sna_block_handler(BLOCKHANDLER_ARGS_DECL)
 {
@@ -642,7 +650,7 @@ sna_block_handler(BLOCKHANDLER_ARGS_DECL)
 
 	sna->BlockHandler(BLOCKHANDLER_ARGS);
 
-	if (*tv == NULL || ((*tv)->tv_usec | (*tv)->tv_sec))
+	if (*tv == NULL || ((*tv)->tv_usec | (*tv)->tv_sec) || has_shadow(sna))
 		sna_accel_block_handler(sna, tv);
 }
 
commit 924237efbddb167efc7f9f3bde42b32ffc538ee3
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Apr 18 11:33:42 2014 +0100

    sna: Fix some DBG formats
    
    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 c841baa..a356e7f 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -360,7 +360,7 @@ has_user_backlight_override(xf86OutputPtr output)
 	if (str == NULL)
 		return NULL;
 
-	DBG(("%s(s) requested %s\n", __FUNCTION__, output->name, str));
+	DBG(("%s(%s) requested %s\n", __FUNCTION__, output->name, str));
 
 	if (backlight_exists(str) == BL_NONE) {
 		xf86DrvMsg(output->scrn->scrnIndex, X_ERROR,
@@ -613,8 +613,8 @@ rotation_init(struct sna *sna, struct rotation *r, uint32_t obj_id, uint32_t obj
 		if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPERTY, &prop))
 			continue;
 
-		DBG(("%s: prop[%d] .id=%d, .name=%s, .flags=%x, .value=%ld\n", __FUNCTION__, i,
-		     prop_values[i], prop.name, prop.flags, prop_values[i+props.count_props]));
+		DBG(("%s: prop[%d] .id=%ld, .name=%s, .flags=%x, .value=%ld\n", __FUNCTION__, i,
+		     (long)prop_values[i], prop.name, prop.flags, (long)prop_values[i+props.count_props]));
 		if ((prop.flags & (1 << 5)) == 0)
 			continue;
 
@@ -638,8 +638,8 @@ rotation_init(struct sna *sna, struct rotation *r, uint32_t obj_id, uint32_t obj
 				 * RandR remains fixed for our lifetimes.
 				 */
 				for (j = 0; j < prop.count_enum_blobs; j++) {
-					DBG(("%s: rotation[%d] = %s [%x]\n", __FUNCTION__,
-					     j, enums[j].name, enums[j].value));
+					DBG(("%s: rotation[%d] = %s [%lx]\n", __FUNCTION__,
+					     j, enums[j].name, (long)enums[j].value));
 					r->supported |= 1 << enums[j].value;
 				}
 			}
commit fa56f1062b926b15e554f46eb268a69b43dd8b9f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Apr 18 09:52:26 2014 +0100

    sna/video: Only try to set the color key once
    
    So that we only report the error to the user a single time, and not
    every frame.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 58f86d2..5d77799 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -540,7 +540,6 @@ bool kgem_bo_write(struct kgem *kgem, struct kgem_bo *bo,
 	int err;
 
 	assert(bo->refcnt);
-	assert(!bo->purged);
 	assert(bo->proxy == NULL);
 	ASSERT_IDLE(kgem, bo->handle);
 
diff --git a/src/sna/sna_video.h b/src/sna/sna_video.h
index f906e95..337f928 100644
--- a/src/sna/sna_video.h
+++ b/src/sna/sna_video.h
@@ -87,7 +87,8 @@ struct sna_video {
 	uint32_t gamma5;
 
 	int color_key;
-	int color_key_changed;
+	bool color_key_changed;
+	bool has_color_key;
 
 	/** YUV data buffers */
 	struct kgem_bo *old_buf[2];
diff --git a/src/sna/sna_video_sprite.c b/src/sna/sna_video_sprite.c
index f4dcb82..6fcc779 100644
--- a/src/sna/sna_video_sprite.c
+++ b/src/sna/sna_video_sprite.c
@@ -214,8 +214,9 @@ sna_video_sprite_show(struct sna *sna,
 		frame->height = tmp;
 	}
 
-#if defined(DRM_I915_SET_SPRITE_COLORKEY)
-	if (video->color_key_changed || video->plane != s.plane_id) {
+#define DRM_I915_SET_SPRITE_COLORKEY 0x2b
+	if ((video->color_key_changed || video->plane != s.plane_id) &&
+	    video->has_color_key) {
 		struct drm_intel_sprite_colorkey set;
 
 		DBG(("%s: updating color key: %x\n",
@@ -231,13 +232,14 @@ sna_video_sprite_show(struct sna *sna,
 
 		if (drmIoctl(sna->kgem.fd,
 			     DRM_IOCTL_I915_SET_SPRITE_COLORKEY,
-			     &set))
+			     &set)) {
 			xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR,
-				   "failed to update color key\n");
+				   "failed to update color key, disabling future updates\n");
+			video->has_color_key = false;
+		}
 
 		video->color_key_changed = false;
 	}
-#endif
 
 	if (frame->bo->delta == 0) {
 		uint32_t offsets[4], pitches[4], handles[4];
@@ -603,6 +605,7 @@ void sna_video_sprite_setup(struct sna *sna, ScreenPtr screen)
 	video->alignment = 64;
 	video->color_key = sna_video_sprite_color_key(sna);
 	video->color_key_changed = true;
+	video->has_color_key = true;
 	video->brightness = -19;	/* (255/219) * -16 */
 	video->contrast = 75;	/* 255/219 * 64 */
 	video->saturation = 146;	/* 128/112 * 128 */
commit 154f7e9668bffdf565b6914a3a3e5bdfe17aa1b9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Apr 18 09:28:02 2014 +0100

    sna: Do not reuse physical cursors for the kernel is broken
    
    Big bug in the kernel that prevents the sharing of cursors across pipes
    when they are backed by a phys_obj. To prevent hitting that bug, don't
    do that!
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77351
    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 90c24fe..c841baa 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -3171,7 +3171,7 @@ static struct sna_cursor *__sna_get_cursor(struct sna *sna, xf86CrtcPtr crtc)
 
 	rotation = crtc->transform_in_use ? crtc->rotation : RR_Rotate_0;
 	for (cursor = sna->cursor.cursors; cursor; cursor = cursor->next) {
-		if (cursor->serial == sna->cursor.serial && cursor->rotation == rotation) {
+		if (cursor->serial == sna->cursor.serial && cursor->rotation == rotation && cursor->image) {
 			__DBG(("%s: reusing handle=%d, serial=%d, rotation=%d, size=%d\n",
 			       __FUNCTION__, cursor->handle, cursor->serial, cursor->rotation, cursor->size));
 			assert(cursor->size == sna->cursor.size);
commit 83f49767f8ed9dd49c40ebc65ed22c288a386edd
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Apr 15 16:27:44 2014 +0100

    sna: Pre-emptively bind framebuffers into the GTT
    
    In order to avoid rendering to the bo and then stalling before we can
    pin it the display plane, bind the framebuffer into the GTT (by using a
    GTT mmap) during the initial allocation.
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=77436
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index a840ed6..58f86d2 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -4194,6 +4194,16 @@ static void __kgem_bo_make_scanout(struct kgem *kgem,
 	    do_ioctl(kgem->fd, DRM_IOCTL_MODE_ADDFB, &arg) == 0) {
 		bo->scanout = true;
 		bo->delta = arg.fb_id;
+
+		/* Pre-emptively move the object into the mappable
+		 * portion to avoid rebinding later when busy.
+		 */
+		if (bo->map__gtt == NULL)
+			bo->map__gtt = __kgem_bo_map__gtt(kgem, bo);
+		if (bo->map__gtt) {
+			*(uint32_t *)bo->map__gtt = 0;
+			bo->domain = DOMAIN_GTT;
+		}
 	}
 }
 


More information about the xorg-commit mailing list