linux-rockchip.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Add format MEDIA_BUS_FMT_METADATA_FIXED and use it in rkisp1
@ 2020-09-22 16:58 Dafna Hirschfeld
  2020-09-22 16:58 ` [PATCH 1/2] meida: uapi: add MEDIA_BUS_FMT_METADATA_FIXED media bus format Dafna Hirschfeld
  2020-09-22 16:58 ` [PATCH 2/2] media: staging: rkisp1: isp: set metadata pads to MEDIA_BUS_FMT_METADATA_FIXED Dafna Hirschfeld
  0 siblings, 2 replies; 6+ messages in thread
From: Dafna Hirschfeld @ 2020-09-22 16:58 UTC (permalink / raw)
  To: linux-media
  Cc: mchehab, dafna.hirschfeld, dafna3, tfiga, hverkuil,
	linux-rockchip, helen.koike, laurent.pinchart, sakari.ailus,
	kernel, ezequiel

There are 2 pads between the entities
rkisp1_isp to rkisp1_params and rkisp1_stats that transmit
metadata. This metadata is fixed and not configurable from
userspace. Since the metadata has no dimensions, it makes
sense to set the width and height of these pads to 0.
The problem is that it makes the v4l-compliance tests fail.
Currently, in order to silent the tests, the width
and height are set to RKISP1_DEFAULT_*

This patchset sets the dimensions to 0 and solves the
compliance error by introducing a new media bus code
MEDIA_BUS_FMT_METADATA_FIXED

The new code should be used when
the same driver handles both sides of the link and
the bus format is a fixed metadata format that is
not configurable from userspace.

Then the v4l2-compliance tests can skip the
dimensions test for this media bus code.

See irc discussion for that issue:
https://linuxtv.org/irc/irclogger_log/v4l?date=2020-05-13,Wed
https://linuxtv.org/irc/irclogger_log/v4l?date=2020-05-14,Thu



Dafna Hirschfeld (2):
  meida: uapi: add MEDIA_BUS_FMT_METADATA_FIXED media bus format.
  media: staging: rkisp1: isp: set metadata pads to
    MEDIA_BUS_FMT_METADATA_FIXED

 drivers/staging/media/rkisp1/TODO         | 1 -
 drivers/staging/media/rkisp1/rkisp1-isp.c | 8 ++++----
 include/uapi/linux/media-bus-format.h     | 8 ++++++++
 3 files changed, 12 insertions(+), 5 deletions(-)

-- 
2.17.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH 1/2] meida: uapi: add MEDIA_BUS_FMT_METADATA_FIXED media bus format.
  2020-09-22 16:58 [PATCH 0/2] Add format MEDIA_BUS_FMT_METADATA_FIXED and use it in rkisp1 Dafna Hirschfeld
@ 2020-09-22 16:58 ` Dafna Hirschfeld
  2020-10-14 20:40   ` Helen Koike
  2020-09-22 16:58 ` [PATCH 2/2] media: staging: rkisp1: isp: set metadata pads to MEDIA_BUS_FMT_METADATA_FIXED Dafna Hirschfeld
  1 sibling, 1 reply; 6+ messages in thread
From: Dafna Hirschfeld @ 2020-09-22 16:58 UTC (permalink / raw)
  To: linux-media
  Cc: mchehab, dafna.hirschfeld, dafna3, tfiga, hverkuil,
	linux-rockchip, helen.koike, laurent.pinchart, sakari.ailus,
	kernel, ezequiel

MEDIA_BUS_FMT_METADATA_FIXED should be used when
the same driver handles both sides of the link and
the bus format is a fixed metadata format that is
not configurable from userspace.

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
---
 include/uapi/linux/media-bus-format.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h
index 84fa53ffb13f..847b45fb546b 100644
--- a/include/uapi/linux/media-bus-format.h
+++ b/include/uapi/linux/media-bus-format.h
@@ -156,4 +156,12 @@
 /* HSV - next is	0x6002 */
 #define MEDIA_BUS_FMT_AHSV8888_1X32		0x6001
 
+/*
+ * This format should be used when the same driver handles
+ * both sides of the link and the bus format is a fixed
+ * metadata format that is not configurable from userspace.
+ * This format may have 0 height and width.
+ */
+#define MEDIA_BUS_FMT_METADATA_FIXED		0x7001
+
 #endif /* __LINUX_MEDIA_BUS_FORMAT_H */
-- 
2.17.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH 2/2] media: staging: rkisp1: isp: set metadata pads to MEDIA_BUS_FMT_METADATA_FIXED
  2020-09-22 16:58 [PATCH 0/2] Add format MEDIA_BUS_FMT_METADATA_FIXED and use it in rkisp1 Dafna Hirschfeld
  2020-09-22 16:58 ` [PATCH 1/2] meida: uapi: add MEDIA_BUS_FMT_METADATA_FIXED media bus format Dafna Hirschfeld
@ 2020-09-22 16:58 ` Dafna Hirschfeld
  2020-10-14 20:40   ` Helen Koike
  1 sibling, 1 reply; 6+ messages in thread
From: Dafna Hirschfeld @ 2020-09-22 16:58 UTC (permalink / raw)
  To: linux-media
  Cc: mchehab, dafna.hirschfeld, dafna3, tfiga, hverkuil,
	linux-rockchip, helen.koike, laurent.pinchart, sakari.ailus,
	kernel, ezequiel

Set the code of the metadata pads of the isp entity to
MEDIA_BUS_FMT_METADATA_FIXED and set the width and
height of their formats to 0. This solves the TODO
item:
"Fix pad format size for statistics and parameters entities."

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
---
 drivers/staging/media/rkisp1/TODO         | 1 -
 drivers/staging/media/rkisp1/rkisp1-isp.c | 8 ++++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/media/rkisp1/TODO b/drivers/staging/media/rkisp1/TODO
index f0c90d1c86a8..f4a94eca6d31 100644
--- a/drivers/staging/media/rkisp1/TODO
+++ b/drivers/staging/media/rkisp1/TODO
@@ -1,4 +1,3 @@
-* Fix pad format size for statistics and parameters entities.
 * Fix checkpatch errors.
 * Review and comment every lock
 * Handle quantization
diff --git a/drivers/staging/media/rkisp1/rkisp1-isp.c b/drivers/staging/media/rkisp1/rkisp1-isp.c
index 02eafea92863..a6c0f1eb0c5a 100644
--- a/drivers/staging/media/rkisp1/rkisp1-isp.c
+++ b/drivers/staging/media/rkisp1/rkisp1-isp.c
@@ -574,7 +574,7 @@ static int rkisp1_isp_enum_mbus_code(struct v4l2_subdev *sd,
 	} else {
 		if (code->index > 0)
 			return -EINVAL;
-		code->code = MEDIA_BUS_FMT_FIXED;
+		code->code = MEDIA_BUS_FMT_METADATA_FIXED;
 		return 0;
 	}
 
@@ -630,10 +630,10 @@ static int rkisp1_isp_init_config(struct v4l2_subdev *sd,
 					      RKISP1_ISP_PAD_SINK_PARAMS);
 	src_fmt = v4l2_subdev_get_try_format(sd, cfg,
 					     RKISP1_ISP_PAD_SOURCE_STATS);
-	sink_fmt->width = RKISP1_DEFAULT_WIDTH;
-	sink_fmt->height = RKISP1_DEFAULT_HEIGHT;
+	sink_fmt->width = 0;
+	sink_fmt->height = 0;
 	sink_fmt->field = V4L2_FIELD_NONE;
-	sink_fmt->code = MEDIA_BUS_FMT_FIXED;
+	sink_fmt->code = MEDIA_BUS_FMT_METADATA_FIXED;
 	*src_fmt = *sink_fmt;
 
 	return 0;
-- 
2.17.1


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH 2/2] media: staging: rkisp1: isp: set metadata pads to MEDIA_BUS_FMT_METADATA_FIXED
  2020-09-22 16:58 ` [PATCH 2/2] media: staging: rkisp1: isp: set metadata pads to MEDIA_BUS_FMT_METADATA_FIXED Dafna Hirschfeld
@ 2020-10-14 20:40   ` Helen Koike
  0 siblings, 0 replies; 6+ messages in thread
From: Helen Koike @ 2020-10-14 20:40 UTC (permalink / raw)
  To: Dafna Hirschfeld, linux-media
  Cc: mchehab, dafna3, tfiga, hverkuil, linux-rockchip,
	laurent.pinchart, sakari.ailus, kernel, ezequiel



On 9/22/20 1:58 PM, Dafna Hirschfeld wrote:
> Set the code of the metadata pads of the isp entity to
> MEDIA_BUS_FMT_METADATA_FIXED and set the width and
> height of their formats to 0. This solves the TODO
> item:
> "Fix pad format size for statistics and parameters entities."
> 
> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>

Acked-by: Helen Koike <helen.koike@collabora.com>

Thanks
Helen

> ---
>  drivers/staging/media/rkisp1/TODO         | 1 -
>  drivers/staging/media/rkisp1/rkisp1-isp.c | 8 ++++----
>  2 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/media/rkisp1/TODO b/drivers/staging/media/rkisp1/TODO
> index f0c90d1c86a8..f4a94eca6d31 100644
> --- a/drivers/staging/media/rkisp1/TODO
> +++ b/drivers/staging/media/rkisp1/TODO
> @@ -1,4 +1,3 @@
> -* Fix pad format size for statistics and parameters entities.
>  * Fix checkpatch errors.
>  * Review and comment every lock
>  * Handle quantization
> diff --git a/drivers/staging/media/rkisp1/rkisp1-isp.c b/drivers/staging/media/rkisp1/rkisp1-isp.c
> index 02eafea92863..a6c0f1eb0c5a 100644
> --- a/drivers/staging/media/rkisp1/rkisp1-isp.c
> +++ b/drivers/staging/media/rkisp1/rkisp1-isp.c
> @@ -574,7 +574,7 @@ static int rkisp1_isp_enum_mbus_code(struct v4l2_subdev *sd,
>  	} else {
>  		if (code->index > 0)
>  			return -EINVAL;
> -		code->code = MEDIA_BUS_FMT_FIXED;
> +		code->code = MEDIA_BUS_FMT_METADATA_FIXED;
>  		return 0;
>  	}
>  
> @@ -630,10 +630,10 @@ static int rkisp1_isp_init_config(struct v4l2_subdev *sd,
>  					      RKISP1_ISP_PAD_SINK_PARAMS);
>  	src_fmt = v4l2_subdev_get_try_format(sd, cfg,
>  					     RKISP1_ISP_PAD_SOURCE_STATS);
> -	sink_fmt->width = RKISP1_DEFAULT_WIDTH;
> -	sink_fmt->height = RKISP1_DEFAULT_HEIGHT;
> +	sink_fmt->width = 0;
> +	sink_fmt->height = 0;
>  	sink_fmt->field = V4L2_FIELD_NONE;
> -	sink_fmt->code = MEDIA_BUS_FMT_FIXED;
> +	sink_fmt->code = MEDIA_BUS_FMT_METADATA_FIXED;
>  	*src_fmt = *sink_fmt;
>  
>  	return 0;
> 

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH 1/2] meida: uapi: add MEDIA_BUS_FMT_METADATA_FIXED media bus format.
  2020-09-22 16:58 ` [PATCH 1/2] meida: uapi: add MEDIA_BUS_FMT_METADATA_FIXED media bus format Dafna Hirschfeld
@ 2020-10-14 20:40   ` Helen Koike
  2020-10-20  7:22     ` Hans Verkuil
  0 siblings, 1 reply; 6+ messages in thread
From: Helen Koike @ 2020-10-14 20:40 UTC (permalink / raw)
  To: Dafna Hirschfeld, linux-media
  Cc: mchehab, dafna3, tfiga, hverkuil, linux-rockchip,
	laurent.pinchart, sakari.ailus, kernel, ezequiel



On 9/22/20 1:58 PM, Dafna Hirschfeld wrote:
> MEDIA_BUS_FMT_METADATA_FIXED should be used when
> the same driver handles both sides of the link and
> the bus format is a fixed metadata format that is
> not configurable from userspace.
> 
> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>

Acked-by: Helen Koike <helen.koike@collabora.com>

Thanks
Helen

> ---
>  include/uapi/linux/media-bus-format.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h
> index 84fa53ffb13f..847b45fb546b 100644
> --- a/include/uapi/linux/media-bus-format.h
> +++ b/include/uapi/linux/media-bus-format.h
> @@ -156,4 +156,12 @@
>  /* HSV - next is	0x6002 */
>  #define MEDIA_BUS_FMT_AHSV8888_1X32		0x6001
>  
> +/*
> + * This format should be used when the same driver handles
> + * both sides of the link and the bus format is a fixed
> + * metadata format that is not configurable from userspace.
> + * This format may have 0 height and width.
> + */
> +#define MEDIA_BUS_FMT_METADATA_FIXED		0x7001
> +
>  #endif /* __LINUX_MEDIA_BUS_FORMAT_H */
> 

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH 1/2] meida: uapi: add MEDIA_BUS_FMT_METADATA_FIXED media bus format.
  2020-10-14 20:40   ` Helen Koike
