xf86-video-intel: 2 commits - src/sna/sna_video_sprite.c test/dri3-test.c

Chris Wilson ickle at kemper.freedesktop.org
Sat Jul 19 23:35:11 PDT 2014


 src/sna/sna_video_sprite.c |   15 ++++++---------
 test/dri3-test.c           |   26 +++++++++++++++++++-------
 2 files changed, 25 insertions(+), 16 deletions(-)

New commits:
commit bfccacf745d054756661be3edd8898ac6aceb878
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Jul 20 07:29:21 2014 +0100

    sna/video: Bump the maximum size for sprites
    
    A sprite plane is limited by the display engine who's maximum resolution
    has increased since the 2kx2k limitations of 8xx, so let's set it
    correctly to the reported maximum CRTC size (since we have no individual
    query for maximum sprite plane sizes).
    
    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 1106c00..80fa43f 100644
--- a/src/sna/sna_video_sprite.c
+++ b/src/sna/sna_video_sprite.c
@@ -63,9 +63,6 @@ struct local_mode_set_plane {
 	uint32_t src_h, src_w;
 };
 
-#define IMAGE_MAX_WIDTH		2048
-#define IMAGE_MAX_HEIGHT	2048
-
 #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, true)
 
 static Atom xvColorKey, xvAlwaysOnTop, xvSyncToVblank;
@@ -584,10 +581,10 @@ static int sna_video_sprite_query(ClientPtr client,
 	struct sna_video_frame frame;
 	int size;
 
-	if (*w > IMAGE_MAX_WIDTH)
-		*w = IMAGE_MAX_WIDTH;
-	if (*h > IMAGE_MAX_HEIGHT)
-		*h = IMAGE_MAX_HEIGHT;
+	if (*w > video->sna->mode.max_crtc_width)
+		*w = video->sna->mode.max_crtc_width;
+	if (*h > video->sna->mode.max_crtc_height)
+		*h = video->sna->mode.max_crtc_height;
 
 	if (offsets)
 		offsets[0] = 0;
@@ -687,8 +684,8 @@ void sna_video_sprite_setup(struct sna *sna, ScreenPtr screen)
 	adaptor->pEncodings[0].id = 0;
 	adaptor->pEncodings[0].pScreen = screen;
 	adaptor->pEncodings[0].name = (char *)"XV_IMAGE";
-	adaptor->pEncodings[0].width = IMAGE_MAX_WIDTH;
-	adaptor->pEncodings[0].height = IMAGE_MAX_HEIGHT;
+	adaptor->pEncodings[0].width = sna->mode.max_crtc_width;
+	adaptor->pEncodings[0].height = sna->mode.max_crtc_height;
 	adaptor->pEncodings[0].rate.numerator = 1;
 	adaptor->pEncodings[0].rate.denominator = 1;
 	adaptor->pFormats = formats;
commit 9bb2818a7db1c9dc89379996415511b6cff4bb33
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Jul 20 07:27:58 2014 +0100

    dri3-test: Print line number for shm failures
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/test/dri3-test.c b/test/dri3-test.c
index 3fe011a..c66da31 100644
--- a/test/dri3-test.c
+++ b/test/dri3-test.c
@@ -444,6 +444,7 @@ static int test_shm(Display *dpy, int device,
 	uint32_t *ptr;
 	int stride, fd;
 	int x, y;
+	int line;
 
 	if (!can_use_shm(dpy))
 		return 0;
@@ -478,16 +479,22 @@ static int test_shm(Display *dpy, int device,
 	printf("Testing write of %dx%d SHM pixmap via DRI3 fd\n", width, height);
 
 	fd = dri3_create_fd(dpy, pixmap, &stride);
-	if (fd < 0)
+	if (fd < 0) {
+		line = __LINE__;
 		goto fail;
+	}
 
 	handle = gem_import(device, fd);
 	close(fd);
-	if (handle == 0)
+	if (handle == 0) {
+		line = __LINE__;
 		goto fail;
+	}
 
-	if (gpu_fill(device, handle, width, height, stride, 32, I915_TILING_NONE, pixel))
+	if (gpu_fill(device, handle, width, height, stride, 32, I915_TILING_NONE, pixel)) {
+		line = __LINE__;
 		goto fail;
+	}
 
 	gem_sync(device, handle, CPU);
 	ptr = (uint32_t *)shm.shmaddr;
@@ -495,6 +502,7 @@ static int test_shm(Display *dpy, int device,
 		for (y = 0; y < sizeof(y_loc)/sizeof(y_loc[0]); y++)
 			if (ptr[y_loc[y]*width + x_loc[x]] != pixel) {
 				printf("pixel[%d, %d]:%d = %08x\n", x, y, 32, ptr[y_loc[y] * width + x_loc[x]]);
+				line = __LINE__;
 				goto fail;
 			}
 
@@ -502,11 +510,15 @@ static int test_shm(Display *dpy, int device,
 		for (y = 0; y < sizeof(y_loc)/sizeof(y_loc[0]); y++)
 			if (!check_pixmap(dpy, pixmap,
 					  x_loc[x], y_loc[y],
-					  pixel, 32))
+					  pixel, 32)) {
+				line = __LINE__;
 				goto fail;
+			}
 
-	if (_x_error_occurred)
+	if (_x_error_occurred) {
+		line = __LINE__;
 		goto fail;
+	}
 
 out:
 	gem_close(device, handle);
@@ -516,8 +528,8 @@ out:
 	return fd != -1;
 
 fail:
-	printf("%s failed at (%dx%d)\n",
-	       __func__, width, height);
+	printf("%s failed at (%dx%d), line %d\n",
+	       __func__, width, height, line);
 	fd = -1;
 	goto out;
 }


More information about the xorg-commit mailing list