All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-media@vger.kernel.org
Cc: Sakari Ailus <sakari.ailus@iki.fi>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Eugen Hristev <eugen.hristev@collabora.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>
Subject: [PATCH 3/7] media: atmel-isc: Use accessors for pad config 'try_*' fields
Date: Tue, 24 Oct 2023 00:40:07 +0300	[thread overview]
Message-ID: <20231023214011.17730-4-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20231023214011.17730-1-laurent.pinchart@ideasonboard.com>

The 'try_*' fields of the v4l2_subdev_pad_config structure are meant to
be accessed through helper functions. Replace direct access with usage
of the v4l2_subdev_get_pad_format(), v4l2_subdev_get_pad_crop() and
v4l2_subdev_get_pad_compose() helpers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 .../staging/media/deprecated/atmel/atmel-isc-base.c    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/deprecated/atmel/atmel-isc-base.c b/drivers/staging/media/deprecated/atmel/atmel-isc-base.c
index 8e26663cecb6..b63eea8f4fc0 100644
--- a/drivers/staging/media/deprecated/atmel/atmel-isc-base.c
+++ b/drivers/staging/media/deprecated/atmel/atmel-isc-base.c
@@ -820,6 +820,8 @@ static int isc_try_configure_pipeline(struct isc_device *isc)
 static void isc_try_fse(struct isc_device *isc,
 			struct v4l2_subdev_state *sd_state)
 {
+	struct v4l2_rect *try_crop =
+		v4l2_subdev_get_pad_crop(isc->current_subdev->sd, sd_state, 0);
 	struct v4l2_subdev_frame_size_enum fse = {
 		.which = V4L2_SUBDEV_FORMAT_TRY,
 	};
@@ -841,11 +843,11 @@ static void isc_try_fse(struct isc_device *isc,
 	 * just use the maximum ISC can receive.
 	 */
 	if (ret) {
-		sd_state->pads->try_crop.width = isc->max_width;
-		sd_state->pads->try_crop.height = isc->max_height;
+		try_crop->width = isc->max_width;
+		try_crop->height = isc->max_height;
 	} else {
-		sd_state->pads->try_crop.width = fse.max_width;
-		sd_state->pads->try_crop.height = fse.max_height;
+		try_crop->width = fse.max_width;
+		try_crop->height = fse.max_height;
 	}
 }
 
-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2023-10-23 21:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23 21:40 [PATCH 0/7] media: v4l2-subdev: Rename pad config 'try_*' fields Laurent Pinchart
2023-10-23 21:40 ` [PATCH 1/7] media: atmel-isi: Use accessors for " Laurent Pinchart
2023-10-23 21:40 ` [PATCH 2/7] media: microchip-isc: " Laurent Pinchart
2023-10-23 21:40 ` Laurent Pinchart [this message]
2023-10-23 21:40 ` [PATCH 4/7] media: atomisp: " Laurent Pinchart
2023-10-23 21:40 ` [PATCH 5/7] media: tegra-video: " Laurent Pinchart
2023-10-25  7:27   ` Luca Ceresoli
2023-10-23 21:40 ` [PATCH 6/7] media: i2c: " Laurent Pinchart
2023-10-27 20:21   ` kernel test robot
2023-10-23 21:40 ` [PATCH 7/7] media: v4l2-subdev: Rename " Laurent Pinchart
2023-10-24  6:55 ` [PATCH 0/7] " Eugen Hristev
2023-10-24  8:41   ` Tomi Valkeinen
2023-10-24  8:47     ` 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=20231023214011.17730-4-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=eugen.hristev@collabora.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=sakari.ailus@iki.fi \
    /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.