Re: [PATCH 1/2] drm/mgag200: simplify offset and scale computation.

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

 



Jocelyn Falempe <jfalempe@xxxxxxxxxx> writes:

Hello Jocelyn,

> Now that the driver handles only 16, 24 and 32-bit framebuffer,
> it can be simplified.
>
> No functional changes.
>
> offset:
> 16bit: (bppshift = 1)
> offset = width >> (4 - bppshift) => width / 8 => pitch / 16
>
> 24bit:  (bppshift = 0)
> offset = (width * 3) >> (4 - bppshift)  => width * 3 / 16 => pitch / 16
>
> 32bit:  (bppshift = 2)
> offset = width >> (4 - bppshift) => width / 4 => pitch / 16
>
> scale:
> 16bit:
> scale = (1 << bppshift) - 1 => 1
> 24bit:
> scale = ((1 << bppshift) * 3) - 1 => 2
> 32bit:
> scale = (1 << bppshift) - 1 => 3
>
> Signed-off-by: Jocelyn Falempe <jfalempe@xxxxxxxxxx>
> ---

Thanks a nice simplication indeed.

Reviewed-by: Javier Martinez Canillas <javierm@xxxxxxxxxx>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux