All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support
@ 2023-07-28 20:07 ` Damian Hobson-Garcia
  0 siblings, 0 replies; 20+ messages in thread
From: Damian Hobson-Garcia @ 2023-07-28 20:07 UTC (permalink / raw)
  To: laurent.pinchart, kieran.bingham+renesas
  Cc: taki, dri-devel, linux-renesas-soc, Damian Hobson-Garcia

Add additional pixel formats for which blending is disabling when
DRM_MODE_BLEND_PIXEL_NONE is set.

Refactor the fourcc selection into a separate function to handle the
increased number of formats.

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
---
 drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
 1 file changed, 32 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
index 45c05d0ffc70..96241c03b60f 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
@@ -176,6 +176,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
 	DRM_FORMAT_Y212,
 };
 
+static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
+{
+	u32 fourcc = state->format->fourcc;
+
+	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
+		switch (fourcc) {
+		case DRM_FORMAT_ARGB1555:
+			fourcc = DRM_FORMAT_XRGB1555;
+			break;
+
+		case DRM_FORMAT_ARGB4444:
+			fourcc = DRM_FORMAT_XRGB4444;
+			break;
+
+		case DRM_FORMAT_ARGB8888:
+			fourcc = DRM_FORMAT_XRGB8888;
+			break;
+
+		case DRM_FORMAT_BGRA8888:
+			fourcc = DRM_FORMAT_BGRX8888;
+			break;
+
+		case DRM_FORMAT_RGBA1010102:
+			fourcc = DRM_FORMAT_RGBX1010102;
+			break;
+		}
+	}
+
+	return fourcc;
+}
+
 static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
 {
 	struct rcar_du_vsp_plane_state *state =
@@ -189,7 +220,7 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
 		.alpha = state->state.alpha >> 8,
 		.zpos = state->state.zpos,
 	};
-	u32 fourcc = state->format->fourcc;
+	u32 fourcc = rcar_du_vsp_state_get_format(state);
 	unsigned int i;
 
 	cfg.src.left = state->state.src.x1 >> 16;
@@ -206,22 +237,6 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
 		cfg.mem[i] = sg_dma_address(state->sg_tables[i].sgl)
 			   + fb->offsets[i];
 
-	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
-		switch (fourcc) {
-		case DRM_FORMAT_ARGB1555:
-			fourcc = DRM_FORMAT_XRGB1555;
-			break;
-
-		case DRM_FORMAT_ARGB4444:
-			fourcc = DRM_FORMAT_XRGB4444;
-			break;
-
-		case DRM_FORMAT_ARGB8888:
-			fourcc = DRM_FORMAT_XRGB8888;
-			break;
-		}
-	}
-
 	format = rcar_du_format_info(fourcc);
 	cfg.pixelformat = format->v4l2;
 
-- 
2.25.1


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

* [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support
@ 2023-07-28 20:07 ` Damian Hobson-Garcia
  0 siblings, 0 replies; 20+ messages in thread
From: Damian Hobson-Garcia @ 2023-07-28 20:07 UTC (permalink / raw)
  To: laurent.pinchart, kieran.bingham+renesas
  Cc: linux-renesas-soc, taki, Damian Hobson-Garcia, dri-devel

Add additional pixel formats for which blending is disabling when
DRM_MODE_BLEND_PIXEL_NONE is set.

Refactor the fourcc selection into a separate function to handle the
increased number of formats.

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
---
 drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
 1 file changed, 32 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
index 45c05d0ffc70..96241c03b60f 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
@@ -176,6 +176,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
 	DRM_FORMAT_Y212,
 };
 
+static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
+{
+	u32 fourcc = state->format->fourcc;
+
+	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
+		switch (fourcc) {
+		case DRM_FORMAT_ARGB1555:
+			fourcc = DRM_FORMAT_XRGB1555;
+			break;
+
+		case DRM_FORMAT_ARGB4444:
+			fourcc = DRM_FORMAT_XRGB4444;
+			break;
+
+		case DRM_FORMAT_ARGB8888:
+			fourcc = DRM_FORMAT_XRGB8888;
+			break;
+
+		case DRM_FORMAT_BGRA8888:
+			fourcc = DRM_FORMAT_BGRX8888;
+			break;
+
+		case DRM_FORMAT_RGBA1010102:
+			fourcc = DRM_FORMAT_RGBX1010102;
+			break;
+		}
+	}
+
+	return fourcc;
+}
+
 static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
 {
 	struct rcar_du_vsp_plane_state *state =
@@ -189,7 +220,7 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
 		.alpha = state->state.alpha >> 8,
 		.zpos = state->state.zpos,
 	};
-	u32 fourcc = state->format->fourcc;
+	u32 fourcc = rcar_du_vsp_state_get_format(state);
 	unsigned int i;
 
 	cfg.src.left = state->state.src.x1 >> 16;
@@ -206,22 +237,6 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
 		cfg.mem[i] = sg_dma_address(state->sg_tables[i].sgl)
 			   + fb->offsets[i];
 
-	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
-		switch (fourcc) {
-		case DRM_FORMAT_ARGB1555:
-			fourcc = DRM_FORMAT_XRGB1555;
-			break;
-
-		case DRM_FORMAT_ARGB4444:
-			fourcc = DRM_FORMAT_XRGB4444;
-			break;
-
-		case DRM_FORMAT_ARGB8888:
-			fourcc = DRM_FORMAT_XRGB8888;
-			break;
-		}
-	}
-
 	format = rcar_du_format_info(fourcc);
 	cfg.pixelformat = format->v4l2;
 
-- 
2.25.1


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

* [PATCH 2/2] drm:rcar-du: Enable ABGR and XBGR formats
  2023-07-28 20:07 ` Damian Hobson-Garcia
@ 2023-07-28 20:07   ` Damian Hobson-Garcia
  -1 siblings, 0 replies; 20+ messages in thread
From: Damian Hobson-Garcia @ 2023-07-28 20:07 UTC (permalink / raw)
  To: laurent.pinchart, kieran.bingham+renesas
  Cc: taki, dri-devel, linux-renesas-soc, Damian Hobson-Garcia

These formats are used by Android so having them available
allows the DU to be used for composition operations.

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
---
 drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
