linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] R-Car VSP miscellaneous fixes
@ 2016-05-19 23:41 Laurent Pinchart
  2016-05-19 23:41 ` [PATCH 1/3] v4l: vsp1: Fix typo in register field names Laurent Pinchart
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Laurent Pinchart @ 2016-05-19 23:41 UTC (permalink / raw)
  To: linux-media; +Cc: linux-renesas-soc

Hello,

This series fixes three unrelated issues in the R-Car VSP driver. Please see
individual patches for details.

Laurent Pinchart (3):
  v4l: vsp1: Fix typo in register field names
  v4l: vsp1: Fix descriptions of Gen2 VSP instances
  v4l: vsp1: Fix crash when resetting pipeline

 drivers/media/platform/vsp1/vsp1_drv.c  |  6 +++---
 drivers/media/platform/vsp1/vsp1_pipe.c | 14 +++++++++-----
 drivers/media/platform/vsp1/vsp1_regs.h |  8 ++++----
 3 files changed, 16 insertions(+), 12 deletions(-)

-- 
Regards,

Laurent Pinchart


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

* [PATCH 1/3] v4l: vsp1: Fix typo in register field names
  2016-05-19 23:41 [PATCH 0/3] R-Car VSP miscellaneous fixes Laurent Pinchart
@ 2016-05-19 23:41 ` Laurent Pinchart
  2016-05-19 23:41 ` [PATCH 2/3] v4l: vsp1: Fix descriptions of Gen2 VSP instances Laurent Pinchart
  2016-05-19 23:41 ` [PATCH 3/3] v4l: vsp1: Fix crash when resetting pipeline Laurent Pinchart
  2 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2016-05-19 23:41 UTC (permalink / raw)
  To: linux-media; +Cc: linux-renesas-soc

The VI6_RPF_ALPH_SEL ALPHA0 and ALPHA1 fields are inverted, swap them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/media/platform/vsp1/vsp1_regs.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_regs.h b/drivers/media/platform/vsp1/vsp1_regs.h
index 927b5fb94c48..7657545a75ed 100644
--- a/drivers/media/platform/vsp1/vsp1_regs.h
+++ b/drivers/media/platform/vsp1/vsp1_regs.h
@@ -154,10 +154,10 @@
 #define VI6_RPF_ALPH_SEL_AEXT_EXT	(1 << 18)
 #define VI6_RPF_ALPH_SEL_AEXT_ONE	(2 << 18)
 #define VI6_RPF_ALPH_SEL_AEXT_MASK	(3 << 18)
-#define VI6_RPF_ALPH_SEL_ALPHA0_MASK	(0xff << 8)
-#define VI6_RPF_ALPH_SEL_ALPHA0_SHIFT	8
-#define VI6_RPF_ALPH_SEL_ALPHA1_MASK	(0xff << 0)
-#define VI6_RPF_ALPH_SEL_ALPHA1_SHIFT	0
+#define VI6_RPF_ALPH_SEL_ALPHA1_MASK	(0xff << 8)
+#define VI6_RPF_ALPH_SEL_ALPHA1_SHIFT	8
+#define VI6_RPF_ALPH_SEL_ALPHA0_MASK	(0xff << 0)
+#define VI6_RPF_ALPH_SEL_ALPHA0_SHIFT	0
 
 #define VI6_RPF_VRTCOL_SET		0x0318
 #define VI6_RPF_VRTCOL_SET_LAYA_MASK	(0xff << 24)
-- 
2.7.3


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

