All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Heider <a.heider@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH v2 2/6] gui: convert graphic utils to respect line_length
Date: Tue,  5 Nov 2013 00:01:00 +0100	[thread overview]
Message-ID: <1383606064-30494-3-git-send-email-a.heider@gmail.com> (raw)
In-Reply-To: <1383606064-30494-1-git-send-email-a.heider@gmail.com>

Signed-off-by: Andre Heider <a.heider@gmail.com>
---
 lib/gui/graphic_utils.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/gui/graphic_utils.c b/lib/gui/graphic_utils.c
index 95687df..300c525 100644
--- a/lib/gui/graphic_utils.c
+++ b/lib/gui/graphic_utils.c
@@ -167,18 +167,18 @@ void rgba_blend(struct fb_info *info, struct image *img, void* buf, int height,
 {
 	unsigned char *adr;
 	int x, y;
-	int xres;
+	int line_length;
 	int img_byte_per_pixel = 3;
 	void *image;
 
 	if (is_rgba)
 		img_byte_per_pixel++;
 
-	xres = info->xres;
+	line_length = info->line_length;
 
 	for (y = 0; y < height; y++) {
-		adr = buf + ((y + starty) * xres + startx) *
-				(info->bits_per_pixel >> 3);
+		adr = buf + (y + starty) * line_length +
+				startx * (info->bits_per_pixel >> 3);
 		image = img->data + (y * img->width *img_byte_per_pixel);
 
 		for (x = 0; x < width; x++) {
@@ -219,7 +219,7 @@ int fb_open(const char * fbdev, struct screen *sc, bool offscreen)
 	sc->s.y = 0;
 	sc->s.width = sc->info.xres;
 	sc->s.height = sc->info.yres;
-	sc->fbsize = sc->s.width * sc->s.height * (sc->info.bits_per_pixel >> 3);
+	sc->fbsize = sc->info.line_length * sc->s.height;
 
 	if (offscreen) {
 		/* Don't fail if malloc fails, just continue rendering directly
-- 
1.8.3.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2013-11-04 23:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-04 23:00 [PATCH v2 0/6] BCM2835 / simple framebuffer support Andre Heider
2013-11-04 23:00 ` [PATCH v2 1/6] fb: add a line_length value to struct fb_info Andre Heider
2013-11-05  0:06   ` Alexander Aring
2013-11-05  8:00     ` Sascha Hauer
2013-11-05  8:17       ` Alexander Aring
2013-11-05  8:48         ` Andre Heider
2013-11-05  8:58           ` Alexander Aring
2013-11-04 23:01 ` Andre Heider [this message]
2013-11-04 23:01 ` [PATCH v2 3/6] gui: convert the bmp renderer to respect line_length Andre Heider
2013-11-04 23:01 ` [PATCH v2 4/6] ARM: bcm2835: add missing mbox overscan response field Andre Heider
2013-11-04 23:01 ` [PATCH v2 5/6] video: add a BCM2835 framebuffer driver Andre Heider
2013-11-04 23:01 ` [PATCH v2 6/6] video: set up the kernel's simple " Andre Heider
2013-11-06  9:46 ` [PATCH v2 0/6] BCM2835 / simple framebuffer support Sascha Hauer
2013-11-06 10:04   ` Alexander Aring
2013-11-06 10:02     ` Sascha Hauer
2013-11-06 10:18       ` Alexander Aring
2013-11-06 17:40   ` Andre Heider
2013-11-12 12:14     ` Andre Heider
2013-11-12 14:19       ` Sascha Hauer
2013-11-14 11:44         ` Andre Heider

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=1383606064-30494-3-git-send-email-a.heider@gmail.com \
    --to=a.heider@gmail.com \
    --cc=barebox@lists.infradead.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.