index 96241c03b60f..d61bb2e44c06 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
@@ -122,6 +122,8 @@ static const u32 rcar_du_vsp_formats[] = {
 	DRM_FORMAT_RGB888,
 	DRM_FORMAT_BGRA8888,
 	DRM_FORMAT_BGRX8888,
+	DRM_FORMAT_ABGR8888,
+	DRM_FORMAT_XBGR8888,
 	DRM_FORMAT_ARGB8888,
 	DRM_FORMAT_XRGB8888,
 	DRM_FORMAT_UYVY,
@@ -154,6 +156,8 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
 	DRM_FORMAT_RGB888,
 	DRM_FORMAT_BGRA8888,
 	DRM_FORMAT_BGRX8888,
+	DRM_FORMAT_ABGR8888,
+	DRM_FORMAT_XBGR8888,
 	DRM_FORMAT_ARGB8888,
 	DRM_FORMAT_XRGB8888,
 	DRM_FORMAT_RGBX1010102,
@@ -194,6 +198,10 @@ static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
 			fourcc = DRM_FORMAT_XRGB8888;
 			break;
 
+		case DRM_FORMAT_ABGR8888:
+			fourcc = DRM_FORMAT_XBGR8888;
+			break;
+
 		case DRM_FORMAT_BGRA8888:
 			fourcc = DRM_FORMAT_BGRX8888;
 			break;
-- 
2.25.1


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

* [PATCH 2/2] drm:rcar-du: Enable ABGR and XBGR formats
@ 2023-07-28 20:07   ` Damian Hobson-Garcia
  0 siblings, 0 replies; 20+ messages in thread
From: Damian Hobson-Garcia @ 2023-07-28 20:07 UTC (permalink / raw)
  To: laurent.pinchart, kieran.bingham+renesas
  Cc: linux-renesas-soc, taki, Damian Hobson-Garcia, dri-devel

These formats are used by Android so having them available
allows the DU to be used for composition operations.

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
---
 drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
index 96241c03b60f..d61bb2e44c06 100644
--- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
+++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
@@ -122,6 +122,8 @@ static const u32 rcar_du_vsp_formats[] = {
 	DRM_FORMAT_RGB888,
 	DRM_FORMAT_BGRA8888,
 	DRM_FORMAT_BGRX8888,
+	DRM_FORMAT_ABGR8888,
+	DRM_FORMAT_XBGR8888,
 	DRM_FORMAT_ARGB8888,
 	DRM_FORMAT_XRGB8888,
 	DRM_FORMAT_UYVY,
@@ -154,6 +156,8 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
 	DRM_FORMAT_RGB888,
 	DRM_FORMAT_BGRA8888,
 	DRM_FORMAT_BGRX8888,
+	DRM_FORMAT_ABGR8888,
+	DRM_FORMAT_XBGR8888,
 	DRM_FORMAT_ARGB8888,
 	DRM_FORMAT_XRGB8888,
 	DRM_FORMAT_RGBX1010102,
@@ -194,6 +198,10 @@ static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
 			fourcc = DRM_FORMAT_XRGB8888;
 			break;
 
+		case DRM_FORMAT_ABGR8888:
+			fourcc = DRM_FORMAT_XBGR8888;
+			break;
+
 		case DRM_FORMAT_BGRA8888:
 			fourcc = DRM_FORMAT_BGRX8888;
 			break;
-- 
2.25.1


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

* Re: [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support
  2023-07-28 20:07 ` Damian Hobson-Garcia
@ 2023-08-03 23:47   ` Laurent Pinchart
  -1 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2023-08-03 23:47 UTC (permalink / raw)
  To: Damian Hobson-Garcia
  Cc: kieran.bingham+renesas, taki, dri-devel, linux-renesas-soc

Hi Damian,

Thank you for the patch.

On Fri, Jul 28, 2023 at 04:07:13PM -0400, Damian Hobson-Garcia wrote:
> Add additional pixel formats for which blending is disabling when

Did you mean "disabled" instead of "disabling" ?

> DRM_MODE_BLEND_PIXEL_NONE is set.
> 
> Refactor the fourcc selection into a separate function to handle the
> increased number of formats.
> 
> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
> ---
>  drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
>  1 file changed, 32 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> index 45c05d0ffc70..96241c03b60f 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> @@ -176,6 +176,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
>  	DRM_FORMAT_Y212,
>  };
>  
> +static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
> +{
> +	u32 fourcc = state->format->fourcc;
> +
> +	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> +		switch (fourcc) {
> +		case DRM_FORMAT_ARGB1555:
> +			fourcc = DRM_FORMAT_XRGB1555;
> +			break;
> +
> +		case DRM_FORMAT_ARGB4444:
> +			fourcc = DRM_FORMAT_XRGB4444;
> +			break;
> +
> +		case DRM_FORMAT_ARGB8888:
> +			fourcc = DRM_FORMAT_XRGB8888;
> +			break;
> +
> +		case DRM_FORMAT_BGRA8888:
> +			fourcc = DRM_FORMAT_BGRX8888;
> +			break;
> +
> +		case DRM_FORMAT_RGBA1010102:
> +			fourcc = DRM_FORMAT_RGBX1010102;
> +			break;

Should DRM_FORMAT_ARGB2101010 be added as well, or did you leave it out
intentionally ?

> +		}
> +	}
> +
> +	return fourcc;
> +}
> +
>  static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
>  {
>  	struct rcar_du_vsp_plane_state *state =
> @@ -189,7 +220,7 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
>  		.alpha = state->state.alpha >> 8,
>  		.zpos = state->state.zpos,
>  	};
> -	u32 fourcc = state->format->fourcc;
> +	u32 fourcc = rcar_du_vsp_state_get_format(state);
>  	unsigned int i;
>  
>  	cfg.src.left = state->state.src.x1 >> 16;
> @@ -206,22 +237,6 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
>  		cfg.mem[i] = sg_dma_address(state->sg_tables[i].sgl)
>  			   + fb->offsets[i];
>  
> -	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> -		switch (fourcc) {
> -		case DRM_FORMAT_ARGB1555:
> -			fourcc = DRM_FORMAT_XRGB1555;
> -			break;
> -
> -		case DRM_FORMAT_ARGB4444:
> -			fourcc = DRM_FORMAT_XRGB4444;
> -			break;
> -
> -		case DRM_FORMAT_ARGB8888:
> -			fourcc = DRM_FORMAT_XRGB8888;
> -			break;
> -		}
> -	}
> -
>  	format = rcar_du_format_info(fourcc);
>  	cfg.pixelformat = format->v4l2;
>  

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support
@ 2023-08-03 23:47   ` Laurent Pinchart
  0 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2023-08-03 23:47 UTC (permalink / raw)
  To: Damian Hobson-Garcia
  Cc: linux-renesas-soc, kieran.bingham+renesas, taki, dri-devel

Hi Damian,

Thank you for the patch.

On Fri, Jul 28, 2023 at 04:07:13PM -0400, Damian Hobson-Garcia wrote:
> Add additional pixel formats for which blending is disabling when

Did you mean "disabled" instead of "disabling" ?

> DRM_MODE_BLEND_PIXEL_NONE is set.
> 
> Refactor the fourcc selection into a separate function to handle the
> increased number of formats.
> 
> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
> ---
>  drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
>  1 file changed, 32 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> index 45c05d0ffc70..96241c03b60f 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> @@ -176,6 +176,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
>  	DRM_FORMAT_Y212,
>  };
>  
> +static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
> +{
> +	u32 fourcc = state->format->fourcc;
> +
> +	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> +		switch (fourcc) {
> +		case DRM_FORMAT_ARGB1555:
> +			fourcc = DRM_FORMAT_XRGB1555;
> +			break;
> +
> +		case DRM_FORMAT_ARGB4444:
> +			fourcc = DRM_FORMAT_XRGB4444;
> +			break;
> +
> +		case DRM_FORMAT_ARGB8888:
> +			fourcc = DRM_FORMAT_XRGB8888;
> +			break;
> +
> +		case DRM_FORMAT_BGRA8888:
> +			fourcc = DRM_FORMAT_BGRX8888;
> +			break;
> +
> +		case DRM_FORMAT_RGBA1010102:
> +			fourcc = DRM_FORMAT_RGBX1010102;
> +			break;

Should DRM_FORMAT_ARGB2101010 be added as well, or did you leave it out
intentionally ?

> +		}
> +	}
> +
> +	return fourcc;
> +}
> +
>  static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
>  {
>  	struct rcar_du_vsp_plane_state *state =
> @@ -189,7 +220,7 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
>  		.alpha = state->state.alpha >> 8,
>  		.zpos = state->state.zpos,
>  	};
> -	u32 fourcc = state->format->fourcc;
> +	u32 fourcc = rcar_du_vsp_state_get_format(state);
>  	unsigned int i;
>  
>  	cfg.src.left = state->state.src.x1 >> 16;
> @@ -206,22 +237,6 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
>  		cfg.mem[i] = sg_dma_address(state->sg_tables[i].sgl)
>  			   + fb->offsets[i];
>  
> -	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> -		switch (fourcc) {
> -		case DRM_FORMAT_ARGB1555:
> -			fourcc = DRM_FORMAT_XRGB1555;
> -			break;
> -
> -		case DRM_FORMAT_ARGB4444:
> -			fourcc = DRM_FORMAT_XRGB4444;
> -			break;
> -
> -		case DRM_FORMAT_ARGB8888:
> -			fourcc = DRM_FORMAT_XRGB8888;
> -			break;
> -		}
> -	}
> -
>  	format = rcar_du_format_info(fourcc);
>  	cfg.pixelformat = format->v4l2;
>  

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 2/2] drm:rcar-du: Enable ABGR and XBGR formats
  2023-07-28 20:07   ` Damian Hobson-Garcia
@ 2023-08-03 23:49     ` Laurent Pinchart
  -1 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2023-08-03 23:49 UTC (permalink / raw)
  To: Damian Hobson-Garcia
  Cc: kieran.bingham+renesas, taki, dri-devel, linux-renesas-soc

Hi Damian,

Thank you for the patch.

On Fri, Jul 28, 2023 at 04:07:14PM -0400, Damian Hobson-Garcia wrote:
> These formats are used by Android so having them available
> allows the DU to be used for composition operations.
> 
> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>

This looks good to me. I'm not sure why I haven't included them
initially.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> index 96241c03b60f..d61bb2e44c06 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> @@ -122,6 +122,8 @@ static const u32 rcar_du_vsp_formats[] = {
>  	DRM_FORMAT_RGB888,
>  	DRM_FORMAT_BGRA8888,
>  	DRM_FORMAT_BGRX8888,
> +	DRM_FORMAT_ABGR8888,
> +	DRM_FORMAT_XBGR8888,
>  	DRM_FORMAT_ARGB8888,
>  	DRM_FORMAT_XRGB8888,
>  	DRM_FORMAT_UYVY,
> @@ -154,6 +156,8 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
>  	DRM_FORMAT_RGB888,
>  	DRM_FORMAT_BGRA8888,
>  	DRM_FORMAT_BGRX8888,
> +	DRM_FORMAT_ABGR8888,
> +	DRM_FORMAT_XBGR8888,
>  	DRM_FORMAT_ARGB8888,
>  	DRM_FORMAT_XRGB8888,
>  	DRM_FORMAT_RGBX1010102,
> @@ -194,6 +198,10 @@ static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
>  			fourcc = DRM_FORMAT_XRGB8888;
>  			break;
>  
> +		case DRM_FORMAT_ABGR8888:
> +			fourcc = DRM_FORMAT_XBGR8888;
> +			break;
> +
>  		case DRM_FORMAT_BGRA8888:
>  			fourcc = DRM_FORMAT_BGRX8888;
>  			break;

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 2/2] drm:rcar-du: Enable ABGR and XBGR formats
@ 2023-08-03 23:49     ` Laurent Pinchart
  0 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2023-08-03 23:49 UTC (permalink / raw)
  To: Damian Hobson-Garcia
  Cc: linux-renesas-soc, kieran.bingham+renesas, taki, dri-devel

Hi Damian,

Thank you for the patch.

On Fri, Jul 28, 2023 at 04:07:14PM -0400, Damian Hobson-Garcia wrote:
> These formats are used by Android so having them available
> allows the DU to be used for composition operations.
> 
> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>

This looks good to me. I'm not sure why I haven't included them
initially.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> index 96241c03b60f..d61bb2e44c06 100644
> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> @@ -122,6 +122,8 @@ static const u32 rcar_du_vsp_formats[] = {
>  	DRM_FORMAT_RGB888,
>  	DRM_FORMAT_BGRA8888,
>  	DRM_FORMAT_BGRX8888,
> +	DRM_FORMAT_ABGR8888,
> +	DRM_FORMAT_XBGR8888,
>  	DRM_FORMAT_ARGB8888,
>  	DRM_FORMAT_XRGB8888,
>  	DRM_FORMAT_UYVY,
> @@ -154,6 +156,8 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
>  	DRM_FORMAT_RGB888,
>  	DRM_FORMAT_BGRA8888,
>  	DRM_FORMAT_BGRX8888,
> +	DRM_FORMAT_ABGR8888,
> +	DRM_FORMAT_XBGR8888,
>  	DRM_FORMAT_ARGB8888,
>  	DRM_FORMAT_XRGB8888,
>  	DRM_FORMAT_RGBX1010102,
> @@ -194,6 +198,10 @@ static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
>  			fourcc = DRM_FORMAT_XRGB8888;
>  			break;
>  
> +		case DRM_FORMAT_ABGR8888:
> +			fourcc = DRM_FORMAT_XBGR8888;
> +			break;
> +
>  		case DRM_FORMAT_BGRA8888:
>  			fourcc = DRM_FORMAT_BGRX8888;
>  			break;

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support
  2023-08-03 23:47   ` Laurent Pinchart
@ 2023-08-03 23:53     ` Laurent Pinchart
  -1 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2023-08-03 23:53 UTC (permalink / raw)
  To: Damian Hobson-Garcia
  Cc: kieran.bingham+renesas, taki, dri-devel, linux-renesas-soc

On Fri, Aug 04, 2023 at 02:47:04AM +0300, Laurent Pinchart wrote:
> Hi Damian,
> 
> Thank you for the patch.
> 
> On Fri, Jul 28, 2023 at 04:07:13PM -0400, Damian Hobson-Garcia wrote:
> > Add additional pixel formats for which blending is disabling when
> 
> Did you mean "disabled" instead of "disabling" ?
> 
> > DRM_MODE_BLEND_PIXEL_NONE is set.
> > 
> > Refactor the fourcc selection into a separate function to handle the
> > increased number of formats.
> > 
> > Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
> > ---
> >  drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
> >  1 file changed, 32 insertions(+), 17 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > index 45c05d0ffc70..96241c03b60f 100644
> > --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > @@ -176,6 +176,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
> >  	DRM_FORMAT_Y212,
> >  };
> >  
> > +static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
> > +{
> > +	u32 fourcc = state->format->fourcc;
> > +
> > +	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> > +		switch (fourcc) {
> > +		case DRM_FORMAT_ARGB1555:
> > +			fourcc = DRM_FORMAT_XRGB1555;
> > +			break;
> > +
> > +		case DRM_FORMAT_ARGB4444:
> > +			fourcc = DRM_FORMAT_XRGB4444;
> > +			break;
> > +
> > +		case DRM_FORMAT_ARGB8888:
> > +			fourcc = DRM_FORMAT_XRGB8888;
> > +			break;
> > +
> > +		case DRM_FORMAT_BGRA8888:
> > +			fourcc = DRM_FORMAT_BGRX8888;
> > +			break;
> > +
> > +		case DRM_FORMAT_RGBA1010102:
> > +			fourcc = DRM_FORMAT_RGBX1010102;
> > +			break;
> 
> Should DRM_FORMAT_ARGB2101010 be added as well, or did you leave it out
> intentionally ?

It looks like DRM_FORMAT_ARGB2101010 will require a bit more work, as
DRM_FORMAT_XRGB2101010 is not handled by the DU driver at the moment.
Let's do so with a patch on top of this series. There's no need to send
a v2, I can handle the simple change in the commit message if you let me
know whether my comment is right or wrong.

> > +		}
> > +	}
> > +
> > +	return fourcc;
> > +}
> > +
> >  static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
> >  {
> >  	struct rcar_du_vsp_plane_state *state =
> > @@ -189,7 +220,7 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
> >  		.alpha = state->state.alpha >> 8,
> >  		.zpos = state->state.zpos,
> >  	};
> > -	u32 fourcc = state->format->fourcc;
> > +	u32 fourcc = rcar_du_vsp_state_get_format(state);
> >  	unsigned int i;
> >  
> >  	cfg.src.left = state->state.src.x1 >> 16;
> > @@ -206,22 +237,6 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
> >  		cfg.mem[i] = sg_dma_address(state->sg_tables[i].sgl)
> >  			   + fb->offsets[i];
> >  
> > -	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> > -		switch (fourcc) {
> > -		case DRM_FORMAT_ARGB1555:
> > -			fourcc = DRM_FORMAT_XRGB1555;
> > -			break;
> > -
> > -		case DRM_FORMAT_ARGB4444:
> > -			fourcc = DRM_FORMAT_XRGB4444;
> > -			break;
> > -
> > -		case DRM_FORMAT_ARGB8888:
> > -			fourcc = DRM_FORMAT_XRGB8888;
> > -			break;
> > -		}
> > -	}
> > -
> >  	format = rcar_du_format_info(fourcc);
> >  	cfg.pixelformat = format->v4l2;
> >  

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support
@ 2023-08-03 23:53     ` Laurent Pinchart
  0 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2023-08-03 23:53 UTC (permalink / raw)
  To: Damian Hobson-Garcia
  Cc: linux-renesas-soc, kieran.bingham+renesas, taki, dri-devel

On Fri, Aug 04, 2023 at 02:47:04AM +0300, Laurent Pinchart wrote:
> Hi Damian,
> 
> Thank you for the patch.
> 
> On Fri, Jul 28, 2023 at 04:07:13PM -0400, Damian Hobson-Garcia wrote:
> > Add additional pixel formats for which blending is disabling when
> 
> Did you mean "disabled" instead of "disabling" ?
> 
> > DRM_MODE_BLEND_PIXEL_NONE is set.
> > 
> > Refactor the fourcc selection into a separate function to handle the
> > increased number of formats.
> > 
> > Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
> > ---
> >  drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
> >  1 file changed, 32 insertions(+), 17 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > index 45c05d0ffc70..96241c03b60f 100644
> > --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > @@ -176,6 +176,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
> >  	DRM_FORMAT_Y212,
> >  };
> >  
> > +static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
> > +{
> > +	u32 fourcc = state->format->fourcc;
> > +
> > +	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> > +		switch (fourcc) {
> > +		case DRM_FORMAT_ARGB1555:
> > +			fourcc = DRM_FORMAT_XRGB1555;
> > +			break;
> > +
> > +		case DRM_FORMAT_ARGB4444:
> > +			fourcc = DRM_FORMAT_XRGB4444;
> > +			break;
> > +
> > +		case DRM_FORMAT_ARGB8888:
> > +			fourcc = DRM_FORMAT_XRGB8888;
> > +			break;
> > +
> > +		case DRM_FORMAT_BGRA8888:
> > +			fourcc = DRM_FORMAT_BGRX8888;
> > +			break;
> > +
> > +		case DRM_FORMAT_RGBA1010102:
> > +			fourcc = DRM_FORMAT_RGBX1010102;
> > +			break;
> 
> Should DRM_FORMAT_ARGB2101010 be added as well, or did you leave it out
> intentionally ?

It looks like DRM_FORMAT_ARGB2101010 will require a bit more work, as
DRM_FORMAT_XRGB2101010 is not handled by the DU driver at the moment.
Let's do so with a patch on top of this series. There's no need to send
a v2, I can handle the simple change in the commit message if you let me
know whether my comment is right or wrong.

> > +		}
> > +	}
> > +
> > +	return fourcc;
> > +}
> > +
> >  static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
> >  {
> >  	struct rcar_du_vsp_plane_state *state =
> > @@ -189,7 +220,7 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
> >  		.alpha = state->state.alpha >> 8,
> >  		.zpos = state->state.zpos,
> >  	};
> > -	u32 fourcc = state->format->fourcc;
> > +	u32 fourcc = rcar_du_vsp_state_get_format(state);
> >  	unsigned int i;
> >  
> >  	cfg.src.left = state->state.src.x1 >> 16;
> > @@ -206,22 +237,6 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
> >  		cfg.mem[i] = sg_dma_address(state->sg_tables[i].sgl)
> >  			   + fb->offsets[i];
> >  
> > -	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> > -		switch (fourcc) {
> > -		case DRM_FORMAT_ARGB1555:
> > -			fourcc = DRM_FORMAT_XRGB1555;
> > -			break;
> > -
> > -		case DRM_FORMAT_ARGB4444:
> > -			fourcc = DRM_FORMAT_XRGB4444;
> > -			break;
> > -
> > -		case DRM_FORMAT_ARGB8888:
> > -			fourcc = DRM_FORMAT_XRGB8888;
> > -			break;
> > -		}
> > -	}
> > -
> >  	format = rcar_du_format_info(fourcc);
> >  	cfg.pixelformat = format->v4l2;
> >  

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support
  2023-08-03 23:53     ` Laurent Pinchart
@ 2023-08-04  0:06       ` Laurent Pinchart
  -1 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2023-08-04  0:06 UTC (permalink / raw)
  To: Damian Hobson-Garcia
  Cc: kieran.bingham+renesas, taki, dri-devel, linux-renesas-soc

