linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] media: rkisp1: Miscellaneous improvements
@ 2022-11-17  8:42 Paul Elder
  2022-11-17  8:42 ` [PATCH v2 1/3] media: rkisp1: Add NV16M and NV61M to output formats Paul Elder
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Paul Elder @ 2022-11-17  8:42 UTC (permalink / raw)
  To: linux-media
  Cc: Paul Elder, Dafna Hirschfeld, Mauro Carvalho Chehab,
	Heiko Stuebner, Laurent Pinchart, linux-rockchip,
	linux-arm-kernel, linux-kernel

This patch series adds small improvements to the rkisp1 driver:
- Add NV16M and NV61M output
- Implement ENUM_FRAMESIZES

As well as a small code cleanup.

These patches have been sent before individually, so really this is a
resend, which also bunches them together.

Laurent Pinchart (1):
  media: rkisp1: Make local immutable array variables static const

Paul Elder (2):
  media: rkisp1: Add NV16M and NV61M to output formats
  media: rkisp1: Implement ENUM_FRAMESIZES

 .../platform/rockchip/rkisp1/rkisp1-capture.c | 64 +++++++++++++++++--
 1 file changed, 60 insertions(+), 4 deletions(-)

-- 
2.35.1


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

* [PATCH v2 1/3] media: rkisp1: Add NV16M and NV61M to output formats
  2022-11-17  8:42 [PATCH v2 0/3] media: rkisp1: Miscellaneous improvements Paul Elder
@ 2022-11-17  8:42 ` Paul Elder
  2022-11-19 10:59   ` Dafna Hirschfeld
  2022-11-17  8:42 ` [PATCH v2 2/3] media: rkisp1: Make local immutable array variables static const Paul Elder
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Paul Elder @ 2022-11-17  8:42 UTC (permalink / raw)
  To: linux-media
  Cc: Paul Elder, Dafna Hirschfeld, Mauro Carvalho Chehab,
	Heiko Stuebner, Laurent Pinchart, linux-rockchip,
	linux-arm-kernel, linux-kernel

