diff mbox

testdisplay: Use the fb stride when painting the color key

Message ID 1354043645-32581-1-git-send-email-damien.lespiau@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Damien Lespiau Nov. 27, 2012, 7:14 p.m. UTC
From: Damien Lespiau <damien.lespiau@intel.com>

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55901

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 tests/testdisplay.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Daniel Vetter Nov. 27, 2012, 11:16 p.m. UTC | #1
On Tue, Nov 27, 2012 at 07:14:05PM +0000, Damien Lespiau wrote:
> From: Damien Lespiau <damien.lespiau@intel.com>
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55901
> 
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Applied, thanks for the patch.
-Daniel
diff mbox

Patch

diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index cd83d9c..7287487 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -334,7 +334,7 @@  static void connector_find_preferred_mode(struct connector *c)
 }
 
 static void
-paint_color_key(void)
+paint_color_key(struct kmstest_fb *fb_info)
 {
 	int i, j;
 
@@ -342,7 +342,7 @@  paint_color_key(void)
 		for (j = crtc_x; j < crtc_x + crtc_w; j++) {
 			uint32_t offset;
 
-			offset = (i * width) + j;
+			offset = (i * fb_info->stride / 4) + j;
 			fb_ptr[offset] = SPRITE_COLOR_KEY;
 		}
 }
@@ -530,7 +530,7 @@  set_mode(struct connector *c)
 		fb_ptr = gem_mmap(drm_fd, fb_info.gem_handle,
 				  fb_info.size, PROT_READ | PROT_WRITE);
 		assert(fb_ptr);
-		paint_color_key();
+		paint_color_key(&fb_info);
 
 		gem_close(drm_fd, fb_info.gem_handle);