mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Louis Chauvet <louis.chauvet@bootlin.com>
To: Matheus Alves de Almeida <matheus.aalmeida@inf.ufrgs.br>,
	Haneen Mohammed <hamohammed.sa@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	Melissa Wen <melissa.srw@gmail.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/5] drm/vkms: add support for BGR233
Date: Wed, 18 Nov 2026 14:30:14 +0100	[thread overview]
Message-ID: <59f417a8-be50-4378-9ded-1adc1148cc6f@bootlin.com> (raw)
In-Reply-To: <20260928005301.367977-6-matheus.aalmeida@inf.ufrgs.br>



On 9/28/26 02:53, Matheus Alves de Almeida wrote:
> Add support for reading and writing the BGR233 pixel format.
> 
> Signed-off-by: Matheus Alves de Almeida <matheus.aalmeida@inf.ufrgs.br>

Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>

> ---
>   drivers/gpu/drm/vkms/vkms_formats.c   | 20 ++++++++++++++++++++
>   drivers/gpu/drm/vkms/vkms_plane.c     |  1 +
>   drivers/gpu/drm/vkms/vkms_writeback.c |  3 ++-
>   3 files changed, 23 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c
> index 0c3bb0618..de25c8a19 100644
> --- a/drivers/gpu/drm/vkms/vkms_formats.c
> +++ b/drivers/gpu/drm/vkms/vkms_formats.c
> @@ -273,6 +273,12 @@ static struct pixel_argb_u16 argb_u16_from_RGB332(u8 pixel)
>   				    pixel & 0x3, 0xffff, 3, 3, 2, 0);
>   }
>   
> +static struct pixel_argb_u16 argb_u16_from_BGR233(u8 pixel)
> +{
> +	return channels_to_argb_u16(pixel & 0x7, (pixel >> 3) & 0x7,
> +				    (pixel >> 6) & 0x3, 0xffff, 3, 3, 2, 0);
> +}
> +
>   static struct pixel_argb_u16 argb_u16_from_gray8(u8 gray)
>   {
>   	return argb_u16_from_u8888(255, gray, gray, gray);
> @@ -482,6 +488,7 @@ READ_LINE(RGB565_read_line, px, __le16, argb_u16_from_RGB565, px)
>   READ_LINE(BGR565_read_line, px, __le16, argb_u16_from_BGR565, px)
>   
>   READ_LINE(RGB332_read_line, px, u8, argb_u16_from_RGB332, *px)
> +READ_LINE(BGR233_read_line, px, u8, argb_u16_from_BGR233, *px)
>   
>   READ_LINE(R8_read_line, px, u8, argb_u16_from_gray8, *px)
>   
> @@ -707,6 +714,15 @@ static void argb_u16_to_RGB332(u8 *out_pixel, const struct pixel_argb_u16 *in_pi
>   	*out_pixel = r << 5 | g << 2 | b;
>   }
>   
> +static void argb_u16_to_BGR233(u8 *out_pixel, const struct pixel_argb_u16 *in_pixel)
> +{
> +	u16 r, g, b;
> +
> +	argb_u16_to_channels(&r, &g, &b, NULL, 3, 3, 2, 0, in_pixel);
> +
> +	*out_pixel = b << 6 | g << 3 | r;
> +}
> +
>   /**
>    * vkms_writeback_row() - Generic loop for all supported writeback format. It is executed just
>    * after the blending to write a line in the writeback buffer.
> @@ -771,6 +787,8 @@ pixel_read_line_t get_pixel_read_line_function(u32 format)
>   		return &BGR565_read_line;
>   	case DRM_FORMAT_RGB332:
>   		return &RGB332_read_line;
> +	case DRM_FORMAT_BGR233:
> +		return &BGR233_read_line;
>   	case DRM_FORMAT_NV12:
>   	case DRM_FORMAT_NV16:
>   	case DRM_FORMAT_NV24:
> @@ -1013,6 +1031,8 @@ pixel_write_t get_pixel_write_function(u32 format)
>   		return &argb_u16_to_BGR565;
>   	case DRM_FORMAT_RGB332:
>   		return &argb_u16_to_RGB332;
> +	case DRM_FORMAT_BGR233:
> +		return &argb_u16_to_BGR233;
>   	default:
>   		/*
>   		 * This is a bug in vkms_writeback_atomic_check. All the supported
> diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
> index fff2d4eb5..89beda57e 100644
> --- a/drivers/gpu/drm/vkms/vkms_plane.c
> +++ b/drivers/gpu/drm/vkms/vkms_plane.c
> @@ -30,6 +30,7 @@ static const u32 vkms_formats[] = {
>   	DRM_FORMAT_RGB565,
>   	DRM_FORMAT_BGR565,
>   	DRM_FORMAT_RGB332,
> +	DRM_FORMAT_BGR233,
>   	DRM_FORMAT_NV12,
>   	DRM_FORMAT_NV16,
>   	DRM_FORMAT_NV24,
> diff --git a/drivers/gpu/drm/vkms/vkms_writeback.c b/drivers/gpu/drm/vkms/vkms_writeback.c
> index 54330803e..37042445d 100644
> --- a/drivers/gpu/drm/vkms/vkms_writeback.c
> +++ b/drivers/gpu/drm/vkms/vkms_writeback.c
> @@ -23,7 +23,8 @@ static const u32 vkms_wb_formats[] = {
>   	DRM_FORMAT_ARGB16161616,
>   	DRM_FORMAT_RGB565,
>   	DRM_FORMAT_BGR565,
> -	DRM_FORMAT_RGB332
> +	DRM_FORMAT_RGB332,
> +	DRM_FORMAT_BGR233
>   };
>   
>   static const struct drm_connector_funcs vkms_wb_connector_funcs = {


  reply	other threads:[~2026-11-18 13:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-28  0:52 [PATCH 0/5] drm/vkms: support more formats and fix RGB565 regression Matheus Alves de Almeida
2026-09-28  0:52 ` [PATCH 1/5] drm/vkms: make argb_u16_to_RGB565 round resulting values Matheus Alves de Almeida
2026-11-08  3:12   ` Sidharth Saha
2026-11-18 13:27   ` Louis Chauvet
2026-09-28  0:52 ` [PATCH 2/5] drm/vkms: support BGR565 writeback Matheus Alves de Almeida
2026-11-18 13:29   ` Louis Chauvet
2026-09-28  0:52 ` [PATCH 3/5] drm/vkms: add a helper for channel to argb_u16 conversion Matheus Alves de Almeida
2026-11-18 13:25   ` Louis Chauvet
2026-09-28  0:53 ` [PATCH 4/5] drm/vkms: add support for RGB332 Matheus Alves de Almeida
2026-11-17 16:11   ` Louis Chauvet
2026-09-28  0:53 ` [PATCH 5/5] drm/vkms: add support for BGR233 Matheus Alves de Almeida
2026-11-18 13:30   ` Louis Chauvet [this message]
2026-10-12 19:18 ` [PATCH 0/5] drm/vkms: support more formats and fix RGB565 regression Matheus Alves de Almeida
2026-11-08  3:08 ` Sidharth Saha
2026-11-13  0:18 ` Sidharth Saha
2026-11-13  1:51   ` Matheus Alves de Almeida
2026-11-14 18:51   ` Sidharth Saha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59f417a8-be50-4378-9ded-1adc1148cc6f@bootlin.com \
    --to=louis.chauvet@bootlin.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=matheus.aalmeida@inf.ufrgs.br \
    --cc=melissa.srw@gmail.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®