public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/16] Switch subdev dv timing callbacks to pad ops
@ 2024-04-05 14:13 Paweł Anikiel
  2024-04-05 14:13 ` [PATCH 01/16] media: v4l2-subdev: Add pad versions of dv timing subdev calls Paweł Anikiel
                   ` (16 more replies)
  0 siblings, 17 replies; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:13 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

Currently, subdev dv timing calls (i.e. g/s/query_dv_timings) are video
ops without a pad argument. This is a problem if the subdevice can have
different dv timings for each pad (e.g. a DisplayPort receiver with
multiple virtual channels).

This patchset changes subdev dv timing callbacks to include a pad
argument, and moves them from video to pad ops. All the affected
drivers are updated to use the new pad ops version.

The affected drivers were updated in a way that mathes how they deal
with the pad argument in other callbacks (mainly enum_dv_timings,
dv_timings_cap, get/set_edid).

This was originally a part of a larger patchset:
https://lore.kernel.org/lkml/20240221160215.484151-2-panikiel@google.com/

Paweł Anikiel (16):
  media: v4l2-subdev: Add pad versions of dv timing subdev calls
  media: i2c: adv748x: Switch dv timing callbacks to pad ops
  media: i2c: adv7511: Switch dv timing callbacks to pad ops
  media: i2c: adv7604: Switch dv timing callbacks to pad ops
  media: i2c: adv7842: Switch dv timing callbacks to pad ops
  media: i2c: tc358743: Switch dv timing callbacks to pad ops
  media: i2c: tda1997x: Switch dv timing callbacks to pad ops
  media: i2c: ths7303: Switch dv timing callbacks to pad ops
  media: i2c: ths8200: Switch dv timing callbacks to pad ops
  media: i2c: tvp7002: Switch dv timing callbacks to pad ops
  media: spi: gs1662: Switch dv timing callbacks to pad ops
  media: cobalt: Use pad variant of dv timing subdev calls
  media: rcar-vin: Use pad variant of dv timing subdev calls
  media: vpif_capture: Use pad variant of dv timing subdev calls
  media: tegra-video: Use pad variant of dv timing subdev calls
  media: v4l2-subdev: Remove non-pad dv timing callbacks

 drivers/media/i2c/adv748x/adv748x-hdmi.c      | 16 ++++----
 drivers/media/i2c/adv7511-v4l2.c              | 14 +++++--
 drivers/media/i2c/adv7604.c                   | 14 +++----
 drivers/media/i2c/adv7842.c                   | 25 ++++++++----
 drivers/media/i2c/tc358743.c                  | 23 +++++++----
 drivers/media/i2c/tda1997x.c                  | 12 +++---
 drivers/media/i2c/ths7303.c                   |  8 +++-
 drivers/media/i2c/ths8200.c                   | 14 +++++--
 drivers/media/i2c/tvp7002.c                   | 26 +++++++++----
 drivers/media/pci/cobalt/cobalt-v4l2.c        | 12 +++---
 .../platform/renesas/rcar-vin/rcar-v4l2.c     |  9 +++--
 .../media/platform/ti/davinci/vpif_capture.c  |  4 +-
 drivers/media/spi/gs1662.c                    | 21 +++++++---
 drivers/media/v4l2-core/v4l2-subdev.c         | 39 +++++++++++++++++--
 drivers/staging/media/tegra-video/vi.c        | 12 +++---
 include/media/v4l2-subdev.h                   | 28 ++++++-------
 16 files changed, 183 insertions(+), 94 deletions(-)

-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 01/16] media: v4l2-subdev: Add pad versions of dv timing subdev calls
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
@ 2024-04-05 14:13 ` Paweł Anikiel
  2024-04-05 14:13 ` [PATCH 02/16] media: i2c: adv748x: Switch dv timing callbacks to pad ops Paweł Anikiel
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:13 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

Currently, subdev dv timing calls (i.e. g/s/query_dv_timings) are video
ops without a pad argument. This is a problem if the subdevice can have
different dv timings for each pad (e.g. a DisplayPort receiver with
multiple virtual channels).

To solve this, change these calls to include a pad argument, and put
them into pad ops. Keep the old ones temporarily to make the switch
easier.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
---
 drivers/media/v4l2-core/v4l2-subdev.c | 33 +++++++++++++++++++++++++++
 include/media/v4l2-subdev.h           | 14 ++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 4c6198c48dd6..07759cdd0844 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -369,6 +369,36 @@ static int call_set_edid(struct v4l2_subdev *sd, struct v4l2_subdev_edid *edid)
 	return check_edid(sd, edid) ? : sd->ops->pad->set_edid(sd, edid);
 }
 
