Skip to contentSkip to conversation

drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support

PATCH In review Damian Hobson-Garcia 2 participants 10 messages Jul 28, 2023 – Aug 14, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm: rcar-du: Add more formats to DRM_MODE_BLEND_PIXEL_NONE support

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.

---
 drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
 1 file changed, 32 insertions(+), 17 deletions(-)
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +32 -17
index 45c05d0ffc70..96241c03b60f 100644
@@ -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;
 
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 drm:rcar-du: Enable ABGR and XBGR formats

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

---
 drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +8 -0
index 96241c03b60f..d61bb2e44c06 100644
@@ -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;
Signature · 1 line
2.25.1
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm:rcar-du: Enable ABGR and XBGR formats

Hi Damian,

Thank you for the patch.

Quoted 4 lines · Damian Hobson-Garcia

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

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

Quoted 37 lines
---
 drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +8 -0
index 96241c03b60f..d61bb2e44c06 100644
@@ -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;
Signature · 3 lines
Regards,

Laurent Pinchart
#3 lore raw
In reply to Damian Hobson-Garcia

Hi Damian,

Thank you for the patch.

Quoted 1 line · Damian Hobson-Garcia

Add additional pixel formats for which blending is disabling when

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

Quoted 33 lines

DRM_MODE_BLEND_PIXEL_NONE is set.

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

---
 drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
 1 file changed, 32 insertions(+), 17 deletions(-)
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +15 -0
index 45c05d0ffc70..96241c03b60f 100644
@@ -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:

drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c static const u32 rcar_du_vsp_formats_gen4[] = { · line 203

Quoted 10 lines
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +10 -0
+			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 ?

Quoted 41 lines
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +7 -17
+		}
+	}
+
+	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;
 
Signature · 3 lines
Regards,

Laurent Pinchart
#4 lore raw
Quoted 47 lines · Laurent Pinchart

Hi Damian,

Thank you for the patch.

Quoted 1 line · Damian Hobson-Garcia

Add additional pixel formats for which blending is disabling when

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

Quoted 38 lines

DRM_MODE_BLEND_PIXEL_NONE is set.

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

---
 drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
 1 file changed, 32 insertions(+), 17 deletions(-)
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +20 -0
index 45c05d0ffc70..96241c03b60f 100644
@@ -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;
Quoted 8 lines

drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c static const u32 rcar_du_vsp_formats_gen4[] = { · line 203

Quoted 5 lines
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +5 -0
+			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.

Quoted 41 lines
Quoted 41 lines
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +7 -17
+		}
+	}
+
+	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;
 
Signature · 3 lines
Regards,

Laurent Pinchart
#5 lore raw
Quoted 57 lines · Laurent Pinchart
Quoted 47 lines · Laurent Pinchart

Hi Damian,

Thank you for the patch.

Quoted 1 line · Damian Hobson-Garcia

Add additional pixel formats for which blending is disabling when

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

Quoted 38 lines

DRM_MODE_BLEND_PIXEL_NONE is set.

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

---
 drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
 1 file changed, 32 insertions(+), 17 deletions(-)
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +20 -0
index 45c05d0ffc70..96241c03b60f 100644
@@ -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;
Quoted 8 lines

drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c static const u32 rcar_du_vsp_formats_gen4[] = { · line 203

Quoted 5 lines
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +5 -0
+			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 ?

Quoted 3 lines

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 ?

Quoted 45 lines

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.

Quoted 41 lines
Quoted 41 lines
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +7 -17
+		}
+	}
+
+	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;
 
Signature · 3 lines
Regards,

Laurent Pinchart
#6 lore raw

Hi Laurent,

Thank you for the review.

Quoted 9 lines · Laurent Pinchart
Quoted 8 lines · Laurent Pinchart
Quoted 7 lines · Laurent Pinchart

Hi Damian,

Thank you for the patch.

Quoted 1 line · Damian Hobson-Garcia

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.

Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Quoted 38 lines

DRM_MODE_BLEND_PIXEL_NONE is set.

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

---
  drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
  1 file changed, 32 insertions(+), 17 deletions(-)
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +19 -0
index 45c05d0ffc70..96241c03b60f 100644
@@ -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:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c static const u32 rcar_du_vsp_formats_gen4[] = { · line 203

Quoted 6 lines
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +6 -0
+			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).

Quoted 3 lines
Quoted 3 lines

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.

Quoted 4 lines

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.

Quoted 4 lines
Quoted 4 lines

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

#7 lore raw

Hi Damian,

(CC'ing Tomi)

Quoted 73 lines · Damian Hobson-Garcia
Quoted 9 lines · Laurent Pinchart
Quoted 8 lines · Laurent Pinchart
Quoted 7 lines · Laurent Pinchart

Hi Damian,

Thank you for the patch.

Quoted 1 line · Damian Hobson-Garcia

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.

Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Quoted 38 lines

DRM_MODE_BLEND_PIXEL_NONE is set.

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

---
  drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
  1 file changed, 32 insertions(+), 17 deletions(-)
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +19 -0
index 45c05d0ffc70..96241c03b60f 100644
@@ -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:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c static const u32 rcar_du_vsp_formats_gen4[] = { · line 203

Quoted 6 lines
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +6 -0
+			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).

Quoted 3 lines
Quoted 3 lines

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.

Quoted 4 lines

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 ?

Quoted 4 lines

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 ?

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

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.

Signature · 3 lines
Regards,

Laurent Pinchart
#8 lore raw
Quoted 10 lines · Laurent Pinchart
Quoted 9 lines · Damian Hobson-Garcia
Quoted 6 lines · Laurent Pinchart
Quoted 5 lines · Laurent Pinchart
Quoted 4 lines · Laurent Pinchart
Quoted 1 line · Damian Hobson-Garcia

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.

Quoted 62 lines
Quoted 62 lines
Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Quoted 38 lines

DRM_MODE_BLEND_PIXEL_NONE is set.

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

---
  drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
  1 file changed, 32 insertions(+), 17 deletions(-)
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +20 -0
index 45c05d0ffc70..96241c03b60f 100644
@@ -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;
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c static const u32 rcar_du_vsp_formats_gen4[] = { · line 203

Quoted 5 lines
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +5 -0
+			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).

Quoted 3 lines
Quoted 3 lines

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.

Quoted 4 lines

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 ?

Quoted 6 lines
Quoted 4 lines

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.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

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.

Signature · 3 lines
Regards,

Laurent Pinchart
#9 lore raw

Hi Laurent,

Quoted 10 lines · Laurent Pinchart
Quoted 8 lines · Laurent Pinchart
Quoted 7 lines · Damian Hobson-Garcia
Quoted 5 lines · Laurent Pinchart
Quoted 4 lines · Laurent Pinchart
Quoted 3 lines · Laurent Pinchart
Quoted 1 line · Damian Hobson-Garcia

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.

Quoted 59 lines
Quoted 59 lines
Quoted 59 lines
Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Quoted 38 lines

DRM_MODE_BLEND_PIXEL_NONE is set.

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

---
   drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c | 49 ++++++++++++-------
   1 file changed, 32 insertions(+), 17 deletions(-)
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +19 -0
index 45c05d0ffc70..96241c03b60f 100644
@@ -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:
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c static const u32 rcar_du_vsp_formats_gen4[] = { · line 203

Quoted 6 lines
drivers/gpu/drm/renesas/rcar-du/rcar_du_vsp.c +6 -0
+			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).

Quoted 3 lines
Quoted 3 lines

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.

Quoted 4 lines

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 ?

Quoted 7 lines
Quoted 5 lines
Quoted 4 lines

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

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

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.