On Fri, Aug 04, 2023 at 02:53:17AM +0300, Laurent Pinchart wrote:
> On Fri, Aug 04, 2023 at 02:47:04AM +0300, Laurent Pinchart wrote:
> > Hi Damian,
> > 
> > Thank you for the patch.
> > 
> > On Fri, Jul 28, 2023 at 04:07:13PM -0400, Damian Hobson-Garcia wrote:
> > > Add additional pixel formats for which blending is disabling when
> > 
> > Did you mean "disabled" instead of "disabling" ?
> > 
> > > DRM_MODE_BLEND_PIXEL_NONE is set.
> > > 
> > > Refactor the fourcc selection into a separate function to handle the
> > > increased number of formats.
> > > 
> > > Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
> > > ---
> > >  drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
> > >  1 file changed, 32 insertions(+), 17 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > > index 45c05d0ffc70..96241c03b60f 100644
> > > --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > > +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > > @@ -176,6 +176,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
> > >  	DRM_FORMAT_Y212,
> > >  };
> > >  
> > > +static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
> > > +{
> > > +	u32 fourcc = state->format->fourcc;
> > > +
> > > +	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> > > +		switch (fourcc) {
> > > +		case DRM_FORMAT_ARGB1555:
> > > +			fourcc = DRM_FORMAT_XRGB1555;
> > > +			break;
> > > +
> > > +		case DRM_FORMAT_ARGB4444:
> > > +			fourcc = DRM_FORMAT_XRGB4444;
> > > +			break;
> > > +
> > > +		case DRM_FORMAT_ARGB8888:
> > > +			fourcc = DRM_FORMAT_XRGB8888;
> > > +			break;
> > > +
> > > +		case DRM_FORMAT_BGRA8888:
> > > +			fourcc = DRM_FORMAT_BGRX8888;
> > > +			break;
> > > +
> > > +		case DRM_FORMAT_RGBA1010102:
> > > +			fourcc = DRM_FORMAT_RGBX1010102;
> > > +			break;
> > 
> > Should DRM_FORMAT_ARGB2101010 be added as well, or did you leave it out
> > intentionally ?
> 
> It looks like DRM_FORMAT_ARGB2101010 will require a bit more work, as
> DRM_FORMAT_XRGB2101010 is not handled by the DU driver at the moment.
> Let's do so with a patch on top of this series.

Replying to myself again, the datasheet doesn't explicitly list
DRM_FORMAT_XRGB2101010 as supported, but the generic mechanism to
specify the location of the components should work fine for that format.
Is this something you would be able to test ?

> There's no need to send
> a v2, I can handle the simple change in the commit message if you let me
> know whether my comment is right or wrong.
> 
> > > +		}
> > > +	}
> > > +
> > > +	return fourcc;
> > > +}
> > > +
> > >  static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
> > >  {
> > >  	struct rcar_du_vsp_plane_state *state =
> > > @@ -189,7 +220,7 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
> > >  		.alpha = state->state.alpha >> 8,
> > >  		.zpos = state->state.zpos,
> > >  	};
> > > -	u32 fourcc = state->format->fourcc;
> > > +	u32 fourcc = rcar_du_vsp_state_get_format(state);
> > >  	unsigned int i;
> > >  
> > >  	cfg.src.left = state->state.src.x1 >> 16;
> > > @@ -206,22 +237,6 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
> > >  		cfg.mem[i] = sg_dma_address(state->sg_tables[i].sgl)
> > >  			   + fb->offsets[i];
> > >  
> > > -	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> > > -		switch (fourcc) {
> > > -		case DRM_FORMAT_ARGB1555:
> > > -			fourcc = DRM_FORMAT_XRGB1555;
> > > -			break;
> > > -
> > > -		case DRM_FORMAT_ARGB4444:
> > > -			fourcc = DRM_FORMAT_XRGB4444;
> > > -			break;
> > > -
> > > -		case DRM_FORMAT_ARGB8888:
> > > -			fourcc = DRM_FORMAT_XRGB8888;
> > > -			break;
> > > -		}
> > > -	}
> > > -
> > >  	format = rcar_du_format_info(fourcc);
> > >  	cfg.pixelformat = format->v4l2;
> > >  

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support
@ 2023-08-04  0:06       ` Laurent Pinchart
  0 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2023-08-04  0:06 UTC (permalink / raw)
  To: Damian Hobson-Garcia
  Cc: linux-renesas-soc, kieran.bingham+renesas, taki, dri-devel

On Fri, Aug 04, 2023 at 02:53:17AM +0300, Laurent Pinchart wrote:
> On Fri, Aug 04, 2023 at 02:47:04AM +0300, Laurent Pinchart wrote:
> > Hi Damian,
> > 
> > Thank you for the patch.
> > 
> > On Fri, Jul 28, 2023 at 04:07:13PM -0400, Damian Hobson-Garcia wrote:
> > > Add additional pixel formats for which blending is disabling when
> > 
> > Did you mean "disabled" instead of "disabling" ?
> > 
> > > DRM_MODE_BLEND_PIXEL_NONE is set.
> > > 
> > > Refactor the fourcc selection into a separate function to handle the
> > > increased number of formats.
> > > 
> > > Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
> > > ---
> > >  drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
> > >  1 file changed, 32 insertions(+), 17 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > > index 45c05d0ffc70..96241c03b60f 100644
> > > --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > > +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > > @@ -176,6 +176,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
> > >  	DRM_FORMAT_Y212,
> > >  };
> > >  
> > > +static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
> > > +{
> > > +	u32 fourcc = state->format->fourcc;
> > > +
> > > +	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> > > +		switch (fourcc) {
> > > +		case DRM_FORMAT_ARGB1555:
> > > +			fourcc = DRM_FORMAT_XRGB1555;
> > > +			break;
> > > +
> > > +		case DRM_FORMAT_ARGB4444:
> > > +			fourcc = DRM_FORMAT_XRGB4444;
> > > +			break;
> > > +
> > > +		case DRM_FORMAT_ARGB8888:
> > > +			fourcc = DRM_FORMAT_XRGB8888;
> > > +			break;
> > > +
> > > +		case DRM_FORMAT_BGRA8888:
> > > +			fourcc = DRM_FORMAT_BGRX8888;
> > > +			break;
> > > +
> > > +		case DRM_FORMAT_RGBA1010102:
> > > +			fourcc = DRM_FORMAT_RGBX1010102;
> > > +			break;
> > 
> > Should DRM_FORMAT_ARGB2101010 be added as well, or did you leave it out
> > intentionally ?
> 
> It looks like DRM_FORMAT_ARGB2101010 will require a bit more work, as
> DRM_FORMAT_XRGB2101010 is not handled by the DU driver at the moment.
> Let's do so with a patch on top of this series.

Replying to myself again, the datasheet doesn't explicitly list
DRM_FORMAT_XRGB2101010 as supported, but the generic mechanism to
specify the location of the components should work fine for that format.
Is this something you would be able to test ?

> There's no need to send
> a v2, I can handle the simple change in the commit message if you let me
> know whether my comment is right or wrong.
> 
> > > +		}
> > > +	}
> > > +
> > > +	return fourcc;
> > > +}
> > > +
> > >  static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
> > >  {
> > >  	struct rcar_du_vsp_plane_state *state =
> > > @@ -189,7 +220,7 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
> > >  		.alpha = state->state.alpha >> 8,
> > >  		.zpos = state->state.zpos,
> > >  	};
> > > -	u32 fourcc = state->format->fourcc;
> > > +	u32 fourcc = rcar_du_vsp_state_get_format(state);
> > >  	unsigned int i;
> > >  
> > >  	cfg.src.left = state->state.src.x1 >> 16;
> > > @@ -206,22 +237,6 @@ static void rcar_du_vsp_plane_setup(struct rcar_du_vsp_plane *plane)
> > >  		cfg.mem[i] = sg_dma_address(state->sg_tables[i].sgl)
> > >  			   + fb->offsets[i];
> > >  
> > > -	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> > > -		switch (fourcc) {
> > > -		case DRM_FORMAT_ARGB1555:
> > > -			fourcc = DRM_FORMAT_XRGB1555;
> > > -			break;
> > > -
> > > -		case DRM_FORMAT_ARGB4444:
> > > -			fourcc = DRM_FORMAT_XRGB4444;
> > > -			break;
> > > -
> > > -		case DRM_FORMAT_ARGB8888:
> > > -			fourcc = DRM_FORMAT_XRGB8888;
> > > -			break;
> > > -		}
> > > -	}
> > > -
> > >  	format = rcar_du_format_info(fourcc);
> > >  	cfg.pixelformat = format->v4l2;
> > >  

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support
  2023-08-04  0:06       ` Laurent Pinchart
@ 2023-08-04 15:49         ` Damian Hobson-Garcia
  -1 siblings, 0 replies; 20+ messages in thread
From: Damian Hobson-Garcia @ 2023-08-04 15:49 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: kieran.bingham+renesas, taki, dri-devel, linux-renesas-soc

Hi Laurent,

Thank you for the review.

On 2023/08/03 20:06, Laurent Pinchart wrote:
> On Fri, Aug 04, 2023 at 02:53:17AM +0300, Laurent Pinchart wrote:
>> On Fri, Aug 04, 2023 at 02:47:04AM +0300, Laurent Pinchart wrote:
>>> Hi Damian,
>>>
>>> Thank you for the patch.
>>>
>>> On Fri, Jul 28, 2023 at 04:07:13PM -0400, Damian Hobson-Garcia wrote:
>>>> Add additional pixel formats for which blending is disabling when
>>> Did you mean "disabled" instead of "disabling" ?


Oops.  Yes, that's exactly what I meant.


>>>
>>>> DRM_MODE_BLEND_PIXEL_NONE is set.
>>>>
>>>> Refactor the fourcc selection into a separate function to handle the
>>>> increased number of formats.
>>>>
>>>> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
>>>> ---
>>>>   drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
>>>>   1 file changed, 32 insertions(+), 17 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
>>>> index 45c05d0ffc70..96241c03b60f 100644
>>>> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
>>>> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
>>>> @@ -176,6 +176,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
>>>>   	DRM_FORMAT_Y212,
>>>>   };
>>>>   
>>>> +static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
>>>> +{
>>>> +	u32 fourcc = state->format->fourcc;
>>>> +
>>>> +	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
>>>> +		switch (fourcc) {
>>>> +		case DRM_FORMAT_ARGB1555:
>>>> +			fourcc = DRM_FORMAT_XRGB1555;
>>>> +			break;
>>>> +
>>>> +		case DRM_FORMAT_ARGB4444:
>>>> +			fourcc = DRM_FORMAT_XRGB4444;
>>>> +			break;
>>>> +
>>>> +		case DRM_FORMAT_ARGB8888:
>>>> +			fourcc = DRM_FORMAT_XRGB8888;
>>>> +			break;
>>>> +
>>>> +		case DRM_FORMAT_BGRA8888:
>>>> +			fourcc = DRM_FORMAT_BGRX8888;
>>>> +			break;
>>>> +
>>>> +		case DRM_FORMAT_RGBA1010102:
>>>> +			fourcc = DRM_FORMAT_RGBX1010102;
>>>> +			break;
>>> Should DRM_FORMAT_ARGB2101010 be added as well, or did you leave it out
>>> intentionally ?

Yes, it was intentionally left out for the time being for the
reason that you noted (i.e. DRM_FORMAT_XRGB2101010 not
being handled by the DU driver).

>> It looks like DRM_FORMAT_ARGB2101010 will require a bit more work, as
>> DRM_FORMAT_XRGB2101010 is not handled by the DU driver at the moment.
>> Let's do so with a patch on top of this series.
Yes, I was thinking the same thing.
> Replying to myself again, the datasheet doesn't explicitly list
> DRM_FORMAT_XRGB2101010 as supported, but the generic mechanism to
> specify the location of the components should work fine for that format.
> Is this something you would be able to test ?

Unfortunately I don't have a Gen 4 system on hand to test the 2-10-10-10 
formats with.
I will double-check with the office in Japan, but I don't think that 
they have one either.

>
>> There's no need to send
>> a v2, I can handle the simple change in the commit message if you let me
>> know whether my comment is right or wrong.


Thank you,
Damian


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

* Re: [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support
@ 2023-08-04 15:49         ` Damian Hobson-Garcia
  0 siblings, 0 replies; 20+ messages in thread
From: Damian Hobson-Garcia @ 2023-08-04 15:49 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-renesas-soc, kieran.bingham+renesas, taki, dri-devel

Hi Laurent,

Thank you for the review.

On 2023/08/03 20:06, Laurent Pinchart wrote:
> On Fri, Aug 04, 2023 at 02:53:17AM +0300, Laurent Pinchart wrote:
>> On Fri, Aug 04, 2023 at 02:47:04AM +0300, Laurent Pinchart wrote:
>>> Hi Damian,
>>>
>>> Thank you for the patch.
>>>
>>> On Fri, Jul 28, 2023 at 04:07:13PM -0400, Damian Hobson-Garcia wrote:
>>>> Add additional pixel formats for which blending is disabling when
>>> Did you mean "disabled" instead of "disabling" ?


Oops.  Yes, that's exactly what I meant.


