qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Correct computation of bytes per pixel from bits per pixel
@ 2012-08-21 21:32 BALATON Zoltan
  2012-08-22  8:02 ` Jan Kiszka
  2012-08-22  8:30 ` Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: BALATON Zoltan @ 2012-08-21 21:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial


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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-22  8:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-21 21:32 [Qemu-devel] [PATCH] Correct computation of bytes per pixel from bits per pixel BALATON Zoltan
2012-08-22  8:02 ` Jan Kiszka
2012-08-22  8:30 ` Peter Maydell

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