Skip to contentSkip to conversation

media: mali-c55: Disable colour space conversion for RGB outputs

PATCH In review David Carlier 3 participants 3 messages Oct 6 – Nov 10

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

PATCH 1/1 media: mali-c55: Disable colour space conversion for RGB outputs

The colour space conversion block is only programmed for YUV formats, and its configuration is kept across streaming sessions. An RGB stream started after a YUV one thus still converts its output to YUV.

Clear the conversion configuration for non-YUV formats.

Fixes d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver")
Assisted-by LLM
---
 drivers/media/platform/arm/mali-c55/mali-c55-capture.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/media/platform/arm/mali-c55/mali-c55-capture.c +4 -0
index ff01553026fb..2425a069a939 100644
@@ -577,6 +577,10 @@ static void mali_c55_cap_dev_format_configure(struct mali_c55_cap_dev *cap_dev)
 				MALI_C55_REG_CS_CONV_CONFIG,
 				MALI_C55_CS_CONV_FILTER_MASK,
 				MALI_C55_CS_CONV_FILTER_ENABLE);
+	} else {
+		/* Don't inherit the conversion set up by a previous YUV stream. */
+		mali_c55_cap_dev_write(cap_dev, MALI_C55_REG_CS_CONV_CONFIG,
+				       0);
 	}
 }
 
Signature · 1 line
2.55.0
maintainer Reviewed-by on v1 1/1
#1 lore raw

Morning David, thanks for the patch

Quoted 19 lines · David Carlier

The colour space conversion block is only programmed for YUV formats, and its configuration is kept across streaming sessions. An RGB stream started after a YUV one thus still converts its output to YUV.

Clear the conversion configuration for non-YUV formats.

Fixes d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver")
Assisted-by LLM
---
  drivers/media/platform/arm/mali-c55/mali-c55-capture.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/media/platform/arm/mali-c55/mali-c55-capture.c +0 -0
index ff01553026fb..2425a069a939 100644

drivers/media/platform/arm/mali-c55/mali-c55-capture.c static void mali_c55_cap_dev_format_configure(struct mali_c55_cap_dev *cap_dev) · line 583

Quoted 7 lines
drivers/media/platform/arm/mali-c55/mali-c55-capture.c +4 -0
@@ -577,6 +577,10 @@ static void mali_c55_cap_dev_format_configure(struct mali_c55_cap_dev *cap_dev)
  				MALI_C55_REG_CS_CONV_CONFIG,
  				MALI_C55_CS_CONV_FILTER_MASK,
  				MALI_C55_CS_CONV_FILTER_ENABLE);
+	} else {
+		/* Don't inherit the conversion set up by a previous YUV stream. */
+		mali_c55_cap_dev_write(cap_dev, MALI_C55_REG_CS_CONV_CONFIG,
+				       0);

Makes sense to me:

Quoted 3 lines
drivers/media/platform/arm/mali-c55/mali-c55-capture.c +0 -0
  	}
  }
 
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to David Carlier

Hi David

Quoted 19 lines · David Carlier

The colour space conversion block is only programmed for YUV formats, and its configuration is kept across streaming sessions. An RGB stream started after a YUV one thus still converts its output to YUV.

Clear the conversion configuration for non-YUV formats.

Fixes d5f281f3dd29 ("media: mali-c55: Add Mali-C55 ISP driver")
Assisted-by LLM
---
 drivers/media/platform/arm/mali-c55/mali-c55-capture.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/media/platform/arm/mali-c55/mali-c55-capture.c +0 -0
index ff01553026fb..2425a069a939 100644

drivers/media/platform/arm/mali-c55/mali-c55-capture.c static void mali_c55_cap_dev_format_configure(struct mali_c55_cap_dev *cap_dev) · line 583

Quoted 7 lines
drivers/media/platform/arm/mali-c55/mali-c55-capture.c +4 -0
@@ -577,6 +577,10 @@ static void mali_c55_cap_dev_format_configure(struct mali_c55_cap_dev *cap_dev)
 				MALI_C55_REG_CS_CONV_CONFIG,
 				MALI_C55_CS_CONV_FILTER_MASK,
 				MALI_C55_CS_CONV_FILTER_ENABLE);
+	} else {
+		/* Don't inherit the conversion set up by a previous YUV stream. */
+		mali_c55_cap_dev_write(cap_dev, MALI_C55_REG_CS_CONV_CONFIG,
+				       0);

nit: fits on one line. I'll adjust it when applying.

The patch seems correct to me

Thanks
j

Quoted 6 lines
drivers/media/platform/arm/mali-c55/mali-c55-capture.c +0 -1
 	}
 }
 
--

2.55.0