media: renesas: vsp1: Store RPF partition configuration per RPF instance
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sun, 19 Nov 2023 01:11:51 +0000 (03:11 +0200)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 19 Jun 2024 22:36:47 +0000 (01:36 +0300)
The vsp1_partition structure stores the RPF partition configuration in a
single field for all RPF instances, while each RPF can have its own
configuration. Fix it by storing the configuration separately for each
RPF instance.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Fixes: ab45e8585182 ("media: v4l: vsp1: Allow entities to participate in the partition algorithm")
Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
drivers/media/platform/renesas/vsp1/vsp1_pipe.h
drivers/media/platform/renesas/vsp1/vsp1_rpf.c

index 02e98d8437303a770ffed102982241c299b820ab..840fd3288efb02f30604a6dcb117721853f29292 100644 (file)
@@ -73,7 +73,7 @@ struct vsp1_partition_window {
  * @wpf: The WPF partition window configuration
  */
 struct vsp1_partition {
-       struct vsp1_partition_window rpf;
+       struct vsp1_partition_window rpf[VSP1_MAX_RPF];
        struct vsp1_partition_window uds_sink;
        struct vsp1_partition_window uds_source;
        struct vsp1_partition_window sru;
index 3e62638fdce606ff4380a0da009b7e8b942766a2..42b0c5655404149d65f00cf56df4cc6a2f1e09f6 100644 (file)
@@ -311,8 +311,8 @@ static void rpf_configure_partition(struct vsp1_entity *entity,
         * 'width' need to be adjusted.
         */
        if (pipe->partitions > 1) {
-               crop.width = pipe->partition->rpf.width;
-               crop.left += pipe->partition->rpf.left;
+               crop.width = pipe->partition->rpf[rpf->entity.index].width;
+               crop.left += pipe->partition->rpf[rpf->entity.index].left;
        }
 
        if (pipe->interlaced) {
@@ -367,7 +367,9 @@ static void rpf_partition(struct vsp1_entity *entity,
                          unsigned int partition_idx,
                          struct vsp1_partition_window *window)
 {
-       partition->rpf = *window;
+       struct vsp1_rwpf *rpf = to_rwpf(&entity->subdev);
+
+       partition->rpf[rpf->entity.index] = *window;
 }
 
 static const struct vsp1_entity_operations rpf_entity_ops = {