Re: [PATCH v2] drm/format-helper: Make conversion_buf_size() support sub-byte pixel fmts

2023-03-16 Thread Javier Martinez Canillas
Geert Uytterhoeven writes: Hello Geert, [...] >> + if (!dst_pitch) { >> + bpp = drm_format_info_bpp(dst_fi, 0); >> + dst_pitch = DIV_ROUND_UP(drm_rect_width(clip) * bpp, 8); > > I know I'm a bit late to the party, but here's actually a helper for that: > >

Re: [PATCH v2] drm/format-helper: Make conversion_buf_size() support sub-byte pixel fmts

2023-03-16 Thread Geert Uytterhoeven
Hi Javier, On Tue, Mar 7, 2023 at 10:54 PM Javier Martinez Canillas wrote: > There are DRM fourcc formats that have pixels smaller than a byte, but the > conversion_buf_size() function assumes that pixels are a multiple of bytes > and use the struct drm_format_info .cpp field to calculate the

Re: [PATCH v2] drm/format-helper: Make conversion_buf_size() support sub-byte pixel fmts

2023-03-10 Thread Javier Martinez Canillas
Javier Martinez Canillas writes: > There are DRM fourcc formats that have pixels smaller than a byte, but the > conversion_buf_size() function assumes that pixels are a multiple of bytes > and use the struct drm_format_info .cpp field to calculate the dst_pitch. > > Instead, calculate it by

Re: [PATCH v2] drm/format-helper: Make conversion_buf_size() support sub-byte pixel fmts

2023-03-09 Thread Maíra Canal
On 3/7/23 18:50, Javier Martinez Canillas wrote: There are DRM fourcc formats that have pixels smaller than a byte, but the conversion_buf_size() function assumes that pixels are a multiple of bytes and use the struct drm_format_info .cpp field to calculate the dst_pitch. Instead, calculate it

Re: [PATCH v2] drm/format-helper: Make conversion_buf_size() support sub-byte pixel fmts

2023-03-09 Thread Arthur Grillo Queiroz Cabral
Hi, On 07/03/23 18:50, Javier Martinez Canillas wrote: > There are DRM fourcc formats that have pixels smaller than a byte, but the > conversion_buf_size() function assumes that pixels are a multiple of bytes > and use the struct drm_format_info .cpp field to calculate the dst_pitch. > >

[PATCH v2] drm/format-helper: Make conversion_buf_size() support sub-byte pixel fmts

2023-03-07 Thread Javier Martinez Canillas
There are DRM fourcc formats that have pixels smaller than a byte, but the conversion_buf_size() function assumes that pixels are a multiple of bytes and use the struct drm_format_info .cpp field to calculate the dst_pitch. Instead, calculate it by using the bits per pixel (bpp) and divide it by