Re: [PATCH] drm/amd/display: add debug logs for dm_crtc_helper_atomic_check

2020-12-02 Thread Alex Deucher
On Wed, Dec 2, 2020 at 4:06 PM Simon Ser  wrote:
>
> Instead of silently failing the atomic check, explain what happened via
> a debug log. This makes it easier for user-space to figure out why
> something failed.
>
> Signed-off-by: Simon Ser 
> Cc: Alex Deucher 
> Cc: Harry Wentland 
> Cc: Nicholas Kazlauskas 

Applied.  Thanks!

Alex

> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 -
>  1 file changed, 4 insertions(+), 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 862a59703060..313501cc39fc 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -6068,8 +6068,10 @@ static int dm_crtc_helper_atomic_check(struct drm_crtc 
> *crtc,
>  * userspace which stops using the HW cursor altogether in response 
> to the resulting EINVAL.
>  */
> if (crtc_state->enable &&
> -   !(crtc_state->plane_mask & drm_plane_mask(crtc->primary)))
> +   !(crtc_state->plane_mask & drm_plane_mask(crtc->primary))) {
> +   DRM_DEBUG_ATOMIC("Can't enable a CRTC without enabling the 
> primary plane\n");
> return -EINVAL;
> +   }
>
> /* In some use cases, like reset, no stream is attached */
> if (!dm_crtc_state->stream)
> @@ -6078,6 +6080,7 @@ static int dm_crtc_helper_atomic_check(struct drm_crtc 
> *crtc,
> if (dc_validate_stream(dc, dm_crtc_state->stream) == DC_OK)
> return 0;
>
> +   DRM_DEBUG_ATOMIC("Failed DC stream validation\n");
> return ret;
>  }
>
> --
> 2.29.2
>
>
> ___
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[PATCH] drm/amd/display: add debug logs for dm_crtc_helper_atomic_check

2020-12-02 Thread Simon Ser
Instead of silently failing the atomic check, explain what happened via
a debug log. This makes it easier for user-space to figure out why
something failed.

Signed-off-by: Simon Ser 
Cc: Alex Deucher 
Cc: Harry Wentland 
Cc: Nicholas Kazlauskas 
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 -
 1 file changed, 4 insertions(+), 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 862a59703060..313501cc39fc 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -6068,8 +6068,10 @@ static int dm_crtc_helper_atomic_check(struct drm_crtc 
*crtc,
 * userspace which stops using the HW cursor altogether in response to 
the resulting EINVAL.
 */
if (crtc_state->enable &&
-   !(crtc_state->plane_mask & drm_plane_mask(crtc->primary)))
+   !(crtc_state->plane_mask & drm_plane_mask(crtc->primary))) {
+   DRM_DEBUG_ATOMIC("Can't enable a CRTC without enabling the 
primary plane\n");
return -EINVAL;
+   }
 
/* In some use cases, like reset, no stream is attached */
if (!dm_crtc_state->stream)
@@ -6078,6 +6080,7 @@ static int dm_crtc_helper_atomic_check(struct drm_crtc 
*crtc,
if (dc_validate_stream(dc, dm_crtc_state->stream) == DC_OK)
return 0;
 
+   DRM_DEBUG_ATOMIC("Failed DC stream validation\n");
return ret;
 }
 
-- 
2.29.2


___
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx