linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/sun4i: Add missing pixel formats to the vi layer
@ 2019-09-18 11:05 roman.stratiienko
  2019-09-19 18:53 ` Jernej Škrabec
  0 siblings, 1 reply; 6+ messages in thread
From: roman.stratiienko @ 2019-09-18 11:05 UTC (permalink / raw)
  To: linux-kernel, mripard, dri-devel; +Cc: Roman Stratiienko

From: Roman Stratiienko <roman.stratiienko@globallogic.com>

According to Allwinner DE2.0 Specification REV 1.0, vi layer supports the
following pixel formats:  ABGR_8888, ARGB_8888, BGRA_8888, RGBA_8888

Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
---
 drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
index bd0e6a52d1d8..07c27e6a4b77 100644
--- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
@@ -404,17 +404,21 @@ static const struct drm_plane_funcs sun8i_vi_layer_funcs = {
 static const u32 sun8i_vi_layer_formats[] = {
 	DRM_FORMAT_ABGR1555,
 	DRM_FORMAT_ABGR4444,
+	DRM_FORMAT_ABGR8888,
 	DRM_FORMAT_ARGB1555,
 	DRM_FORMAT_ARGB4444,
+	DRM_FORMAT_ARGB8888,
 	DRM_FORMAT_BGR565,
 	DRM_FORMAT_BGR888,
 	DRM_FORMAT_BGRA5551,
 	DRM_FORMAT_BGRA4444,
+	DRM_FORMAT_BGRA8888,
 	DRM_FORMAT_BGRX8888,
 	DRM_FORMAT_RGB565,
 	DRM_FORMAT_RGB888,
 	DRM_FORMAT_RGBA4444,
 	DRM_FORMAT_RGBA5551,
+	DRM_FORMAT_RGBA8888,
 	DRM_FORMAT_RGBX8888,
 	DRM_FORMAT_XBGR8888,
 	DRM_FORMAT_XRGB8888,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: drm/sun4i: Add missing pixel formats to the vi layer
  2019-09-18 11:05 [PATCH] drm/sun4i: Add missing pixel formats to the vi layer roman.stratiienko
@ 2019-09-19 18:53 ` Jernej Škrabec
  2019-09-20  6:20   ` Maxime Ripard
  2019-09-20 20:22   ` Roman Stratiienko
  0 siblings, 2 replies; 6+ messages in thread
From: Jernej Škrabec @ 2019-09-19 18:53 UTC (permalink / raw)
  To: roman.stratiienko; +Cc: linux-kernel, mripard, dri-devel

Hi!

Dne sreda, 18. september 2019 ob 13:05:41 CEST je 
roman.stratiienko@globallogic.com napisal(a):
> From: Roman Stratiienko <roman.stratiienko@globallogic.com>
> 
> According to Allwinner DE2.0 Specification REV 1.0, vi layer supports the
> following pixel formats:  ABGR_8888, ARGB_8888, BGRA_8888, RGBA_8888

It's true that DE2 VI layers support those formats, but it wouldn't change 
anything because alpha blending is not supported by those planes. These 
formats were deliberately left out because their counterparts without alpha 
exist, for example ABGR8888 <-> XBGR8888. It would also confuse user, which 
would expect that alpha blending works if format with alpha channel is 
selected.

Admittedly some formats with alpha are still reported as supported due to lack 
of their counterparts without alpha, but I'm fine with removing them for 
consistency.

Best regards,
Jernej

> 
> Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
> ---
>  drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
> b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index bd0e6a52d1d8..07c27e6a4b77
> 100644
> --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
> +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
> @@ -404,17 +404,21 @@ static const struct drm_plane_funcs
> sun8i_vi_layer_funcs = { static const u32 sun8i_vi_layer_formats[] = {
>  	DRM_FORMAT_ABGR1555,
>  	DRM_FORMAT_ABGR4444,
> +	DRM_FORMAT_ABGR8888,
>  	DRM_FORMAT_ARGB1555,
>  	DRM_FORMAT_ARGB4444,
> +	DRM_FORMAT_ARGB8888,
>  	DRM_FORMAT_BGR565,
>  	DRM_FORMAT_BGR888,
>  	DRM_FORMAT_BGRA5551,
>  	DRM_FORMAT_BGRA4444,
> +	DRM_FORMAT_BGRA8888,
>  	DRM_FORMAT_BGRX8888,
>  	DRM_FORMAT_RGB565,
>  	DRM_FORMAT_RGB888,
>  	DRM_FORMAT_RGBA4444,
>  	DRM_FORMAT_RGBA5551,
> +	DRM_FORMAT_RGBA8888,
>  	DRM_FORMAT_RGBX8888,
>  	DRM_FORMAT_XBGR8888,
>  	DRM_FORMAT_XRGB8888,





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: drm/sun4i: Add missing pixel formats to the vi layer
  2019-09-19 18:53 ` Jernej Škrabec
@ 2019-09-20  6:20   ` Maxime Ripard
  2019-09-20 10:14     ` Roman Stratiienko
  2019-09-20 20:22   ` Roman Stratiienko
  1 sibling, 1 reply; 6+ messages in thread
From: Maxime Ripard @ 2019-09-20  6:20 UTC (permalink / raw)
  To: Jernej Škrabec; +Cc: roman.stratiienko, linux-kernel, dri-devel

[-- Attachment #1: Type: text/plain, Size: 929 bytes --]

On Thu, Sep 19, 2019 at 08:53:10PM +0200, Jernej Škrabec wrote:
> Dne sreda, 18. september 2019 ob 13:05:41 CEST je
> roman.stratiienko@globallogic.com napisal(a):
> > From: Roman Stratiienko <roman.stratiienko@globallogic.com>
> >
> > According to Allwinner DE2.0 Specification REV 1.0, vi layer supports the
> > following pixel formats:  ABGR_8888, ARGB_8888, BGRA_8888, RGBA_8888
>
> It's true that DE2 VI layers support those formats, but it wouldn't change
> anything because alpha blending is not supported by those planes. These
> formats were deliberately left out because their counterparts without alpha
> exist, for example ABGR8888 <-> XBGR8888. It would also confuse user, which
> would expect that alpha blending works if format with alpha channel is
> selected.

I'm not too familiar with the DE2 code, but why is alpha not working
if the VI planes support formats with alpha?

Thanks!
Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: drm/sun4i: Add missing pixel formats to the vi layer
  2019-09-20  6:20   ` Maxime Ripard
@ 2019-09-20 10:14     ` Roman Stratiienko
  0 siblings, 0 replies; 6+ messages in thread
From: Roman Stratiienko @ 2019-09-20 10:14 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: Jernej Škrabec, linux-kernel, dri-devel

On Fri, Sep 20, 2019 at 9:20 AM Maxime Ripard <mripard@kernel.org> wrote:
>
> On Thu, Sep 19, 2019 at 08:53:10PM +0200, Jernej Škrabec wrote:
> > Dne sreda, 18. september 2019 ob 13:05:41 CEST je
> > roman.stratiienko@globallogic.com napisal(a):
> > > From: Roman Stratiienko <roman.stratiienko@globallogic.com>
> > >
> > > According to Allwinner DE2.0 Specification REV 1.0, vi layer supports the
> > > following pixel formats:  ABGR_8888, ARGB_8888, BGRA_8888, RGBA_8888
> >
> > It's true that DE2 VI layers support those formats, but it wouldn't change
> > anything because alpha blending is not supported by those planes. These
> > formats were deliberately left out because their counterparts without alpha
> > exist, for example ABGR8888 <-> XBGR8888. It would also confuse user, which
> > would expect that alpha blending works if format with alpha channel is
> > selected.
>
> I'm not too familiar with the DE2 code, but why is alpha not working
> if the VI planes support formats with alpha?

Good question. It mentioned in the datasheet
https://linux-sunxi.org/images/7/7b/Allwinner_DE2.0_Spec_V1.0.pdf
on page 95: "All ui layers' alpha is useless"
And my experiments proves it.

My assumption that vi uses post-processing that cuts out alpha values.

>
> Thanks!
> Maxime



-- 
Best regards,
Roman Stratiienko
Global Logic Inc.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: drm/sun4i: Add missing pixel formats to the vi layer
  2019-09-19 18:53 ` Jernej Škrabec
  2019-09-20  6:20   ` Maxime Ripard
@ 2019-09-20 20:22   ` Roman Stratiienko
  2019-09-20 20:31     ` Jernej Škrabec
  1 sibling, 1 reply; 6+ messages in thread
From: Roman Stratiienko @ 2019-09-20 20:22 UTC (permalink / raw)
  To: Jernej Škrabec; +Cc: linux-kernel, Maxime Ripard, dri-devel

On Thu, Sep 19, 2019 at 9:53 PM Jernej Škrabec <jernej.skrabec@siol.net> wrote:
>
> Hi!
>
> Dne sreda, 18. september 2019 ob 13:05:41 CEST je
> roman.stratiienko@globallogic.com napisal(a):
> > From: Roman Stratiienko <roman.stratiienko@globallogic.com>
> >
> > According to Allwinner DE2.0 Specification REV 1.0, vi layer supports the
> > following pixel formats:  ABGR_8888, ARGB_8888, BGRA_8888, RGBA_8888
>
> It's true that DE2 VI layers support those formats, but it wouldn't change
> anything because alpha blending is not supported by those planes. These
> formats were deliberately left out because their counterparts without alpha
> exist, for example ABGR8888 <-> XBGR8888. It would also confuse user, which
> would expect that alpha blending works if format with alpha channel is
> selected.
>
> Admittedly some formats with alpha are still reported as supported due to lack
> of their counterparts without alpha, but I'm fine with removing them for
> consistency.

Why not to replace 'A' with 'X' on all relevant formats and map them
to corresponding index marked with 'A' (that behaves as true 'X' for
vi)

>
> Best regards,
> Jernej
>
> >
> > Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
> > ---
> >  drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
> > b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index bd0e6a52d1d8..07c27e6a4b77
> > 100644
> > --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
> > +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
> > @@ -404,17 +404,21 @@ static const struct drm_plane_funcs
> > sun8i_vi_layer_funcs = { static const u32 sun8i_vi_layer_formats[] = {
> >       DRM_FORMAT_ABGR1555,
> >       DRM_FORMAT_ABGR4444,
> > +     DRM_FORMAT_ABGR8888,
> >       DRM_FORMAT_ARGB1555,
> >       DRM_FORMAT_ARGB4444,
> > +     DRM_FORMAT_ARGB8888,
> >       DRM_FORMAT_BGR565,
> >       DRM_FORMAT_BGR888,
> >       DRM_FORMAT_BGRA5551,
> >       DRM_FORMAT_BGRA4444,
> > +     DRM_FORMAT_BGRA8888,
> >       DRM_FORMAT_BGRX8888,
> >       DRM_FORMAT_RGB565,
> >       DRM_FORMAT_RGB888,
> >       DRM_FORMAT_RGBA4444,
> >       DRM_FORMAT_RGBA5551,
> > +     DRM_FORMAT_RGBA8888,
> >       DRM_FORMAT_RGBX8888,
> >       DRM_FORMAT_XBGR8888,
> >       DRM_FORMAT_XRGB8888,
>
>
>
>


-- 
Best regards,
Roman Stratiienko
Global Logic Inc.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: drm/sun4i: Add missing pixel formats to the vi layer
  2019-09-20 20:22   ` Roman Stratiienko
@ 2019-09-20 20:31     ` Jernej Škrabec
  0 siblings, 0 replies; 6+ messages in thread
From: Jernej Škrabec @ 2019-09-20 20:31 UTC (permalink / raw)
  To: Roman Stratiienko; +Cc: linux-kernel, Maxime Ripard, dri-devel

Dne petek, 20. september 2019 ob 22:22:44 CEST je Roman Stratiienko 
napisal(a):
> On Thu, Sep 19, 2019 at 9:53 PM Jernej Škrabec <jernej.skrabec@siol.net> 
wrote:
> > Hi!
> > 
> > Dne sreda, 18. september 2019 ob 13:05:41 CEST je
> > 
> > roman.stratiienko@globallogic.com napisal(a):
> > > From: Roman Stratiienko <roman.stratiienko@globallogic.com>
> > > 
> > > According to Allwinner DE2.0 Specification REV 1.0, vi layer supports
> > > the
> > > following pixel formats:  ABGR_8888, ARGB_8888, BGRA_8888, RGBA_8888
> > 
> > It's true that DE2 VI layers support those formats, but it wouldn't change
> > anything because alpha blending is not supported by those planes. These
> > formats were deliberately left out because their counterparts without
> > alpha
> > exist, for example ABGR8888 <-> XBGR8888. It would also confuse user,
> > which
> > would expect that alpha blending works if format with alpha channel is
> > selected.
> > 
> > Admittedly some formats with alpha are still reported as supported due to
> > lack of their counterparts without alpha, but I'm fine with removing them
> > for consistency.

I checked again and appropriate formats (with "X" instead of "A") already 
exist.

> 
> Why not to replace 'A' with 'X' on all relevant formats and map them
> to corresponding index marked with 'A' (that behaves as true 'X' for
> vi)

Yes, that's would be best.

Best regards,
Jernej

> 
> > Best regards,
> > Jernej
> > 
> > > Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
> > > ---
> > > 
> > >  drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
> > > b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c index
> > > bd0e6a52d1d8..07c27e6a4b77
> > > 100644
> > > --- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
> > > +++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
> > > @@ -404,17 +404,21 @@ static const struct drm_plane_funcs
> > > sun8i_vi_layer_funcs = { static const u32 sun8i_vi_layer_formats[] = {
> > > 
> > >       DRM_FORMAT_ABGR1555,
> > >       DRM_FORMAT_ABGR4444,
> > > 
> > > +     DRM_FORMAT_ABGR8888,
> > > 
> > >       DRM_FORMAT_ARGB1555,
> > >       DRM_FORMAT_ARGB4444,
> > > 
> > > +     DRM_FORMAT_ARGB8888,
> > > 
> > >       DRM_FORMAT_BGR565,
> > >       DRM_FORMAT_BGR888,
> > >       DRM_FORMAT_BGRA5551,
> > >       DRM_FORMAT_BGRA4444,
> > > 
> > > +     DRM_FORMAT_BGRA8888,
> > > 
> > >       DRM_FORMAT_BGRX8888,
> > >       DRM_FORMAT_RGB565,
> > >       DRM_FORMAT_RGB888,
> > >       DRM_FORMAT_RGBA4444,
> > >       DRM_FORMAT_RGBA5551,
> > > 
> > > +     DRM_FORMAT_RGBA8888,
> > > 
> > >       DRM_FORMAT_RGBX8888,
> > >       DRM_FORMAT_XBGR8888,
> > >       DRM_FORMAT_XRGB8888,





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-09-20 20:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-18 11:05 [PATCH] drm/sun4i: Add missing pixel formats to the vi layer roman.stratiienko
2019-09-19 18:53 ` Jernej Škrabec
2019-09-20  6:20   ` Maxime Ripard
2019-09-20 10:14     ` Roman Stratiienko
2019-09-20 20:22   ` Roman Stratiienko
2019-09-20 20:31     ` Jernej Škrabec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).