[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg-devel
Subject:    [PATCH 2/2] exa: round of fb_pitch to the next byte
From:       michel () daenzer ! net (Michel =?ISO-8859-1?Q?D=E4nzer?=)
Date:       2009-03-18 17:56:32
Message-ID: 1237398992.5256.11100.camel () thor ! local
[Download RAW message or body]

On Mit, 2009-03-18 at 18:38 +0100, Maarten Maathuis wrote:
> ---
>  exa/exa.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/exa/exa.c b/exa/exa.c
> index 3fcb3e2..ecb2117 100644
> --- a/exa/exa.c
> +++ b/exa/exa.c
> @@ -258,9 +258,9 @@ exaSetFbPitch(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap,
>                int w, int h, int bpp)
>  {
>      if (pExaScr->info->flags & EXA_OFFSCREEN_ALIGN_POT && w != 1)
> -        pExaPixmap->fb_pitch = (1 << (exaLog2(w - 1) + 1)) * bpp / 8;
> +        pExaPixmap->fb_pitch = ((1 << (exaLog2(w - 1) + 1)) * bpp + 7) / 8;
>      else
> -        pExaPixmap->fb_pitch = w * bpp / 8;
> +        pExaPixmap->fb_pitch = (w * bpp + 7) / 8;

Looks good.

Your other patch is probably fine as well.


-- 
Earthling Michel D?nzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic