All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Only get the connector state for VRR when toggled
@ 2019-01-10 20:12 Nicholas Kazlauskas
       [not found] ` <20190110201248.26647-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Kazlauskas @ 2019-01-10 20:12 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Leo Li, Harry Wentland, Nicholas Kazlauskas

[Why]
This fixes a stuttering issue that occurs when moving a hardware cursor
when VRR is enabled.

Previously when VRR is enabled atomic check will grab the connector
state for every atomic update. This has to lock the connector in order
to do so. The locking is bad enough by itself for performance, but
it gets worse with what we do just below that - add all the planes
for the CRTC to the commit.

This prevents the cursor fast path from working - there's more than one
plane now. With state->allow_modeset = true on top of this, it also
adds and removes all the planes from the DC context triggering a full
(very slow) update in DC.

[How]
We need the connector state to get the VRR min/max capbilities, but we
only need them when there's a CRTC mode change or when VRR is toggled.

The condition has been updated accordingly.

Fixes: 3cc22f281318 ("drm/amdgpu: Set FreeSync state using drm VRR properties")

Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 48777739d2dc..b7867ec166f3 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -6083,7 +6083,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
 	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
 		if (!drm_atomic_crtc_needs_modeset(new_crtc_state) &&
 		    !new_crtc_state->color_mgmt_changed &&
-		    !new_crtc_state->vrr_enabled)
+		    old_crtc_state->vrr_enabled == new_crtc_state->vrr_enabled)
 			continue;
 
 		if (!new_crtc_state->enable)
-- 
2.17.1

_______________________________________________
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: Only get the connector state for VRR when toggled
       [not found] ` <20190110201248.26647-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
@ 2019-01-11 14:49   ` Li, Sun peng (Leo)
  0 siblings, 0 replies; 2+ messages in thread
From: Li, Sun peng (Leo) @ 2019-01-11 14:49 UTC (permalink / raw)
  To: Kazlauskas, Nicholas, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
  Cc: Wentland, Harry



On 2019-01-10 3:12 p.m., Nicholas Kazlauskas wrote:
> [Why]
> This fixes a stuttering issue that occurs when moving a hardware cursor
> when VRR is enabled.
> 
> Previously when VRR is enabled atomic check will grab the connector
> state for every atomic update. This has to lock the connector in order
> to do so. The locking is bad enough by itself for performance, but
> it gets worse with what we do just below that - add all the planes
> for the CRTC to the commit.
> 
> This prevents the cursor fast path from working - there's more than one
> plane now. With state->allow_modeset = true on top of this, it also
> adds and removes all the planes from the DC context triggering a full
> (very slow) update in DC.
> 
> [How]
> We need the connector state to get the VRR min/max capbilities, but we
> only need them when there's a CRTC mode change or when VRR is toggled.
> 
> The condition has been updated accordingly.
> 
> Fixes: 3cc22f281318 ("drm/amdgpu: Set FreeSync state using drm VRR properties")
> 
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: Leo Li <sunpeng.li@amd.com>
> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

Reviewed-by: Leo Li <sunpeng.li@amd.com>

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 48777739d2dc..b7867ec166f3 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -6083,7 +6083,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
>   	for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
>   		if (!drm_atomic_crtc_needs_modeset(new_crtc_state) &&
>   		    !new_crtc_state->color_mgmt_changed &&
> -		    !new_crtc_state->vrr_enabled)
> +		    old_crtc_state->vrr_enabled == new_crtc_state->vrr_enabled)
>   			continue;
>   
>   		if (!new_crtc_state->enable)
> 
_______________________________________________
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:[~2019-01-11 14:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-10 20:12 [PATCH] drm/amd/display: Only get the connector state for VRR when toggled Nicholas Kazlauskas
     [not found] ` <20190110201248.26647-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org>
2019-01-11 14:49   ` Li, Sun peng (Leo)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.