* [PATCH 2/3] v4l: vsp1: Fix descriptions of Gen2 VSP instances
  2016-05-19 23:41 [PATCH 0/3] R-Car VSP miscellaneous fixes Laurent Pinchart
  2016-05-19 23:41 ` [PATCH 1/3] v4l: vsp1: Fix typo in register field names Laurent Pinchart
@ 2016-05-19 23:41 ` Laurent Pinchart
  2016-05-19 23:41 ` [PATCH 3/3] v4l: vsp1: Fix crash when resetting pipeline Laurent Pinchart
  2 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2016-05-19 23:41 UTC (permalink / raw)
  To: linux-media; +Cc: linux-renesas-soc

The number of UDS and WPF are set to incorrect values, fix them.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/media/platform/vsp1/vsp1_drv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c
index e655639af7e2..70e7a81e8255 100644
--- a/drivers/media/platform/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/vsp1/vsp1_drv.c
@@ -560,7 +560,7 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
 		.gen = 2,
 		.features = VSP1_HAS_BRU | VSP1_HAS_SRU,
 		.rpf_count = 5,
-		.uds_count = 1,
+		.uds_count = 3,
 		.wpf_count = 4,
 		.num_bru_inputs = 4,
 		.uapi = true,
@@ -570,7 +570,7 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
 		.features = VSP1_HAS_BRU | VSP1_HAS_LIF | VSP1_HAS_LUT,
 		.rpf_count = 4,
 		.uds_count = 1,
-		.wpf_count = 4,
+		.wpf_count = 1,
 		.num_bru_inputs = 4,
 		.uapi = true,
 	}, {
@@ -578,7 +578,7 @@ static const struct vsp1_device_info vsp1_device_infos[] = {
 		.gen = 2,
 		.features = VSP1_HAS_BRU | VSP1_HAS_LUT | VSP1_HAS_SRU,
 		.rpf_count = 5,
-		.uds_count = 3,
+		.uds_count = 1,
 		.wpf_count = 4,
 		.num_bru_inputs = 4,
 		.uapi = true,
-- 
2.7.3


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

* [PATCH 3/3] v4l: vsp1: Fix crash when resetting pipeline
  2016-05-19 23:41 [PATCH 0/3] R-Car VSP miscellaneous fixes Laurent Pinchart
  2016-05-19 23:41 ` [PATCH 1/3] v4l: vsp1: Fix typo in register field names Laurent Pinchart
  2016-05-19 23:41 ` [PATCH 2/3] v4l: vsp1: Fix descriptions of Gen2 VSP instances Laurent Pinchart
@ 2016-05-19 23:41 ` Laurent Pinchart
  2 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2016-05-19 23:41 UTC (permalink / raw)
  To: linux-media; +Cc: linux-renesas-soc

The vsp1_pipeline_reset() function loops over pipeline inputs and output
and resets them. When doing so it assumes both that the pipeline has
been correctly configured with an output, and that inputs are are stored
in the pipe inputs array at positions 0 to num_inputs-1.

Both the assumptions are incorrect. The pipeline might need to be reset
after a failed attempts to configure it, without any output specified.
Furthermore, inputs are stored in a positiong equal to their RPF index,
possibly creating holes in the inputs array if the RPFs are not used in
sequence.

Fix both issues by looping over the whole inputs array and skipping
unused entries, and ignoring the output when not set.

Fixes: ff7e97c94d9f ("[media] v4l: vsp1: Store pipeline pointer in rwpf")
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/media/platform/vsp1/vsp1_pipe.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_pipe.c b/drivers/media/platform/vsp1/vsp1_pipe.c
index be47c8a1a812..3c6f623f056c 100644
--- a/drivers/media/platform/vsp1/vsp1_pipe.c
+++ b/drivers/media/platform/vsp1/vsp1_pipe.c
@@ -172,13 +172,17 @@ void vsp1_pipeline_reset(struct vsp1_pipeline *pipe)
 			bru->inputs[i].rpf = NULL;
 	}
 
-	for (i = 0; i < pipe->num_inputs; ++i) {
-		pipe->inputs[i]->pipe = NULL;
-		pipe->inputs[i] = NULL;
+	for (i = 0; i < ARRAY_SIZE(pipe->inputs); ++i) {
+		if (pipe->inputs[i]) {
+			pipe->inputs[i]->pipe = NULL;
+			pipe->inputs[i] = NULL;
+		}
 	}
 
-	pipe->output->pipe = NULL;
-	pipe->output = NULL;
+	if (pipe->output) {
+		pipe->output->pipe = NULL;
+		pipe->output = NULL;
+	}
 
 	INIT_LIST_HEAD(&pipe->entities);
 	pipe->state = VSP1_PIPELINE_STOPPED;
-- 
2.7.3


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

end of thread, other threads:[~2016-05-19 23:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-19 23:41 [PATCH 0/3] R-Car VSP miscellaneous fixes Laurent Pinchart
2016-05-19 23:41 ` [PATCH 1/3] v4l: vsp1: Fix typo in register field names Laurent Pinchart
2016-05-19 23:41 ` [PATCH 2/3] v4l: vsp1: Fix descriptions of Gen2 VSP instances Laurent Pinchart
2016-05-19 23:41 ` [PATCH 3/3] v4l: vsp1: Fix crash when resetting pipeline Laurent Pinchart

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