Hi, On 9/30/24 8:31 AM, Louis Chauvet wrote: > Introduce two typedefs: pixel_read_t and pixel_write_t. It allows the > compiler to check if the passed functions take the correct arguments. > Such typedefs will help ensuring consistency across the code base in > case of update of these prototypes. > > Rename input/output variable in a consistent way between read_line and > write_line. > > A warn has been added in get_pixel_*_function to alert when an unsupported > pixel format is requested. As those formats are checked before > atomic_update callbacks, it should never happen. > > Document for those typedefs. > > Reviewed-by: Pekka Paalanen <pekka.paalanen@xxxxxxxxxxxxx> > Signed-off-by: Louis Chauvet <louis.chauvet@xxxxxxxxxxx> > --- > drivers/gpu/drm/vkms/vkms_drv.h | 23 ++++++- > drivers/gpu/drm/vkms/vkms_formats.c | 124 ++++++++++++++++++++---------------- > drivers/gpu/drm/vkms/vkms_formats.h | 4 +- > drivers/gpu/drm/vkms/vkms_plane.c | 2 +- > 4 files changed, 94 insertions(+), 59 deletions(-) > > diff --git a/drivers/gpu/drm/vkms/vkms_drv.h b/drivers/gpu/drm/vkms/vkms_drv.h > index fcb5a5ff7df7..137348f4adb2 100644 > --- a/drivers/gpu/drm/vkms/vkms_drv.h > +++ b/drivers/gpu/drm/vkms/vkms_drv.h > @@ -53,12 +53,31 @@ struct line_buffer { > struct pixel_argb_u16 *pixels; > }; > > +/** > + * typedef pixel_write_t - These functions are used to read a pixel from a > + * &struct pixel_argb_u16, convert it in a specific format and write it in the @dst_pixels Should @dst_pixels be @out_pixel? > + * buffer. > + * > + * @out_pixel: destination address to write the pixel > + * @in_pixel: pixel to write > + */ > +typedef void (*pixel_write_t)(u8 *out_pixel, struct pixel_argb_u16 *in_pixel);