* [PATCH] media: aspeed: fix mode-detect always timeout at 2nd run
@ 2021-11-02 7:13 Jammy Huang
2021-11-02 8:07 ` Paul Menzel
0 siblings, 1 reply; 3+ messages in thread
From: Jammy Huang @ 2021-11-02 7:13 UTC (permalink / raw)
To: linux-aspeed
aspeed_video_get_resolution() will try to do res-detect again if the
timing got in last try is invalid. But it will always timeout because
VE_SEQ_CTRL_TRIG_MODE_DET only cleared after 1st mode-detect.
To fix the problem, just clear VE_SEQ_CTRL_TRIG_MODE_DET before set in
aspeed_video_enable_mode_detect().
Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
---
drivers/media/platform/aspeed-video.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c
index cd2b71c81e31..b470f4b68aa0 100644
--- a/drivers/media/platform/aspeed-video.c
+++ b/drivers/media/platform/aspeed-video.c
@@ -611,6 +611,10 @@ static void aspeed_video_enable_mode_detect(struct aspeed_video *video)
aspeed_video_update(video, VE_INTERRUPT_CTRL, 0,
VE_INTERRUPT_MODE_DETECT);
+ /* Disable mode detect in order to re-trigger */
+ aspeed_video_update(video, VE_SEQ_CTRL,
+ VE_SEQ_CTRL_TRIG_MODE_DET, 0);
+
/* Trigger mode detect */
aspeed_video_update(video, VE_SEQ_CTRL, 0, VE_SEQ_CTRL_TRIG_MODE_DET);
}
@@ -930,10 +934,6 @@ static void aspeed_video_get_resolution(struct aspeed_video *video)
return;
}
- /* Disable mode detect in order to re-trigger */
- aspeed_video_update(video, VE_SEQ_CTRL,
- VE_SEQ_CTRL_TRIG_MODE_DET, 0);
-
aspeed_video_check_and_set_polarity(video);
aspeed_video_enable_mode_detect(video);
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] media: aspeed: fix mode-detect always timeout at 2nd run
2021-11-02 7:13 [PATCH] media: aspeed: fix mode-detect always timeout at 2nd run Jammy Huang
@ 2021-11-02 8:07 ` Paul Menzel
2021-11-02 8:40 ` Jammy Huang
0 siblings, 1 reply; 3+ messages in thread
From: Paul Menzel @ 2021-11-02 8:07 UTC (permalink / raw)
To: linux-aspeed
Dear Jammy,
On 02.11.21 08:13, Jammy Huang wrote:
> aspeed_video_get_resolution() will try to do res-detect again if the
> timing got in last try is invalid. But it will always timeout because
The verb *time out* is spelled with a space.
> VE_SEQ_CTRL_TRIG_MODE_DET only cleared after 1st mode-detect.
is only cleared?
>
> To fix the problem, just clear VE_SEQ_CTRL_TRIG_MODE_DET before set in
before setting it?
> aspeed_video_enable_mode_detect().
>
> Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
> ---
> drivers/media/platform/aspeed-video.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c
> index cd2b71c81e31..b470f4b68aa0 100644
> --- a/drivers/media/platform/aspeed-video.c
> +++ b/drivers/media/platform/aspeed-video.c
> @@ -611,6 +611,10 @@ static void aspeed_video_enable_mode_detect(struct aspeed_video *video)
> aspeed_video_update(video, VE_INTERRUPT_CTRL, 0,
> VE_INTERRUPT_MODE_DETECT);
>
> + /* Disable mode detect in order to re-trigger */
> + aspeed_video_update(video, VE_SEQ_CTRL,
> + VE_SEQ_CTRL_TRIG_MODE_DET, 0);
> +
> /* Trigger mode detect */
> aspeed_video_update(video, VE_SEQ_CTRL, 0, VE_SEQ_CTRL_TRIG_MODE_DET);
> }
> @@ -930,10 +934,6 @@ static void aspeed_video_get_resolution(struct aspeed_video *video)
> return;
> }
>
> - /* Disable mode detect in order to re-trigger */
> - aspeed_video_update(video, VE_SEQ_CTRL,
> - VE_SEQ_CTRL_TRIG_MODE_DET, 0);
> -
> aspeed_video_check_and_set_polarity(video);
>
> aspeed_video_enable_mode_detect(video);
>
Acked-by: Paul Menzel <pmenzel@molgen.mpg.de>
Kind regards,
Paul
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] media: aspeed: fix mode-detect always timeout at 2nd run
2021-11-02 8:07 ` Paul Menzel
@ 2021-11-02 8:40 ` Jammy Huang
0 siblings, 0 replies; 3+ messages in thread
From: Jammy Huang @ 2021-11-02 8:40 UTC (permalink / raw)
To: linux-aspeed
Dear Paul,
I will modify my commit message. Thanks for your review and suggestion.
On 2021/11/2 ?? 04:07, Paul Menzel wrote:
> Dear Jammy,
>
>
> On 02.11.21 08:13, Jammy Huang wrote:
>> aspeed_video_get_resolution() will try to do res-detect again if the
>> timing got in last try is invalid. But it will always timeout because
> The verb *time out* is spelled with a space.
>
>> VE_SEQ_CTRL_TRIG_MODE_DET only cleared after 1st mode-detect.
> is only cleared?
>
>> To fix the problem, just clear VE_SEQ_CTRL_TRIG_MODE_DET before set in
> before setting it?
>
>> aspeed_video_enable_mode_detect().
>>
>> Signed-off-by: Jammy Huang<jammy_huang@aspeedtech.com>
>> ---
>> drivers/media/platform/aspeed-video.c | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c
>> index cd2b71c81e31..b470f4b68aa0 100644
>> --- a/drivers/media/platform/aspeed-video.c
>> +++ b/drivers/media/platform/aspeed-video.c
>> @@ -611,6 +611,10 @@ static void aspeed_video_enable_mode_detect(struct aspeed_video *video)
>> aspeed_video_update(video, VE_INTERRUPT_CTRL, 0,
>> VE_INTERRUPT_MODE_DETECT);
>>
>> + /* Disable mode detect in order to re-trigger */
>> + aspeed_video_update(video, VE_SEQ_CTRL,
>> + VE_SEQ_CTRL_TRIG_MODE_DET, 0);
>> +
>> /* Trigger mode detect */
>> aspeed_video_update(video, VE_SEQ_CTRL, 0, VE_SEQ_CTRL_TRIG_MODE_DET);
>> }
>> @@ -930,10 +934,6 @@ static void aspeed_video_get_resolution(struct aspeed_video *video)
>> return;
>> }
>>
>> - /* Disable mode detect in order to re-trigger */
>> - aspeed_video_update(video, VE_SEQ_CTRL,
>> - VE_SEQ_CTRL_TRIG_MODE_DET, 0);
>> -
>> aspeed_video_check_and_set_polarity(video);
>>
>> aspeed_video_enable_mode_detect(video);
>>
> Acked-by: Paul Menzel<pmenzel@molgen.mpg.de>
>
>
> Kind regards,
>
> Paul
--
Best Regards
Jammy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20211102/06a4e5c4/attachment-0001.htm>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-02 8:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-02 7:13 [PATCH] media: aspeed: fix mode-detect always timeout at 2nd run Jammy Huang
2021-11-02 8:07 ` Paul Menzel
2021-11-02 8:40 ` Jammy Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox