diff mbox series

[v6,3/8] media: subdev: add v4l2_subdev_get_pad_* helpers

Message ID 20220324080030.216716-4-tomi.valkeinen@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series v4l: subdev active state | expand

Commit Message

Tomi Valkeinen March 24, 2022, 8 a.m. UTC
The subdev state is now used for both try and active cases. We should
rename v4l2_subdev_get_try_* helpers to v4l2_subdev_get_pad_*, but due
to the size of that change lets add temporary wrapper helpers which can
be used in drivers that support active state.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
 include/media/v4l2-subdev.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Hans Verkuil April 6, 2022, 1:36 p.m. UTC | #1
On 24/03/2022 09:00, Tomi Valkeinen wrote:
> The subdev state is now used for both try and active cases. We should
> rename v4l2_subdev_get_try_* helpers to v4l2_subdev_get_pad_*, but due
> to the size of that change lets add temporary wrapper helpers which can
> be used in drivers that support active state.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

> ---
>  include/media/v4l2-subdev.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
> index 1bbe4383966c..b9587a265b32 100644
> --- a/include/media/v4l2-subdev.h
> +++ b/include/media/v4l2-subdev.h
> @@ -1042,6 +1042,16 @@ v4l2_subdev_get_try_compose(struct v4l2_subdev *sd,
>  	return &state->pads[pad].try_compose;
>  }
>  
> +/* Temprary helpers until v4l2_subdev_get_try_* functions have been renamed */
> +#define v4l2_subdev_get_pad_format(sd, state, pad) \
> +	v4l2_subdev_get_try_format(sd, state, pad)
> +
> +#define v4l2_subdev_get_pad_crop(sd, state, pad) \
> +	v4l2_subdev_get_try_crop(sd, state, pad)
> +
> +#define v4l2_subdev_get_pad_compose(sd, state, pad) \
> +	v4l2_subdev_get_try_compose(sd, state, pad)
> +
>  #endif
>  
>  extern const struct v4l2_file_operations v4l2_subdev_fops;
Hans Verkuil April 6, 2022, 1:52 p.m. UTC | #2
On 06/04/2022 15:36, Hans Verkuil wrote:
> 
> 
> On 24/03/2022 09:00, Tomi Valkeinen wrote:
>> The subdev state is now used for both try and active cases. We should
>> rename v4l2_subdev_get_try_* helpers to v4l2_subdev_get_pad_*, but due
>> to the size of that change lets add temporary wrapper helpers which can
>> be used in drivers that support active state.
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> 
> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> 
>> ---
>>  include/media/v4l2-subdev.h | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
>> index 1bbe4383966c..b9587a265b32 100644
>> --- a/include/media/v4l2-subdev.h
>> +++ b/include/media/v4l2-subdev.h
>> @@ -1042,6 +1042,16 @@ v4l2_subdev_get_try_compose(struct v4l2_subdev *sd,
>>  	return &state->pads[pad].try_compose;
>>  }
>>  
>> +/* Temprary helpers until v4l2_subdev_get_try_* functions have been renamed */
>> +#define v4l2_subdev_get_pad_format(sd, state, pad) \
>> +	v4l2_subdev_get_try_format(sd, state, pad)
>> +
>> +#define v4l2_subdev_get_pad_crop(sd, state, pad) \
>> +	v4l2_subdev_get_try_crop(sd, state, pad)
>> +
>> +#define v4l2_subdev_get_pad_compose(sd, state, pad) \
>> +	v4l2_subdev_get_try_compose(sd, state, pad)

Actually, wouldn't it be better to rename the try helpers and
add #defines for the old names?

I think I prefer that.

Regards,

	Hans

>> +
>>  #endif
>>  
>>  extern const struct v4l2_file_operations v4l2_subdev_fops;
Tomi Valkeinen April 7, 2022, 5:22 a.m. UTC | #3
On 06/04/2022 16:52, Hans Verkuil wrote:
> 
> 
> On 06/04/2022 15:36, Hans Verkuil wrote:
>>
>>
>> On 24/03/2022 09:00, Tomi Valkeinen wrote:
>>> The subdev state is now used for both try and active cases. We should
>>> rename v4l2_subdev_get_try_* helpers to v4l2_subdev_get_pad_*, but due
>>> to the size of that change lets add temporary wrapper helpers which can
>>> be used in drivers that support active state.
>>>
>>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
>>
>> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
>>
>>> ---
>>>   include/media/v4l2-subdev.h | 10 ++++++++++
>>>   1 file changed, 10 insertions(+)
>>>
>>> diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
>>> index 1bbe4383966c..b9587a265b32 100644
>>> --- a/include/media/v4l2-subdev.h
>>> +++ b/include/media/v4l2-subdev.h
>>> @@ -1042,6 +1042,16 @@ v4l2_subdev_get_try_compose(struct v4l2_subdev *sd,
>>>   	return &state->pads[pad].try_compose;
>>>   }
>>>   
>>> +/* Temprary helpers until v4l2_subdev_get_try_* functions have been renamed */
>>> +#define v4l2_subdev_get_pad_format(sd, state, pad) \
>>> +	v4l2_subdev_get_try_format(sd, state, pad)
>>> +
>>> +#define v4l2_subdev_get_pad_crop(sd, state, pad) \
>>> +	v4l2_subdev_get_try_crop(sd, state, pad)
>>> +
>>> +#define v4l2_subdev_get_pad_compose(sd, state, pad) \
>>> +	v4l2_subdev_get_try_compose(sd, state, pad)
> 
> Actually, wouldn't it be better to rename the try helpers and
> add #defines for the old names?
> 
> I think I prefer that.

Yes, that's a good idea.

  Tomi
diff mbox series

Patch

diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 1bbe4383966c..b9587a265b32 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -1042,6 +1042,16 @@  v4l2_subdev_get_try_compose(struct v4l2_subdev *sd,
 	return &state->pads[pad].try_compose;
 }
 
+/* Temprary helpers until v4l2_subdev_get_try_* functions have been renamed */
+#define v4l2_subdev_get_pad_format(sd, state, pad) \
+	v4l2_subdev_get_try_format(sd, state, pad)
+
+#define v4l2_subdev_get_pad_crop(sd, state, pad) \
+	v4l2_subdev_get_try_crop(sd, state, pad)
+
+#define v4l2_subdev_get_pad_compose(sd, state, pad) \
+	v4l2_subdev_get_try_compose(sd, state, pad)
+
 #endif
 
 extern const struct v4l2_file_operations v4l2_subdev_fops;