@ 2020-10-20  7:22     ` Hans Verkuil
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Verkuil @ 2020-10-20  7:22 UTC (permalink / raw)
  To: Helen Koike, Dafna Hirschfeld, linux-media
  Cc: mchehab, dafna3, tfiga, linux-rockchip, laurent.pinchart,
	sakari.ailus, kernel, ezequiel

On 14/10/2020 22:40, Helen Koike wrote:
> 
> 
> On 9/22/20 1:58 PM, Dafna Hirschfeld wrote:
>> MEDIA_BUS_FMT_METADATA_FIXED should be used when
>> the same driver handles both sides of the link and
>> the bus format is a fixed metadata format that is
>> not configurable from userspace.
>>
>> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
> 
> Acked-by: Helen Koike <helen.koike@collabora.com>
> 
> Thanks
> Helen
> 
>> ---
>>  include/uapi/linux/media-bus-format.h | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h
>> index 84fa53ffb13f..847b45fb546b 100644
>> --- a/include/uapi/linux/media-bus-format.h
>> +++ b/include/uapi/linux/media-bus-format.h
>> @@ -156,4 +156,12 @@
>>  /* HSV - next is	0x6002 */
>>  #define MEDIA_BUS_FMT_AHSV8888_1X32		0x6001
>>  
>> +/*
>> + * This format should be used when the same driver handles
>> + * both sides of the link and the bus format is a fixed
>> + * metadata format that is not configurable from userspace.
>> + * This format may have 0 height and width.

I would make this stronger:

"Width and height will be set to 0 for this format."

Regards,

	Hans

>> + */
>> +#define MEDIA_BUS_FMT_METADATA_FIXED		0x7001
>> +
>>  #endif /* __LINUX_MEDIA_BUS_FORMAT_H */
>>


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

end of thread, other threads:[~2020-10-20  7:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 16:58 [PATCH 0/2] Add format MEDIA_BUS_FMT_METADATA_FIXED and use it in rkisp1 Dafna Hirschfeld
2020-09-22 16:58 ` [PATCH 1/2] meida: uapi: add MEDIA_BUS_FMT_METADATA_FIXED media bus format Dafna Hirschfeld
2020-10-14 20:40   ` Helen Koike
2020-10-20  7:22     ` Hans Verkuil
2020-09-22 16:58 ` [PATCH 2/2] media: staging: rkisp1: isp: set metadata pads to MEDIA_BUS_FMT_METADATA_FIXED Dafna Hirschfeld
2020-10-14 20:40   ` Helen Koike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).