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 2/5] drm/vkms: support BGR565 writeback
Date: Wed, 18 Nov 2026 14:29:29 +0100	[thread overview]
Message-ID: <6de5fa9a-f8d7-4f5d-a822-b8577831a6ea@bootlin.com> (raw)
In-Reply-To: <20260928005301.367977-3-matheus.aalmeida@inf.ufrgs.br>



On 9/28/26 02:52, Matheus Alves de Almeida wrote:
> While BGR565 read is currently supported, the format code is missing
> support for BGR565 write.
> 
> Implement argb_u16_to_BGR565(), add it to get_pixel_write_function()
> and advertise BGR565 support in vkms_wb_formats.
> 
> 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   | 12 ++++++++++++
>   drivers/gpu/drm/vkms/vkms_writeback.c |  3 ++-
>   2 files changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c
> index 6d7853e87..b44900761 100644
> --- a/drivers/gpu/drm/vkms/vkms_formats.c
> +++ b/drivers/gpu/drm/vkms/vkms_formats.c
> @@ -672,6 +672,16 @@ static void argb_u16_to_RGB565(u8 *out_pixel, const struct pixel_argb_u16 *in_pi
>   	*pixel = cpu_to_le16(r << 11 | g << 5 | b);
>   }
>   
> +static void argb_u16_to_BGR565(u8 *out_pixel, const struct pixel_argb_u16 *in_pixel)
> +{
> +	__le16 *pixel = (__le16 *)out_pixel;
> +	u16 r, g, b;
> +
> +	argb_u16_to_channels(&r, &g, &b, NULL, 5, 6, 5, 0, in_pixel);
> +
> +	*pixel = cpu_to_le16(b << 11 | g << 5 | 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.
> @@ -972,6 +982,8 @@ pixel_write_t get_pixel_write_function(u32 format)
>   		return &argb_u16_to_XRGB16161616;
>   	case DRM_FORMAT_RGB565:
>   		return &argb_u16_to_RGB565;
> +	case DRM_FORMAT_BGR565:
> +		return &argb_u16_to_BGR565;
>   	default:
>   		/*
>   		 * This is a bug in vkms_writeback_atomic_check. All the supported
> diff --git a/drivers/gpu/drm/vkms/vkms_writeback.c b/drivers/gpu/drm/vkms/vkms_writeback.c
> index ecf29a2c0..f64b90908 100644
> --- a/drivers/gpu/drm/vkms/vkms_writeback.c
> +++ b/drivers/gpu/drm/vkms/vkms_writeback.c
> @@ -21,7 +21,8 @@ static const u32 vkms_wb_formats[] = {
>   	DRM_FORMAT_ABGR8888,
>   	DRM_FORMAT_XRGB16161616,
>   	DRM_FORMAT_ARGB16161616,
> -	DRM_FORMAT_RGB565
> +	DRM_FORMAT_RGB565,
> +	DRM_FORMAT_BGR565
>   };
>   
>   static const struct drm_connector_funcs vkms_wb_connector_funcs = {


  reply	other threads:[~2026-11-18 13:29 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 [this message]
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
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=6de5fa9a-f8d7-4f5d-a822-b8577831a6ea@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®