From: Oarora Etimis <oaroraetimis@gmail.com>
To: Karthik Sarvan <karthiks1mail@gmail.com>
Cc: dri-devel@lists.freedesktop.org, louis.chauvet@bootlin.com,
tzimmermann@suse.de, melissa.srw@gmail.com, simona@ffwll.ch
Subject: Re: [PATCH] drm/vkms: Add DRM_FORMAT_XBGR8888 support to writeback
Date: Tue, 24 Nov 2026 12:14:26 +0100 [thread overview]
Message-ID: <awVxc0cix2z3pC8z@Oarora> (raw)
In-Reply-To: <20261124054953.39432-1-karthiks1mail@gmail.com>
On Tue, Nov 24, 2026 at 11:19:53AM +0530, Karthik Sarvan wrote:
> VKMS planes already support reading DRM_FORMAT_XBGR8888, but writeback
> cannot write it yet. In the 8888 format family, writeback only supports
> ARGB8888, XRGB8888, and ABGR8888.
>
> Add a pixel write function for XBGR8888 and include it in the supported
> writeback formats list so compositors and tests can capture frames in
> this format.
>
> Signed-off-by: Karthik Sarvan <karthiks1mail@gmail.com>
> ---
> drivers/gpu/drm/vkms/vkms_formats.c | 10 ++++++++++
> drivers/gpu/drm/vkms/vkms_writeback.c | 1 +
> 2 files changed, 11 insertions(+)
>
> diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c
> index 7f1f29b589e8..a89aef97cede 100644
> --- a/drivers/gpu/drm/vkms/vkms_formats.c
> +++ b/drivers/gpu/drm/vkms/vkms_formats.c
> @@ -611,6 +611,14 @@ static void argb_u16_to_XRGB8888(u8 *out_pixel, const struct pixel_argb_u16 *in_
> out_pixel[0] = DIV_ROUND_CLOSEST(in_pixel->b, 257);
> }
>
> +static void argb_u16_to_XBGR8888(u8 *out_pixel, const struct pixel_argb_u16 *in_pixel)
> +{
> + out_pixel[3] = 0xff;
> + out_pixel[2] = DIV_ROUND_CLOSEST(in_pixel->b, 257);
> + out_pixel[1] = DIV_ROUND_CLOSEST(in_pixel->g, 257);
> + out_pixel[0] = DIV_ROUND_CLOSEST(in_pixel->r, 257);
> +}
> +
> static void argb_u16_to_ABGR8888(u8 *out_pixel, const struct pixel_argb_u16 *in_pixel)
> {
> out_pixel[3] = DIV_ROUND_CLOSEST(in_pixel->a, 257);
> @@ -977,6 +985,8 @@ pixel_write_t get_pixel_write_function(u32 format)
> return &argb_u16_to_ARGB8888;
> case DRM_FORMAT_XRGB8888:
> return &argb_u16_to_XRGB8888;
> + case DRM_FORMAT_XBGR8888:
> + return &argb_u16_to_XBGR8888;
> case DRM_FORMAT_ABGR8888:
> return &argb_u16_to_ABGR8888;
> case DRM_FORMAT_ARGB16161616:
> diff --git a/drivers/gpu/drm/vkms/vkms_writeback.c b/drivers/gpu/drm/vkms/vkms_writeback.c
> index 858df1f89f66..3407b5914694 100644
> --- a/drivers/gpu/drm/vkms/vkms_writeback.c
> +++ b/drivers/gpu/drm/vkms/vkms_writeback.c
> @@ -18,6 +18,7 @@
> static const u32 vkms_wb_formats[] = {
> DRM_FORMAT_ARGB8888,
> DRM_FORMAT_XRGB8888,
> + DRM_FORMAT_XBGR8888,
> DRM_FORMAT_ABGR8888,
> DRM_FORMAT_XRGB16161616,
> DRM_FORMAT_ARGB16161616,
> --
> 2.56.0
>
Reviewed-by: Oarora Etimis <oaroraetimis@gmail.com>
prev parent reply other threads:[~2026-11-24 11:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 5:49 [PATCH] drm/vkms: Add DRM_FORMAT_XBGR8888 support to writeback Karthik Sarvan
2026-11-24 11:14 ` Oarora Etimis [this message]
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=awVxc0cix2z3pC8z@Oarora \
--to=oaroraetimis@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=karthiks1mail@gmail.com \
--cc=louis.chauvet@bootlin.com \
--cc=melissa.srw@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.