Skip to contentSkip to conversation

omap3isp: does not allow pipeline with multiple video outputs yet

PATCH Superseded David Cohen 1 participant 2 messages Nov 19, 2010 Media (V4L/DVB)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omap3isp: does not allow pipeline with multiple video outputs yet

OMAP3 ISP driver does not support pipeline with multiple video outputs yet. Driver must return -EBUSY in this case.

---
 drivers/media/video/isp/ispccdc.c    |   26 ++++++++++++++++++++------
 drivers/media/video/isp/ispcsi2.c    |   19 +++++++++++++++----
 drivers/media/video/isp/isppreview.c |   19 +++++++++++++++----
 3 files changed, 50 insertions(+), 14 deletions(-)
drivers/media/video/isp/ispccdc.c +20 -6
index a4c6444..a19795c 100644
@@ -2016,30 +2016,44 @@ static int ccdc_link_setup(struct media_entity *entity,
 
 		break;
 
+	/*
+	 * This driver currently does not support pipeline with multiples
+	 * video outputs. It must return -EBUSY while it's not implemented.
+	 */
+
 	case CCDC_PAD_SOURCE_VP | (MEDIA_ENTITY_TYPE_SUBDEV << 16):
 		/* Write to preview engine, histogram and H3A. When none of
 		 * those links are active, the video port can be disabled.
 		 */
-		if (flags & MEDIA_LINK_FLAG_ACTIVE)
+		if (flags & MEDIA_LINK_FLAG_ACTIVE) {
+			if (ccdc->output & ~CCDC_OUTPUT_PREVIEW)
+				return -EBUSY;
 			ccdc->output |= CCDC_OUTPUT_PREVIEW;
-		else
+		} else {
 			ccdc->output &= ~CCDC_OUTPUT_PREVIEW;
+		}
 		break;
 
 	case CCDC_PAD_SOURCE_OF | (MEDIA_ENTITY_TYPE_NODE << 16):
 		/* Write to memory */
-		if (flags & MEDIA_LINK_FLAG_ACTIVE)
+		if (flags & MEDIA_LINK_FLAG_ACTIVE) {
+			if (ccdc->output & ~CCDC_OUTPUT_MEMORY)
+				return -EBUSY;
 			ccdc->output |= CCDC_OUTPUT_MEMORY;
-		else
+		} else {
 			ccdc->output &= ~CCDC_OUTPUT_MEMORY;
+		}
 		break;
 
 	case CCDC_PAD_SOURCE_OF | (MEDIA_ENTITY_TYPE_SUBDEV << 16):
 		/* Write to resizer */
-		if (flags & MEDIA_LINK_FLAG_ACTIVE)
+		if (flags & MEDIA_LINK_FLAG_ACTIVE) {
+			if (ccdc->output & ~CCDC_OUTPUT_RESIZER)
+				return -EBUSY;
 			ccdc->output |= CCDC_OUTPUT_RESIZER;
-		else
+		} else {
 			ccdc->output &= ~CCDC_OUTPUT_RESIZER;
+		}
 		break;
 
 	default:
drivers/media/video/isp/ispcsi2.c +15 -4
index 65c777a..8052b38 100644
@@ -1088,19 +1088,30 @@ static int csi2_link_setup(struct media_entity *entity,
 	struct isp_csi2_device *csi2 = v4l2_get_subdevdata(sd);
 	struct isp_csi2_ctrl_cfg *ctrl = &csi2->ctrl;
 
+	/*
+	 * This driver currently does not support pipeline with multiples
+	 * video outputs. It must return -EBUSY while it's not implemented.
+	 */
+
 	switch (local->index | (remote->entity->type << 16)) {
 	case CSI2_PAD_SOURCE | (MEDIA_ENTITY_TYPE_NODE << 16):
-		if (flags & MEDIA_LINK_FLAG_ACTIVE)
+		if (flags & MEDIA_LINK_FLAG_ACTIVE) {
+			if (csi2->output & ~CSI2_OUTPUT_MEMORY)
+				return -EBUSY;
 			csi2->output |= CSI2_OUTPUT_MEMORY;
-		else
+		} else {
 			csi2->output &= ~CSI2_OUTPUT_MEMORY;
+		}
 		break;
 
 	case CSI2_PAD_SOURCE | (MEDIA_ENTITY_TYPE_SUBDEV << 16):
-		if (flags & MEDIA_LINK_FLAG_ACTIVE)
+		if (flags & MEDIA_LINK_FLAG_ACTIVE) {
+			if (csi2->output & ~CSI2_OUTPUT_MEMORY)
+				return -EBUSY;
 			csi2->output |= CSI2_OUTPUT_CCDC;
-		else
+		} else {
 			csi2->output &= ~CSI2_OUTPUT_CCDC;
+		}
 		break;
 
 	default:
drivers/media/video/isp/isppreview.c +15 -4
index 6274b44..39d4da4 100644
@@ -2026,20 +2026,31 @@ static int preview_link_setup(struct media_entity *entity,
 		}
 		break;
 
+	/*
+	 * This driver currently does not support pipeline with multiples
+	 * video outputs. It must return -EBUSY while it's not implemented.
+	 */
+
 	case PREV_PAD_SOURCE | (MEDIA_ENTITY_TYPE_NODE << 16):
 		/* write to memory */
-		if (flags & MEDIA_LINK_FLAG_ACTIVE)
+		if (flags & MEDIA_LINK_FLAG_ACTIVE) {
+			if (prev->output & ~PREVIEW_OUTPUT_MEMORY)
+				return -EBUSY;
 			prev->output |= PREVIEW_OUTPUT_MEMORY;
-		else
+		} else {
 			prev->output &= ~PREVIEW_OUTPUT_MEMORY;
+		}
 		break;
 
 	case PREV_PAD_SOURCE | (MEDIA_ENTITY_TYPE_SUBDEV << 16):
 		/* write to resizer */
-		if (flags & MEDIA_LINK_FLAG_ACTIVE)
+		if (flags & MEDIA_LINK_FLAG_ACTIVE) {
+			if (prev->output & ~PREVIEW_OUTPUT_RESIZER)
+				return -EBUSY;
 			prev->output |= PREVIEW_OUTPUT_RESIZER;
-		else
+		} else {
 			prev->output &= ~PREVIEW_OUTPUT_RESIZER;
+		}
 		break;
 
 	default:
Signature · 1 line
1.7.2.3
#1 lore raw
Quoted 10 lines · Cohen David (Nokia-MS/Helsinki)

OMAP3 ISP driver does not support pipeline with multiple video outputs yet. Driver must return -EBUSY in this case.

---
 drivers/media/video/isp/ispccdc.c    |   26 ++++++++++++++++++++------
 drivers/media/video/isp/ispcsi2.c    |   19 +++++++++++++++----
 drivers/media/video/isp/isppreview.c |   19 +++++++++++++++----
 3 files changed, 50 insertions(+), 14 deletions(-)

[snip]

Quoted 20 lines
drivers/media/video/isp/ispcsi2.c +8 -1
index 65c777a..8052b38 100644
@@ -1088,19 +1088,30 @@ static int csi2_link_setup(struct media_entity *entity,
 	struct isp_csi2_device *csi2 = v4l2_get_subdevdata(sd);
 	struct isp_csi2_ctrl_cfg *ctrl = &csi2->ctrl;
 
+	/*
+	 * This driver currently does not support pipeline with multiples
+	 * video outputs. It must return -EBUSY while it's not implemented.
+	 */
+
 	switch (local->index | (remote->entity->type << 16)) {
 	case CSI2_PAD_SOURCE | (MEDIA_ENTITY_TYPE_NODE << 16):
-		if (flags & MEDIA_LINK_FLAG_ACTIVE)
+		if (flags & MEDIA_LINK_FLAG_ACTIVE) {
+			if (csi2->output & ~CSI2_OUTPUT_MEMORY)
+				return -EBUSY;
 			csi2->output |= CSI2_OUTPUT_MEMORY;

drivers/media/video/isp/ispcsi2.c static int csi2_link_setup(struct media_entity *entity, · line 1109

Quoted 10 lines
drivers/media/video/isp/ispcsi2.c +4 -2
-		else
+		} else {
 			csi2->output &= ~CSI2_OUTPUT_MEMORY;
+		}
 		break;
 
 	case CSI2_PAD_SOURCE | (MEDIA_ENTITY_TYPE_SUBDEV << 16):
-		if (flags & MEDIA_LINK_FLAG_ACTIVE)
+		if (flags & MEDIA_LINK_FLAG_ACTIVE) {
+			if (csi2->output & ~CSI2_OUTPUT_MEMORY)

There is a typo here. Please, change ~CSI2_OUTPUT_MEMORY to ~CSI2_OUTPUT_CCDC here before test it. I'll send a new version after get comments.

Br,

David Cohen

Quoted 51 lines
drivers/media/video/isp/ispcsi2.c +3 -1
+				return -EBUSY;
 			csi2->output |= CSI2_OUTPUT_CCDC;
-		else
+		} else {
 			csi2->output &= ~CSI2_OUTPUT_CCDC;
+		}
 		break;
 
 	default:
drivers/media/video/isp/isppreview.c +15 -4
index 6274b44..39d4da4 100644
@@ -2026,20 +2026,31 @@ static int preview_link_setup(struct media_entity *entity,
 		}
 		break;
 
+	/*
+	 * This driver currently does not support pipeline with multiples
+	 * video outputs. It must return -EBUSY while it's not implemented.
+	 */
+
 	case PREV_PAD_SOURCE | (MEDIA_ENTITY_TYPE_NODE << 16):
 		/* write to memory */
-		if (flags & MEDIA_LINK_FLAG_ACTIVE)
+		if (flags & MEDIA_LINK_FLAG_ACTIVE) {
+			if (prev->output & ~PREVIEW_OUTPUT_MEMORY)
+				return -EBUSY;
 			prev->output |= PREVIEW_OUTPUT_MEMORY;
-		else
+		} else {
 			prev->output &= ~PREVIEW_OUTPUT_MEMORY;
+		}
 		break;
 
 	case PREV_PAD_SOURCE | (MEDIA_ENTITY_TYPE_SUBDEV << 16):
 		/* write to resizer */
-		if (flags & MEDIA_LINK_FLAG_ACTIVE)
+		if (flags & MEDIA_LINK_FLAG_ACTIVE) {
+			if (prev->output & ~PREVIEW_OUTPUT_RESIZER)
+				return -EBUSY;
 			prev->output |= PREVIEW_OUTPUT_RESIZER;
-		else
+		} else {
 			prev->output &= ~PREVIEW_OUTPUT_RESIZER;
+		}
 		break;
 
 	default:
Signature · 1 line
1.7.2.3