All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
To: linux-media@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
	Sakari Ailus <sakari.ailus@iki.fi>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>
Subject: [RFC PATCH v1 13/19] media: renesas: vsp1: Compute partitions for DRM pipelines
Date: Wed, 22 Nov 2023 06:30:03 +0200	[thread overview]
Message-ID: <20231122043009.2741-14-laurent.pinchart+renesas@ideasonboard.com> (raw)
In-Reply-To: <20231122043009.2741-1-laurent.pinchart+renesas@ideasonboard.com>

The DRM pipelines don't partition frames, as the hardware operates
synchronously with the display. The entity operations access
configuration data from the entity state in that case, instead of
accessing the partition structure. This requires special cases in
entity-specific code, increasing the driver complexity.

To prepare for simplifying the code, initialize a single partition for
the DRM pipelines, similarly to how video pipelines create one partition
spanning the full image when partitioning isn't needed. The partition is
allocated statically in the vsp1_drm_pipeline structure instead of
dynamically as for video pipelines, as DRM pipelines are guaranteed to
operate on a single partition.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/media/platform/renesas/vsp1/vsp1_drm.c | 9 ++++++++-
 drivers/media/platform/renesas/vsp1/vsp1_drm.h | 2 ++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drm.c b/drivers/media/platform/renesas/vsp1/vsp1_drm.c
index e44359b661b6..11313e26a298 100644
--- a/drivers/media/platform/renesas/vsp1/vsp1_drm.c
+++ b/drivers/media/platform/renesas/vsp1/vsp1_drm.c
@@ -550,6 +550,9 @@ static void vsp1_du_pipeline_configure(struct vsp1_pipeline *pipe)
 	struct vsp1_dl_body *dlb;
 	unsigned int dl_flags = 0;
 
+	vsp1_pipeline_calculate_partition(pipe, &pipe->part_table[0],
+					  drm_pipe->width, 0);
+
 	if (drm_pipe->force_brx_release)
 		dl_flags |= VSP1_DL_FRAME_END_INTERNAL;
 	if (pipe->output->writeback)
@@ -573,7 +576,8 @@ static void vsp1_du_pipeline_configure(struct vsp1_pipeline *pipe)
 		vsp1_entity_route_setup(entity, pipe, dlb);
 		vsp1_entity_configure_stream(entity, pipe, dl, dlb);
 		vsp1_entity_configure_frame(entity, pipe, dl, dlb);
-		vsp1_entity_configure_partition(entity, pipe, NULL, dl, dlb);
+		vsp1_entity_configure_partition(entity, pipe,
+						&pipe->part_table[0], dl, dlb);
 	}
 
 	vsp1_dl_list_commit(dl, dl_flags);
@@ -968,6 +972,9 @@ int vsp1_drm_init(struct vsp1_device *vsp1)
 
 		vsp1_pipeline_init(pipe);
 
+		pipe->partitions = 1;
+		pipe->part_table = &drm_pipe->partition;
+
 		pipe->frame_end = vsp1_du_pipeline_frame_end;
 
 		/*
diff --git a/drivers/media/platform/renesas/vsp1/vsp1_drm.h b/drivers/media/platform/renesas/vsp1/vsp1_drm.h
index ab8b7e3161a2..3fd95b53f27e 100644
--- a/drivers/media/platform/renesas/vsp1/vsp1_drm.h
+++ b/drivers/media/platform/renesas/vsp1/vsp1_drm.h
@@ -20,6 +20,7 @@
 /**
  * struct vsp1_drm_pipeline - State for the API exposed to the DRM driver
  * @pipe: the VSP1 pipeline used for display
+ * @partition: the pre-calculated partition used by the pipeline
  * @width: output display width
  * @height: output display height
  * @force_brx_release: when set, release the BRx during the next reconfiguration
@@ -31,6 +32,7 @@
  */
 struct vsp1_drm_pipeline {
 	struct vsp1_pipeline pipe;
+	struct vsp1_partition partition;
 
 	unsigned int width;
 	unsigned int height;
-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2023-11-22  4:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22  4:29 [RFC PATCH v1 00/19] media: renesas: vsp1: Conversion to subdev active state Laurent Pinchart
2023-11-22  4:29 ` [RFC PATCH v1 01/19] media: renesas: vsp1: Drop vsp1_entity_get_pad_format() wrapper Laurent Pinchart
2023-11-22  4:29 ` [RFC PATCH v1 02/19] media: renesas: vsp1: Drop vsp1_entity_get_pad_selection() wrapper Laurent Pinchart
2023-11-22  4:29 ` [RFC PATCH v1 03/19] media: renesas: vsp1: Drop vsp1_rwpf_get_crop() wrapper Laurent Pinchart
2023-11-22  4:29 ` [RFC PATCH v1 04/19] media: renesas: vsp1: Drop brx_get_compose() wrapper Laurent Pinchart
2023-11-22  4:29 ` [RFC PATCH v1 05/19] media: renesas: vsp1: Drop custom .get_fmt() handler for histogram Laurent Pinchart
2023-11-22  4:29 ` [RFC PATCH v1 06/19] media: renesas: vsp1: Move partition calculation to vsp1_pipe.c Laurent Pinchart
2023-11-22  4:29 ` [RFC PATCH v1 07/19] media: renesas: vsp1: Simplify partition calculation Laurent Pinchart
2023-11-22  4:29 ` [RFC PATCH v1 08/19] media: renesas: vsp1: Store RPF partition configuration per RPF instance Laurent Pinchart
2023-11-22  4:29 ` [RFC PATCH v1 09/19] media: renesas: vsp1: Pass partition pointer to .configure_partition() Laurent Pinchart
2023-11-22  4:30 ` [RFC PATCH v1 10/19] media: renesas: vsp1: Replace vsp1_partition_window with v4l2_rect Laurent Pinchart
2023-11-22  4:30 ` [RFC PATCH v1 11/19] media: renesas: vsp1: Add and use function to dump a pipeline to the log Laurent Pinchart
2023-11-22  4:30 ` [RFC PATCH v1 12/19] media: renesas: vsp1: Keep the DRM pipeline entities sorted Laurent Pinchart
2023-11-22  4:30 ` Laurent Pinchart [this message]
2023-11-22  4:30 ` [RFC PATCH v1 14/19] media: renesas: vsp1: Get configuration from partition instead of state Laurent Pinchart
2023-11-22  4:30 ` [RFC PATCH v1 15/19] media: renesas: vsp1: Name parameters to entity operations Laurent Pinchart
2023-11-22  4:30 ` [RFC PATCH v1 16/19] media: renesas: vsp1: Pass subdev state " Laurent Pinchart
2023-11-22  4:30 ` [RFC PATCH v1 17/19] media: renesas: vsp1: Initialize control handler after subdev Laurent Pinchart
2023-11-22  4:30 ` [RFC PATCH v1 18/19] media: renesas: vsp1: Switch to V4L2 subdev active state Laurent Pinchart
2023-11-22  4:30 ` [RFC PATCH v1 19/19] media: renesas: vsp1: Rename all v4l2_subdev_state variables to 'state' Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231122043009.2741-14-laurent.pinchart+renesas@ideasonboard.com \
    --to=laurent.pinchart+renesas@ideasonboard.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=sakari.ailus@iki.fi \
    --cc=tomi.valkeinen@ideasonboard.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.