[PATCH 04/18] exa: switch to byte counting functions.

Michel Dänzer michel at daenzer.net
Thu Jul 9 01:43:05 PDT 2009


On Thu, 2009-07-09 at 10:05 +1000, Peter Hutterer wrote:
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>  exa/exa.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/exa/exa.c b/exa/exa.c
> index d04ea71..750a4a6 100644
> --- a/exa/exa.c
> +++ b/exa/exa.c
> @@ -236,7 +236,7 @@ exaSetAccelBlock(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap,
>      pExaPixmap->accel_blocked = 0;
>  
>      if (pExaScr->info->maxPitchPixels) {
> -        int max_pitch = pExaScr->info->maxPitchPixels * (bpp + 7) / 8;
> +        int max_pitch = pExaScr->info->maxPitchPixels * num_bytes_for_bits(bpp);
>  
>          if (pExaPixmap->fb_pitch > max_pitch)
>              pExaPixmap->accel_blocked |= EXA_RANGE_PITCH;
> @@ -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 + 7) / 8;
> +        pExaPixmap->fb_pitch = num_bytes_for_bits((1 << (exaLog2(w - 1) + 1)) * bpp);
>      else
> -        pExaPixmap->fb_pitch = (w * bpp + 7) / 8;
> +        pExaPixmap->fb_pitch = num_bytes_for_bits(w * bpp);
>  
>      pExaPixmap->fb_pitch = EXA_ALIGN(pExaPixmap->fb_pitch,
>                                       pExaScr->info->pixmapPitchAlign);

Acked-by: Michel Dänzer <michel at daenzer.net>


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


More information about the xorg-devel mailing list