>>>
>>>> DRM_MODE_BLEND_PIXEL_NONE is set.
>>>>
>>>> Refactor the fourcc selection into a separate function to handle the
>>>> increased number of formats.
>>>>
>>>> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
>>>> ---
>>>>   drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
>>>>   1 file changed, 32 insertions(+), 17 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
>>>> index 45c05d0ffc70..96241c03b60f 100644
>>>> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
>>>> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
>>>> @@ -176,6 +176,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
>>>>   	DRM_FORMAT_Y212,
>>>>   };
>>>>   
>>>> +static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
>>>> +{
>>>> +	u32 fourcc = state->format->fourcc;
>>>> +
>>>> +	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
>>>> +		switch (fourcc) {
>>>> +		case DRM_FORMAT_ARGB1555:
>>>> +			fourcc = DRM_FORMAT_XRGB1555;
>>>> +			break;
>>>> +
>>>> +		case DRM_FORMAT_ARGB4444:
>>>> +			fourcc = DRM_FORMAT_XRGB4444;
>>>> +			break;
>>>> +
>>>> +		case DRM_FORMAT_ARGB8888:
>>>> +			fourcc = DRM_FORMAT_XRGB8888;
>>>> +			break;
>>>> +
>>>> +		case DRM_FORMAT_BGRA8888:
>>>> +			fourcc = DRM_FORMAT_BGRX8888;
>>>> +			break;
>>>> +
>>>> +		case DRM_FORMAT_RGBA1010102:
>>>> +			fourcc = DRM_FORMAT_RGBX1010102;
>>>> +			break;
>>> Should DRM_FORMAT_ARGB2101010 be added as well, or did you leave it out
>>> intentionally ?

Yes, it was intentionally left out for the time being for the
reason that you noted (i.e. DRM_FORMAT_XRGB2101010 not
being handled by the DU driver).

>> It looks like DRM_FORMAT_ARGB2101010 will require a bit more work, as
>> DRM_FORMAT_XRGB2101010 is not handled by the DU driver at the moment.
>> Let's do so with a patch on top of this series.
Yes, I was thinking the same thing.
> Replying to myself again, the datasheet doesn't explicitly list
> DRM_FORMAT_XRGB2101010 as supported, but the generic mechanism to
> specify the location of the components should work fine for that format.
> Is this something you would be able to test ?

Unfortunately I don't have a Gen 4 system on hand to test the 2-10-10-10 
formats with.
I will double-check with the office in Japan, but I don't think that 
they have one either.

>
>> There's no need to send
>> a v2, I can handle the simple change in the commit message if you let me
>> know whether my comment is right or wrong.


Thank you,
Damian


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

* Re: [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support
  2023-08-04 15:49         ` Damian Hobson-Garcia
@ 2023-08-04 15:52           ` Laurent Pinchart
  -1 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2023-08-04 15:52 UTC (permalink / raw)
  To: Damian Hobson-Garcia
  Cc: kieran.bingham+renesas, taki, dri-devel, linux-renesas-soc,
	Tomi Valkeinen

Hi Damian,

(CC'ing Tomi)

On Fri, Aug 04, 2023 at 11:49:32AM -0400, Damian Hobson-Garcia wrote:
> On 2023/08/03 20:06, Laurent Pinchart wrote:
> > On Fri, Aug 04, 2023 at 02:53:17AM +0300, Laurent Pinchart wrote:
> >> On Fri, Aug 04, 2023 at 02:47:04AM +0300, Laurent Pinchart wrote:
> >>> Hi Damian,
> >>>
> >>> Thank you for the patch.
> >>>
> >>> On Fri, Jul 28, 2023 at 04:07:13PM -0400, Damian Hobson-Garcia wrote:
> >>>> Add additional pixel formats for which blending is disabling when
> >>> Did you mean "disabled" instead of "disabling" ?
> 
> Oops.  Yes, that's exactly what I meant.
> 
> >>>
> >>>> DRM_MODE_BLEND_PIXEL_NONE is set.
> >>>>
> >>>> Refactor the fourcc selection into a separate function to handle the
> >>>> increased number of formats.
> >>>>
> >>>> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
> >>>> ---
> >>>>   drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
> >>>>   1 file changed, 32 insertions(+), 17 deletions(-)
> >>>>
> >>>> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> >>>> index 45c05d0ffc70..96241c03b60f 100644
> >>>> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> >>>> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> >>>> @@ -176,6 +176,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
> >>>>   	DRM_FORMAT_Y212,
> >>>>   };
> >>>>   
> >>>> +static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
> >>>> +{
> >>>> +	u32 fourcc = state->format->fourcc;
> >>>> +
> >>>> +	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> >>>> +		switch (fourcc) {
> >>>> +		case DRM_FORMAT_ARGB1555:
> >>>> +			fourcc = DRM_FORMAT_XRGB1555;
> >>>> +			break;
> >>>> +
> >>>> +		case DRM_FORMAT_ARGB4444:
> >>>> +			fourcc = DRM_FORMAT_XRGB4444;
> >>>> +			break;
> >>>> +
> >>>> +		case DRM_FORMAT_ARGB8888:
> >>>> +			fourcc = DRM_FORMAT_XRGB8888;
> >>>> +			break;
> >>>> +
> >>>> +		case DRM_FORMAT_BGRA8888:
> >>>> +			fourcc = DRM_FORMAT_BGRX8888;
> >>>> +			break;
> >>>> +
> >>>> +		case DRM_FORMAT_RGBA1010102:
> >>>> +			fourcc = DRM_FORMAT_RGBX1010102;
> >>>> +			break;
> >>> Should DRM_FORMAT_ARGB2101010 be added as well, or did you leave it out
> >>> intentionally ?
> 
> Yes, it was intentionally left out for the time being for the
> reason that you noted (i.e. DRM_FORMAT_XRGB2101010 not
> being handled by the DU driver).
> 
> >> It looks like DRM_FORMAT_ARGB2101010 will require a bit more work, as
> >> DRM_FORMAT_XRGB2101010 is not handled by the DU driver at the moment.
> >> Let's do so with a patch on top of this series.
> Yes, I was thinking the same thing.
> > Replying to myself again, the datasheet doesn't explicitly list
> > DRM_FORMAT_XRGB2101010 as supported, but the generic mechanism to
> > specify the location of the components should work fine for that format.
> > Is this something you would be able to test ?
> 
> Unfortunately I don't have a Gen 4 system on hand to test the 2-10-10-10 
> formats with.
> I will double-check with the office in Japan, but I don't think that 
> they have one either.

Tomi, is this something you could test ?

> >> There's no need to send
> >> a v2, I can handle the simple change in the commit message if you let me
> >> know whether my comment is right or wrong.

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support
@ 2023-08-04 15:52           ` Laurent Pinchart
  0 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2023-08-04 15:52 UTC (permalink / raw)
  To: Damian Hobson-Garcia
  Cc: linux-renesas-soc, Tomi Valkeinen, kieran.bingham+renesas, taki,
	dri-devel

Hi Damian,

(CC'ing Tomi)

On Fri, Aug 04, 2023 at 11:49:32AM -0400, Damian Hobson-Garcia wrote:
> On 2023/08/03 20:06, Laurent Pinchart wrote:
> > On Fri, Aug 04, 2023 at 02:53:17AM +0300, Laurent Pinchart wrote:
> >> On Fri, Aug 04, 2023 at 02:47:04AM +0300, Laurent Pinchart wrote:
> >>> Hi Damian,
> >>>
> >>> Thank you for the patch.
> >>>
> >>> On Fri, Jul 28, 2023 at 04:07:13PM -0400, Damian Hobson-Garcia wrote:
> >>>> Add additional pixel formats for which blending is disabling when
> >>> Did you mean "disabled" instead of "disabling" ?
> 
> Oops.  Yes, that's exactly what I meant.
> 
> >>>
> >>>> DRM_MODE_BLEND_PIXEL_NONE is set.
> >>>>
> >>>> Refactor the fourcc selection into a separate function to handle the
> >>>> increased number of formats.
> >>>>
> >>>> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
> >>>> ---
> >>>>   drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
> >>>>   1 file changed, 32 insertions(+), 17 deletions(-)
> >>>>
> >>>> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> >>>> index 45c05d0ffc70..96241c03b60f 100644
> >>>> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> >>>> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> >>>> @@ -176,6 +176,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
> >>>>   	DRM_FORMAT_Y212,
> >>>>   };
> >>>>   
> >>>> +static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
> >>>> +{
> >>>> +	u32 fourcc = state->format->fourcc;
> >>>> +
> >>>> +	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> >>>> +		switch (fourcc) {
> >>>> +		case DRM_FORMAT_ARGB1555:
> >>>> +			fourcc = DRM_FORMAT_XRGB1555;
> >>>> +			break;
> >>>> +
> >>>> +		case DRM_FORMAT_ARGB4444:
> >>>> +			fourcc = DRM_FORMAT_XRGB4444;
> >>>> +			break;
> >>>> +
> >>>> +		case DRM_FORMAT_ARGB8888:
> >>>> +			fourcc = DRM_FORMAT_XRGB8888;
> >>>> +			break;
> >>>> +
> >>>> +		case DRM_FORMAT_BGRA8888:
> >>>> +			fourcc = DRM_FORMAT_BGRX8888;
> >>>> +			break;
> >>>> +
> >>>> +		case DRM_FORMAT_RGBA1010102:
> >>>> +			fourcc = DRM_FORMAT_RGBX1010102;
> >>>> +			break;
> >>> Should DRM_FORMAT_ARGB2101010 be added as well, or did you leave it out
> >>> intentionally ?
> 
> Yes, it was intentionally left out for the time being for the
> reason that you noted (i.e. DRM_FORMAT_XRGB2101010 not
> being handled by the DU driver).
> 
> >> It looks like DRM_FORMAT_ARGB2101010 will require a bit more work, as
> >> DRM_FORMAT_XRGB2101010 is not handled by the DU driver at the moment.
> >> Let's do so with a patch on top of this series.
> Yes, I was thinking the same thing.
> > Replying to myself again, the datasheet doesn't explicitly list
> > DRM_FORMAT_XRGB2101010 as supported, but the generic mechanism to
> > specify the location of the components should work fine for that format.
> > Is this something you would be able to test ?
> 
> Unfortunately I don't have a Gen 4 system on hand to test the 2-10-10-10 
> formats with.
> I will double-check with the office in Japan, but I don't think that 
> they have one either.

Tomi, is this something you could test ?

> >> There's no need to send
> >> a v2, I can handle the simple change in the commit message if you let me
> >> know whether my comment is right or wrong.

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support
  2023-08-04 15:52           ` Laurent Pinchart
@ 2023-08-14 10:46             ` Laurent Pinchart
  -1 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2023-08-14 10:46 UTC (permalink / raw)
  To: Damian Hobson-Garcia
  Cc: linux-renesas-soc, Tomi Valkeinen, kieran.bingham+renesas, taki,
	dri-devel

On Fri, Aug 04, 2023 at 06:52:51PM +0300, Laurent Pinchart wrote:
> On Fri, Aug 04, 2023 at 11:49:32AM -0400, Damian Hobson-Garcia wrote:
> > On 2023/08/03 20:06, Laurent Pinchart wrote:
> > > On Fri, Aug 04, 2023 at 02:53:17AM +0300, Laurent Pinchart wrote:
> > >> On Fri, Aug 04, 2023 at 02:47:04AM +0300, Laurent Pinchart wrote:
> > >>> On Fri, Jul 28, 2023 at 04:07:13PM -0400, Damian Hobson-Garcia wrote:
> > >>>> Add additional pixel formats for which blending is disabling when
> > >>>
> > >>> Did you mean "disabled" instead of "disabling" ?
> > 
> > Oops.  Yes, that's exactly what I meant.

I'll fix this locally.

> > >>>> DRM_MODE_BLEND_PIXEL_NONE is set.
> > >>>>
> > >>>> Refactor the fourcc selection into a separate function to handle the
> > >>>> increased number of formats.
> > >>>>
> > >>>> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
> > >>>> ---
> > >>>>   drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
> > >>>>   1 file changed, 32 insertions(+), 17 deletions(-)
> > >>>>
> > >>>> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > >>>> index 45c05d0ffc70..96241c03b60f 100644
> > >>>> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > >>>> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > >>>> @@ -176,6 +176,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
> > >>>>   	DRM_FORMAT_Y212,
> > >>>>   };
> > >>>>   
> > >>>> +static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
> > >>>> +{
> > >>>> +	u32 fourcc = state->format->fourcc;
> > >>>> +
> > >>>> +	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> > >>>> +		switch (fourcc) {
> > >>>> +		case DRM_FORMAT_ARGB1555:
> > >>>> +			fourcc = DRM_FORMAT_XRGB1555;
> > >>>> +			break;
> > >>>> +
> > >>>> +		case DRM_FORMAT_ARGB4444:
> > >>>> +			fourcc = DRM_FORMAT_XRGB4444;
> > >>>> +			break;
> > >>>> +
> > >>>> +		case DRM_FORMAT_ARGB8888:
> > >>>> +			fourcc = DRM_FORMAT_XRGB8888;
> > >>>> +			break;
> > >>>> +
> > >>>> +		case DRM_FORMAT_BGRA8888:
> > >>>> +			fourcc = DRM_FORMAT_BGRX8888;
> > >>>> +			break;
> > >>>> +
> > >>>> +		case DRM_FORMAT_RGBA1010102:
> > >>>> +			fourcc = DRM_FORMAT_RGBX1010102;
> > >>>> +			break;
> > >>>
> > >>> Should DRM_FORMAT_ARGB2101010 be added as well, or did you leave it out
> > >>> intentionally ?
> > 
> > Yes, it was intentionally left out for the time being for the
> > reason that you noted (i.e. DRM_FORMAT_XRGB2101010 not
> > being handled by the DU driver).
> > 
> > >> It looks like DRM_FORMAT_ARGB2101010 will require a bit more work, as
> > >> DRM_FORMAT_XRGB2101010 is not handled by the DU driver at the moment.
> > >> Let's do so with a patch on top of this series.
> >
> > Yes, I was thinking the same thing.
> >
> > > Replying to myself again, the datasheet doesn't explicitly list
> > > DRM_FORMAT_XRGB2101010 as supported, but the generic mechanism to
> > > specify the location of the components should work fine for that format.
> > > Is this something you would be able to test ?
> > 
> > Unfortunately I don't have a Gen 4 system on hand to test the 2-10-10-10 
> > formats with.
> > I will double-check with the office in Japan, but I don't think that 
> > they have one either.
> 
> Tomi, is this something you could test ?

Replying to myself, this is something we could test, but let's not delay
this series, new formats can always be added on top.

> > >> There's no need to send
> > >> a v2, I can handle the simple change in the commit message if you let me
> > >> know whether my comment is right or wrong.

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support
@ 2023-08-14 10:46             ` Laurent Pinchart
  0 siblings, 0 replies; 20+ messages in thread
From: Laurent Pinchart @ 2023-08-14 10:46 UTC (permalink / raw)
  To: Damian Hobson-Garcia
  Cc: kieran.bingham+renesas, taki, dri-devel, linux-renesas-soc,
	Tomi Valkeinen

On Fri, Aug 04, 2023 at 06:52:51PM +0300, Laurent Pinchart wrote:
> On Fri, Aug 04, 2023 at 11:49:32AM -0400, Damian Hobson-Garcia wrote:
> > On 2023/08/03 20:06, Laurent Pinchart wrote:
> > > On Fri, Aug 04, 2023 at 02:53:17AM +0300, Laurent Pinchart wrote:
> > >> On Fri, Aug 04, 2023 at 02:47:04AM +0300, Laurent Pinchart wrote:
> > >>> On Fri, Jul 28, 2023 at 04:07:13PM -0400, Damian Hobson-Garcia wrote:
> > >>>> Add additional pixel formats for which blending is disabling when
> > >>>
> > >>> Did you mean "disabled" instead of "disabling" ?
> > 
> > Oops.  Yes, that's exactly what I meant.

I'll fix this locally.

> > >>>> DRM_MODE_BLEND_PIXEL_NONE is set.
> > >>>>
> > >>>> Refactor the fourcc selection into a separate function to handle the
> > >>>> increased number of formats.
> > >>>>
> > >>>> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
> > >>>> ---
> > >>>>   drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
> > >>>>   1 file changed, 32 insertions(+), 17 deletions(-)
> > >>>>
> > >>>> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > >>>> index 45c05d0ffc70..96241c03b60f 100644
> > >>>> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > >>>> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
> > >>>> @@ -176,6 +176,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
> > >>>>   	DRM_FORMAT_Y212,
> > >>>>   };
> > >>>>   
> > >>>> +static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
> > >>>> +{
> > >>>> +	u32 fourcc = state->format->fourcc;
> > >>>> +
> > >>>> +	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
> > >>>> +		switch (fourcc) {
> > >>>> +		case DRM_FORMAT_ARGB1555:
> > >>>> +			fourcc = DRM_FORMAT_XRGB1555;
> > >>>> +			break;
> > >>>> +
> > >>>> +		case DRM_FORMAT_ARGB4444:
> > >>>> +			fourcc = DRM_FORMAT_XRGB4444;
> > >>>> +			break;
> > >>>> +
> > >>>> +		case DRM_FORMAT_ARGB8888:
> > >>>> +			fourcc = DRM_FORMAT_XRGB8888;
> > >>>> +			break;
> > >>>> +
> > >>>> +		case DRM_FORMAT_BGRA8888:
> > >>>> +			fourcc = DRM_FORMAT_BGRX8888;
> > >>>> +			break;
> > >>>> +
> > >>>> +		case DRM_FORMAT_RGBA1010102:
> > >>>> +			fourcc = DRM_FORMAT_RGBX1010102;
> > >>>> +			break;
> > >>>
> > >>> Should DRM_FORMAT_ARGB2101010 be added as well, or did you leave it out
> > >>> intentionally ?
> > 
> > Yes, it was intentionally left out for the time being for the
> > reason that you noted (i.e. DRM_FORMAT_XRGB2101010 not
> > being handled by the DU driver).
> > 
> > >> It looks like DRM_FORMAT_ARGB2101010 will require a bit more work, as
> > >> DRM_FORMAT_XRGB2101010 is not handled by the DU driver at the moment.
> > >> Let's do so with a patch on top of this series.
> >
> > Yes, I was thinking the same thing.
> >
> > > Replying to myself again, the datasheet doesn't explicitly list
> > > DRM_FORMAT_XRGB2101010 as supported, but the generic mechanism to
> > > specify the location of the components should work fine for that format.
> > > Is this something you would be able to test ?
> > 
> > Unfortunately I don't have a Gen 4 system on hand to test the 2-10-10-10 
> > formats with.
> > I will double-check with the office in Japan, but I don't think that 
> > they have one either.
> 
> Tomi, is this something you could test ?

Replying to myself, this is something we could test, but let's not delay
this series, new formats can always be added on top.

> > >> There's no need to send
> > >> a v2, I can handle the simple change in the commit message if you let me
> > >> know whether my comment is right or wrong.

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support
  2023-08-14 10:46             ` Laurent Pinchart
@ 2023-08-14 16:27               ` Damian Hobson-Garcia
  -1 siblings, 0 replies; 20+ messages in thread
From: Damian Hobson-Garcia @ 2023-08-14 16:27 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: kieran.bingham+renesas, taki, dri-devel, linux-renesas-soc,
	Tomi Valkeinen

Hi Laurent,


On 2023/08/14 6:46, Laurent Pinchart wrote:
> On Fri, Aug 04, 2023 at 06:52:51PM +0300, Laurent Pinchart wrote:
>> On Fri, Aug 04, 2023 at 11:49:32AM -0400, Damian Hobson-Garcia wrote:
>>> On 2023/08/03 20:06, Laurent Pinchart wrote:
>>>> On Fri, Aug 04, 2023 at 02:53:17AM +0300, Laurent Pinchart wrote:
>>>>> On Fri, Aug 04, 2023 at 02:47:04AM +0300, Laurent Pinchart wrote:
>>>>>> On Fri, Jul 28, 2023 at 04:07:13PM -0400, Damian Hobson-Garcia wrote:
>>>>>>> Add additional pixel formats for which blending is disabling when
>>>>>> Did you mean "disabled" instead of "disabling" ?
>>> Oops.  Yes, that's exactly what I meant.
> I'll fix this locally.


Thank you very much.


>
>>>>>>> DRM_MODE_BLEND_PIXEL_NONE is set.
>>>>>>>
>>>>>>> Refactor the fourcc selection into a separate function to handle the
>>>>>>> increased number of formats.
>>>>>>>
>>>>>>> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
>>>>>>> ---
>>>>>>>    drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
>>>>>>>    1 file changed, 32 insertions(+), 17 deletions(-)
>>>>>>>
>>>>>>> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
>>>>>>> index 45c05d0ffc70..96241c03b60f 100644
>>>>>>> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
>>>>>>> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
>>>>>>> @@ -176,6 +176,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
>>>>>>>    	DRM_FORMAT_Y212,
>>>>>>>    };
>>>>>>>    
>>>>>>> +static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
>>>>>>> +{
>>>>>>> +	u32 fourcc = state->format->fourcc;
>>>>>>> +
>>>>>>> +	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
>>>>>>> +		switch (fourcc) {
>>>>>>> +		case DRM_FORMAT_ARGB1555:
>>>>>>> +			fourcc = DRM_FORMAT_XRGB1555;
>>>>>>> +			break;
>>>>>>> +
>>>>>>> +		case DRM_FORMAT_ARGB4444:
>>>>>>> +			fourcc = DRM_FORMAT_XRGB4444;
>>>>>>> +			break;
>>>>>>> +
>>>>>>> +		case DRM_FORMAT_ARGB8888:
>>>>>>> +			fourcc = DRM_FORMAT_XRGB8888;
>>>>>>> +			break;
>>>>>>> +
>>>>>>> +		case DRM_FORMAT_BGRA8888:
>>>>>>> +			fourcc = DRM_FORMAT_BGRX8888;
>>>>>>> +			break;
>>>>>>> +
>>>>>>> +		case DRM_FORMAT_RGBA1010102:
>>>>>>> +			fourcc = DRM_FORMAT_RGBX1010102;
>>>>>>> +			break;
>>>>>> Should DRM_FORMAT_ARGB2101010 be added as well, or did you leave it out
>>>>>> intentionally ?
>>> Yes, it was intentionally left out for the time being for the
>>> reason that you noted (i.e. DRM_FORMAT_XRGB2101010 not
>>> being handled by the DU driver).
>>>
>>>>> It looks like DRM_FORMAT_ARGB2101010 will require a bit more work, as
>>>>> DRM_FORMAT_XRGB2101010 is not handled by the DU driver at the moment.
>>>>> Let's do so with a patch on top of this series.
>>> Yes, I was thinking the same thing.
>>>
>>>> Replying to myself again, the datasheet doesn't explicitly list
>>>> DRM_FORMAT_XRGB2101010 as supported, but the generic mechanism to
>>>> specify the location of the components should work fine for that format.
>>>> Is this something you would be able to test ?
>>> Unfortunately I don't have a Gen 4 system on hand to test the 2-10-10-10
>>> formats with.
>>> I will double-check with the office in Japan, but I don't think that
>>> they have one either.
>> Tomi, is this something you could test ?
> Replying to myself, this is something we could test, but let's not delay
> this series, new formats can always be added on top.

Ok, great.  Thanks very much.


Damian

>>>>> There's no need to send
>>>>> a v2, I can handle the simple change in the commit message if you let me
>>>>> know whether my comment is right or wrong.

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

* Re: [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support
@ 2023-08-14 16:27               ` Damian Hobson-Garcia
  0 siblings, 0 replies; 20+ messages in thread
From: Damian Hobson-Garcia @ 2023-08-14 16:27 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-renesas-soc, Tomi Valkeinen, kieran.bingham+renesas, taki,
	dri-devel

Hi Laurent,


On 2023/08/14 6:46, Laurent Pinchart wrote:
> On Fri, Aug 04, 2023 at 06:52:51PM +0300, Laurent Pinchart wrote:
>> On Fri, Aug 04, 2023 at 11:49:32AM -0400, Damian Hobson-Garcia wrote:
>>> On 2023/08/03 20:06, Laurent Pinchart wrote:
>>>> On Fri, Aug 04, 2023 at 02:53:17AM +0300, Laurent Pinchart wrote:
>>>>> On Fri, Aug 04, 2023 at 02:47:04AM +0300, Laurent Pinchart wrote:
>>>>>> On Fri, Jul 28, 2023 at 04:07:13PM -0400, Damian Hobson-Garcia wrote:
>>>>>>> Add additional pixel formats for which blending is disabling when
>>>>>> Did you mean "disabled" instead of "disabling" ?
>>> Oops.  Yes, that's exactly what I meant.
> I'll fix this locally.


Thank you very much.


>
>>>>>>> DRM_MODE_BLEND_PIXEL_NONE is set.
>>>>>>>
>>>>>>> Refactor the fourcc selection into a separate function to handle the
>>>>>>> increased number of formats.
>>>>>>>
>>>>>>> Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
>>>>>>> ---
>>>>>>>    drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
>>>>>>>    1 file changed, 32 insertions(+), 17 deletions(-)
>>>>>>>
>>>>>>> diff --git a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
>>>>>>> index 45c05d0ffc70..96241c03b60f 100644
>>>>>>> --- a/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
>>>>>>> +++ b/drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c
>>>>>>> @@ -176,6 +176,37 @@ static const u32 rcar_du_vsp_formats_gen4[] = {
>>>>>>>    	DRM_FORMAT_Y212,
>>>>>>>    };
>>>>>>>    
>>>>>>> +static u32 rcar_du_vsp_state_get_format(struct rcar_du_vsp_plane_state *state)
>>>>>>> +{
>>>>>>> +	u32 fourcc = state->format->fourcc;
>>>>>>> +
>>>>>>> +	if (state->state.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) {
>>>>>>> +		switch (fourcc) {
>>>>>>> +		case DRM_FORMAT_ARGB1555:
>>>>>>> +			fourcc = DRM_FORMAT_XRGB1555;
>>>>>>> +			break;
>>>>>>> +
>>>>>>> +		case DRM_FORMAT_ARGB4444:
>>>>>>> +			fourcc = DRM_FORMAT_XRGB4444;
>>>>>>> +			break;
>>>>>>> +
>>>>>>> +		case DRM_FORMAT_ARGB8888:
>>>>>>> +			fourcc = DRM_FORMAT_XRGB8888;
>>>>>>> +			break;
>>>>>>> +
>>>>>>> +		case DRM_FORMAT_BGRA8888:
>>>>>>> +			fourcc = DRM_FORMAT_BGRX8888;
>>>>>>> +			break;
>>>>>>> +
>>>>>>> +		case DRM_FORMAT_RGBA1010102:
>>>>>>> +			fourcc = DRM_FORMAT_RGBX1010102;
>>>>>>> +			break;
>>>>>> Should DRM_FORMAT_ARGB2101010 be added as well, or did you leave it out
>>>>>> intentionally ?
>>> Yes, it was intentionally left out for the time being for the
>>> reason that you noted (i.e. DRM_FORMAT_XRGB2101010 not
>>> being handled by the DU driver).
>>>
>>>>> It looks like DRM_FORMAT_ARGB2101010 will require a bit more work, as
>>>>> DRM_FORMAT_XRGB2101010 is not handled by the DU driver at the moment.
>>>>> Let's do so with a patch on top of this series.
>>> Yes, I was thinking the same thing.
>>>
>>>> Replying to myself again, the datasheet doesn't explicitly list
>>>> DRM_FORMAT_XRGB2101010 as supported, but the generic mechanism to
>>>> specify the location of the components should work fine for that format.
>>>> Is this something you would be able to test ?
>>> Unfortunately I don't have a Gen 4 system on hand to test the 2-10-10-10
>>> formats with.
>>> I will double-check with the office in Japan, but I don't think that
>>> they have one either.
>> Tomi, is this something you could test ?
> Replying to myself, this is something we could test, but let's not delay
> this series, new formats can always be added on top.

Ok, great.  Thanks very much.


Damian

>>>>> There's no need to send
>>>>> a v2, I can handle the simple change in the commit message if you let me
>>>>> know whether my comment is right or wrong.

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

end of thread, other threads:[~2023-08-14 16:34 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-28 20:07 [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support Damian Hobson-Garcia
2023-07-28 20:07 ` Damian Hobson-Garcia
2023-07-28 20:07 ` [PATCH 2/2] drm:rcar-du: Enable ABGR and XBGR formats Damian Hobson-Garcia
2023-07-28 20:07   ` Damian Hobson-Garcia
2023-08-03 23:49   ` Laurent Pinchart
2023-08-03 23:49     ` Laurent Pinchart
2023-08-03 23:47 ` [PATCH 1/2] drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support Laurent Pinchart
2023-08-03 23:47   ` Laurent Pinchart
2023-08-03 23:53   ` Laurent Pinchart
2023-08-03 23:53     ` Laurent Pinchart
2023-08-04  0:06     ` Laurent Pinchart
2023-08-04  0:06       ` Laurent Pinchart
2023-08-04 15:49       ` Damian Hobson-Garcia
2023-08-04 15:49         ` Damian Hobson-Garcia
2023-08-04 15:52         ` Laurent Pinchart
2023-08-04 15:52           ` Laurent Pinchart
2023-08-14 10:46           ` Laurent Pinchart
2023-08-14 10:46             ` Laurent Pinchart
2023-08-14 16:27             ` Damian Hobson-Garcia
2023-08-14 16:27               ` Damian Hobson-Garcia

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.