mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [v2] staging: media: starfive: Add the dynamic resolution support
@ 2024-08-16 12:51 Changhuang Liang
  2024-08-16 13:04 ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Changhuang Liang @ 2024-08-16 12:51 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Greg Kroah-Hartman
  Cc: Hans Verkuil, Laurent Pinchart, Jack Zhu, Changhuang Liang,
	linux-media, linux-kernel, linux-staging

Add the dynamic resolution support for video "capture_raw" device.

Fixes: e080f339c80a ("media: staging: media: starfive: camss: Add capture driver")

Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
---
 drivers/staging/media/starfive/camss/stf-capture.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/starfive/camss/stf-capture.c b/drivers/staging/media/starfive/camss/stf-capture.c
index ec5169e7b391..e15d2e97eb0b 100644
--- a/drivers/staging/media/starfive/camss/stf-capture.c
+++ b/drivers/staging/media/starfive/camss/stf-capture.c
@@ -180,6 +180,8 @@ static void stf_channel_set(struct stfcamss_video *video)
 	u32 val;
 
 	if (cap->type == STF_CAPTURE_RAW) {
+		const struct v4l2_pix_format *pix = &video->active_fmt.fmt.pix;
+
 		val = stf_syscon_reg_read(stfcamss, VIN_CHANNEL_SEL_EN);
 		val &= ~U0_VIN_CHANNEL_SEL_MASK;
 		val |= CHANNEL(0);
@@ -193,7 +195,7 @@ static void stf_channel_set(struct stfcamss_video *video)
 		val |= PIXEL_HEIGH_BIT_SEL(0);
 
 		val &= ~U0_VIN_PIX_CNT_END_MASK;
-		val |= PIX_CNT_END(IMAGE_MAX_WIDTH / 4 - 1);
+		val |= PIX_CNT_END(pix->width / 4 - 1);
 
 		stf_syscon_reg_write(stfcamss, VIN_INRT_PIX_CFG, val);
 	} else if (cap->type == STF_CAPTURE_YUV) {
-- 
2.25.1


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

* Re: [v2] staging: media: starfive: Add the dynamic resolution support
  2024-08-16 12:51 [v2] staging: media: starfive: Add the dynamic resolution support Changhuang Liang
@ 2024-08-16 13:04 ` Dan Carpenter
  2024-08-16 13:09   ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2024-08-16 13:04 UTC (permalink / raw)
  To: Changhuang Liang
  Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman, Hans Verkuil,
	Laurent Pinchart, Jack Zhu, linux-media, linux-kernel,
	linux-staging

On Fri, Aug 16, 2024 at 05:51:32AM -0700, Changhuang Liang wrote:
> Add the dynamic resolution support for video "capture_raw" device.
> 

What does this change look like from a use perspective if a user is reading the
git log?

> Fixes: e080f339c80a ("media: staging: media: starfive: camss: Add capture driver")
> 

This looks like a new feature and not a bugfix.  Please describe the bug more
clearly if it's really a bugfix.

regards,
dan carpenter


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

* Re: [v2] staging: media: starfive: Add the dynamic resolution support
  2024-08-16 13:04 ` Dan Carpenter
@ 2024-08-16 13:09   ` Dan Carpenter
  2024-08-19 13:27     ` Changhuang Liang
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2024-08-16 13:09 UTC (permalink / raw)
  To: Changhuang Liang
  Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman, Hans Verkuil,
	Laurent Pinchart, Jack Zhu, linux-media, linux-kernel,
	linux-staging

On Fri, Aug 16, 2024 at 04:04:38PM +0300, Dan Carpenter wrote:
> On Fri, Aug 16, 2024 at 05:51:32AM -0700, Changhuang Liang wrote:
> > Add the dynamic resolution support for video "capture_raw" device.
> > 
> 
> What does this change look like from a use perspective if a user is reading the
> git log?
> 
> > Fixes: e080f339c80a ("media: staging: media: starfive: camss: Add capture driver")
> > 
> 
> This looks like a new feature and not a bugfix.  Please describe the bug more
> clearly if it's really a bugfix.
> 

Actually the first version of the commit had a good description.  Just go back
to that.

> Add multiple resolution support for video "capture_raw" device. Otherwise
> it will capture the wrong image data if the width is not 1920.

Btw:
1) Don't put a blank line after the Fixes tag.
2) Put a note under the --- cut off line that says what changed.

https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/

Please send v3.

regards,
dan carpenter


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

* Re: [v2] staging: media: starfive: Add the dynamic resolution support
  2024-08-16 13:09   ` Dan Carpenter
@ 2024-08-19 13:27     ` Changhuang Liang
  0 siblings, 0 replies; 4+ messages in thread
From: Changhuang Liang @ 2024-08-19 13:27 UTC (permalink / raw)
  To: dan.carpenter
  Cc: changhuang.liang, gregkh, hverkuil-cisco, jack.zhu,
	laurent.pinchart, linux-kernel, linux-media, linux-staging,
	mchehab

Hi, Dan

Thanks for your comments.

>On Fri, Aug 16, 2024 at 04:04:38PM +0300, Dan Carpenter wrote:
>> On Fri, Aug 16, 2024 at 05:51:32AM -0700, Changhuang Liang wrote:
>> > Add the dynamic resolution support for video "capture_raw" device.
>> >
>>
>> What does this change look like from a use perspective if a user is reading the
>> git log?
>>
>> > Fixes: e080f339c80a ("media: staging: media: starfive: camss: Add capture driver")
>> >
>>
>> This looks like a new feature and not a bugfix.  Please describe the bug more
>> clearly if it's really a bugfix.
>>
>
>Actually the first version of the commit had a good description.  Just go back
>to that.
>

Yes, I forgot to synchronous description.

>> Add multiple resolution support for video "capture_raw" device. Otherwise
>> it will capture the wrong image data if the width is not 1920.
>
>Btw:
>1) Don't put a blank line after the Fixes tag.
>2) Put a note under the --- cut off line that says what changed.
>
>https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/
>

Thanks for this.

>Please send v3.

regards,
Changhuang

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-16 12:51 [v2] staging: media: starfive: Add the dynamic resolution support Changhuang Liang
2024-08-16 13:04 ` Dan Carpenter
2024-08-16 13:09   ` Dan Carpenter
2024-08-19 13:27     ` Changhuang Liang

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

all inboxes | Powered by JetHome®