All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Lespiau <damien.lespiau@gmail.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH] testdisplay: Use the fb stride when painting the color key
Date: Tue, 27 Nov 2012 19:14:05 +0000	[thread overview]
Message-ID: <1354043645-32581-1-git-send-email-damien.lespiau@gmail.com> (raw)

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(-)

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);
 
-- 
1.7.11.7

             reply	other threads:[~2012-11-27 19:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27 19:14 Damien Lespiau [this message]
2012-11-27 23:16 ` [PATCH] testdisplay: Use the fb stride when painting the color key Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1354043645-32581-1-git-send-email-damien.lespiau@gmail.com \
    --to=damien.lespiau@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.