Add support for NV16M and NV61M as output formats. As NV16, NV61, NV12M
and NV21M are already supported, the infrastructure is already in place
to support NV16M and NV61M, so it is sufficient to simply add relevant
entries to the list of output formats.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 .../platform/rockchip/rkisp1/rkisp1-capture.c | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
index d4540684ea9a..7695ef134908 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
@@ -110,6 +110,16 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_mp_fmts[] = {
 		.uv_swap = 1,
 		.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
 		.mbus = MEDIA_BUS_FMT_YUYV8_2X8,
+	}, {
+		.fourcc = V4L2_PIX_FMT_NV16M,
+		.uv_swap = 0,
+		.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
+		.mbus = MEDIA_BUS_FMT_YUYV8_2X8,
+	}, {
+		.fourcc = V4L2_PIX_FMT_NV61M,
+		.uv_swap = 1,
+		.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
+		.mbus = MEDIA_BUS_FMT_YUYV8_2X8,
 	}, {
 		.fourcc = V4L2_PIX_FMT_YVU422M,
 		.uv_swap = 1,
@@ -237,6 +247,18 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
 		.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
 		.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
 		.mbus = MEDIA_BUS_FMT_YUYV8_2X8,
+	}, {
+		.fourcc = V4L2_PIX_FMT_NV16M,
+		.uv_swap = 0,
+		.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
+		.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
+		.mbus = MEDIA_BUS_FMT_YUYV8_2X8,
+	}, {
+		.fourcc = V4L2_PIX_FMT_NV61M,
+		.uv_swap = 1,
+		.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
+		.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
+		.mbus = MEDIA_BUS_FMT_YUYV8_2X8,
 	}, {
 		.fourcc = V4L2_PIX_FMT_YVU422M,
 		.uv_swap = 1,
-- 
2.35.1


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

* [PATCH v2 2/3] media: rkisp1: Make local immutable array variables static const
  2022-11-17  8:42 [PATCH v2 0/3] media: rkisp1: Miscellaneous improvements Paul Elder
  2022-11-17  8:42 ` [PATCH v2 1/3] media: rkisp1: Add NV16M and NV61M to output formats Paul Elder
@ 2022-11-17  8:42 ` Paul Elder
  2022-11-19 22:28   ` Laurent Pinchart
  2022-11-17  8:42 ` [PATCH v2 3/3] media: rkisp1: Implement ENUM_FRAMESIZES Paul Elder
  2023-02-21 13:57 ` [PATCH v2 0/3] media: rkisp1: Miscellaneous improvements Jacopo Mondi
  3 siblings, 1 reply; 12+ messages in thread
From: Paul Elder @ 2022-11-17  8:42 UTC (permalink / raw)
  To: linux-media
  Cc: Laurent Pinchart, Dafna Hirschfeld, Mauro Carvalho Chehab,
	Heiko Stuebner, linux-rockchip, linux-arm-kernel, linux-kernel,
	Paul Elder

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

The max_widths and max_heights variables in rkisp1_try_fmt() are
immutable and don't need to be allocated on the stack every time the
function is called. Make them static.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
---
 .../media/platform/rockchip/rkisp1/rkisp1-capture.c  | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
index 7695ef134908..91e685fdbbe9 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
@@ -1150,13 +1150,17 @@ static void rkisp1_try_fmt(const struct rkisp1_capture *cap,
 			   const struct rkisp1_capture_fmt_cfg **fmt_cfg,
 			   const struct v4l2_format_info **fmt_info)
 {
+	static const unsigned int max_widths[] = {
+		RKISP1_RSZ_MP_SRC_MAX_WIDTH,
+		RKISP1_RSZ_SP_SRC_MAX_WIDTH,
+	};
+	static const unsigned int max_heights[] = {
+		RKISP1_RSZ_MP_SRC_MAX_HEIGHT,
+		RKISP1_RSZ_SP_SRC_MAX_HEIGHT,
+	};
 	const struct rkisp1_capture_config *config = cap->config;
 	const struct rkisp1_capture_fmt_cfg *fmt;
 	const struct v4l2_format_info *info;
-	const unsigned int max_widths[] = { RKISP1_RSZ_MP_SRC_MAX_WIDTH,
-					    RKISP1_RSZ_SP_SRC_MAX_WIDTH };
-	const unsigned int max_heights[] = { RKISP1_RSZ_MP_SRC_MAX_HEIGHT,
-					     RKISP1_RSZ_SP_SRC_MAX_HEIGHT};
 
 	fmt = rkisp1_find_fmt_cfg(cap, pixm->pixelformat);
 	if (!fmt) {
-- 
2.35.1


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

* [PATCH v2 3/3] media: rkisp1: Implement ENUM_FRAMESIZES
  2022-11-17  8:42 [PATCH v2 0/3] media: rkisp1: Miscellaneous improvements Paul Elder
  2022-11-17  8:42 ` [PATCH v2 1/3] media: rkisp1: Add NV16M and NV61M to output formats Paul Elder
  2022-11-17  8:42 ` [PATCH v2 2/3] media: rkisp1: Make local immutable array variables static const Paul Elder
@ 2022-11-17  8:42 ` Paul Elder
  2022-11-19 10:57   ` Dafna Hirschfeld
  2023-02-21 13:57 ` [PATCH v2 0/3] media: rkisp1: Miscellaneous improvements Jacopo Mondi
  3 siblings, 1 reply; 12+ messages in thread
From: Paul Elder @ 2022-11-17  8:42 UTC (permalink / raw)
  To: linux-media
  Cc: Paul Elder, Dafna Hirschfeld, Mauro Carvalho Chehab,
	Heiko Stuebner, Laurent Pinchart, linux-rockchip,
	linux-arm-kernel, linux-kernel

Implement VIDIOC_ENUM_FRAMESIZES for the rkisp1 capture devices.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 .../platform/rockchip/rkisp1/rkisp1-capture.c | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
index 91e685fdbbe9..03c2922bfbed 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
@@ -1236,6 +1236,35 @@ static int rkisp1_enum_fmt_vid_cap_mplane(struct file *file, void *priv,
 	return -EINVAL;
 }
 
+static int rkisp1_enum_framesizes(struct file *file, void *fh,
+				  struct v4l2_frmsizeenum *fsize)
+{
+	static const unsigned int max_widths[] = {
+		RKISP1_RSZ_MP_SRC_MAX_WIDTH,
+		RKISP1_RSZ_SP_SRC_MAX_WIDTH,
+	};
+	static const unsigned int max_heights[] = {
+		RKISP1_RSZ_MP_SRC_MAX_HEIGHT,
+		RKISP1_RSZ_SP_SRC_MAX_HEIGHT,
+	};
+	struct rkisp1_capture *cap = video_drvdata(file);
+
+	if (fsize->index != 0)
+		return -EINVAL;
+
+	fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE;
+
+	fsize->stepwise.min_width = RKISP1_RSZ_SRC_MIN_WIDTH;
+	fsize->stepwise.max_width = max_widths[cap->id];
+	fsize->stepwise.step_width = 2;
+
+	fsize->stepwise.min_height = RKISP1_RSZ_SRC_MIN_HEIGHT;
+	fsize->stepwise.max_height = max_heights[cap->id];
+	fsize->stepwise.step_height = 2;
+
+	return 0;
+}
+
 static int rkisp1_s_fmt_vid_cap_mplane(struct file *file,
 				       void *priv, struct v4l2_format *f)
 {
@@ -1285,6 +1314,7 @@ static const struct v4l2_ioctl_ops rkisp1_v4l2_ioctl_ops = {
 	.vidioc_s_fmt_vid_cap_mplane = rkisp1_s_fmt_vid_cap_mplane,
 	.vidioc_g_fmt_vid_cap_mplane = rkisp1_g_fmt_vid_cap_mplane,
 	.vidioc_enum_fmt_vid_cap = rkisp1_enum_fmt_vid_cap_mplane,
+	.vidioc_enum_framesizes = rkisp1_enum_framesizes,
 	.vidioc_querycap = rkisp1_querycap,
 	.vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
 	.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
-- 
2.35.1


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

* Re: [PATCH v2 3/3] media: rkisp1: Implement ENUM_FRAMESIZES
  2022-11-17  8:42 ` [PATCH v2 3/3] media: rkisp1: Implement ENUM_FRAMESIZES Paul Elder
@ 2022-11-19 10:57   ` Dafna Hirschfeld
  0 siblings, 0 replies; 12+ messages in thread
From: Dafna Hirschfeld @ 2022-11-19 10:57 UTC (permalink / raw)
  To: Paul Elder
  Cc: linux-media, Mauro Carvalho Chehab, Heiko Stuebner,
	Laurent Pinchart, linux-rockchip, linux-arm-kernel, linux-kernel

On 17.11.2022 17:42, Paul Elder wrote:
>Implement VIDIOC_ENUM_FRAMESIZES for the rkisp1 capture devices.
>
>Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
>Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>

>---
> .../platform/rockchip/rkisp1/rkisp1-capture.c | 30 +++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
>diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
>index 91e685fdbbe9..03c2922bfbed 100644
>--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
>+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
>@@ -1236,6 +1236,35 @@ static int rkisp1_enum_fmt_vid_cap_mplane(struct file *file, void *priv,
> 	return -EINVAL;
> }
>
>+static int rkisp1_enum_framesizes(struct file *file, void *fh,
>+				  struct v4l2_frmsizeenum *fsize)
>+{
>+	static const unsigned int max_widths[] = {
>+		RKISP1_RSZ_MP_SRC_MAX_WIDTH,
>+		RKISP1_RSZ_SP_SRC_MAX_WIDTH,
>+	};
>+	static const unsigned int max_heights[] = {
>+		RKISP1_RSZ_MP_SRC_MAX_HEIGHT,
>+		RKISP1_RSZ_SP_SRC_MAX_HEIGHT,
>+	};
>+	struct rkisp1_capture *cap = video_drvdata(file);
>+
>+	if (fsize->index != 0)
>+		return -EINVAL;
>+
>+	fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE;
>+
>+	fsize->stepwise.min_width = RKISP1_RSZ_SRC_MIN_WIDTH;
>+	fsize->stepwise.max_width = max_widths[cap->id];
>+	fsize->stepwise.step_width = 2;
>+
>+	fsize->stepwise.min_height = RKISP1_RSZ_SRC_MIN_HEIGHT;
>+	fsize->stepwise.max_height = max_heights[cap->id];
>+	fsize->stepwise.step_height = 2;
>+
>+	return 0;
>+}
>+
> static int rkisp1_s_fmt_vid_cap_mplane(struct file *file,
> 				       void *priv, struct v4l2_format *f)
> {
>@@ -1285,6 +1314,7 @@ static const struct v4l2_ioctl_ops rkisp1_v4l2_ioctl_ops = {
> 	.vidioc_s_fmt_vid_cap_mplane = rkisp1_s_fmt_vid_cap_mplane,
> 	.vidioc_g_fmt_vid_cap_mplane = rkisp1_g_fmt_vid_cap_mplane,
> 	.vidioc_enum_fmt_vid_cap = rkisp1_enum_fmt_vid_cap_mplane,
>+	.vidioc_enum_framesizes = rkisp1_enum_framesizes,
> 	.vidioc_querycap = rkisp1_querycap,
> 	.vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
> 	.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
>-- 
>2.35.1
>

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

* Re: [PATCH v2 1/3] media: rkisp1: Add NV16M and NV61M to output formats
  2022-11-17  8:42 ` [PATCH v2 1/3] media: rkisp1: Add NV16M and NV61M to output formats Paul Elder
@ 2022-11-19 10:59   ` Dafna Hirschfeld
  0 siblings, 0 replies; 12+ messages in thread
From: Dafna Hirschfeld @ 2022-11-19 10:59 UTC (permalink / raw)
  To: Paul Elder
  Cc: linux-media, Mauro Carvalho Chehab, Heiko Stuebner,
	Laurent Pinchart, linux-rockchip, linux-arm-kernel, linux-kernel

On 17.11.2022 17:42, Paul Elder wrote:
>Add support for NV16M and NV61M as output formats. As NV16, NV61, NV12M
>and NV21M are already supported, the infrastructure is already in place
>to support NV16M and NV61M, so it is sufficient to simply add relevant
>entries to the list of output formats.
>
>Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
>Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>

>---
> .../platform/rockchip/rkisp1/rkisp1-capture.c | 22 +++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
>diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
>index d4540684ea9a..7695ef134908 100644
>--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
>+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
>@@ -110,6 +110,16 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_mp_fmts[] = {
> 		.uv_swap = 1,
> 		.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
> 		.mbus = MEDIA_BUS_FMT_YUYV8_2X8,
>+	}, {
>+		.fourcc = V4L2_PIX_FMT_NV16M,
>+		.uv_swap = 0,
>+		.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
>+		.mbus = MEDIA_BUS_FMT_YUYV8_2X8,
>+	}, {
>+		.fourcc = V4L2_PIX_FMT_NV61M,
>+		.uv_swap = 1,
>+		.write_format = RKISP1_MI_CTRL_MP_WRITE_YUV_SPLA,
>+		.mbus = MEDIA_BUS_FMT_YUYV8_2X8,
> 	}, {
> 		.fourcc = V4L2_PIX_FMT_YVU422M,
> 		.uv_swap = 1,
>@@ -237,6 +247,18 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
> 		.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
> 		.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
> 		.mbus = MEDIA_BUS_FMT_YUYV8_2X8,
>+	}, {
>+		.fourcc = V4L2_PIX_FMT_NV16M,
>+		.uv_swap = 0,
>+		.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
>+		.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
>+		.mbus = MEDIA_BUS_FMT_YUYV8_2X8,
>+	}, {
>+		.fourcc = V4L2_PIX_FMT_NV61M,
>+		.uv_swap = 1,
>+		.write_format = RKISP1_MI_CTRL_SP_WRITE_SPLA,
>+		.output_format = RKISP1_MI_CTRL_SP_OUTPUT_YUV422,
>+		.mbus = MEDIA_BUS_FMT_YUYV8_2X8,
> 	}, {
> 		.fourcc = V4L2_PIX_FMT_YVU422M,
> 		.uv_swap = 1,
>-- 
>2.35.1
>

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

* Re: [PATCH v2 2/3] media: rkisp1: Make local immutable array variables static const
  2022-11-17  8:42 ` [PATCH v2 2/3] media: rkisp1: Make local immutable array variables static const Paul Elder
@ 2022-11-19 22:28   ` Laurent Pinchart
  2023-01-26 23:28     ` Laurent Pinchart
  0 siblings, 1 reply; 12+ messages in thread
From: Laurent Pinchart @ 2022-11-19 22:28 UTC (permalink / raw)
  To: Dafna Hirschfeld
  Cc: Paul Elder, linux-media, Mauro Carvalho Chehab, Heiko Stuebner,
	linux-rockchip, linux-arm-kernel, linux-kernel

Hi Dafna,

Are you fine with this patch, can I include it in my next pull request
along with the other ones from the series ?

On Thu, Nov 17, 2022 at 05:42:16PM +0900, Paul Elder wrote:
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> The max_widths and max_heights variables in rkisp1_try_fmt() are
> immutable and don't need to be allocated on the stack every time the
> function is called. Make them static.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
> ---
>  .../media/platform/rockchip/rkisp1/rkisp1-capture.c  | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> index 7695ef134908..91e685fdbbe9 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> @@ -1150,13 +1150,17 @@ static void rkisp1_try_fmt(const struct rkisp1_capture *cap,
>  			   const struct rkisp1_capture_fmt_cfg **fmt_cfg,
>  			   const struct v4l2_format_info **fmt_info)
>  {
> +	static const unsigned int max_widths[] = {
> +		RKISP1_RSZ_MP_SRC_MAX_WIDTH,
> +		RKISP1_RSZ_SP_SRC_MAX_WIDTH,
> +	};
> +	static const unsigned int max_heights[] = {
> +		RKISP1_RSZ_MP_SRC_MAX_HEIGHT,
> +		RKISP1_RSZ_SP_SRC_MAX_HEIGHT,
> +	};
>  	const struct rkisp1_capture_config *config = cap->config;
>  	const struct rkisp1_capture_fmt_cfg *fmt;
>  	const struct v4l2_format_info *info;
> -	const unsigned int max_widths[] = { RKISP1_RSZ_MP_SRC_MAX_WIDTH,
> -					    RKISP1_RSZ_SP_SRC_MAX_WIDTH };
> -	const unsigned int max_heights[] = { RKISP1_RSZ_MP_SRC_MAX_HEIGHT,
> -					     RKISP1_RSZ_SP_SRC_MAX_HEIGHT};
>  
>  	fmt = rkisp1_find_fmt_cfg(cap, pixm->pixelformat);
>  	if (!fmt) {
> -- 
> 2.35.1
> 

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v2 2/3] media: rkisp1: Make local immutable array variables static const
  2022-11-19 22:28   ` Laurent Pinchart
@ 2023-01-26 23:28     ` Laurent Pinchart
  2023-03-24 10:37       ` Jacopo Mondi
  0 siblings, 1 reply; 12+ messages in thread
From: Laurent Pinchart @ 2023-01-26 23:28 UTC (permalink / raw)
  To: Dafna Hirschfeld
  Cc: Paul Elder, linux-media, Mauro Carvalho Chehab, Heiko Stuebner,
	linux-rockchip, linux-arm-kernel, linux-kernel

Hi Dafna,

On Sun, Nov 20, 2022 at 12:28:01AM +0200, Laurent Pinchart wrote:
> Hi Dafna,
> 
> Are you fine with this patch, can I include it in my next pull request
> along with the other ones from the series ?

Ping.

> On Thu, Nov 17, 2022 at 05:42:16PM +0900, Paul Elder wrote:
> > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > 
> > The max_widths and max_heights variables in rkisp1_try_fmt() are
> > immutable and don't need to be allocated on the stack every time the
> > function is called. Make them static.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
> > ---
> >  .../media/platform/rockchip/rkisp1/rkisp1-capture.c  | 12 ++++++++----
> >  1 file changed, 8 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> > index 7695ef134908..91e685fdbbe9 100644
> > --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> > +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> > @@ -1150,13 +1150,17 @@ static void rkisp1_try_fmt(const struct rkisp1_capture *cap,
> >  			   const struct rkisp1_capture_fmt_cfg **fmt_cfg,
> >  			   const struct v4l2_format_info **fmt_info)
> >  {
> > +	static const unsigned int max_widths[] = {
> > +		RKISP1_RSZ_MP_SRC_MAX_WIDTH,
> > +		RKISP1_RSZ_SP_SRC_MAX_WIDTH,
> > +	};
> > +	static const unsigned int max_heights[] = {
> > +		RKISP1_RSZ_MP_SRC_MAX_HEIGHT,
> > +		RKISP1_RSZ_SP_SRC_MAX_HEIGHT,
> > +	};
> >  	const struct rkisp1_capture_config *config = cap->config;
> >  	const struct rkisp1_capture_fmt_cfg *fmt;
> >  	const struct v4l2_format_info *info;
> > -	const unsigned int max_widths[] = { RKISP1_RSZ_MP_SRC_MAX_WIDTH,
> > -					    RKISP1_RSZ_SP_SRC_MAX_WIDTH };
> > -	const unsigned int max_heights[] = { RKISP1_RSZ_MP_SRC_MAX_HEIGHT,
> > -					     RKISP1_RSZ_SP_SRC_MAX_HEIGHT};
> >  
> >  	fmt = rkisp1_find_fmt_cfg(cap, pixm->pixelformat);
> >  	if (!fmt) {

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v2 0/3] media: rkisp1: Miscellaneous improvements
  2022-11-17  8:42 [PATCH v2 0/3] media: rkisp1: Miscellaneous improvements Paul Elder
                   ` (2 preceding siblings ...)
  2022-11-17  8:42 ` [PATCH v2 3/3] media: rkisp1: Implement ENUM_FRAMESIZES Paul Elder
@ 2023-02-21 13:57 ` Jacopo Mondi
  2023-03-25 20:00   ` Laurent Pinchart
  3 siblings, 1 reply; 12+ messages in thread
From: Jacopo Mondi @ 2023-02-21 13:57 UTC (permalink / raw)
  To: Paul Elder
  Cc: linux-media, Dafna Hirschfeld, Mauro Carvalho Chehab,
	Heiko Stuebner, Laurent Pinchart, linux-rockchip,
	linux-arm-kernel, linux-kernel

Hello

On Thu, Nov 17, 2022 at 05:42:14PM +0900, Paul Elder wrote:
> This patch series adds small improvements to the rkisp1 driver:
> - Add NV16M and NV61M output
> - Implement ENUM_FRAMESIZES
>
> As well as a small code cleanup.
>
> These patches have been sent before individually, so really this is a
> resend, which also bunches them together.
>
> Laurent Pinchart (1):
>   media: rkisp1: Make local immutable array variables static const
>
> Paul Elder (2):
>   media: rkisp1: Add NV16M and NV61M to output formats
>   media: rkisp1: Implement ENUM_FRAMESIZES

Has this series fell into cracks ? Support for VIDIOC_ENUM_FRAMESIZES
in particular is a relevant feature and seems not controversial at all...

>
>  .../platform/rockchip/rkisp1/rkisp1-capture.c | 64 +++++++++++++++++--
>  1 file changed, 60 insertions(+), 4 deletions(-)
>
> --
> 2.35.1
>

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

* Re: [PATCH v2 2/3] media: rkisp1: Make local immutable array variables static const
  2023-01-26 23:28     ` Laurent Pinchart
@ 2023-03-24 10:37       ` Jacopo Mondi
  2023-03-25 19:24         ` Laurent Pinchart
  0 siblings, 1 reply; 12+ messages in thread
From: Jacopo Mondi @ 2023-03-24 10:37 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Dafna Hirschfeld, Paul Elder, linux-media, Mauro Carvalho Chehab,
	Heiko Stuebner, linux-rockchip, linux-arm-kernel, linux-kernel

Hello
   the change seems trivial, do we need an explicit ack from Dafna ?

Dafna are you comfortable being listed as maintainer of this driver or
do you think you won't be able to dedicate time to it and need help ?

Thanks
   j

On Fri, Jan 27, 2023 at 01:28:05AM +0200, Laurent Pinchart wrote:
> Hi Dafna,
>
> On Sun, Nov 20, 2022 at 12:28:01AM +0200, Laurent Pinchart wrote:
> > Hi Dafna,
> >
> > Are you fine with this patch, can I include it in my next pull request
> > along with the other ones from the series ?
>
> Ping.
>
> > On Thu, Nov 17, 2022 at 05:42:16PM +0900, Paul Elder wrote:
> > > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > >
> > > The max_widths and max_heights variables in rkisp1_try_fmt() are
> > > immutable and don't need to be allocated on the stack every time the
> > > function is called. Make them static.
> > >
> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
> > > ---
> > >  .../media/platform/rockchip/rkisp1/rkisp1-capture.c  | 12 ++++++++----
> > >  1 file changed, 8 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> > > index 7695ef134908..91e685fdbbe9 100644
> > > --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> > > +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> > > @@ -1150,13 +1150,17 @@ static void rkisp1_try_fmt(const struct rkisp1_capture *cap,
> > >  			   const struct rkisp1_capture_fmt_cfg **fmt_cfg,
> > >  			   const struct v4l2_format_info **fmt_info)
> > >  {
> > > +	static const unsigned int max_widths[] = {
> > > +		RKISP1_RSZ_MP_SRC_MAX_WIDTH,
> > > +		RKISP1_RSZ_SP_SRC_MAX_WIDTH,
> > > +	};
> > > +	static const unsigned int max_heights[] = {
> > > +		RKISP1_RSZ_MP_SRC_MAX_HEIGHT,
> > > +		RKISP1_RSZ_SP_SRC_MAX_HEIGHT,
> > > +	};
> > >  	const struct rkisp1_capture_config *config = cap->config;
> > >  	const struct rkisp1_capture_fmt_cfg *fmt;
> > >  	const struct v4l2_format_info *info;
> > > -	const unsigned int max_widths[] = { RKISP1_RSZ_MP_SRC_MAX_WIDTH,
> > > -					    RKISP1_RSZ_SP_SRC_MAX_WIDTH };
> > > -	const unsigned int max_heights[] = { RKISP1_RSZ_MP_SRC_MAX_HEIGHT,
> > > -					     RKISP1_RSZ_SP_SRC_MAX_HEIGHT};
> > >
> > >  	fmt = rkisp1_find_fmt_cfg(cap, pixm->pixelformat);
> > >  	if (!fmt) {
>
> --
> Regards,
>
> Laurent Pinchart

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

* Re: [PATCH v2 2/3] media: rkisp1: Make local immutable array variables static const
  2023-03-24 10:37       ` Jacopo Mondi
@ 2023-03-25 19:24         ` Laurent Pinchart
  0 siblings, 0 replies; 12+ messages in thread
From: Laurent Pinchart @ 2023-03-25 19:24 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: Dafna Hirschfeld, Paul Elder, linux-media, Mauro Carvalho Chehab,
	Heiko Stuebner, linux-rockchip, linux-arm-kernel, linux-kernel

Hi Jacopo,

On Fri, Mar 24, 2023 at 11:37:44AM +0100, Jacopo Mondi wrote:
> Hello
>    the change seems trivial, do we need an explicit ack from Dafna ?

An alternative patch has been merged in commit 4ee8191c7c9f ("media:
rkisp1: make a few const arrays static").

> Dafna are you comfortable being listed as maintainer of this driver or
> do you think you won't be able to dedicate time to it and need help ?
> 
> Thanks
>    j
> 
> On Fri, Jan 27, 2023 at 01:28:05AM +0200, Laurent Pinchart wrote:
> > On Sun, Nov 20, 2022 at 12:28:01AM +0200, Laurent Pinchart wrote:
> > > Hi Dafna,
> > >
> > > Are you fine with this patch, can I include it in my next pull request
> > > along with the other ones from the series ?
> >
> > Ping.
> >
> > > On Thu, Nov 17, 2022 at 05:42:16PM +0900, Paul Elder wrote:
> > > > From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > >
> > > > The max_widths and max_heights variables in rkisp1_try_fmt() are
> > > > immutable and don't need to be allocated on the stack every time the
> > > > function is called. Make them static.
> > > >
> > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > > Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
> > > > ---
> > > >  .../media/platform/rockchip/rkisp1/rkisp1-capture.c  | 12 ++++++++----
> > > >  1 file changed, 8 insertions(+), 4 deletions(-)
> > > >
> > > > diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> > > > index 7695ef134908..91e685fdbbe9 100644
> > > > --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> > > > +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> > > > @@ -1150,13 +1150,17 @@ static void rkisp1_try_fmt(const struct rkisp1_capture *cap,
> > > >  			   const struct rkisp1_capture_fmt_cfg **fmt_cfg,
> > > >  			   const struct v4l2_format_info **fmt_info)
> > > >  {
> > > > +	static const unsigned int max_widths[] = {
> > > > +		RKISP1_RSZ_MP_SRC_MAX_WIDTH,
> > > > +		RKISP1_RSZ_SP_SRC_MAX_WIDTH,
> > > > +	};
> > > > +	static const unsigned int max_heights[] = {
> > > > +		RKISP1_RSZ_MP_SRC_MAX_HEIGHT,
> > > > +		RKISP1_RSZ_SP_SRC_MAX_HEIGHT,
> > > > +	};
> > > >  	const struct rkisp1_capture_config *config = cap->config;
> > > >  	const struct rkisp1_capture_fmt_cfg *fmt;
> > > >  	const struct v4l2_format_info *info;
> > > > -	const unsigned int max_widths[] = { RKISP1_RSZ_MP_SRC_MAX_WIDTH,
> > > > -					    RKISP1_RSZ_SP_SRC_MAX_WIDTH };
> > > > -	const unsigned int max_heights[] = { RKISP1_RSZ_MP_SRC_MAX_HEIGHT,
> > > > -					     RKISP1_RSZ_SP_SRC_MAX_HEIGHT};
> > > >
> > > >  	fmt = rkisp1_find_fmt_cfg(cap, pixm->pixelformat);
> > > >  	if (!fmt) {

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH v2 0/3] media: rkisp1: Miscellaneous improvements
  2023-02-21 13:57 ` [PATCH v2 0/3] media: rkisp1: Miscellaneous improvements Jacopo Mondi
@ 2023-03-25 20:00   ` Laurent Pinchart
  0 siblings, 0 replies; 12+ messages in thread
From: Laurent Pinchart @ 2023-03-25 20:00 UTC (permalink / raw)
  To: Jacopo Mondi
  Cc: Paul Elder, linux-media, Dafna Hirschfeld, Mauro Carvalho Chehab,
	Heiko Stuebner, linux-rockchip, linux-arm-kernel, linux-kernel

Hi Jacopo,

On Tue, Feb 21, 2023 at 02:57:30PM +0100, Jacopo Mondi wrote:
> On Thu, Nov 17, 2022 at 05:42:14PM +0900, Paul Elder wrote:
> > This patch series adds small improvements to the rkisp1 driver:
> > - Add NV16M and NV61M output
> > - Implement ENUM_FRAMESIZES
> >
> > As well as a small code cleanup.
> >
> > These patches have been sent before individually, so really this is a
> > resend, which also bunches them together.
> >
> > Laurent Pinchart (1):
> >   media: rkisp1: Make local immutable array variables static const
> >
> > Paul Elder (2):
> >   media: rkisp1: Add NV16M and NV61M to output formats
> >   media: rkisp1: Implement ENUM_FRAMESIZES
> 
> Has this series fell into cracks ? Support for VIDIOC_ENUM_FRAMESIZES
> in particular is a relevant feature and seems not controversial at all...

An alternative version of the first patch has been merged already, and
I've just sent a pull request for the other two.

> >  .../platform/rockchip/rkisp1/rkisp1-capture.c | 64 +++++++++++++++++--
> >  1 file changed, 60 insertions(+), 4 deletions(-)

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2023-03-25 20:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-17  8:42 [PATCH v2 0/3] media: rkisp1: Miscellaneous improvements Paul Elder
2022-11-17  8:42 ` [PATCH v2 1/3] media: rkisp1: Add NV16M and NV61M to output formats Paul Elder
2022-11-19 10:59   ` Dafna Hirschfeld
2022-11-17  8:42 ` [PATCH v2 2/3] media: rkisp1: Make local immutable array variables static const Paul Elder
2022-11-19 22:28   ` Laurent Pinchart
2023-01-26 23:28     ` Laurent Pinchart
2023-03-24 10:37       ` Jacopo Mondi
2023-03-25 19:24         ` Laurent Pinchart
2022-11-17  8:42 ` [PATCH v2 3/3] media: rkisp1: Implement ENUM_FRAMESIZES Paul Elder
2022-11-19 10:57   ` Dafna Hirschfeld
2023-02-21 13:57 ` [PATCH v2 0/3] media: rkisp1: Miscellaneous improvements Jacopo Mondi
2023-03-25 20:00   ` Laurent Pinchart

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).