From: Hans de Goede <hdegoede@redhat.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Andy Shevchenko <andy@kernel.org>
Cc: Hans de Goede <hdegoede@redhat.com>, Kate Hsuan <hpa@redhat.com>,
Tsuchiya Yuto <kitakar@gmail.com>,
Yury Luneff <yury.lunev@gmail.com>,
Nable <nable.maininbox@googlemail.com>,
andrey.i.trufanov@gmail.com, Fabio Aiuto <fabioaiuto83@gmail.com>,
linux-media@vger.kernel.org, linux-staging@lists.linux.dev
Subject: [PATCH 1/9] media: atomisp: Remove isp_subdev_propagate()
Date: Sat, 17 Feb 2024 12:24:30 +0100 [thread overview]
Message-ID: <20240217112438.15240-2-hdegoede@redhat.com> (raw)
In-Reply-To: <20240217112438.15240-1-hdegoede@redhat.com>
isp_subdev_propagate() is a wrapper around atomisp_subdev_set_selection()
which gets only used in a single place.
Scall atomisp_subdev_set_selection() directly in that single place instead.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
.../media/atomisp/pci/atomisp_subdev.c | 38 ++++---------------
1 file changed, 7 insertions(+), 31 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c
index a87fc74159e2..8293bda0c681 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c
@@ -287,35 +287,6 @@ static void isp_get_fmt_rect(struct v4l2_subdev *sd,
}
}
-static void isp_subdev_propagate(struct v4l2_subdev *sd,
- struct v4l2_subdev_state *sd_state,
- u32 which, uint32_t pad, uint32_t target,
- uint32_t flags)
-{
- struct v4l2_mbus_framefmt *ffmt[ATOMISP_SUBDEV_PADS_NUM];
- struct v4l2_rect *crop[ATOMISP_SUBDEV_PADS_NUM],
- *comp[ATOMISP_SUBDEV_PADS_NUM];
-
- if (flags & V4L2_SEL_FLAG_KEEP_CONFIG)
- return;
-
- isp_get_fmt_rect(sd, sd_state, which, ffmt, crop, comp);
-
- switch (pad) {
- case ATOMISP_SUBDEV_PAD_SINK: {
- struct v4l2_rect r = {0};
-
- /* Only crop target supported on sink pad. */
- r.width = ffmt[pad]->width;
- r.height = ffmt[pad]->height;
-
- atomisp_subdev_set_selection(sd, sd_state, which, pad,
- target, flags, &r);
- break;
- }
- }
-}
-
static int isp_subdev_get_selection(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_selection *sel)
@@ -541,6 +512,7 @@ void atomisp_subdev_set_ffmt(struct v4l2_subdev *sd,
case ATOMISP_SUBDEV_PAD_SINK: {
const struct atomisp_in_fmt_conv *fc =
atomisp_find_in_fmt_conv(ffmt->code);
+ struct v4l2_rect r = {};
if (!fc) {
fc = atomisp_in_fmt_conv;
@@ -551,8 +523,12 @@ void atomisp_subdev_set_ffmt(struct v4l2_subdev *sd,
*__ffmt = *ffmt;
- isp_subdev_propagate(sd, sd_state, which, pad,
- V4L2_SEL_TGT_CROP, 0);
+ /* Propagate new ffmt to selection */
+ r.width = ffmt->width;
+ r.height = ffmt->height;
+ /* Only crop target supported on sink pad. */
+ atomisp_subdev_set_selection(sd, sd_state, which, pad,
+ V4L2_SEL_TGT_CROP, 0, &r);
if (which == V4L2_SUBDEV_FORMAT_ACTIVE) {
atomisp_css_input_set_resolution(isp_sd,
--
2.43.0
next prev parent reply other threads:[~2024-02-17 11:24 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-17 11:24 [PATCH 0/9] media: atomisp: Changes for libcamera support Hans de Goede
2024-02-17 11:24 ` Hans de Goede [this message]
2024-02-17 14:57 ` [PATCH 1/9] media: atomisp: Remove isp_subdev_propagate() Kieran Bingham
2024-02-17 11:24 ` [PATCH 2/9] media: atomisp: Rename atomisp_set_crop_and_fmt() Hans de Goede
2024-02-17 15:07 ` Kieran Bingham
2024-02-17 11:24 ` [PATCH 3/9] media: atomisp: Remove custom VCM handling Hans de Goede
2024-02-17 15:09 ` Kieran Bingham
2024-02-17 11:24 ` [PATCH 4/9] media: atomisp: Remove ISP controls which get passed through to the camera Hans de Goede
2024-02-17 15:13 ` Kieran Bingham
2024-02-17 11:24 ` [PATCH 5/9] media: atomisp: Stop setting sd->devnode for the ATOMISP_SUBDEV v4l2-subdev Hans de Goede
2024-02-17 11:24 ` [PATCH 6/9] media: atomisp: Add DMABUF support Hans de Goede
2024-02-17 15:21 ` Kieran Bingham
2024-02-17 11:24 ` [PATCH 7/9] media: atomisp: Change ISP subdev name to "ATOM ISP" Hans de Goede
2024-02-17 16:00 ` Kieran Bingham
2024-02-17 18:48 ` Andy Shevchenko
2024-02-18 11:10 ` Hans de Goede
2024-02-17 11:24 ` [PATCH 8/9] media: atomisp: Make MC link from ISP to /dev/video# output node immutable Hans de Goede
2024-02-17 15:22 ` Kieran Bingham
2024-02-17 11:24 ` [PATCH 9/9] media: atomisp: Implement link_setup op for ISP subdev MC entity Hans de Goede
2024-02-17 18:52 ` Andy Shevchenko
2024-02-18 11:08 ` Hans de Goede
2024-02-17 18:53 ` [PATCH 0/9] media: atomisp: Changes for libcamera support Andy Shevchenko
2024-02-18 11:15 ` Hans de Goede
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=20240217112438.15240-2-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=andrey.i.trufanov@gmail.com \
--cc=andy@kernel.org \
--cc=fabioaiuto83@gmail.com \
--cc=hpa@redhat.com \
--cc=kitakar@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=nable.maininbox@googlemail.com \
--cc=sakari.ailus@linux.intel.com \
--cc=yury.lunev@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox