AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Fix a loop timeout in wait_for_fbc_state_changed()
@ 2018-06-20 12:05 Dan Carpenter
       [not found] ` <20180620120507.qztby4wtgehc65f2-vMlZ3nK25oGAIHFoDFOv9A@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-06-20 12:05 UTC (permalink / raw)
  To: Alex Deucher, Roman Li
  Cc: David (ChunMing) Zhou, David Airlie, Bhawanpreet Lakha,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Shirish S,
	Harry Wentland, Dave Airlie, Tony Cheng, Christian König

We changed this loop so now it loops 1000 times instead of 10.  We need
to make the counter larger because a uint8_t can't go up to 1000 and
we need to update the test at the end to test for 1000 instead of 10.

Fixes: 2b6199a1d1b7 ("drm/amd/display: replace msleep with udelay in fbc path")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
index e2994d337044..8e83ec66fd22 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
@@ -143,7 +143,7 @@ static void wait_for_fbc_state_changed(
 	struct dce110_compressor *cp110,
 	bool enabled)
 {
-	uint8_t counter = 0;
+	int counter = 0;
 	uint32_t addr = mmFBC_STATUS;
 	uint32_t value;
 
@@ -158,7 +158,7 @@ static void wait_for_fbc_state_changed(
 		counter++;
 	}
 
-	if (counter == 10) {
+	if (counter == 1000) {
 		DC_LOG_WARNING("%s: wait counter exceeded, changes to HW not applied",
 			__func__);
 	} else {
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amd/display: Fix a loop timeout in wait_for_fbc_state_changed()
       [not found] ` <20180620120507.qztby4wtgehc65f2-vMlZ3nK25oGAIHFoDFOv9A@public.gmane.org>
@ 2018-06-20 14:12   ` Harry Wentland
  0 siblings, 0 replies; 2+ messages in thread
From: Harry Wentland @ 2018-06-20 14:12 UTC (permalink / raw)
  To: Dan Carpenter, Alex Deucher, Roman Li
  Cc: David (ChunMing) Zhou, David Airlie, Bhawanpreet Lakha,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Shirish S, Dave Airlie,
	Tony Cheng, Christian König

On 2018-06-20 08:05 AM, Dan Carpenter wrote:
> We changed this loop so now it loops 1000 times instead of 10.  We need
> to make the counter larger because a uint8_t can't go up to 1000 and
> we need to update the test at the end to test for 1000 instead of 10.
> 
> Fixes: 2b6199a1d1b7 ("drm/amd/display: replace msleep with udelay in fbc path")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks for the patch. An equivalent one is already on-route to be merged: https://patchwork.freedesktop.org/patch/230412/

Harry

> 
> diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
> index e2994d337044..8e83ec66fd22 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
> @@ -143,7 +143,7 @@ static void wait_for_fbc_state_changed(
>  	struct dce110_compressor *cp110,
>  	bool enabled)
>  {
> -	uint8_t counter = 0;
> +	int counter = 0;
>  	uint32_t addr = mmFBC_STATUS;
>  	uint32_t value;
>  
> @@ -158,7 +158,7 @@ static void wait_for_fbc_state_changed(
>  		counter++;
>  	}
>  
> -	if (counter == 10) {
> +	if (counter == 1000) {
>  		DC_LOG_WARNING("%s: wait counter exceeded, changes to HW not applied",
>  			__func__);
>  	} else {
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2018-06-20 14:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-20 12:05 [PATCH] drm/amd/display: Fix a loop timeout in wait_for_fbc_state_changed() Dan Carpenter
     [not found] ` <20180620120507.qztby4wtgehc65f2-vMlZ3nK25oGAIHFoDFOv9A@public.gmane.org>
2018-06-20 14:12   ` Harry Wentland

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