On 30/07/2022 14:21, Sakari Ailus wrote:
Moi,
On Wed, Jul 27, 2022 at 01:36:14PM +0300, Tomi Valkeinen wrote:
From: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
Replace direct access to the pipe field in drivers with a new helper
function. This will allow easier refactoring of media pipeline handling
in the MC core behind the scenes without affecting drivers.
Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@xxxxxxxxxxxxxxxx>
---
drivers/media/mc/mc-entity.c | 6 ++++++
.../platform/renesas/rcar-vin/rcar-core.c | 5 ++---
.../media/platform/renesas/rcar-vin/rcar-dma.c | 2 +-
drivers/media/platform/ti/omap3isp/isp.c | 4 +---
drivers/media/platform/ti/omap3isp/ispvideo.c | 3 +--
drivers/media/platform/ti/omap3isp/ispvideo.h | 11 +++++++++--
drivers/media/platform/xilinx/xilinx-dma.c | 3 +--
drivers/media/platform/xilinx/xilinx-dma.h | 7 ++++++-
drivers/staging/media/imx/imx-media-utils.c | 2 +-
drivers/staging/media/omap4iss/iss.c | 4 +---
drivers/staging/media/omap4iss/iss_video.c | 3 +--
drivers/staging/media/omap4iss/iss_video.h | 11 +++++++++--
include/media/media-entity.h | 18 ++++++++++++++++++
13 files changed, 57 insertions(+), 22 deletions(-)
diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c
index 9f4a1c98dc43..50872d953cf9 100644
--- a/drivers/media/mc/mc-entity.c
+++ b/drivers/media/mc/mc-entity.c
@@ -923,6 +923,12 @@ int media_entity_get_fwnode_pad(struct media_entity *entity,
}
EXPORT_SYMBOL_GPL(media_entity_get_fwnode_pad);
+struct media_pipeline *media_entity_pipeline(struct media_entity *entity)
+{
+ return entity->pipe;
I'd make this an inline function. Or do you plan to add more code later?
I have this in my work tree due to comments from Satish:
struct media_pipeline *media_entity_pipeline(struct media_entity *entity)
{
struct media_pipeline *pipe;
struct media_pad *pad;
if (entity->num_pads == 0)
return NULL;
pipe = entity->pads->pipe;
media_entity_for_each_pad(entity, pad) {
if (WARN_ON(pad->pipe != pipe))
return NULL;
}
return pipe;
}
Tomi