All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Fix stale buffer object (bo) use
@ 2018-06-11  6:46 Pratik Vishwakarma
       [not found] ` <1528699583-4873-1-git-send-email-Pratik.Vishwakarma-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Pratik Vishwakarma @ 2018-06-11  6:46 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	Andrey.Grodzovsky-5C7GfCeVMHo,
	alexdeucher-Re5JQEeQqe8AvxtiuMwx3w, Harry.Wentland-5C7GfCeVMHo,
	christian.koenig-5C7GfCeVMHo

Fixes stale buffer object (bo) usage for cursor plane

Cursor plane's bo operations are handled in DC code.
Currently, atomic_commit() does not handle bo operations
for cursor plane, as a result the bo assigned for cursor
plane in dm_plane_helper_prepare_fb() is not coherent
with the updates to the same made in dc code.This mismatch
leads to "bo" corruption and hence crashes during S3 entry.

This patch cleans up the code which was added as a hack
for 4.9 version only.

Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 11 -----------
 1 file changed, 11 deletions(-)

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 a2009d5..8c31abf 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -3138,17 +3138,6 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
 		}
 	}
 
-	/* It's a hack for s3 since in 4.9 kernel filter out cursor buffer
-	 * prepare and cleanup in drm_atomic_helper_prepare_planes
-	 * and drm_atomic_helper_cleanup_planes because fb doens't in s3.
-	 * IN 4.10 kernel this code should be removed and amdgpu_device_suspend
-	 * code touching fram buffers should be avoided for DC.
-	 */
-	if (plane->type == DRM_PLANE_TYPE_CURSOR) {
-		struct amdgpu_crtc *acrtc = to_amdgpu_crtc(new_state->crtc);
-
-		acrtc->cursor_bo = obj;
-	}
 	return 0;
 }
 
-- 
1.9.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: Fix stale buffer object (bo) use
       [not found] ` <1528699583-4873-1-git-send-email-Pratik.Vishwakarma-5C7GfCeVMHo@public.gmane.org>
@ 2018-06-11 14:03   ` Andrey Grodzovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Andrey Grodzovsky @ 2018-06-11 14:03 UTC (permalink / raw)
  To: Pratik Vishwakarma, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	alexdeucher-Re5JQEeQqe8AvxtiuMwx3w, Harry.Wentland-5C7GfCeVMHo,
	christian.koenig-5C7GfCeVMHo

Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>

Andrey


On 06/11/2018 02:46 AM, Pratik Vishwakarma wrote:
> Fixes stale buffer object (bo) usage for cursor plane
>
> Cursor plane's bo operations are handled in DC code.
> Currently, atomic_commit() does not handle bo operations
> for cursor plane, as a result the bo assigned for cursor
> plane in dm_plane_helper_prepare_fb() is not coherent
> with the updates to the same made in dc code.This mismatch
> leads to "bo" corruption and hence crashes during S3 entry.
>
> This patch cleans up the code which was added as a hack
> for 4.9 version only.
>
> Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>
> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 11 -----------
>   1 file changed, 11 deletions(-)
>
> 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 a2009d5..8c31abf 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -3138,17 +3138,6 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
>   		}
>   	}
>   
> -	/* It's a hack for s3 since in 4.9 kernel filter out cursor buffer
> -	 * prepare and cleanup in drm_atomic_helper_prepare_planes
> -	 * and drm_atomic_helper_cleanup_planes because fb doens't in s3.
> -	 * IN 4.10 kernel this code should be removed and amdgpu_device_suspend
> -	 * code touching fram buffers should be avoided for DC.
> -	 */
> -	if (plane->type == DRM_PLANE_TYPE_CURSOR) {
> -		struct amdgpu_crtc *acrtc = to_amdgpu_crtc(new_state->crtc);
> -
> -		acrtc->cursor_bo = obj;
> -	}
>   	return 0;
>   }
>   

_______________________________________________
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-11 14:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-11  6:46 [PATCH] drm/amd/display: Fix stale buffer object (bo) use Pratik Vishwakarma
     [not found] ` <1528699583-4873-1-git-send-email-Pratik.Vishwakarma-5C7GfCeVMHo@public.gmane.org>
2018-06-11 14:03   ` Andrey Grodzovsky

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.