* [PATCH] drm/vkms: Add support for ABGR8888 pixel format
@ 2024-10-07 14:27 Paz Zcharya
2024-10-07 16:51 ` Louis Chauvet
0 siblings, 1 reply; 8+ messages in thread
From: Paz Zcharya @ 2024-10-07 14:27 UTC (permalink / raw)
To: LKML
Cc: Paz Zcharya, Paz Zcharya, David Airlie, Haneen Mohammed,
Maarten Lankhorst, Maxime Ripard, Maíra Canal, Melissa Wen,
Rodrigo Siqueira, Simona Vetter, Thomas Zimmermann, dri-devel
Add support for pixel format ABGR8888, which is the default format
on Android devices. This will allow us to use VKMS as the default
display driver in Android Emulator (Cuttlefish) and increase VKMS
adoption.
Signed-off-by: Paz Zcharya <pazz@chromium.org>
---
drivers/gpu/drm/vkms/vkms_formats.c | 20 ++++++++++++++++++++
drivers/gpu/drm/vkms/vkms_plane.c | 1 +
drivers/gpu/drm/vkms/vkms_writeback.c | 1 +
3 files changed, 22 insertions(+)
diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c
index 040b7f113a3b..9e9d7290388e 100644
--- a/drivers/gpu/drm/vkms/vkms_formats.c
+++ b/drivers/gpu/drm/vkms/vkms_formats.c
@@ -73,6 +73,14 @@ static void XRGB8888_to_argb_u16(u8 *src_pixels, struct pixel_argb_u16 *out_pixe
out_pixel->b = (u16)src_pixels[0] * 257;
}
+static void ABGR8888_to_argb_u16(u8 *src_pixels, struct pixel_argb_u16 *out_pixel)
+{
+ out_pixel->a = (u16)src_pixels[3] * 257;
+ out_pixel->b = (u16)src_pixels[2] * 257;
+ out_pixel->g = (u16)src_pixels[1] * 257;
+ out_pixel->r = (u16)src_pixels[0] * 257;
+}
+
static void ARGB16161616_to_argb_u16(u8 *src_pixels, struct pixel_argb_u16 *out_pixel)
{
__le16 *pixels = (__force __le16 *)src_pixels;
@@ -176,6 +184,14 @@ static void argb_u16_to_XRGB8888(u8 *dst_pixels, struct pixel_argb_u16 *in_pixel
dst_pixels[0] = DIV_ROUND_CLOSEST(in_pixel->b, 257);
}
+static void argb_u16_to_ABGR8888(u8 *dst_pixels, struct pixel_argb_u16 *in_pixel)
+{
+ dst_pixels[3] = DIV_ROUND_CLOSEST(in_pixel->a, 257);
+ dst_pixels[2] = DIV_ROUND_CLOSEST(in_pixel->b, 257);
+ dst_pixels[1] = DIV_ROUND_CLOSEST(in_pixel->g, 257);
+ dst_pixels[0] = DIV_ROUND_CLOSEST(in_pixel->r, 257);
+}
+
static void argb_u16_to_ARGB16161616(u8 *dst_pixels, struct pixel_argb_u16 *in_pixel)
{
__le16 *pixels = (__force __le16 *)dst_pixels;
@@ -234,6 +250,8 @@ void *get_pixel_conversion_function(u32 format)
return &ARGB8888_to_argb_u16;
case DRM_FORMAT_XRGB8888:
return &XRGB8888_to_argb_u16;
+ case DRM_FORMAT_ABGR8888:
+ return &ABGR8888_to_argb_u16;
case DRM_FORMAT_ARGB16161616:
return &ARGB16161616_to_argb_u16;
case DRM_FORMAT_XRGB16161616:
@@ -252,6 +270,8 @@ void *get_pixel_write_function(u32 format)
return &argb_u16_to_ARGB8888;
case DRM_FORMAT_XRGB8888:
return &argb_u16_to_XRGB8888;
+ case DRM_FORMAT_ABGR8888:
+ return &argb_u16_to_ABGR8888;
case DRM_FORMAT_ARGB16161616:
return &argb_u16_to_ARGB16161616;
case DRM_FORMAT_XRGB16161616:
diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
index e5c625ab8e3e..8efd585fc34c 100644
--- a/drivers/gpu/drm/vkms/vkms_plane.c
+++ b/drivers/gpu/drm/vkms/vkms_plane.c
@@ -15,6 +15,7 @@
static const u32 vkms_formats[] = {
DRM_FORMAT_ARGB8888,
DRM_FORMAT_XRGB8888,
+ DRM_FORMAT_ABGR8888,
DRM_FORMAT_XRGB16161616,
DRM_FORMAT_ARGB16161616,
DRM_FORMAT_RGB565
diff --git a/drivers/gpu/drm/vkms/vkms_writeback.c b/drivers/gpu/drm/vkms/vkms_writeback.c
index bc724cbd5e3a..04cb9c58e7ad 100644
--- a/drivers/gpu/drm/vkms/vkms_writeback.c
+++ b/drivers/gpu/drm/vkms/vkms_writeback.c
@@ -17,6 +17,7 @@
static const u32 vkms_wb_formats[] = {
DRM_FORMAT_ARGB8888,
DRM_FORMAT_XRGB8888,
+ DRM_FORMAT_ABGR8888,
DRM_FORMAT_XRGB16161616,
DRM_FORMAT_ARGB16161616,
DRM_FORMAT_RGB565
--
2.47.0.rc0.187.ge670bccf7e-goog
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/vkms: Add support for ABGR8888 pixel format
2024-10-07 14:27 Paz Zcharya
@ 2024-10-07 16:51 ` Louis Chauvet
2024-10-09 8:33 ` Paz Zcharya
0 siblings, 1 reply; 8+ messages in thread
From: Louis Chauvet @ 2024-10-07 16:51 UTC (permalink / raw)
To: Paz Zcharya
Cc: LKML, Paz Zcharya, David Airlie, Haneen Mohammed,
Maarten Lankhorst, Maxime Ripard, Maaara Canal, Melissa Wen,
Rodrigo Siqueira, Simona Vetter, Thomas Zimmermann, dri-devel
On 07/10/24 - 14:27, Paz Zcharya wrote:
> Add support for pixel format ABGR8888, which is the default format
> on Android devices. This will allow us to use VKMS as the default
> display driver in Android Emulator (Cuttlefish) and increase VKMS
> adoption.
Hi Paz,
Thank you for your contribution!
I am very happy to see new users for VKMS, and I will be glad to add new
formats to VKMS!
However, as you can see [1], there is a significant rework of the VKMS
formats and composition that should be merged soon.
This series introduces two key improvements: performance enhancements and
YUV support. These changes involve substantial modifications to the
vkms_format.c file, which may conflict with your work.
Additionally, I wrote a few patches [2] and [3] a few months ago to
practice with VKMS, and they did not receive any comments, so I believe I
will be able to merge them quickly after [1].
In [2], I added many new formats: ABGR, BGRA, RGBA, XBGR, RGBX, BGRX,
BGR565, P010, P012, P016.
Would you mind testing this version to see if it meets your needs?
In [3], I did similar work for writeback, but it is not as complete, so I
need to add a patch, almost identical to your code:
static void argb_u16_to_ABGR8888(u8 *out_pixel, const struct pixel_argb_u16 *in_pixel)
[...]
Added: WRITE_LINE(XBGR8888_write_line, argb_u16_to_XBGR8888)
I need to send a v2 of [3] anyway because of conflicts, do you mind if I
take your argb_u16_to_ABGR8888 to integrate it (with your signed-off-by
obviously)?
In any case, if you have time to test, or even better review [1], [2] or
[3], it could be amazing!
Thank you,
Louis Chauvet
[1]:https://lore.kernel.org/all/20241007-yuv-v12-0-01c1ada6fec8@bootlin.com/
[2]:https://lore.kernel.org/all/20241007-b4-new-color-formats-v2-0-d47da50d4674@bootlin.com/
[3]:https://lore.kernel.org/all/20240814-writeback_line_by_line-v2-0-36541c717569@bootlin.com/
> Signed-off-by: Paz Zcharya <pazz@chromium.org>
> ---
>
> drivers/gpu/drm/vkms/vkms_formats.c | 20 ++++++++++++++++++++
> drivers/gpu/drm/vkms/vkms_plane.c | 1 +
> drivers/gpu/drm/vkms/vkms_writeback.c | 1 +
> 3 files changed, 22 insertions(+)
>
> diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c
> index 040b7f113a3b..9e9d7290388e 100644
> --- a/drivers/gpu/drm/vkms/vkms_formats.c
> +++ b/drivers/gpu/drm/vkms/vkms_formats.c
> @@ -73,6 +73,14 @@ static void XRGB8888_to_argb_u16(u8 *src_pixels, struct pixel_argb_u16 *out_pixe
> out_pixel->b = (u16)src_pixels[0] * 257;
> }
>
> +static void ABGR8888_to_argb_u16(u8 *src_pixels, struct pixel_argb_u16 *out_pixel)
> +{
> + out_pixel->a = (u16)src_pixels[3] * 257;
> + out_pixel->b = (u16)src_pixels[2] * 257;
> + out_pixel->g = (u16)src_pixels[1] * 257;
> + out_pixel->r = (u16)src_pixels[0] * 257;
> +}
> +
> static void ARGB16161616_to_argb_u16(u8 *src_pixels, struct pixel_argb_u16 *out_pixel)
> {
> __le16 *pixels = (__force __le16 *)src_pixels;
> @@ -176,6 +184,14 @@ static void argb_u16_to_XRGB8888(u8 *dst_pixels, struct pixel_argb_u16 *in_pixel
> dst_pixels[0] = DIV_ROUND_CLOSEST(in_pixel->b, 257);
> }
>
> +static void argb_u16_to_ABGR8888(u8 *dst_pixels, struct pixel_argb_u16 *in_pixel)
> +{
> + dst_pixels[3] = DIV_ROUND_CLOSEST(in_pixel->a, 257);
> + dst_pixels[2] = DIV_ROUND_CLOSEST(in_pixel->b, 257);
> + dst_pixels[1] = DIV_ROUND_CLOSEST(in_pixel->g, 257);
> + dst_pixels[0] = DIV_ROUND_CLOSEST(in_pixel->r, 257);
> +}
> +
> static void argb_u16_to_ARGB16161616(u8 *dst_pixels, struct pixel_argb_u16 *in_pixel)
> {
> __le16 *pixels = (__force __le16 *)dst_pixels;
> @@ -234,6 +250,8 @@ void *get_pixel_conversion_function(u32 format)
> return &ARGB8888_to_argb_u16;
> case DRM_FORMAT_XRGB8888:
> return &XRGB8888_to_argb_u16;
> + case DRM_FORMAT_ABGR8888:
> + return &ABGR8888_to_argb_u16;
> case DRM_FORMAT_ARGB16161616:
> return &ARGB16161616_to_argb_u16;
> case DRM_FORMAT_XRGB16161616:
> @@ -252,6 +270,8 @@ void *get_pixel_write_function(u32 format)
> return &argb_u16_to_ARGB8888;
> case DRM_FORMAT_XRGB8888:
> return &argb_u16_to_XRGB8888;
> + case DRM_FORMAT_ABGR8888:
> + return &argb_u16_to_ABGR8888;
> case DRM_FORMAT_ARGB16161616:
> return &argb_u16_to_ARGB16161616;
> case DRM_FORMAT_XRGB16161616:
> diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
> index e5c625ab8e3e..8efd585fc34c 100644
> --- a/drivers/gpu/drm/vkms/vkms_plane.c
> +++ b/drivers/gpu/drm/vkms/vkms_plane.c
> @@ -15,6 +15,7 @@
> static const u32 vkms_formats[] = {
> DRM_FORMAT_ARGB8888,
> DRM_FORMAT_XRGB8888,
> + DRM_FORMAT_ABGR8888,
> DRM_FORMAT_XRGB16161616,
> DRM_FORMAT_ARGB16161616,
> DRM_FORMAT_RGB565
> diff --git a/drivers/gpu/drm/vkms/vkms_writeback.c b/drivers/gpu/drm/vkms/vkms_writeback.c
> index bc724cbd5e3a..04cb9c58e7ad 100644
> --- a/drivers/gpu/drm/vkms/vkms_writeback.c
> +++ b/drivers/gpu/drm/vkms/vkms_writeback.c
> @@ -17,6 +17,7 @@
> static const u32 vkms_wb_formats[] = {
> DRM_FORMAT_ARGB8888,
> DRM_FORMAT_XRGB8888,
> + DRM_FORMAT_ABGR8888,
> DRM_FORMAT_XRGB16161616,
> DRM_FORMAT_ARGB16161616,
> DRM_FORMAT_RGB565
> --
> 2.47.0.rc0.187.ge670bccf7e-goog
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/vkms: Add support for ABGR8888 pixel format
2024-10-07 16:51 ` Louis Chauvet
@ 2024-10-09 8:33 ` Paz Zcharya
0 siblings, 0 replies; 8+ messages in thread
From: Paz Zcharya @ 2024-10-09 8:33 UTC (permalink / raw)
To: Louis Chauvet
Cc: LKML, David Airlie, Haneen Mohammed, Maarten Lankhorst,
Maxime Ripard, Maaara Canal, Melissa Wen, Rodrigo Siqueira,
Simona Vetter, Thomas Zimmermann, dri-devel
On Mon, Oct 07, 2024 at 06:51:16PM +0200, Louis Chauvet wrote:
> On 07/10/24 - 14:27, Paz Zcharya wrote:
> > Add support for pixel format ABGR8888, which is the default format
> > on Android devices. This will allow us to use VKMS as the default
> > display driver in Android Emulator (Cuttlefish) and increase VKMS
> > adoption.
>
> Hi Paz,
>
> Thank you for your contribution!
>
> I am very happy to see new users for VKMS, and I will be glad to add new
> formats to VKMS!
>
> However, as you can see [1], there is a significant rework of the VKMS
> formats and composition that should be merged soon.
>
Thank you for highlighting this. Great work!
> This series introduces two key improvements: performance enhancements and
> YUV support. These changes involve substantial modifications to the
> vkms_format.c file, which may conflict with your work.
>
> Additionally, I wrote a few patches [2] and [3] a few months ago to
> practice with VKMS, and they did not receive any comments, so I believe I
> will be able to merge them quickly after [1].
>
> In [2], I added many new formats: ABGR, BGRA, RGBA, XBGR, RGBX, BGRX,
> BGR565, P010, P012, P016.
> Would you mind testing this version to see if it meets your needs?
>
Yep, this is perfect!
> In [3], I did similar work for writeback, but it is not as complete, so I
> need to add a patch, almost identical to your code:
>
> static void argb_u16_to_ABGR8888(u8 *out_pixel, const struct pixel_argb_u16 *in_pixel)
> [...]
>
> Added: WRITE_LINE(XBGR8888_write_line, argb_u16_to_XBGR8888)
>
> I need to send a v2 of [3] anyway because of conflicts, do you mind if I
> take your argb_u16_to_ABGR8888 to integrate it (with your signed-off-by
> obviously)?
>
Yeah, that would be very helpful. Thank you so much!
> In any case, if you have time to test, or even better review [1], [2] or
> [3], it could be amazing!
>
Patches look great. I tested them locally after adding ABGR8888
support, and things seem to be working.
Let me know if I can assist you with anything else.
Thanks,
Paz Zcharya
> Thank you,
> Louis Chauvet
>
> [1]:https://lore.kernel.org/all/20241007-yuv-v12-0-01c1ada6fec8@bootlin.com/
> [2]:https://lore.kernel.org/all/20241007-b4-new-color-formats-v2-0-d47da50d4674@bootlin.com/
> [3]:https://lore.kernel.org/all/20240814-writeback_line_by_line-v2-0-36541c717569@bootlin.com/
>
> > Signed-off-by: Paz Zcharya <pazz@chromium.org>
> > ---
> >
> > drivers/gpu/drm/vkms/vkms_formats.c | 20 ++++++++++++++++++++
> > drivers/gpu/drm/vkms/vkms_plane.c | 1 +
> > drivers/gpu/drm/vkms/vkms_writeback.c | 1 +
> > 3 files changed, 22 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c
> > index 040b7f113a3b..9e9d7290388e 100644
> > --- a/drivers/gpu/drm/vkms/vkms_formats.c
> > +++ b/drivers/gpu/drm/vkms/vkms_formats.c
> > @@ -73,6 +73,14 @@ static void XRGB8888_to_argb_u16(u8 *src_pixels, struct pixel_argb_u16 *out_pixe
> > out_pixel->b = (u16)src_pixels[0] * 257;
> > }
> >
> > +static void ABGR8888_to_argb_u16(u8 *src_pixels, struct pixel_argb_u16 *out_pixel)
> > +{
> > + out_pixel->a = (u16)src_pixels[3] * 257;
> > + out_pixel->b = (u16)src_pixels[2] * 257;
> > + out_pixel->g = (u16)src_pixels[1] * 257;
> > + out_pixel->r = (u16)src_pixels[0] * 257;
> > +}
> > +
> > static void ARGB16161616_to_argb_u16(u8 *src_pixels, struct pixel_argb_u16 *out_pixel)
> > {
> > __le16 *pixels = (__force __le16 *)src_pixels;
> > @@ -176,6 +184,14 @@ static void argb_u16_to_XRGB8888(u8 *dst_pixels, struct pixel_argb_u16 *in_pixel
> > dst_pixels[0] = DIV_ROUND_CLOSEST(in_pixel->b, 257);
> > }
> >
> > +static void argb_u16_to_ABGR8888(u8 *dst_pixels, struct pixel_argb_u16 *in_pixel)
> > +{
> > + dst_pixels[3] = DIV_ROUND_CLOSEST(in_pixel->a, 257);
> > + dst_pixels[2] = DIV_ROUND_CLOSEST(in_pixel->b, 257);
> > + dst_pixels[1] = DIV_ROUND_CLOSEST(in_pixel->g, 257);
> > + dst_pixels[0] = DIV_ROUND_CLOSEST(in_pixel->r, 257);
> > +}
> > +
> > static void argb_u16_to_ARGB16161616(u8 *dst_pixels, struct pixel_argb_u16 *in_pixel)
> > {
> > __le16 *pixels = (__force __le16 *)dst_pixels;
> > @@ -234,6 +250,8 @@ void *get_pixel_conversion_function(u32 format)
> > return &ARGB8888_to_argb_u16;
> > case DRM_FORMAT_XRGB8888:
> > return &XRGB8888_to_argb_u16;
> > + case DRM_FORMAT_ABGR8888:
> > + return &ABGR8888_to_argb_u16;
> > case DRM_FORMAT_ARGB16161616:
> > return &ARGB16161616_to_argb_u16;
> > case DRM_FORMAT_XRGB16161616:
> > @@ -252,6 +270,8 @@ void *get_pixel_write_function(u32 format)
> > return &argb_u16_to_ARGB8888;
> > case DRM_FORMAT_XRGB8888:
> > return &argb_u16_to_XRGB8888;
> > + case DRM_FORMAT_ABGR8888:
> > + return &argb_u16_to_ABGR8888;
> > case DRM_FORMAT_ARGB16161616:
> > return &argb_u16_to_ARGB16161616;
> > case DRM_FORMAT_XRGB16161616:
> > diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
> > index e5c625ab8e3e..8efd585fc34c 100644
> > --- a/drivers/gpu/drm/vkms/vkms_plane.c
> > +++ b/drivers/gpu/drm/vkms/vkms_plane.c
> > @@ -15,6 +15,7 @@
> > static const u32 vkms_formats[] = {
> > DRM_FORMAT_ARGB8888,
> > DRM_FORMAT_XRGB8888,
> > + DRM_FORMAT_ABGR8888,
> > DRM_FORMAT_XRGB16161616,
> > DRM_FORMAT_ARGB16161616,
> > DRM_FORMAT_RGB565
> > diff --git a/drivers/gpu/drm/vkms/vkms_writeback.c b/drivers/gpu/drm/vkms/vkms_writeback.c
> > index bc724cbd5e3a..04cb9c58e7ad 100644
> > --- a/drivers/gpu/drm/vkms/vkms_writeback.c
> > +++ b/drivers/gpu/drm/vkms/vkms_writeback.c
> > @@ -17,6 +17,7 @@
> > static const u32 vkms_wb_formats[] = {
> > DRM_FORMAT_ARGB8888,
> > DRM_FORMAT_XRGB8888,
> > + DRM_FORMAT_ABGR8888,
> > DRM_FORMAT_XRGB16161616,
> > DRM_FORMAT_ARGB16161616,
> > DRM_FORMAT_RGB565
> > --
> > 2.47.0.rc0.187.ge670bccf7e-goog
> >
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] drm/vkms: Add support for ABGR8888 pixel format
@ 2025-01-27 23:59 Paz Zcharya
2025-01-28 10:04 ` Louis Chauvet
0 siblings, 1 reply; 8+ messages in thread
From: Paz Zcharya @ 2025-01-27 23:59 UTC (permalink / raw)
To: Louis Chauvet
Cc: Sean Paul, Drew Davenport, dri-devel, linux-kernel, Paz Zcharya,
David Airlie, Haneen Mohammed, Maarten Lankhorst, Maxime Ripard,
Melissa Wen, Simona Vetter, Thomas Zimmermann
Add support for pixel format ABGR8888, which is the default format
on Android devices. This will allow us to use VKMS as the default
display driver in Android Emulator (Cuttlefish) and increase VKMS
adoption.
Changes in v2:
- Rebased on top of tip of tree because it has been 3 months.
- No functional changes.
Signed-off-by: Paz Zcharya <pazz@google.com>
---
drivers/gpu/drm/vkms/vkms_formats.c | 32 +++++++++++++++++++++++++++
drivers/gpu/drm/vkms/vkms_plane.c | 1 +
drivers/gpu/drm/vkms/vkms_writeback.c | 1 +
3 files changed, 34 insertions(+)
diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c
index 39b1d7c97d45..30a64ecca87c 100644
--- a/drivers/gpu/drm/vkms/vkms_formats.c
+++ b/drivers/gpu/drm/vkms/vkms_formats.c
@@ -253,6 +253,26 @@ static void XRGB8888_read_line(const struct vkms_plane_state *plane, int x_start
}
}
+static void ABGR8888_read_line(const struct vkms_plane_state *plane, int x_start, int y_start,
+ enum pixel_read_direction direction, int count,
+ struct pixel_argb_u16 out_pixel[])
+{
+ struct pixel_argb_u16 *end = out_pixel + count;
+ u8 *src_pixels;
+
+ packed_pixels_addr_1x1(plane->frame_info, x_start, y_start, 0, &src_pixels);
+
+ int step = get_block_step_bytes(plane->frame_info->fb, direction, 0);
+
+ while (out_pixel < end) {
+ u8 *px = (u8 *)src_pixels;
+ /* Switch blue and red pixels. */
+ *out_pixel = argb_u16_from_u8888(px[3], px[0], px[1], px[2]);
+ out_pixel += 1;
+ src_pixels += step;
+ }
+}
+
static void ARGB16161616_read_line(const struct vkms_plane_state *plane, int x_start,
int y_start, enum pixel_read_direction direction, int count,
struct pixel_argb_u16 out_pixel[])
@@ -344,6 +364,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_ABGR8888(u8 *out_pixel, const struct pixel_argb_u16 *in_pixel)
+{
+ out_pixel[3] = DIV_ROUND_CLOSEST(in_pixel->a, 257);
+ 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_ARGB16161616(u8 *out_pixel, const struct pixel_argb_u16 *in_pixel)
{
__le16 *pixel = (__le16 *)out_pixel;
@@ -420,6 +448,8 @@ pixel_read_line_t get_pixel_read_line_function(u32 format)
return &ARGB8888_read_line;
case DRM_FORMAT_XRGB8888:
return &XRGB8888_read_line;
+ case DRM_FORMAT_ABGR8888:
+ return &ABGR8888_read_line;
case DRM_FORMAT_ARGB16161616:
return &ARGB16161616_read_line;
case DRM_FORMAT_XRGB16161616:
@@ -453,6 +483,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_ABGR8888:
+ return &argb_u16_to_ABGR8888;
case DRM_FORMAT_ARGB16161616:
return &argb_u16_to_ARGB16161616;
case DRM_FORMAT_XRGB16161616:
diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
index e2fce471870f..e34f8c7f83c3 100644
--- a/drivers/gpu/drm/vkms/vkms_plane.c
+++ b/drivers/gpu/drm/vkms/vkms_plane.c
@@ -15,6 +15,7 @@
static const u32 vkms_formats[] = {
DRM_FORMAT_ARGB8888,
DRM_FORMAT_XRGB8888,
+ DRM_FORMAT_ABGR8888,
DRM_FORMAT_XRGB16161616,
DRM_FORMAT_ARGB16161616,
DRM_FORMAT_RGB565
diff --git a/drivers/gpu/drm/vkms/vkms_writeback.c b/drivers/gpu/drm/vkms/vkms_writeback.c
index e9b5c74d7c58..fe163271d5b5 100644
--- a/drivers/gpu/drm/vkms/vkms_writeback.c
+++ b/drivers/gpu/drm/vkms/vkms_writeback.c
@@ -17,6 +17,7 @@
static const u32 vkms_wb_formats[] = {
DRM_FORMAT_ARGB8888,
DRM_FORMAT_XRGB8888,
+ DRM_FORMAT_ABGR8888,
DRM_FORMAT_XRGB16161616,
DRM_FORMAT_ARGB16161616,
DRM_FORMAT_RGB565
--
2.48.1.262.g85cc9f2d1e-goog
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/vkms: Add support for ABGR8888 pixel format
2025-01-27 23:59 [PATCH] drm/vkms: Add support for ABGR8888 pixel format Paz Zcharya
@ 2025-01-28 10:04 ` Louis Chauvet
2025-01-28 15:08 ` Paz Zcharya
0 siblings, 1 reply; 8+ messages in thread
From: Louis Chauvet @ 2025-01-28 10:04 UTC (permalink / raw)
To: Paz Zcharya
Cc: Sean Paul, Drew Davenport, dri-devel, linux-kernel, Paz Zcharya,
David Airlie, Haneen Mohammed, Maarten Lankhorst, Maxime Ripard,
Melissa Wen, Simona Vetter, Thomas Zimmermann
On 27/01/25 - 23:59, Paz Zcharya wrote:
> Add support for pixel format ABGR8888, which is the default format
> on Android devices. This will allow us to use VKMS as the default
> display driver in Android Emulator (Cuttlefish) and increase VKMS
> adoption.
>
> Changes in v2:
> - Rebased on top of tip of tree because it has been 3 months.
> - No functional changes.
>
> Signed-off-by: Paz Zcharya <pazz@google.com>
Hi Paz,
Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
When applying a patch I got a small warning about a missmatch between your
author email and the Signed-off-by:
-:106: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Paz Zcharya <pazz@chromium.org>' != 'Signed-off-by: Paz Zcharya <pazz@google.com>'
I can fix it for you by adding a Author: / changing the Sign-of-by before
applying on drm-misc-next.
What mail do you want to use? pazz@google.com or pazz@chromium.org?
Thanks!
Louis Chauvet
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/vkms: Add support for ABGR8888 pixel format
2025-01-28 10:04 ` Louis Chauvet
@ 2025-01-28 15:08 ` Paz Zcharya
2025-01-29 10:18 ` Louis Chauvet
0 siblings, 1 reply; 8+ messages in thread
From: Paz Zcharya @ 2025-01-28 15:08 UTC (permalink / raw)
To: Louis Chauvet
Cc: Sean Paul, Drew Davenport, dri-devel, linux-kernel, David Airlie,
Haneen Mohammed, Maarten Lankhorst, Maxime Ripard, Melissa Wen,
Simona Vetter, Thomas Zimmermann
On Tue, Jan 28, 2025 at 11:04:33AM +0100, Louis Chauvet wrote:
> On 27/01/25 - 23:59, Paz Zcharya wrote:
> > Add support for pixel format ABGR8888, which is the default format
> > on Android devices. This will allow us to use VKMS as the default
> > display driver in Android Emulator (Cuttlefish) and increase VKMS
> > adoption.
> >
> > Changes in v2:
> > - Rebased on top of tip of tree because it has been 3 months.
> > - No functional changes.
> >
> > Signed-off-by: Paz Zcharya <pazz@google.com>
>
> Hi Paz,
>
> Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
>
> When applying a patch I got a small warning about a missmatch between your
> author email and the Signed-off-by:
>
> -:106: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Paz Zcharya <pazz@chromium.org>' != 'Signed-off-by: Paz Zcharya <pazz@google.com>'
>
> I can fix it for you by adding a Author: / changing the Sign-of-by before
> applying on drm-misc-next.
>
> What mail do you want to use? pazz@google.com or pazz@chromium.org?
>
> Thanks!
> Louis Chauvet
Thank you for the quick review, Louis!
Let's use pazz@google.com.
I apologize about the mistake -- I'll make sure to fix that in the
future.
Greatly appericiate your help!
Thanks a lot,
Paz
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/vkms: Add support for ABGR8888 pixel format
2025-01-28 15:08 ` Paz Zcharya
@ 2025-01-29 10:18 ` Louis Chauvet
2025-01-29 14:27 ` Paz Zcharya
0 siblings, 1 reply; 8+ messages in thread
From: Louis Chauvet @ 2025-01-29 10:18 UTC (permalink / raw)
To: Paz Zcharya
Cc: Sean Paul, Drew Davenport, dri-devel, linux-kernel, David Airlie,
Haneen Mohammed, Maarten Lankhorst, Maxime Ripard, Melissa Wen,
Simona Vetter, Thomas Zimmermann
On 28/01/25 - 15:08, Paz Zcharya wrote:
> On Tue, Jan 28, 2025 at 11:04:33AM +0100, Louis Chauvet wrote:
> > On 27/01/25 - 23:59, Paz Zcharya wrote:
> > > Add support for pixel format ABGR8888, which is the default format
> > > on Android devices. This will allow us to use VKMS as the default
> > > display driver in Android Emulator (Cuttlefish) and increase VKMS
> > > adoption.
> > >
> > > Changes in v2:
> > > - Rebased on top of tip of tree because it has been 3 months.
> > > - No functional changes.
> > >
> > > Signed-off-by: Paz Zcharya <pazz@google.com>
> >
> > Hi Paz,
> >
> > Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
> >
> > When applying a patch I got a small warning about a missmatch between your
> > author email and the Signed-off-by:
> >
> > -:106: WARNING:FROM_SIGN_OFF_MISMATCH: From:/Signed-off-by: email address mismatch: 'From: Paz Zcharya <pazz@chromium.org>' != 'Signed-off-by: Paz Zcharya <pazz@google.com>'
> >
> > I can fix it for you by adding a Author: / changing the Sign-of-by before
> > applying on drm-misc-next.
> >
> > What mail do you want to use? pazz@google.com or pazz@chromium.org?
> >
> > Thanks!
> > Louis Chauvet
>
> Thank you for the quick review, Louis!
>
> Let's use pazz@google.com.
> I apologize about the mistake -- I'll make sure to fix that in the
> future.
And I just noticed that "changes in v2" is in the commit log. It should
not be there.
To add a changelog, you must put it after ---, so in your case your commit
should be something like:
drm/vkms: Add support for ABGR8888 pixel format
Add support for [...] adoption.
Signed-off-by: Paz Zcharya <pazz@google.com>
---
Changes in v2:
[...]
Can you send a "real" v2 with the correct commit message and the correct
author?
If you don't know it, you can use b4[1] to help you manage your series and
iterations.
[1]:https://b4.docs.kernel.org/en/latest/
> Greatly appericiate your help!
>
> Thanks a lot,
> Paz
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/vkms: Add support for ABGR8888 pixel format
2025-01-29 10:18 ` Louis Chauvet
@ 2025-01-29 14:27 ` Paz Zcharya
0 siblings, 0 replies; 8+ messages in thread
From: Paz Zcharya @ 2025-01-29 14:27 UTC (permalink / raw)
To: Louis Chauvet
Cc: Sean Paul, Drew Davenport, dri-devel, linux-kernel, David Airlie,
Haneen Mohammed, Maarten Lankhorst, Maxime Ripard, Melissa Wen,
Simona Vetter, Thomas Zimmermann
On Wed, Jan 29, 2025 at 11:18:26AM +0100, Louis Chauvet wrote:
> And I just noticed that "changes in v2" is in the commit log. It should
> not be there.
>
> To add a changelog, you must put it after ---, so in your case your commit
> should be something like:
>
> drm/vkms: Add support for ABGR8888 pixel format
>
> Add support for [...] adoption.
>
> Signed-off-by: Paz Zcharya <pazz@google.com>
>
> ---
>
> Changes in v2:
> [...]
>
> Can you send a "real" v2 with the correct commit message and the correct
> author?
>
> If you don't know it, you can use b4[1] to help you manage your series and
> iterations.
>
> [1]:https://b4.docs.kernel.org/en/latest/
>
>
Just resent it.
My email server is using pazz@chromium.org, so I went with that.
I really hope I got it done right this time.
I apologize for any additional work or inconvenience I may have caused.
I greatly appreciate your help,
Paz Zcharya
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-01-29 14:27 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-27 23:59 [PATCH] drm/vkms: Add support for ABGR8888 pixel format Paz Zcharya
2025-01-28 10:04 ` Louis Chauvet
2025-01-28 15:08 ` Paz Zcharya
2025-01-29 10:18 ` Louis Chauvet
2025-01-29 14:27 ` Paz Zcharya
-- strict thread matches above, loose matches on Subject: below --
2024-10-07 14:27 Paz Zcharya
2024-10-07 16:51 ` Louis Chauvet
2024-10-09 8:33 ` Paz Zcharya
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox