xf86-video-intel: 4 commits - src/sna/sna_video_sprite.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Nov 10 15:43:43 UTC 2016


 src/sna/sna_video_sprite.c |   28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

New commits:
commit dad64e9f76c718033402be7bfd2129866d492304
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Nov 10 15:38:18 2016 +0000

    sna/video: Mark the bo as clean after a setplane
    
    The kernel will flush it, so we can treat it as clean after a successful
    setplane.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_video_sprite.c b/src/sna/sna_video_sprite.c
index adb7ba2..bef1a44 100644
--- a/src/sna/sna_video_sprite.c
+++ b/src/sna/sna_video_sprite.c
@@ -370,7 +370,7 @@ sna_video_sprite_show(struct sna *sna,
 		return false;
 	}
 
-	frame->bo->domain = DOMAIN_NONE;
+	__kgem_bo_clear_dirty(frame->bo);
 
 	if (video->bo[pipe])
 		kgem_bo_destroy(&sna->kgem, video->bo[pipe]);
@@ -580,7 +580,6 @@ off:
 			ret = BadAlloc;
 		}
 
-		frame.bo->domain = DOMAIN_NONE;
 		if (cache_bo)
 			sna_video_buffer_fini(video);
 		else
commit 65b680e6cf6b710e6feb23d707f728e89bee4a22
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Nov 10 15:36:23 2016 +0000

    sna/video: Don't skip setplane if this frame.bo is the same as the last
    
    Always show the image, even if the bo doesn't appear to change as the
    client may have put fresh data in the shared buffer and repositioned the
    image.
    
    Suggested-by: Ville Syrjala <ville.syrjala at linux.intel.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_video_sprite.c b/src/sna/sna_video_sprite.c
index c8b77a8..adb7ba2 100644
--- a/src/sna/sna_video_sprite.c
+++ b/src/sna/sna_video_sprite.c
@@ -261,10 +261,6 @@ sna_video_sprite_show(struct sna *sna,
 		video->color_key_changed &= ~(1 << pipe);
 	}
 
-	assert(pipe < ARRAY_SIZE(video->bo));
-	if (video->bo[pipe] == frame->bo)
-		return true;
-
 	update_dst_box_to_crtc_coords(sna, crtc, dstBox);
 	if (frame->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
 		int tmp = frame->width;
commit 6d7e13f78b63bc21f82056ca6814c54f39adb9e8
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Nov 10 15:28:56 2016 +0000

    sna/video: Add tiling modifiers for addfb2
    
    In case we do end up with a tiled buffer, create the framebuffer
    appropriately.
    
    Suggested-by: Ville Syrjala <ville.syrjala at linux.intel.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_video_sprite.c b/src/sna/sna_video_sprite.c
index a8deabd..c8b77a8 100644
--- a/src/sna/sna_video_sprite.c
+++ b/src/sna/sna_video_sprite.c
@@ -282,15 +282,30 @@ sna_video_sprite_show(struct sna *sna,
 			uint32_t handles[4];
 			uint32_t pitches[4]; /* pitch for each plane */
 			uint32_t offsets[4]; /* offset of each plane */
+			uint64_t modifiers[4];
 		} f;
 		bool purged = true;
 
 		memset(&f, 0, sizeof(f));
 		f.width = frame->width;
 		f.height = frame->height;
+		f.flags = 1 << 1; /* +modifiers */
 		f.handles[0] = frame->bo->handle;
 		f.pitches[0] = frame->pitch[0];
 
+		switch (frame->bo->tiling) {
+		case I915_TILING_NONE:
+			break;
+		case I915_TILING_X:
+			/* I915_FORMAT_MOD_X_TILED */
+			f.modifiers[0] = (uint64_t)1 << 56 | 1;
+			break;
+		case I915_TILING_Y:
+			/* I915_FORMAT_MOD_X_TILED */
+			f.modifiers[0] = (uint64_t)1 << 56 | 2;
+			break;
+		}
+
 		switch (frame->id) {
 		case FOURCC_RGB565:
 			f.pixel_format = DRM_FORMAT_RGB565;
commit f3809df493bfc825fe4068566bb3210e772a6594
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Nov 10 15:26:14 2016 +0000

    sna/video: Pass the dst extents to xf86XVClipVideoHelper()
    
    xf86XVClipVideoHelper wants to measure from the origin of the target
    extents to the clip in order to determine the right offset into the
    source.
    
    Suggested-by: Ville Syrjala <ville.syrjala at linux.intel.com>
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_video_sprite.c b/src/sna/sna_video_sprite.c
index 1a2b1c8..a8deabd 100644
--- a/src/sna/sna_video_sprite.c
+++ b/src/sna/sna_video_sprite.c
@@ -373,9 +373,11 @@ static int sna_video_sprite_put_image(ddPutImage_ARGS)
 	struct sna *sna = video->sna;
 	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn);
 	RegionRec clip;
+	BoxRec draw_extents;
 	int ret, i;
 
 	init_video_region(&clip, draw, drw_x, drw_y, drw_w, drw_h);
+	draw_extents = clip.extents;
 
 	DBG(("%s: always_on_top=%d\n", __FUNCTION__, video->AlwaysOnTop));
 	if (!video->AlwaysOnTop) {
@@ -402,9 +404,9 @@ static int sna_video_sprite_put_image(ddPutImage_ARGS)
 	for (i = 0; i < video->sna->mode.num_real_crtc; i++) {
 		xf86CrtcPtr crtc = config->crtc[i];
 		struct sna_video_frame frame;
+		BoxRec dst = draw_extents;
 		int pipe;
 		INT32 x1, x2, y1, y2;
-		BoxRec dst;
 		RegionRec reg;
 		Rotation rotation;
 		bool cache_bo;
@@ -436,8 +438,6 @@ off:
 		y1 = src_y;
 		y2 = src_y + src_h;
 
-		dst = clip.extents;
-
 		ret = xf86XVClipVideoHelper(&dst, &x1, &x2, &y1, &y2,
 					    &reg, frame.width, frame.height);
 		RegionUninit(&reg);


More information about the xorg-commit mailing list