+static int call_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
+			     struct v4l2_dv_timings *timings)
+{
+	if (!timings)
+		return -EINVAL;
+
+	return check_pad(sd, pad) ? :
+	       sd->ops->pad->s_dv_timings(sd, pad, timings);
+}
+
+static int call_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
+			     struct v4l2_dv_timings *timings)
+{
+	if (!timings)
+		return -EINVAL;
+
+	return check_pad(sd, pad) ? :
+	       sd->ops->pad->g_dv_timings(sd, pad, timings);
+}
+
+static int call_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
+				 struct v4l2_dv_timings *timings)
+{
+	if (!timings)
+		return -EINVAL;
+
+	return check_pad(sd, pad) ? :
+	       sd->ops->pad->query_dv_timings(sd, pad, timings);
+}
+
 static int call_dv_timings_cap(struct v4l2_subdev *sd,
 			       struct v4l2_dv_timings_cap *cap)
 {
@@ -487,6 +517,9 @@ static const struct v4l2_subdev_pad_ops v4l2_subdev_call_pad_wrappers = {
 	.set_frame_interval	= call_set_frame_interval,
 	.get_edid		= call_get_edid,
 	.set_edid		= call_set_edid,
+	.s_dv_timings		= call_s_dv_timings,
+	.g_dv_timings		= call_g_dv_timings,
+	.query_dv_timings	= call_query_dv_timings,
 	.dv_timings_cap		= call_dv_timings_cap,
 	.enum_dv_timings	= call_enum_dv_timings,
 	.get_frame_desc		= call_get_frame_desc,
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index a9e6b8146279..a5213411ef2b 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -791,6 +791,14 @@ struct v4l2_subdev_state {
  *
  * @set_edid: callback for VIDIOC_SUBDEV_S_EDID() ioctl handler code.
  *
+ * @s_dv_timings: Set custom dv timings in the sub device. This is used
+ *	when sub device is capable of setting detailed timing information
+ *	in the hardware to generate/detect the video signal.
+ *
+ * @g_dv_timings: Get custom dv timings in the sub device.
+ *
+ * @query_dv_timings: callback for VIDIOC_QUERY_DV_TIMINGS() ioctl handler code.
+ *
  * @dv_timings_cap: callback for VIDIOC_SUBDEV_DV_TIMINGS_CAP() ioctl handler
  *		    code.
  *
@@ -864,6 +872,12 @@ struct v4l2_subdev_pad_ops {
 				  struct v4l2_subdev_frame_interval *interval);
 	int (*get_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid);
 	int (*set_edid)(struct v4l2_subdev *sd, struct v4l2_edid *edid);
+	int (*s_dv_timings)(struct v4l2_subdev *sd, unsigned int pad,
+			    struct v4l2_dv_timings *timings);
+	int (*g_dv_timings)(struct v4l2_subdev *sd, unsigned int pad,
+			    struct v4l2_dv_timings *timings);
+	int (*query_dv_timings)(struct v4l2_subdev *sd, unsigned int pad,
+				struct v4l2_dv_timings *timings);
 	int (*dv_timings_cap)(struct v4l2_subdev *sd,
 			      struct v4l2_dv_timings_cap *cap);
 	int (*enum_dv_timings)(struct v4l2_subdev *sd,
-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 02/16] media: i2c: adv748x: Switch dv timing callbacks to pad ops
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
  2024-04-05 14:13 ` [PATCH 01/16] media: v4l2-subdev: Add pad versions of dv timing subdev calls Paweł Anikiel
@ 2024-04-05 14:13 ` Paweł Anikiel
  2024-04-06 14:04   ` Niklas Söderlund
  2024-04-05 14:13 ` [PATCH 03/16] media: i2c: adv7511: " Paweł Anikiel
                   ` (14 subsequent siblings)
  16 siblings, 1 reply; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:13 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
---
 drivers/media/i2c/adv748x/adv748x-hdmi.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/media/i2c/adv748x/adv748x-hdmi.c b/drivers/media/i2c/adv748x/adv748x-hdmi.c
index ec151dc69c23..a4db9bae5f79 100644
--- a/drivers/media/i2c/adv748x/adv748x-hdmi.c
+++ b/drivers/media/i2c/adv748x/adv748x-hdmi.c
@@ -214,7 +214,7 @@ static int adv748x_hdmi_set_video_timings(struct adv748x_state *state,
  * v4l2_subdev_video_ops
  */
 
-static int adv748x_hdmi_s_dv_timings(struct v4l2_subdev *sd,
+static int adv748x_hdmi_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 				     struct v4l2_dv_timings *timings)
 {
 	struct adv748x_hdmi *hdmi = adv748x_sd_to_hdmi(sd);
@@ -254,7 +254,7 @@ static int adv748x_hdmi_s_dv_timings(struct v4l2_subdev *sd,
 	return ret;
 }
 
-static int adv748x_hdmi_g_dv_timings(struct v4l2_subdev *sd,
+static int adv748x_hdmi_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 				     struct v4l2_dv_timings *timings)
 {
 	struct adv748x_hdmi *hdmi = adv748x_sd_to_hdmi(sd);
@@ -269,7 +269,7 @@ static int adv748x_hdmi_g_dv_timings(struct v4l2_subdev *sd,
 	return 0;
 }
 
-static int adv748x_hdmi_query_dv_timings(struct v4l2_subdev *sd,
+static int adv748x_hdmi_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 					 struct v4l2_dv_timings *timings)
 {
 	struct adv748x_hdmi *hdmi = adv748x_sd_to_hdmi(sd);
@@ -392,9 +392,6 @@ static int adv748x_hdmi_g_pixelaspect(struct v4l2_subdev *sd,
 }
 
 static const struct v4l2_subdev_video_ops adv748x_video_ops_hdmi = {
-	.s_dv_timings = adv748x_hdmi_s_dv_timings,
-	.g_dv_timings = adv748x_hdmi_g_dv_timings,
-	.query_dv_timings = adv748x_hdmi_query_dv_timings,
 	.g_input_status = adv748x_hdmi_g_input_status,
 	.s_stream = adv748x_hdmi_s_stream,
 	.g_pixelaspect = adv748x_hdmi_g_pixelaspect,
@@ -413,7 +410,7 @@ static int adv748x_hdmi_propagate_pixelrate(struct adv748x_hdmi *hdmi)
 	if (!tx)
 		return -ENOLINK;
 
-	adv748x_hdmi_query_dv_timings(&hdmi->sd, &timings);
+	adv748x_hdmi_query_dv_timings(&hdmi->sd, 0, &timings);
 
 	return adv748x_csi2_set_pixelrate(tx, timings.bt.pixelclock);
 }
@@ -610,6 +607,9 @@ static const struct v4l2_subdev_pad_ops adv748x_pad_ops_hdmi = {
 	.get_fmt = adv748x_hdmi_get_format,
 	.get_edid = adv748x_hdmi_get_edid,
 	.set_edid = adv748x_hdmi_set_edid,
+	.s_dv_timings = adv748x_hdmi_s_dv_timings,
+	.g_dv_timings = adv748x_hdmi_g_dv_timings,
+	.query_dv_timings = adv748x_hdmi_query_dv_timings,
 	.dv_timings_cap = adv748x_hdmi_dv_timings_cap,
 	.enum_dv_timings = adv748x_hdmi_enum_dv_timings,
 };
@@ -734,7 +734,7 @@ int adv748x_hdmi_init(struct adv748x_hdmi *hdmi)
 	struct v4l2_dv_timings cea1280x720 = V4L2_DV_BT_CEA_1280X720P30;
 	int ret;
 
-	adv748x_hdmi_s_dv_timings(&hdmi->sd, &cea1280x720);
+	adv748x_hdmi_s_dv_timings(&hdmi->sd, 0, &cea1280x720);
 
 	/* Initialise a default 16:9 aspect ratio */
 	hdmi->aspect_ratio.numerator = 16;
-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 03/16] media: i2c: adv7511: Switch dv timing callbacks to pad ops
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
  2024-04-05 14:13 ` [PATCH 01/16] media: v4l2-subdev: Add pad versions of dv timing subdev calls Paweł Anikiel
  2024-04-05 14:13 ` [PATCH 02/16] media: i2c: adv748x: Switch dv timing callbacks to pad ops Paweł Anikiel
@ 2024-04-05 14:13 ` Paweł Anikiel
  2024-04-05 14:13 ` [PATCH 04/16] media: i2c: adv7604: " Paweł Anikiel
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:13 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
---
 drivers/media/i2c/adv7511-v4l2.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/media/i2c/adv7511-v4l2.c b/drivers/media/i2c/adv7511-v4l2.c
index 0f780eb6ef63..00fbe411429a 100644
--- a/drivers/media/i2c/adv7511-v4l2.c
+++ b/drivers/media/i2c/adv7511-v4l2.c
@@ -995,7 +995,7 @@ static int adv7511_s_stream(struct v4l2_subdev *sd, int enable)
 	return 0;
 }
 
-static int adv7511_s_dv_timings(struct v4l2_subdev *sd,
+static int adv7511_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 			       struct v4l2_dv_timings *timings)
 {
 	struct adv7511_state *state = get_adv7511_state(sd);
@@ -1004,6 +1004,9 @@ static int adv7511_s_dv_timings(struct v4l2_subdev *sd,
 
 	v4l2_dbg(1, debug, sd, "%s:\n", __func__);
 
+	if (pad != 0)
+		return -EINVAL;
+
 	/* quick sanity check */
 	if (!v4l2_valid_dv_timings(timings, &adv7511_timings_cap, NULL, NULL))
 		return -EINVAL;
@@ -1042,13 +1045,16 @@ static int adv7511_s_dv_timings(struct v4l2_subdev *sd,
 	return 0;
 }
 
-static int adv7511_g_dv_timings(struct v4l2_subdev *sd,
+static int adv7511_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 				struct v4l2_dv_timings *timings)
 {
 	struct adv7511_state *state = get_adv7511_state(sd);
 
 	v4l2_dbg(1, debug, sd, "%s:\n", __func__);
 
+	if (pad != 0)
+		return -EINVAL;
+
 	if (!timings)
 		return -EINVAL;
 
@@ -1078,8 +1084,6 @@ static int adv7511_dv_timings_cap(struct v4l2_subdev *sd,
 
 static const struct v4l2_subdev_video_ops adv7511_video_ops = {
 	.s_stream = adv7511_s_stream,
-	.s_dv_timings = adv7511_s_dv_timings,
-	.g_dv_timings = adv7511_g_dv_timings,
 };
 
 /* ------------------------------ AUDIO OPS ------------------------------ */
@@ -1403,6 +1407,8 @@ static const struct v4l2_subdev_pad_ops adv7511_pad_ops = {
 	.enum_mbus_code = adv7511_enum_mbus_code,
 	.get_fmt = adv7511_get_fmt,
 	.set_fmt = adv7511_set_fmt,
+	.s_dv_timings = adv7511_s_dv_timings,
+	.g_dv_timings = adv7511_g_dv_timings,
 	.enum_dv_timings = adv7511_enum_dv_timings,
 	.dv_timings_cap = adv7511_dv_timings_cap,
 };
-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 04/16] media: i2c: adv7604: Switch dv timing callbacks to pad ops
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
                   ` (2 preceding siblings ...)
  2024-04-05 14:13 ` [PATCH 03/16] media: i2c: adv7511: " Paweł Anikiel
@ 2024-04-05 14:13 ` Paweł Anikiel
  2024-04-05 14:14 ` [PATCH 05/16] media: i2c: adv7842: " Paweł Anikiel
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:13 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
---
 drivers/media/i2c/adv7604.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c
index 319db3e847c4..404ccc9b42f0 100644
--- a/drivers/media/i2c/adv7604.c
+++ b/drivers/media/i2c/adv7604.c
@@ -1557,7 +1557,7 @@ static unsigned int adv76xx_read_hdmi_pixelclock(struct v4l2_subdev *sd)
 	return freq;
 }
 
-static int adv76xx_query_dv_timings(struct v4l2_subdev *sd,
+static int adv76xx_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 			struct v4l2_dv_timings *timings)
 {
 	struct adv76xx_state *state = to_state(sd);
@@ -1687,7 +1687,7 @@ static int adv76xx_query_dv_timings(struct v4l2_subdev *sd,
 	return 0;
 }
 
-static int adv76xx_s_dv_timings(struct v4l2_subdev *sd,
+static int adv76xx_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 		struct v4l2_dv_timings *timings)
 {
 	struct adv76xx_state *state = to_state(sd);
@@ -1730,7 +1730,7 @@ static int adv76xx_s_dv_timings(struct v4l2_subdev *sd,
 	return 0;
 }
 
-static int adv76xx_g_dv_timings(struct v4l2_subdev *sd,
+static int adv76xx_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 		struct v4l2_dv_timings *timings)
 {
 	struct adv76xx_state *state = to_state(sd);
@@ -2607,7 +2607,7 @@ static int adv76xx_log_status(struct v4l2_subdev *sd)
 				stdi.lcf, stdi.bl, stdi.lcvs,
 				stdi.interlaced ? "interlaced" : "progressive",
 				stdi.hs_pol, stdi.vs_pol);
-	if (adv76xx_query_dv_timings(sd, &timings))
+	if (adv76xx_query_dv_timings(sd, 0, &timings))
 		v4l2_info(sd, "No video detected\n");
 	else
 		v4l2_print_dv_timings(sd->name, "Detected format: ",
@@ -2726,9 +2726,6 @@ static const struct v4l2_subdev_core_ops adv76xx_core_ops = {
 static const struct v4l2_subdev_video_ops adv76xx_video_ops = {
 	.s_routing = adv76xx_s_routing,
 	.g_input_status = adv76xx_g_input_status,
-	.s_dv_timings = adv76xx_s_dv_timings,
-	.g_dv_timings = adv76xx_g_dv_timings,
-	.query_dv_timings = adv76xx_query_dv_timings,
 };
 
 static const struct v4l2_subdev_pad_ops adv76xx_pad_ops = {
@@ -2738,6 +2735,9 @@ static const struct v4l2_subdev_pad_ops adv76xx_pad_ops = {
 	.set_fmt = adv76xx_set_format,
 	.get_edid = adv76xx_get_edid,
 	.set_edid = adv76xx_set_edid,
+	.s_dv_timings = adv76xx_s_dv_timings,
+	.g_dv_timings = adv76xx_g_dv_timings,
+	.query_dv_timings = adv76xx_query_dv_timings,
 	.dv_timings_cap = adv76xx_dv_timings_cap,
 	.enum_dv_timings = adv76xx_enum_dv_timings,
 };
-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 05/16] media: i2c: adv7842: Switch dv timing callbacks to pad ops
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
                   ` (3 preceding siblings ...)
  2024-04-05 14:13 ` [PATCH 04/16] media: i2c: adv7604: " Paweł Anikiel
@ 2024-04-05 14:14 ` Paweł Anikiel
  2024-04-05 14:14 ` [PATCH 06/16] media: i2c: tc358743: " Paweł Anikiel
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:14 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
---
 drivers/media/i2c/adv7842.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c
index 2ad0f9f5503d..f2d4217310e7 100644
--- a/drivers/media/i2c/adv7842.c
+++ b/drivers/media/i2c/adv7842.c
@@ -1518,7 +1518,7 @@ static void adv7842_fill_optional_dv_timings_fields(struct v4l2_subdev *sd,
 	timings->bt.flags |= V4L2_DV_FL_CAN_DETECT_REDUCED_FPS;
 }
 
-static int adv7842_query_dv_timings(struct v4l2_subdev *sd,
+static int adv7842_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 				    struct v4l2_dv_timings *timings)
 {
 	struct adv7842_state *state = to_state(sd);
@@ -1527,6 +1527,9 @@ static int adv7842_query_dv_timings(struct v4l2_subdev *sd,
 
 	v4l2_dbg(1, debug, sd, "%s:\n", __func__);
 
+	if (pad != 0)
+		return -EINVAL;
+
 	memset(timings, 0, sizeof(struct v4l2_dv_timings));
 
 	/* SDP block */
@@ -1643,7 +1646,7 @@ static int adv7842_query_dv_timings(struct v4l2_subdev *sd,
 	return 0;
 }
 
-static int adv7842_s_dv_timings(struct v4l2_subdev *sd,
+static int adv7842_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 				struct v4l2_dv_timings *timings)
 {
 	struct adv7842_state *state = to_state(sd);
@@ -1652,6 +1655,9 @@ static int adv7842_s_dv_timings(struct v4l2_subdev *sd,
 
 	v4l2_dbg(1, debug, sd, "%s:\n", __func__);
 
+	if (pad != 0)
+		return -EINVAL;
+
 	if (state->mode == ADV7842_MODE_SDP)
 		return -ENODATA;
 
@@ -1689,11 +1695,14 @@ static int adv7842_s_dv_timings(struct v4l2_subdev *sd,
 	return 0;
 }
 
-static int adv7842_g_dv_timings(struct v4l2_subdev *sd,
+static int adv7842_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 				struct v4l2_dv_timings *timings)
 {
 	struct adv7842_state *state = to_state(sd);
 
+	if (pad != 0)
+		return -EINVAL;
+
 	if (state->mode == ADV7842_MODE_SDP)
 		return -ENODATA;
 	*timings = state->timings;
@@ -2780,7 +2789,7 @@ static int adv7842_cp_log_status(struct v4l2_subdev *sd)
 				"interlaced" : "progressive",
 			hs_pol, vs_pol);
 	}
-	if (adv7842_query_dv_timings(sd, &timings))
+	if (adv7842_query_dv_timings(sd, 0, &timings))
 		v4l2_info(sd, "No video detected\n");
 	else
 		v4l2_print_dv_timings(sd->name, "Detected format: ",
@@ -3226,7 +3235,7 @@ static int adv7842_command_ram_test(struct v4l2_subdev *sd)
 
 	memset(&state->timings, 0, sizeof(struct v4l2_dv_timings));
 
-	adv7842_s_dv_timings(sd, &timings);
+	adv7842_s_dv_timings(sd, 0, &timings);
 
 	return ret;
 }
@@ -3298,9 +3307,6 @@ static const struct v4l2_subdev_video_ops adv7842_video_ops = {
 	.s_routing = adv7842_s_routing,
 	.querystd = adv7842_querystd,
 	.g_input_status = adv7842_g_input_status,
-	.s_dv_timings = adv7842_s_dv_timings,
-	.g_dv_timings = adv7842_g_dv_timings,
-	.query_dv_timings = adv7842_query_dv_timings,
 };
 
 static const struct v4l2_subdev_pad_ops adv7842_pad_ops = {
@@ -3309,6 +3315,9 @@ static const struct v4l2_subdev_pad_ops adv7842_pad_ops = {
 	.set_fmt = adv7842_set_format,
 	.get_edid = adv7842_get_edid,
 	.set_edid = adv7842_set_edid,
+	.s_dv_timings = adv7842_s_dv_timings,
+	.g_dv_timings = adv7842_g_dv_timings,
+	.query_dv_timings = adv7842_query_dv_timings,
 	.enum_dv_timings = adv7842_enum_dv_timings,
 	.dv_timings_cap = adv7842_dv_timings_cap,
 };
-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 06/16] media: i2c: tc358743: Switch dv timing callbacks to pad ops
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
                   ` (4 preceding siblings ...)
  2024-04-05 14:14 ` [PATCH 05/16] media: i2c: adv7842: " Paweł Anikiel
@ 2024-04-05 14:14 ` Paweł Anikiel
  2024-04-05 14:14 ` [PATCH 07/16] media: i2c: tda1997x: " Paweł Anikiel
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:14 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
---
 drivers/media/i2c/tc358743.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
index 3192a334aaab..303c1d06c8b5 100644
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -1521,11 +1521,14 @@ static int tc358743_g_input_status(struct v4l2_subdev *sd, u32 *status)
 	return 0;
 }
 
-static int tc358743_s_dv_timings(struct v4l2_subdev *sd,
+static int tc358743_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 				 struct v4l2_dv_timings *timings)
 {
 	struct tc358743_state *state = to_state(sd);
 
+	if (pad != 0)
+		return -EINVAL;
+
 	if (!timings)
 		return -EINVAL;
 
@@ -1553,11 +1556,14 @@ static int tc358743_s_dv_timings(struct v4l2_subdev *sd,
 	return 0;
 }
 
-static int tc358743_g_dv_timings(struct v4l2_subdev *sd,
+static int tc358743_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 				 struct v4l2_dv_timings *timings)
 {
 	struct tc358743_state *state = to_state(sd);
 
+	if (pad != 0)
+		return -EINVAL;
+
 	*timings = state->timings;
 
 	return 0;
@@ -1573,11 +1579,14 @@ static int tc358743_enum_dv_timings(struct v4l2_subdev *sd,
 			&tc358743_timings_cap, NULL, NULL);
 }
 
-static int tc358743_query_dv_timings(struct v4l2_subdev *sd,
+static int tc358743_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 		struct v4l2_dv_timings *timings)
 {
 	int ret;
 
+	if (pad != 0)
+		return -EINVAL;
+
 	ret = tc358743_get_detected_timings(sd, timings);
 	if (ret)
 		return ret;
@@ -1822,9 +1831,6 @@ static const struct v4l2_subdev_core_ops tc358743_core_ops = {
 
 static const struct v4l2_subdev_video_ops tc358743_video_ops = {
 	.g_input_status = tc358743_g_input_status,
-	.s_dv_timings = tc358743_s_dv_timings,
-	.g_dv_timings = tc358743_g_dv_timings,
-	.query_dv_timings = tc358743_query_dv_timings,
 	.s_stream = tc358743_s_stream,
 };
 
@@ -1834,6 +1840,9 @@ static const struct v4l2_subdev_pad_ops tc358743_pad_ops = {
 	.get_fmt = tc358743_get_fmt,
 	.get_edid = tc358743_g_edid,
 	.set_edid = tc358743_s_edid,
+	.s_dv_timings = tc358743_s_dv_timings,
+	.g_dv_timings = tc358743_g_dv_timings,
+	.query_dv_timings = tc358743_query_dv_timings,
 	.enum_dv_timings = tc358743_enum_dv_timings,
 	.dv_timings_cap = tc358743_dv_timings_cap,
 	.get_mbus_config = tc358743_get_mbus_config,
@@ -2110,7 +2119,7 @@ static int tc358743_probe(struct i2c_client *client)
 
 	tc358743_initial_setup(sd);
 
-	tc358743_s_dv_timings(sd, &default_timing);
+	tc358743_s_dv_timings(sd, 0, &default_timing);
 
 	tc358743_set_csi_color_space(sd);
 
-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 07/16] media: i2c: tda1997x: Switch dv timing callbacks to pad ops
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
                   ` (5 preceding siblings ...)
  2024-04-05 14:14 ` [PATCH 06/16] media: i2c: tc358743: " Paweł Anikiel
@ 2024-04-05 14:14 ` Paweł Anikiel
  2024-04-05 14:14 ` [PATCH 08/16] media: i2c: ths7303: " Paweł Anikiel
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:14 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
---
 drivers/media/i2c/tda1997x.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c
index 8e4a0718c4b6..55a0b5d39893 100644
--- a/drivers/media/i2c/tda1997x.c
+++ b/drivers/media/i2c/tda1997x.c
@@ -1669,7 +1669,7 @@ tda1997x_g_input_status(struct v4l2_subdev *sd, u32 *status)
 	return 0;
 };
 
-static int tda1997x_s_dv_timings(struct v4l2_subdev *sd,
+static int tda1997x_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 				struct v4l2_dv_timings *timings)
 {
 	struct tda1997x_state *state = to_state(sd);
@@ -1694,7 +1694,7 @@ static int tda1997x_s_dv_timings(struct v4l2_subdev *sd,
 	return 0;
 }
 
-static int tda1997x_g_dv_timings(struct v4l2_subdev *sd,
+static int tda1997x_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 				 struct v4l2_dv_timings *timings)
 {
 	struct tda1997x_state *state = to_state(sd);
@@ -1707,7 +1707,7 @@ static int tda1997x_g_dv_timings(struct v4l2_subdev *sd,
 	return 0;
 }
 
-static int tda1997x_query_dv_timings(struct v4l2_subdev *sd,
+static int tda1997x_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 				     struct v4l2_dv_timings *timings)
 {
 	struct tda1997x_state *state = to_state(sd);
@@ -1724,9 +1724,6 @@ static int tda1997x_query_dv_timings(struct v4l2_subdev *sd,
 
 static const struct v4l2_subdev_video_ops tda1997x_video_ops = {
 	.g_input_status = tda1997x_g_input_status,
-	.s_dv_timings = tda1997x_s_dv_timings,
-	.g_dv_timings = tda1997x_g_dv_timings,
-	.query_dv_timings = tda1997x_query_dv_timings,
 };
 
 
@@ -1930,6 +1927,9 @@ static const struct v4l2_subdev_pad_ops tda1997x_pad_ops = {
 	.set_fmt = tda1997x_set_format,
 	.get_edid = tda1997x_get_edid,
 	.set_edid = tda1997x_set_edid,
+	.s_dv_timings = tda1997x_s_dv_timings,
+	.g_dv_timings = tda1997x_g_dv_timings,
+	.query_dv_timings = tda1997x_query_dv_timings,
 	.dv_timings_cap = tda1997x_get_dv_timings_cap,
 	.enum_dv_timings = tda1997x_enum_dv_timings,
 };
-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 08/16] media: i2c: ths7303: Switch dv timing callbacks to pad ops
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
                   ` (6 preceding siblings ...)
  2024-04-05 14:14 ` [PATCH 07/16] media: i2c: tda1997x: " Paweł Anikiel
@ 2024-04-05 14:14 ` Paweł Anikiel
  2024-04-05 14:14 ` [PATCH 09/16] media: i2c: ths8200: " Paweł Anikiel
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:14 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
---
 drivers/media/i2c/ths7303.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/media/i2c/ths7303.c b/drivers/media/i2c/ths7303.c
index ea70c1c13872..5e4a76eaf507 100644
--- a/drivers/media/i2c/ths7303.c
+++ b/drivers/media/i2c/ths7303.c
@@ -193,7 +193,7 @@ static int ths7303_s_stream(struct v4l2_subdev *sd, int enable)
 }
 
 /* for setting filter for HD output */
-static int ths7303_s_dv_timings(struct v4l2_subdev *sd,
+static int ths7303_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 			       struct v4l2_dv_timings *dv_timings)
 {
 	struct ths7303_state *state = to_state(sd);
@@ -210,7 +210,6 @@ static int ths7303_s_dv_timings(struct v4l2_subdev *sd,
 static const struct v4l2_subdev_video_ops ths7303_video_ops = {
 	.s_stream	= ths7303_s_stream,
 	.s_std_output	= ths7303_s_std_output,
-	.s_dv_timings   = ths7303_s_dv_timings,
 };
 
 #ifdef CONFIG_VIDEO_ADV_DEBUG
@@ -317,9 +316,14 @@ static const struct v4l2_subdev_core_ops ths7303_core_ops = {
 #endif
 };
 
+static const struct v4l2_subdev_pad_ops ths7303_pad_ops = {
+	.s_dv_timings = ths7303_s_dv_timings,
+};
+
 static const struct v4l2_subdev_ops ths7303_ops = {
 	.core	= &ths7303_core_ops,
 	.video	= &ths7303_video_ops,
+	.pad	= &ths7303_pad_ops,
 };
 
 static int ths7303_probe(struct i2c_client *client)
-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 09/16] media: i2c: ths8200: Switch dv timing callbacks to pad ops
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
                   ` (7 preceding siblings ...)
  2024-04-05 14:14 ` [PATCH 08/16] media: i2c: ths7303: " Paweł Anikiel
@ 2024-04-05 14:14 ` Paweł Anikiel
  2024-04-05 14:14 ` [PATCH 10/16] media: i2c: tvp7002: " Paweł Anikiel
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:14 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
---
 drivers/media/i2c/ths8200.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c
index 0e0f676cd221..ce0a7f809f19 100644
--- a/drivers/media/i2c/ths8200.c
+++ b/drivers/media/i2c/ths8200.c
@@ -358,13 +358,16 @@ static void ths8200_setup(struct v4l2_subdev *sd, struct v4l2_bt_timings *bt)
 		 bt->hsync, bt->vsync);
 }
 
-static int ths8200_s_dv_timings(struct v4l2_subdev *sd,
+static int ths8200_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 				struct v4l2_dv_timings *timings)
 {
 	struct ths8200_state *state = to_state(sd);
 
 	v4l2_dbg(1, debug, sd, "%s:\n", __func__);
 
+	if (pad != 0)
+		return -EINVAL;
+
 	if (!v4l2_valid_dv_timings(timings, &ths8200_timings_cap,
 				NULL, NULL))
 		return -EINVAL;
@@ -385,13 +388,16 @@ static int ths8200_s_dv_timings(struct v4l2_subdev *sd,
 	return 0;
 }
 
-static int ths8200_g_dv_timings(struct v4l2_subdev *sd,
+static int ths8200_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 				struct v4l2_dv_timings *timings)
 {
 	struct ths8200_state *state = to_state(sd);
 
 	v4l2_dbg(1, debug, sd, "%s:\n", __func__);
 
+	if (pad != 0)
+		return -EINVAL;
+
 	*timings = state->dv_timings;
 
 	return 0;
@@ -420,11 +426,11 @@ static int ths8200_dv_timings_cap(struct v4l2_subdev *sd,
 /* Specific video subsystem operation handlers */
 static const struct v4l2_subdev_video_ops ths8200_video_ops = {
 	.s_stream = ths8200_s_stream,
-	.s_dv_timings = ths8200_s_dv_timings,
-	.g_dv_timings = ths8200_g_dv_timings,
 };
 
 static const struct v4l2_subdev_pad_ops ths8200_pad_ops = {
+	.s_dv_timings = ths8200_s_dv_timings,
+	.g_dv_timings = ths8200_g_dv_timings,
 	.enum_dv_timings = ths8200_enum_dv_timings,
 	.dv_timings_cap = ths8200_dv_timings_cap,
 };
-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 10/16] media: i2c: tvp7002: Switch dv timing callbacks to pad ops
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
                   ` (8 preceding siblings ...)
  2024-04-05 14:14 ` [PATCH 09/16] media: i2c: ths8200: " Paweł Anikiel
@ 2024-04-05 14:14 ` Paweł Anikiel
  2024-04-05 14:14 ` [PATCH 11/16] media: spi: gs1662: " Paweł Anikiel
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:14 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
---
 drivers/media/i2c/tvp7002.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c
index 6a04ffae5343..881b54f46d41 100644
--- a/drivers/media/i2c/tvp7002.c
+++ b/drivers/media/i2c/tvp7002.c
@@ -546,13 +546,16 @@ static int tvp7002_write_inittab(struct v4l2_subdev *sd,
 	return error;
 }
 
-static int tvp7002_s_dv_timings(struct v4l2_subdev *sd,
+static int tvp7002_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 					struct v4l2_dv_timings *dv_timings)
 {
 	struct tvp7002 *device = to_tvp7002(sd);
 	const struct v4l2_bt_timings *bt = &dv_timings->bt;
 	int i;
 
+	if (pad != 0)
+		return -EINVAL;
+
 	if (dv_timings->type != V4L2_DV_BT_656_1120)
 		return -EINVAL;
 	for (i = 0; i < NUM_TIMINGS; i++) {
@@ -566,11 +569,14 @@ static int tvp7002_s_dv_timings(struct v4l2_subdev *sd,
 	return -EINVAL;
 }
 
-static int tvp7002_g_dv_timings(struct v4l2_subdev *sd,
+static int tvp7002_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 					struct v4l2_dv_timings *dv_timings)
 {
 	struct tvp7002 *device = to_tvp7002(sd);
 
+	if (pad != 0)
+		return -EINVAL;
+
 	*dv_timings = device->current_timings->timings;
 	return 0;
 }
@@ -659,12 +665,16 @@ static int tvp7002_query_dv(struct v4l2_subdev *sd, int *index)
 	return 0;
 }
 
-static int tvp7002_query_dv_timings(struct v4l2_subdev *sd,
+static int tvp7002_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 					struct v4l2_dv_timings *timings)
 {
 	int index;
-	int err = tvp7002_query_dv(sd, &index);
+	int err;
+
+	if (pad != 0)
+		return -EINVAL;
 
+	err = tvp7002_query_dv(sd, &index);
 	if (err)
 		return err;
 	*timings = tvp7002_timings[index].timings;
@@ -861,9 +871,6 @@ static const struct v4l2_subdev_core_ops tvp7002_core_ops = {
 
 /* Specific video subsystem operation handlers */
 static const struct v4l2_subdev_video_ops tvp7002_video_ops = {
-	.g_dv_timings = tvp7002_g_dv_timings,
-	.s_dv_timings = tvp7002_s_dv_timings,
-	.query_dv_timings = tvp7002_query_dv_timings,
 	.s_stream = tvp7002_s_stream,
 };
 
@@ -872,6 +879,9 @@ static const struct v4l2_subdev_pad_ops tvp7002_pad_ops = {
 	.enum_mbus_code = tvp7002_enum_mbus_code,
 	.get_fmt = tvp7002_get_pad_format,
 	.set_fmt = tvp7002_set_pad_format,
+	.g_dv_timings = tvp7002_g_dv_timings,
+	.s_dv_timings = tvp7002_s_dv_timings,
+	.query_dv_timings = tvp7002_query_dv_timings,
 	.enum_dv_timings = tvp7002_enum_dv_timings,
 };
 
@@ -1001,7 +1011,7 @@ static int tvp7002_probe(struct i2c_client *c)
 
 	/* Set registers according to default video mode */
 	timings = device->current_timings->timings;
-	error = tvp7002_s_dv_timings(sd, &timings);
+	error = tvp7002_s_dv_timings(sd, 0, &timings);
 
 #if defined(CONFIG_MEDIA_CONTROLLER)
 	device->pad.flags = MEDIA_PAD_FL_SOURCE;
-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 11/16] media: spi: gs1662: Switch dv timing callbacks to pad ops
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
                   ` (9 preceding siblings ...)
  2024-04-05 14:14 ` [PATCH 10/16] media: i2c: tvp7002: " Paweł Anikiel
@ 2024-04-05 14:14 ` Paweł Anikiel
  2024-04-05 14:14 ` [PATCH 12/16] media: cobalt: Use pad variant of dv timing subdev calls Paweł Anikiel
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:14 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

Change all (s|g|query)_dv_timings subdev callbacks to include
a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
---
 drivers/media/spi/gs1662.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/media/spi/gs1662.c b/drivers/media/spi/gs1662.c
index 75c21a93e6d0..44f97e99ff15 100644
--- a/drivers/media/spi/gs1662.c
+++ b/drivers/media/spi/gs1662.c
@@ -259,12 +259,15 @@ static inline struct gs *to_gs(struct v4l2_subdev *sd)
 	return container_of(sd, struct gs, sd);
 }
 
-static int gs_s_dv_timings(struct v4l2_subdev *sd,
+static int gs_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 		    struct v4l2_dv_timings *timings)
 {
 	struct gs *gs = to_gs(sd);
 	int reg_value;
 
+	if (pad != 0)
+		return -EINVAL;
+
 	reg_value = get_register_timings(timings);
 	if (reg_value == 0x0)
 		return -EINVAL;
@@ -273,16 +276,19 @@ static int gs_s_dv_timings(struct v4l2_subdev *sd,
 	return 0;
 }
 
-static int gs_g_dv_timings(struct v4l2_subdev *sd,
+static int gs_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 		    struct v4l2_dv_timings *timings)
 {
 	struct gs *gs = to_gs(sd);
 
+	if (pad != 0)
+		return -EINVAL;
+
 	*timings = gs->current_timings;
 	return 0;
 }
 
-static int gs_query_dv_timings(struct v4l2_subdev *sd,
+static int gs_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
 			struct v4l2_dv_timings *timings)
 {
 	struct gs *gs = to_gs(sd);
@@ -290,6 +296,9 @@ static int gs_query_dv_timings(struct v4l2_subdev *sd,
 	u16 reg_value, i;
 	int ret;
 
+	if (pad != 0)
+		return -EINVAL;
+
 	if (gs->enabled)
 		return -EBUSY;
 
@@ -410,14 +419,14 @@ static const struct v4l2_subdev_core_ops gs_core_ops = {
 };
 
 static const struct v4l2_subdev_video_ops gs_video_ops = {
-	.s_dv_timings = gs_s_dv_timings,
-	.g_dv_timings = gs_g_dv_timings,
 	.s_stream = gs_s_stream,
 	.g_input_status = gs_g_input_status,
-	.query_dv_timings = gs_query_dv_timings,
 };
 
 static const struct v4l2_subdev_pad_ops gs_pad_ops = {
+	.s_dv_timings = gs_s_dv_timings,
+	.g_dv_timings = gs_g_dv_timings,
+	.query_dv_timings = gs_query_dv_timings,
 	.enum_dv_timings = gs_enum_dv_timings,
 	.dv_timings_cap = gs_dv_timings_cap,
 };
-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 12/16] media: cobalt: Use pad variant of dv timing subdev calls
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
                   ` (10 preceding siblings ...)
  2024-04-05 14:14 ` [PATCH 11/16] media: spi: gs1662: " Paweł Anikiel
@ 2024-04-05 14:14 ` Paweł Anikiel
  2024-04-05 14:14 ` [PATCH 13/16] media: rcar-vin: " Paweł Anikiel
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:14 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

Use the pad variant for all (s|g|query)_dv_timings subdev calls, which
includes a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
---
 drivers/media/pci/cobalt/cobalt-v4l2.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c
index 77ba08ace29f..d4d7b264c965 100644
--- a/drivers/media/pci/cobalt/cobalt-v4l2.c
+++ b/drivers/media/pci/cobalt/cobalt-v4l2.c
@@ -633,7 +633,7 @@ static int cobalt_s_dv_timings(struct file *file, void *priv_fh,
 		return -EBUSY;
 
 	err = v4l2_subdev_call(s->sd,
-			video, s_dv_timings, timings);
+			pad, s_dv_timings, 0, timings);
 	if (!err) {
 		s->timings = *timings;
 		s->width = timings->bt.width;
@@ -653,7 +653,7 @@ static int cobalt_g_dv_timings(struct file *file, void *priv_fh,
 		return 0;
 	}
 	return v4l2_subdev_call(s->sd,
-			video, g_dv_timings, timings);
+			pad, g_dv_timings, 0, timings);
 }
 
 static int cobalt_query_dv_timings(struct file *file, void *priv_fh,
@@ -666,7 +666,7 @@ static int cobalt_query_dv_timings(struct file *file, void *priv_fh,
 		return 0;
 	}
 	return v4l2_subdev_call(s->sd,
-			video, query_dv_timings, timings);
+			pad, query_dv_timings, 0, timings);
 }
 
 static int cobalt_dv_timings_cap(struct file *file, void *priv_fh,
@@ -1080,7 +1080,7 @@ static int cobalt_g_pixelaspect(struct file *file, void *fh,
 	if (s->input == 1)
 		timings = cea1080p60;
 	else
-		err = v4l2_subdev_call(s->sd, video, g_dv_timings, &timings);
+		err = v4l2_subdev_call(s->sd, pad, g_dv_timings, 0, &timings);
 	if (!err)
 		*f = v4l2_dv_timings_aspect_ratio(&timings);
 	return err;
@@ -1099,7 +1099,7 @@ static int cobalt_g_selection(struct file *file, void *fh,
 	if (s->input == 1)
 		timings = cea1080p60;
 	else
-		err = v4l2_subdev_call(s->sd, video, g_dv_timings, &timings);
+		err = v4l2_subdev_call(s->sd, pad, g_dv_timings, 0, &timings);
 
 	if (err)
 		return err;
@@ -1243,7 +1243,7 @@ static int cobalt_node_register(struct cobalt *cobalt, int node)
 		if (s->sd)
 			vdev->ctrl_handler = s->sd->ctrl_handler;
 		s->timings = dv1080p60;
-		v4l2_subdev_call(s->sd, video, s_dv_timings, &s->timings);
+		v4l2_subdev_call(s->sd, pad, s_dv_timings, 0, &s->timings);
 		if (!s->is_output && s->sd)
 			cobalt_enable_input(s);
 		vdev->ioctl_ops = s->is_dummy ? &cobalt_ioctl_empty_ops :
-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 13/16] media: rcar-vin: Use pad variant of dv timing subdev calls
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
                   ` (11 preceding siblings ...)
  2024-04-05 14:14 ` [PATCH 12/16] media: cobalt: Use pad variant of dv timing subdev calls Paweł Anikiel
@ 2024-04-05 14:14 ` Paweł Anikiel
  2024-04-06 14:03   ` Niklas Söderlund
  2024-04-05 14:14 ` [PATCH 14/16] media: vpif_capture: " Paweł Anikiel
                   ` (3 subsequent siblings)
  16 siblings, 1 reply; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:14 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

Use the pad variant for all (s|g|query)_dv_timings subdev calls, which
includes a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
---
 drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c b/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c
index 073f70c6ac68..bb4b07bed28d 100644
--- a/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c
@@ -730,7 +730,8 @@ static int rvin_s_dv_timings(struct file *file, void *priv_fh,
 	struct v4l2_subdev *sd = vin_to_source(vin);
 	int ret;
 
-	ret = v4l2_subdev_call(sd, video, s_dv_timings, timings);
+	ret = v4l2_subdev_call(sd, pad, s_dv_timings,
+			       vin->parallel.sink_pad, timings);
 	if (ret)
 		return ret;
 
@@ -744,7 +745,8 @@ static int rvin_g_dv_timings(struct file *file, void *priv_fh,
 	struct rvin_dev *vin = video_drvdata(file);
 	struct v4l2_subdev *sd = vin_to_source(vin);
 
-	return v4l2_subdev_call(sd, video, g_dv_timings, timings);
+	return v4l2_subdev_call(sd, pad, g_dv_timings,
+				vin->parallel.sink_pad, timings);
 }
 
 static int rvin_query_dv_timings(struct file *file, void *priv_fh,
@@ -753,7 +755,8 @@ static int rvin_query_dv_timings(struct file *file, void *priv_fh,
 	struct rvin_dev *vin = video_drvdata(file);
 	struct v4l2_subdev *sd = vin_to_source(vin);
 
-	return v4l2_subdev_call(sd, video, query_dv_timings, timings);
+	return v4l2_subdev_call(sd, pad, query_dv_timings,
+				vin->parallel.sink_pad, timings);
 }
 
 static int rvin_dv_timings_cap(struct file *file, void *priv_fh,
-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 14/16] media: vpif_capture: Use pad variant of dv timing subdev calls
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
                   ` (12 preceding siblings ...)
  2024-04-05 14:14 ` [PATCH 13/16] media: rcar-vin: " Paweł Anikiel
@ 2024-04-05 14:14 ` Paweł Anikiel
  2024-04-05 14:14 ` [PATCH 15/16] media: tegra-video: " Paweł Anikiel
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:14 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

Use the pad variant for all (s|g|query)_dv_timings subdev calls, which
includes a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
---
 drivers/media/platform/ti/davinci/vpif_capture.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/ti/davinci/vpif_capture.c b/drivers/media/platform/ti/davinci/vpif_capture.c
index c31a5566fc5a..c28794b6677b 100644
--- a/drivers/media/platform/ti/davinci/vpif_capture.c
+++ b/drivers/media/platform/ti/davinci/vpif_capture.c
@@ -1132,7 +1132,7 @@ vpif_query_dv_timings(struct file *file, void *priv,
 	if (input.capabilities != V4L2_IN_CAP_DV_TIMINGS)
 		return -ENODATA;
 
-	ret = v4l2_subdev_call(ch->sd, video, query_dv_timings, timings);
+	ret = v4l2_subdev_call(ch->sd, pad, query_dv_timings, 0, timings);
 	if (ret == -ENOIOCTLCMD || ret == -ENODEV)
 		return -ENODATA;
 
@@ -1177,7 +1177,7 @@ static int vpif_s_dv_timings(struct file *file, void *priv,
 		return -EBUSY;
 
 	/* Configure subdevice timings, if any */
-	ret = v4l2_subdev_call(ch->sd, video, s_dv_timings, timings);
+	ret = v4l2_subdev_call(ch->sd, pad, s_dv_timings, 0, timings);
 	if (ret == -ENOIOCTLCMD || ret == -ENODEV)
 		ret = 0;
 	if (ret < 0) {
-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 15/16] media: tegra-video: Use pad variant of dv timing subdev calls
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
                   ` (13 preceding siblings ...)
  2024-04-05 14:14 ` [PATCH 14/16] media: vpif_capture: " Paweł Anikiel
@ 2024-04-05 14:14 ` Paweł Anikiel
  2024-04-05 14:14 ` [PATCH 16/16] media: v4l2-subdev: Remove non-pad dv timing callbacks Paweł Anikiel
  2024-04-08 14:15 ` [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Hans Verkuil
  16 siblings, 0 replies; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:14 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

Use the pad variant for all (s|g|query)_dv_timings subdev calls, which
includes a pad argument.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
---
 drivers/staging/media/tegra-video/vi.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c
index af6e3a0d8df4..57a856a21e90 100644
--- a/drivers/staging/media/tegra-video/vi.c
+++ b/drivers/staging/media/tegra-video/vi.c
@@ -719,11 +719,11 @@ static int tegra_channel_g_dv_timings(struct file *file, void *fh,
 	struct v4l2_subdev *subdev;
 
 	subdev = tegra_channel_get_remote_source_subdev(chan);
-	if (!v4l2_subdev_has_op(subdev, video, g_dv_timings))
+	if (!v4l2_subdev_has_op(subdev, pad, g_dv_timings))
 		return -ENOTTY;
 
 	return v4l2_device_call_until_err(chan->video.v4l2_dev, 0,
-					  video, g_dv_timings, timings);
+					  pad, g_dv_timings, 0, timings);
 }
 
 static int tegra_channel_s_dv_timings(struct file *file, void *fh,
@@ -736,7 +736,7 @@ static int tegra_channel_s_dv_timings(struct file *file, void *fh,
 	int ret;
 
 	subdev = tegra_channel_get_remote_source_subdev(chan);
-	if (!v4l2_subdev_has_op(subdev, video, s_dv_timings))
+	if (!v4l2_subdev_has_op(subdev, pad, s_dv_timings))
 		return -ENOTTY;
 
 	ret = tegra_channel_g_dv_timings(file, fh, &curr_timings);
@@ -750,7 +750,7 @@ static int tegra_channel_s_dv_timings(struct file *file, void *fh,
 		return -EBUSY;
 
 	ret = v4l2_device_call_until_err(chan->video.v4l2_dev, 0,
-					 video, s_dv_timings, timings);
+					 pad, s_dv_timings, 0, timings);
 	if (ret)
 		return ret;
 
@@ -771,11 +771,11 @@ static int tegra_channel_query_dv_timings(struct file *file, void *fh,
 	struct v4l2_subdev *subdev;
 
 	subdev = tegra_channel_get_remote_source_subdev(chan);
-	if (!v4l2_subdev_has_op(subdev, video, query_dv_timings))
+	if (!v4l2_subdev_has_op(subdev, pad, query_dv_timings))
 		return -ENOTTY;
 
 	return v4l2_device_call_until_err(chan->video.v4l2_dev, 0,
-					  video, query_dv_timings, timings);
+					  pad, query_dv_timings, 0, timings);
 }
 
 static int tegra_channel_enum_dv_timings(struct file *file, void *fh,
-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [PATCH 16/16] media: v4l2-subdev: Remove non-pad dv timing callbacks
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
                   ` (14 preceding siblings ...)
  2024-04-05 14:14 ` [PATCH 15/16] media: tegra-video: " Paweł Anikiel
@ 2024-04-05 14:14 ` Paweł Anikiel
  2024-04-08 14:15 ` [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Hans Verkuil
  16 siblings, 0 replies; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-05 14:14 UTC (permalink / raw)
  To: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming,
	Paweł Anikiel

After the conversion of dv timing calls to use a pad argument is done,
remove the old callbacks. Update the subdev ioctl handlers to use the
new callbacks.

Signed-off-by: Paweł Anikiel <panikiel@google.com>
---
 drivers/media/v4l2-core/v4l2-subdev.c |  6 +++---
 include/media/v4l2-subdev.h           | 14 --------------
 2 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 07759cdd0844..6572667fd5c4 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -906,16 +906,16 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,
 	}
 
 	case VIDIOC_SUBDEV_QUERY_DV_TIMINGS:
-		return v4l2_subdev_call(sd, video, query_dv_timings, arg);
+		return v4l2_subdev_call(sd, pad, query_dv_timings, 0, arg);
 
 	case VIDIOC_SUBDEV_G_DV_TIMINGS:
-		return v4l2_subdev_call(sd, video, g_dv_timings, arg);
+		return v4l2_subdev_call(sd, pad, g_dv_timings, 0, arg);
 
 	case VIDIOC_SUBDEV_S_DV_TIMINGS:
 		if (ro_subdev)
 			return -EPERM;
 
-		return v4l2_subdev_call(sd, video, s_dv_timings, arg);
+		return v4l2_subdev_call(sd, pad, s_dv_timings, 0, arg);
 
 	case VIDIOC_SUBDEV_G_STD:
 		return v4l2_subdev_call(sd, video, g_std, arg);
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index a5213411ef2b..1af16b16f0bf 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -452,14 +452,6 @@ enum v4l2_subdev_pre_streamon_flags {
  *
  * @g_pixelaspect: callback to return the pixelaspect ratio.
  *
- * @s_dv_timings: Set custom dv timings in the sub device. This is used
- *	when sub device is capable of setting detailed timing information
- *	in the hardware to generate/detect the video signal.
- *
- * @g_dv_timings: Get custom dv timings in the sub device.
- *
- * @query_dv_timings: callback for VIDIOC_QUERY_DV_TIMINGS() ioctl handler code.
- *
  * @s_rx_buffer: set a host allocated memory buffer for the subdev. The subdev
  *	can adjust @size to a lower value and must not write more data to the
  *	buffer starting at @data than the original value of @size.
@@ -490,12 +482,6 @@ struct v4l2_subdev_video_ops {
 	int (*g_input_status)(struct v4l2_subdev *sd, u32 *status);
 	int (*s_stream)(struct v4l2_subdev *sd, int enable);
 	int (*g_pixelaspect)(struct v4l2_subdev *sd, struct v4l2_fract *aspect);
-	int (*s_dv_timings)(struct v4l2_subdev *sd,
-			struct v4l2_dv_timings *timings);
-	int (*g_dv_timings)(struct v4l2_subdev *sd,
-			struct v4l2_dv_timings *timings);
-	int (*query_dv_timings)(struct v4l2_subdev *sd,
-			struct v4l2_dv_timings *timings);
 	int (*s_rx_buffer)(struct v4l2_subdev *sd, void *buf,
 			   unsigned int *size);
 	int (*pre_streamon)(struct v4l2_subdev *sd, u32 flags);
-- 
2.44.0.478.gd926399ef9-goog


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* Re: [PATCH 13/16] media: rcar-vin: Use pad variant of dv timing subdev calls
  2024-04-05 14:14 ` [PATCH 13/16] media: rcar-vin: " Paweł Anikiel
@ 2024-04-06 14:03   ` Niklas Söderlund
  0 siblings, 0 replies; 22+ messages in thread
From: Niklas Söderlund @ 2024-04-06 14:03 UTC (permalink / raw)
  To: Paweł Anikiel
  Cc: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	prabhakar.csengg, charles-antoine.couret, thierry.reding,
	jonathanh, skomatineni, luca.ceresoli, linux-media, linux-kernel,
	chromeos-krk-upstreaming

Hi Paweł,

Thanks for your work.

On 2024-04-05 14:14:08 +0000, Paweł Anikiel wrote:
> Use the pad variant for all (s|g|query)_dv_timings subdev calls, which
> includes a pad argument.
> 
> Signed-off-by: Paweł Anikiel <panikiel@google.com>

Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c b/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c
> index 073f70c6ac68..bb4b07bed28d 100644
> --- a/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c
> +++ b/drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c
> @@ -730,7 +730,8 @@ static int rvin_s_dv_timings(struct file *file, void *priv_fh,
>  	struct v4l2_subdev *sd = vin_to_source(vin);
>  	int ret;
>  
> -	ret = v4l2_subdev_call(sd, video, s_dv_timings, timings);
> +	ret = v4l2_subdev_call(sd, pad, s_dv_timings,
> +			       vin->parallel.sink_pad, timings);
>  	if (ret)
>  		return ret;
>  
> @@ -744,7 +745,8 @@ static int rvin_g_dv_timings(struct file *file, void *priv_fh,
>  	struct rvin_dev *vin = video_drvdata(file);
>  	struct v4l2_subdev *sd = vin_to_source(vin);
>  
> -	return v4l2_subdev_call(sd, video, g_dv_timings, timings);
> +	return v4l2_subdev_call(sd, pad, g_dv_timings,
> +				vin->parallel.sink_pad, timings);
>  }
>  
>  static int rvin_query_dv_timings(struct file *file, void *priv_fh,
> @@ -753,7 +755,8 @@ static int rvin_query_dv_timings(struct file *file, void *priv_fh,
>  	struct rvin_dev *vin = video_drvdata(file);
>  	struct v4l2_subdev *sd = vin_to_source(vin);
>  
> -	return v4l2_subdev_call(sd, video, query_dv_timings, timings);
> +	return v4l2_subdev_call(sd, pad, query_dv_timings,
> +				vin->parallel.sink_pad, timings);
>  }
>  
>  static int rvin_dv_timings_cap(struct file *file, void *priv_fh,
> -- 
> 2.44.0.478.gd926399ef9-goog
> 

-- 
Kind Regards,
Niklas Söderlund

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 02/16] media: i2c: adv748x: Switch dv timing callbacks to pad ops
  2024-04-05 14:13 ` [PATCH 02/16] media: i2c: adv748x: Switch dv timing callbacks to pad ops Paweł Anikiel
@ 2024-04-06 14:04   ` Niklas Söderlund
  0 siblings, 0 replies; 22+ messages in thread
From: Niklas Söderlund @ 2024-04-06 14:04 UTC (permalink / raw)
  To: Paweł Anikiel
  Cc: kieran.bingham, mchehab, hverkuil-cisco, tharvey,
	prabhakar.csengg, charles-antoine.couret, thierry.reding,
	jonathanh, skomatineni, luca.ceresoli, linux-media, linux-kernel,
	chromeos-krk-upstreaming

Hi Paweł,

Thanks for your work.

On 2024-04-05 14:13:57 +0000, Paweł Anikiel wrote:
> Change all (s|g|query)_dv_timings subdev callbacks to include
> a pad argument.
> 
> Signed-off-by: Paweł Anikiel <panikiel@google.com>

Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  drivers/media/i2c/adv748x/adv748x-hdmi.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/media/i2c/adv748x/adv748x-hdmi.c b/drivers/media/i2c/adv748x/adv748x-hdmi.c
> index ec151dc69c23..a4db9bae5f79 100644
> --- a/drivers/media/i2c/adv748x/adv748x-hdmi.c
> +++ b/drivers/media/i2c/adv748x/adv748x-hdmi.c
> @@ -214,7 +214,7 @@ static int adv748x_hdmi_set_video_timings(struct adv748x_state *state,
>   * v4l2_subdev_video_ops
>   */
>  
> -static int adv748x_hdmi_s_dv_timings(struct v4l2_subdev *sd,
> +static int adv748x_hdmi_s_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
>  				     struct v4l2_dv_timings *timings)
>  {
>  	struct adv748x_hdmi *hdmi = adv748x_sd_to_hdmi(sd);
> @@ -254,7 +254,7 @@ static int adv748x_hdmi_s_dv_timings(struct v4l2_subdev *sd,
>  	return ret;
>  }
>  
> -static int adv748x_hdmi_g_dv_timings(struct v4l2_subdev *sd,
> +static int adv748x_hdmi_g_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
>  				     struct v4l2_dv_timings *timings)
>  {
>  	struct adv748x_hdmi *hdmi = adv748x_sd_to_hdmi(sd);
> @@ -269,7 +269,7 @@ static int adv748x_hdmi_g_dv_timings(struct v4l2_subdev *sd,
>  	return 0;
>  }
>  
> -static int adv748x_hdmi_query_dv_timings(struct v4l2_subdev *sd,
> +static int adv748x_hdmi_query_dv_timings(struct v4l2_subdev *sd, unsigned int pad,
>  					 struct v4l2_dv_timings *timings)
>  {
>  	struct adv748x_hdmi *hdmi = adv748x_sd_to_hdmi(sd);
> @@ -392,9 +392,6 @@ static int adv748x_hdmi_g_pixelaspect(struct v4l2_subdev *sd,
>  }
>  
>  static const struct v4l2_subdev_video_ops adv748x_video_ops_hdmi = {
> -	.s_dv_timings = adv748x_hdmi_s_dv_timings,
> -	.g_dv_timings = adv748x_hdmi_g_dv_timings,
> -	.query_dv_timings = adv748x_hdmi_query_dv_timings,
>  	.g_input_status = adv748x_hdmi_g_input_status,
>  	.s_stream = adv748x_hdmi_s_stream,
>  	.g_pixelaspect = adv748x_hdmi_g_pixelaspect,
> @@ -413,7 +410,7 @@ static int adv748x_hdmi_propagate_pixelrate(struct adv748x_hdmi *hdmi)
>  	if (!tx)
>  		return -ENOLINK;
>  
> -	adv748x_hdmi_query_dv_timings(&hdmi->sd, &timings);
> +	adv748x_hdmi_query_dv_timings(&hdmi->sd, 0, &timings);
>  
>  	return adv748x_csi2_set_pixelrate(tx, timings.bt.pixelclock);
>  }
> @@ -610,6 +607,9 @@ static const struct v4l2_subdev_pad_ops adv748x_pad_ops_hdmi = {
>  	.get_fmt = adv748x_hdmi_get_format,
>  	.get_edid = adv748x_hdmi_get_edid,
>  	.set_edid = adv748x_hdmi_set_edid,
> +	.s_dv_timings = adv748x_hdmi_s_dv_timings,
> +	.g_dv_timings = adv748x_hdmi_g_dv_timings,
> +	.query_dv_timings = adv748x_hdmi_query_dv_timings,
>  	.dv_timings_cap = adv748x_hdmi_dv_timings_cap,
>  	.enum_dv_timings = adv748x_hdmi_enum_dv_timings,
>  };
> @@ -734,7 +734,7 @@ int adv748x_hdmi_init(struct adv748x_hdmi *hdmi)
>  	struct v4l2_dv_timings cea1280x720 = V4L2_DV_BT_CEA_1280X720P30;
>  	int ret;
>  
> -	adv748x_hdmi_s_dv_timings(&hdmi->sd, &cea1280x720);
> +	adv748x_hdmi_s_dv_timings(&hdmi->sd, 0, &cea1280x720);
>  
>  	/* Initialise a default 16:9 aspect ratio */
>  	hdmi->aspect_ratio.numerator = 16;
> -- 
> 2.44.0.478.gd926399ef9-goog
> 

-- 
Kind Regards,
Niklas Söderlund

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 00/16] Switch subdev dv timing callbacks to pad ops
  2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
                   ` (15 preceding siblings ...)
  2024-04-05 14:14 ` [PATCH 16/16] media: v4l2-subdev: Remove non-pad dv timing callbacks Paweł Anikiel
@ 2024-04-08 14:15 ` Hans Verkuil
  2024-04-08 14:17   ` Hans Verkuil
  16 siblings, 1 reply; 22+ messages in thread
From: Hans Verkuil @ 2024-04-08 14:15 UTC (permalink / raw)
  To: Paweł Anikiel, kieran.bingham, mchehab, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming

On 05/04/2024 16:13, Paweł Anikiel wrote:
> Currently, subdev dv timing calls (i.e. g/s/query_dv_timings) are video
> ops without a pad argument. This is a problem if the subdevice can have
> different dv timings for each pad (e.g. a DisplayPort receiver with
> multiple virtual channels).
> 
> This patchset changes subdev dv timing callbacks to include a pad
> argument, and moves them from video to pad ops. All the affected
> drivers are updated to use the new pad ops version.
> 
> The affected drivers were updated in a way that mathes how they deal
> with the pad argument in other callbacks (mainly enum_dv_timings,
> dv_timings_cap, get/set_edid).
> 
> This was originally a part of a larger patchset:
> https://lore.kernel.org/lkml/20240221160215.484151-2-panikiel@google.com/
> 
> Paweł Anikiel (16):
>   media: v4l2-subdev: Add pad versions of dv timing subdev calls
>   media: i2c: adv748x: Switch dv timing callbacks to pad ops
>   media: i2c: adv7511: Switch dv timing callbacks to pad ops
>   media: i2c: adv7604: Switch dv timing callbacks to pad ops
>   media: i2c: adv7842: Switch dv timing callbacks to pad ops
>   media: i2c: tc358743: Switch dv timing callbacks to pad ops
>   media: i2c: tda1997x: Switch dv timing callbacks to pad ops
>   media: i2c: ths7303: Switch dv timing callbacks to pad ops
>   media: i2c: ths8200: Switch dv timing callbacks to pad ops
>   media: i2c: tvp7002: Switch dv timing callbacks to pad ops
>   media: spi: gs1662: Switch dv timing callbacks to pad ops
>   media: cobalt: Use pad variant of dv timing subdev calls
>   media: rcar-vin: Use pad variant of dv timing subdev calls
>   media: vpif_capture: Use pad variant of dv timing subdev calls
>   media: tegra-video: Use pad variant of dv timing subdev calls
>   media: v4l2-subdev: Remove non-pad dv timing callbacks

You missed one:

In file included from include/media/v4l2-device.h:13,
                 from drivers/media/platform/ti/davinci/vpif_display.h:13,
                 from drivers/media/platform/ti/davinci/vpif_display.c:26:
drivers/media/platform/ti/davinci/vpif_display.c: In function 'vpif_s_dv_timings':
include/media/v4l2-subdev.h:1816:56: error: 'const struct v4l2_subdev_video_ops' has no member named 's_dv_timings'
 1816 |                 else if (!(__sd->ops->o && __sd->ops->o->f))            \
      |                                                        ^~
drivers/media/platform/ti/davinci/vpif_display.c:937:15: note: in expansion of macro 'v4l2_subdev_call'
  937 |         ret = v4l2_subdev_call(ch->sd, video, s_dv_timings, timings);
      |               ^~~~~~~~~~~~~~~~
include/media/v4l2-subdev.h:1819:53: error: 'const struct v4l2_subdev_video_ops' has no member named 's_dv_timings'
 1819 |                          v4l2_subdev_call_wrappers.o->f)                \
      |                                                     ^~
drivers/media/platform/ti/davinci/vpif_display.c:937:15: note: in expansion of macro 'v4l2_subdev_call'
  937 |         ret = v4l2_subdev_call(ch->sd, video, s_dv_timings, timings);
      |               ^~~~~~~~~~~~~~~~
include/media/v4l2-subdev.h:1820:63: error: 'const struct v4l2_subdev_video_ops' has no member named 's_dv_timings'
 1820 |                         __result = v4l2_subdev_call_wrappers.o->f(      \
      |                                                               ^~
drivers/media/platform/ti/davinci/vpif_display.c:937:15: note: in expansion of macro 'v4l2_subdev_call'
  937 |         ret = v4l2_subdev_call(ch->sd, video, s_dv_timings, timings);
      |               ^~~~~~~~~~~~~~~~
include/media/v4l2-subdev.h:1823:48: error: 'const struct v4l2_subdev_video_ops' has no member named 's_dv_timings'
 1823 |                         __result = __sd->ops->o->f(__sd, ##args);       \
      |                                                ^~
drivers/media/platform/ti/davinci/vpif_display.c:937:15: note: in expansion of macro 'v4l2_subdev_call'
  937 |         ret = v4l2_subdev_call(ch->sd, video, s_dv_timings, timings);
      |               ^~~~~~~~~~~~~~~~
drivers/media/platform/ti/davinci/vpif_display.c:937:15: error: no member 's_dv_timings' in struct v4l2_subdev_video_ops
drivers/media/platform/ti/davinci/vpif_display.c:937:15: error: no member 's_dv_timings' in struct v4l2_subdev_video_ops
drivers/media/platform/ti/davinci/vpif_display.c:937:15: error: no member 's_dv_timings' in struct v4l2_subdev_video_ops
drivers/media/platform/ti/davinci/vpif_display.c:937:15: error: no member 's_dv_timings' in struct v4l2_subdev_video_ops

Regards,

	Hans

> 
>  drivers/media/i2c/adv748x/adv748x-hdmi.c      | 16 ++++----
>  drivers/media/i2c/adv7511-v4l2.c              | 14 +++++--
>  drivers/media/i2c/adv7604.c                   | 14 +++----
>  drivers/media/i2c/adv7842.c                   | 25 ++++++++----
>  drivers/media/i2c/tc358743.c                  | 23 +++++++----
>  drivers/media/i2c/tda1997x.c                  | 12 +++---
>  drivers/media/i2c/ths7303.c                   |  8 +++-
>  drivers/media/i2c/ths8200.c                   | 14 +++++--
>  drivers/media/i2c/tvp7002.c                   | 26 +++++++++----
>  drivers/media/pci/cobalt/cobalt-v4l2.c        | 12 +++---
>  .../platform/renesas/rcar-vin/rcar-v4l2.c     |  9 +++--
>  .../media/platform/ti/davinci/vpif_capture.c  |  4 +-
>  drivers/media/spi/gs1662.c                    | 21 +++++++---
>  drivers/media/v4l2-core/v4l2-subdev.c         | 39 +++++++++++++++++--
>  drivers/staging/media/tegra-video/vi.c        | 12 +++---
>  include/media/v4l2-subdev.h                   | 28 ++++++-------
>  16 files changed, 183 insertions(+), 94 deletions(-)
> 


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 00/16] Switch subdev dv timing callbacks to pad ops
  2024-04-08 14:15 ` [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Hans Verkuil
@ 2024-04-08 14:17   ` Hans Verkuil
  2024-04-08 15:25     ` Paweł Anikiel
  0 siblings, 1 reply; 22+ messages in thread
From: Hans Verkuil @ 2024-04-08 14:17 UTC (permalink / raw)
  To: Paweł Anikiel, kieran.bingham, mchehab, tharvey,
	niklas.soderlund, prabhakar.csengg, charles-antoine.couret,
	thierry.reding, jonathanh, skomatineni, luca.ceresoli
  Cc: linux-media, linux-kernel, chromeos-krk-upstreaming

On 08/04/2024 16:15, Hans Verkuil wrote:
> On 05/04/2024 16:13, Paweł Anikiel wrote:
>> Currently, subdev dv timing calls (i.e. g/s/query_dv_timings) are video
>> ops without a pad argument. This is a problem if the subdevice can have
>> different dv timings for each pad (e.g. a DisplayPort receiver with
>> multiple virtual channels).
>>
>> This patchset changes subdev dv timing callbacks to include a pad
>> argument, and moves them from video to pad ops. All the affected
>> drivers are updated to use the new pad ops version.
>>
>> The affected drivers were updated in a way that mathes how they deal
>> with the pad argument in other callbacks (mainly enum_dv_timings,
>> dv_timings_cap, get/set_edid).
>>
>> This was originally a part of a larger patchset:
>> https://lore.kernel.org/lkml/20240221160215.484151-2-panikiel@google.com/
>>
>> Paweł Anikiel (16):
>>   media: v4l2-subdev: Add pad versions of dv timing subdev calls
>>   media: i2c: adv748x: Switch dv timing callbacks to pad ops
>>   media: i2c: adv7511: Switch dv timing callbacks to pad ops
>>   media: i2c: adv7604: Switch dv timing callbacks to pad ops
>>   media: i2c: adv7842: Switch dv timing callbacks to pad ops
>>   media: i2c: tc358743: Switch dv timing callbacks to pad ops
>>   media: i2c: tda1997x: Switch dv timing callbacks to pad ops
>>   media: i2c: ths7303: Switch dv timing callbacks to pad ops
>>   media: i2c: ths8200: Switch dv timing callbacks to pad ops
>>   media: i2c: tvp7002: Switch dv timing callbacks to pad ops
>>   media: spi: gs1662: Switch dv timing callbacks to pad ops
>>   media: cobalt: Use pad variant of dv timing subdev calls
>>   media: rcar-vin: Use pad variant of dv timing subdev calls
>>   media: vpif_capture: Use pad variant of dv timing subdev calls
>>   media: tegra-video: Use pad variant of dv timing subdev calls
>>   media: v4l2-subdev: Remove non-pad dv timing callbacks
> 
> You missed one:
> 
> In file included from include/media/v4l2-device.h:13,
>                  from drivers/media/platform/ti/davinci/vpif_display.h:13,
>                  from drivers/media/platform/ti/davinci/vpif_display.c:26:
> drivers/media/platform/ti/davinci/vpif_display.c: In function 'vpif_s_dv_timings':
> include/media/v4l2-subdev.h:1816:56: error: 'const struct v4l2_subdev_video_ops' has no member named 's_dv_timings'
>  1816 |                 else if (!(__sd->ops->o && __sd->ops->o->f))            \
>       |                                                        ^~
> drivers/media/platform/ti/davinci/vpif_display.c:937:15: note: in expansion of macro 'v4l2_subdev_call'
>   937 |         ret = v4l2_subdev_call(ch->sd, video, s_dv_timings, timings);
>       |               ^~~~~~~~~~~~~~~~
> include/media/v4l2-subdev.h:1819:53: error: 'const struct v4l2_subdev_video_ops' has no member named 's_dv_timings'
>  1819 |                          v4l2_subdev_call_wrappers.o->f)                \
>       |                                                     ^~
> drivers/media/platform/ti/davinci/vpif_display.c:937:15: note: in expansion of macro 'v4l2_subdev_call'
>   937 |         ret = v4l2_subdev_call(ch->sd, video, s_dv_timings, timings);
>       |               ^~~~~~~~~~~~~~~~
> include/media/v4l2-subdev.h:1820:63: error: 'const struct v4l2_subdev_video_ops' has no member named 's_dv_timings'
>  1820 |                         __result = v4l2_subdev_call_wrappers.o->f(      \
>       |                                                               ^~
> drivers/media/platform/ti/davinci/vpif_display.c:937:15: note: in expansion of macro 'v4l2_subdev_call'
>   937 |         ret = v4l2_subdev_call(ch->sd, video, s_dv_timings, timings);
>       |               ^~~~~~~~~~~~~~~~
> include/media/v4l2-subdev.h:1823:48: error: 'const struct v4l2_subdev_video_ops' has no member named 's_dv_timings'
>  1823 |                         __result = __sd->ops->o->f(__sd, ##args);       \
>       |                                                ^~
> drivers/media/platform/ti/davinci/vpif_display.c:937:15: note: in expansion of macro 'v4l2_subdev_call'
>   937 |         ret = v4l2_subdev_call(ch->sd, video, s_dv_timings, timings);
>       |               ^~~~~~~~~~~~~~~~
> drivers/media/platform/ti/davinci/vpif_display.c:937:15: error: no member 's_dv_timings' in struct v4l2_subdev_video_ops
> drivers/media/platform/ti/davinci/vpif_display.c:937:15: error: no member 's_dv_timings' in struct v4l2_subdev_video_ops
> drivers/media/platform/ti/davinci/vpif_display.c:937:15: error: no member 's_dv_timings' in struct v4l2_subdev_video_ops
> drivers/media/platform/ti/davinci/vpif_display.c:937:15: error: no member 's_dv_timings' in struct v4l2_subdev_video_ops

No need to post a v2. Just post a single patch '14.5/16' to convert vpif_display that
will be added after patch [14/16], then I'll take care of it.

Regards,

	Hans

> 
> Regards,
> 
> 	Hans
> 
>>
>>  drivers/media/i2c/adv748x/adv748x-hdmi.c      | 16 ++++----
>>  drivers/media/i2c/adv7511-v4l2.c              | 14 +++++--
>>  drivers/media/i2c/adv7604.c                   | 14 +++----
>>  drivers/media/i2c/adv7842.c                   | 25 ++++++++----
>>  drivers/media/i2c/tc358743.c                  | 23 +++++++----
>>  drivers/media/i2c/tda1997x.c                  | 12 +++---
>>  drivers/media/i2c/ths7303.c                   |  8 +++-
>>  drivers/media/i2c/ths8200.c                   | 14 +++++--
>>  drivers/media/i2c/tvp7002.c                   | 26 +++++++++----
>>  drivers/media/pci/cobalt/cobalt-v4l2.c        | 12 +++---
>>  .../platform/renesas/rcar-vin/rcar-v4l2.c     |  9 +++--
>>  .../media/platform/ti/davinci/vpif_capture.c  |  4 +-
>>  drivers/media/spi/gs1662.c                    | 21 +++++++---
>>  drivers/media/v4l2-core/v4l2-subdev.c         | 39 +++++++++++++++++--
>>  drivers/staging/media/tegra-video/vi.c        | 12 +++---
>>  include/media/v4l2-subdev.h                   | 28 ++++++-------
>>  16 files changed, 183 insertions(+), 94 deletions(-)
>>
> 
> 


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 00/16] Switch subdev dv timing callbacks to pad ops
  2024-04-08 14:17   ` Hans Verkuil
@ 2024-04-08 15:25     ` Paweł Anikiel
  0 siblings, 0 replies; 22+ messages in thread
From: Paweł Anikiel @ 2024-04-08 15:25 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: kieran.bingham, mchehab, tharvey, niklas.soderlund,
	prabhakar.csengg, charles-antoine.couret, thierry.reding,
	jonathanh, skomatineni, luca.ceresoli, linux-media, linux-kernel,
	chromeos-krk-upstreaming

On Mon, Apr 8, 2024 at 4:18 PM Hans Verkuil <hverkuil-cisco@xs4all.nl> wrote:
>
> On 08/04/2024 16:15, Hans Verkuil wrote:
> > On 05/04/2024 16:13, Paweł Anikiel wrote:
> >> Currently, subdev dv timing calls (i.e. g/s/query_dv_timings) are video
> >> ops without a pad argument. This is a problem if the subdevice can have
> >> different dv timings for each pad (e.g. a DisplayPort receiver with
> >> multiple virtual channels).
> >>
> >> This patchset changes subdev dv timing callbacks to include a pad
> >> argument, and moves them from video to pad ops. All the affected
> >> drivers are updated to use the new pad ops version.
> >>
> >> The affected drivers were updated in a way that mathes how they deal
> >> with the pad argument in other callbacks (mainly enum_dv_timings,
> >> dv_timings_cap, get/set_edid).
> >>
> >> This was originally a part of a larger patchset:
> >> https://lore.kernel.org/lkml/20240221160215.484151-2-panikiel@google.com/
> >>
> >> Paweł Anikiel (16):
> >>   media: v4l2-subdev: Add pad versions of dv timing subdev calls
> >>   media: i2c: adv748x: Switch dv timing callbacks to pad ops
> >>   media: i2c: adv7511: Switch dv timing callbacks to pad ops
> >>   media: i2c: adv7604: Switch dv timing callbacks to pad ops
> >>   media: i2c: adv7842: Switch dv timing callbacks to pad ops
> >>   media: i2c: tc358743: Switch dv timing callbacks to pad ops
> >>   media: i2c: tda1997x: Switch dv timing callbacks to pad ops
> >>   media: i2c: ths7303: Switch dv timing callbacks to pad ops
> >>   media: i2c: ths8200: Switch dv timing callbacks to pad ops
> >>   media: i2c: tvp7002: Switch dv timing callbacks to pad ops
> >>   media: spi: gs1662: Switch dv timing callbacks to pad ops
> >>   media: cobalt: Use pad variant of dv timing subdev calls
> >>   media: rcar-vin: Use pad variant of dv timing subdev calls
> >>   media: vpif_capture: Use pad variant of dv timing subdev calls
> >>   media: tegra-video: Use pad variant of dv timing subdev calls
> >>   media: v4l2-subdev: Remove non-pad dv timing callbacks
> >
> > You missed one:
> >
> > In file included from include/media/v4l2-device.h:13,
> >                  from drivers/media/platform/ti/davinci/vpif_display.h:13,
> >                  from drivers/media/platform/ti/davinci/vpif_display.c:26:
> > drivers/media/platform/ti/davinci/vpif_display.c: In function 'vpif_s_dv_timings':
> > include/media/v4l2-subdev.h:1816:56: error: 'const struct v4l2_subdev_video_ops' has no member named 's_dv_timings'
> >  1816 |                 else if (!(__sd->ops->o && __sd->ops->o->f))            \
> >       |                                                        ^~
> > drivers/media/platform/ti/davinci/vpif_display.c:937:15: note: in expansion of macro 'v4l2_subdev_call'
> >   937 |         ret = v4l2_subdev_call(ch->sd, video, s_dv_timings, timings);
> >       |               ^~~~~~~~~~~~~~~~
> > include/media/v4l2-subdev.h:1819:53: error: 'const struct v4l2_subdev_video_ops' has no member named 's_dv_timings'
> >  1819 |                          v4l2_subdev_call_wrappers.o->f)                \
> >       |                                                     ^~
> > drivers/media/platform/ti/davinci/vpif_display.c:937:15: note: in expansion of macro 'v4l2_subdev_call'
> >   937 |         ret = v4l2_subdev_call(ch->sd, video, s_dv_timings, timings);
> >       |               ^~~~~~~~~~~~~~~~
> > include/media/v4l2-subdev.h:1820:63: error: 'const struct v4l2_subdev_video_ops' has no member named 's_dv_timings'
> >  1820 |                         __result = v4l2_subdev_call_wrappers.o->f(      \
> >       |                                                               ^~
> > drivers/media/platform/ti/davinci/vpif_display.c:937:15: note: in expansion of macro 'v4l2_subdev_call'
> >   937 |         ret = v4l2_subdev_call(ch->sd, video, s_dv_timings, timings);
> >       |               ^~~~~~~~~~~~~~~~
> > include/media/v4l2-subdev.h:1823:48: error: 'const struct v4l2_subdev_video_ops' has no member named 's_dv_timings'
> >  1823 |                         __result = __sd->ops->o->f(__sd, ##args);       \
> >       |                                                ^~
> > drivers/media/platform/ti/davinci/vpif_display.c:937:15: note: in expansion of macro 'v4l2_subdev_call'
> >   937 |         ret = v4l2_subdev_call(ch->sd, video, s_dv_timings, timings);
> >       |               ^~~~~~~~~~~~~~~~
> > drivers/media/platform/ti/davinci/vpif_display.c:937:15: error: no member 's_dv_timings' in struct v4l2_subdev_video_ops
> > drivers/media/platform/ti/davinci/vpif_display.c:937:15: error: no member 's_dv_timings' in struct v4l2_subdev_video_ops
> > drivers/media/platform/ti/davinci/vpif_display.c:937:15: error: no member 's_dv_timings' in struct v4l2_subdev_video_ops
> > drivers/media/platform/ti/davinci/vpif_display.c:937:15: error: no member 's_dv_timings' in struct v4l2_subdev_video_ops
>
> No need to post a v2. Just post a single patch '14.5/16' to convert vpif_display that
> will be added after patch [14/16], then I'll take care of it.

I probably thought vpif-capture.c and vpif-display.c were the same
file. I sent the 14.5 patch as you requested.

As an aside, how did you run the compile test? It would be nice to
know for the future. For this, I did a few greps and manually enabled
all the drivers in menuconfig. Is there a better way?

Regards,
Paweł

>
> Regards,
>
>         Hans
>
> >
> > Regards,
> >
> >       Hans
> >
> >>
> >>  drivers/media/i2c/adv748x/adv748x-hdmi.c      | 16 ++++----
> >>  drivers/media/i2c/adv7511-v4l2.c              | 14 +++++--
> >>  drivers/media/i2c/adv7604.c                   | 14 +++----
> >>  drivers/media/i2c/adv7842.c                   | 25 ++++++++----
> >>  drivers/media/i2c/tc358743.c                  | 23 +++++++----
> >>  drivers/media/i2c/tda1997x.c                  | 12 +++---
> >>  drivers/media/i2c/ths7303.c                   |  8 +++-
> >>  drivers/media/i2c/ths8200.c                   | 14 +++++--
> >>  drivers/media/i2c/tvp7002.c                   | 26 +++++++++----
> >>  drivers/media/pci/cobalt/cobalt-v4l2.c        | 12 +++---
> >>  .../platform/renesas/rcar-vin/rcar-v4l2.c     |  9 +++--
> >>  .../media/platform/ti/davinci/vpif_capture.c  |  4 +-
> >>  drivers/media/spi/gs1662.c                    | 21 +++++++---
> >>  drivers/media/v4l2-core/v4l2-subdev.c         | 39 +++++++++++++++++--
> >>  drivers/staging/media/tegra-video/vi.c        | 12 +++---
> >>  include/media/v4l2-subdev.h                   | 28 ++++++-------
> >>  16 files changed, 183 insertions(+), 94 deletions(-)
> >>
> >
> >
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2024-04-08 15:25 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-05 14:13 [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Paweł Anikiel
2024-04-05 14:13 ` [PATCH 01/16] media: v4l2-subdev: Add pad versions of dv timing subdev calls Paweł Anikiel
2024-04-05 14:13 ` [PATCH 02/16] media: i2c: adv748x: Switch dv timing callbacks to pad ops Paweł Anikiel
2024-04-06 14:04   ` Niklas Söderlund
2024-04-05 14:13 ` [PATCH 03/16] media: i2c: adv7511: " Paweł Anikiel
2024-04-05 14:13 ` [PATCH 04/16] media: i2c: adv7604: " Paweł Anikiel
2024-04-05 14:14 ` [PATCH 05/16] media: i2c: adv7842: " Paweł Anikiel
2024-04-05 14:14 ` [PATCH 06/16] media: i2c: tc358743: " Paweł Anikiel
2024-04-05 14:14 ` [PATCH 07/16] media: i2c: tda1997x: " Paweł Anikiel
2024-04-05 14:14 ` [PATCH 08/16] media: i2c: ths7303: " Paweł Anikiel
2024-04-05 14:14 ` [PATCH 09/16] media: i2c: ths8200: " Paweł Anikiel
2024-04-05 14:14 ` [PATCH 10/16] media: i2c: tvp7002: " Paweł Anikiel
2024-04-05 14:14 ` [PATCH 11/16] media: spi: gs1662: " Paweł Anikiel
2024-04-05 14:14 ` [PATCH 12/16] media: cobalt: Use pad variant of dv timing subdev calls Paweł Anikiel
2024-04-05 14:14 ` [PATCH 13/16] media: rcar-vin: " Paweł Anikiel
2024-04-06 14:03   ` Niklas Söderlund
2024-04-05 14:14 ` [PATCH 14/16] media: vpif_capture: " Paweł Anikiel
2024-04-05 14:14 ` [PATCH 15/16] media: tegra-video: " Paweł Anikiel
2024-04-05 14:14 ` [PATCH 16/16] media: v4l2-subdev: Remove non-pad dv timing callbacks Paweł Anikiel
2024-04-08 14:15 ` [PATCH 00/16] Switch subdev dv timing callbacks to pad ops Hans Verkuil
2024-04-08 14:17   ` Hans Verkuil
2024-04-08 15:25     ` Paweł Anikiel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox