qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH] Correct computation of bytes per


From: Peter Maydell
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] Correct computation of bytes per pixel from bits per pixel
Date: Wed, 22 Aug 2012 09:30:32 +0100

On 21 August 2012 22:32, BALATON Zoltan <address@hidden> wrote:

If you make the Subject "console: Correct computation of bytes per pixel
from bits per pixel" it's easier to tell what bit of qemu the patch
is dealing with.

> Signed-off-by: BALATON Zoltan <address@hidden>
> ---
>  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;

You could write this as
       pf.bytes_per_pixel = DIV_ROUND_UP(bpp, 8);

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]