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

2023-04-12 Thread Javier Martinez Canillas
Jocelyn Falempe 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 = (wid

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

2023-04-12 Thread Jocelyn Falempe
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 3