From: BALATON Zoltan <balaton@eik.bme.hu>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org
Subject: [Qemu-devel] [PATCH] Correct computation of bytes per pixel from bits per pixel
Date: Tue, 21 Aug 2012 23:32:04 +0200 (CEST) [thread overview]
Message-ID: <Pine.GSO.4.64.1208212331340.11653@mono> (raw)
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
console.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/console.c b/console.c
index 4525cc7..f698b77 100644
--- a/console.c
+++ b/console.c
@@ -1612,7 +1612,7 @@ PixelFormat qemu_different_endianness_pixelformat(int bpp)
memset(&pf, 0x00, sizeof(PixelFormat));
pf.bits_per_pixel = bpp;
- pf.bytes_per_pixel = bpp / 8;
+ pf.bytes_per_pixel = (bpp + 7) >> 3;
pf.depth = bpp == 32 ? 24 : bpp;
switch (bpp) {
@@ -1661,7 +1661,7 @@ PixelFormat qemu_default_pixelformat(int bpp)
memset(&pf, 0x00, sizeof(PixelFormat));
pf.bits_per_pixel = bpp;
- pf.bytes_per_pixel = bpp / 8;
+ pf.bytes_per_pixel = (bpp + 7) >> 3;
pf.depth = bpp == 32 ? 24 : bpp;
switch (bpp) {
--
1.7.10
next reply other threads:[~2012-08-21 21:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 21:32 BALATON Zoltan [this message]
2012-08-22 8:02 ` [Qemu-devel] [PATCH] Correct computation of bytes per pixel from bits per pixel Jan Kiszka
2012-08-22 8:30 ` Peter Maydell
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=Pine.GSO.4.64.1208212331340.11653@mono \
--to=balaton@eik.bme.hu \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).