diff mbox series

[v2,1/3] drm/atomic-helper: print message on driver connector check failure

Message ID 20220829151451.152114-1-contact@emersion.fr (mailing list archive)
State New, archived
Headers show
Series [v2,1/3] drm/atomic-helper: print message on driver connector check failure | expand

Commit Message

Simon Ser Aug. 29, 2022, 3:14 p.m. UTC
Sometimes drivers are missing logs when they return EINVAL.
Printing the failure here in common code can help understand where
EINVAL is coming from.

All other atomic_check() calls in this file already have similar
logging.

v2: add missing newlines

Signed-off-by: Simon Ser <contact@emersion.fr>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Lyude Paul <lyude@redhat.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Lyude Paul Aug. 29, 2022, 7:29 p.m. UTC | #1
Thanks for this! We definitely need more logging like this in DRM. for patches
1 and 2:

Reviewed-by: Lyude Paul <lyude@redhat.com>

On Mon, 2022-08-29 at 15:14 +0000, Simon Ser wrote:
> Sometimes drivers are missing logs when they return EINVAL.
> Printing the failure here in common code can help understand where
> EINVAL is coming from.
> 
> All other atomic_check() calls in this file already have similar
> logging.
> 
> v2: add missing newlines
> 
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Lyude Paul <lyude@redhat.com>
> ---
>  drivers/gpu/drm/drm_atomic_helper.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index c6abfd3d4b62..4aa05b626b57 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -702,8 +702,12 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
>  
>  		if (funcs->atomic_check)
>  			ret = funcs->atomic_check(connector, state);
> -		if (ret)
> +		if (ret) {
> +			drm_dbg_atomic(dev,
> +				       "[CONNECTOR:%d:%s] driver check failed\n",
> +				       connector->base.id, connector->name);
>  			return ret;
> +		}
>  
>  		connectors_mask |= BIT(i);
>  	}
> @@ -745,8 +749,12 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
>  
>  		if (funcs->atomic_check)
>  			ret = funcs->atomic_check(connector, state);
> -		if (ret)
> +		if (ret) {
> +			drm_dbg_atomic(dev,
> +				       "[CONNECTOR:%d:%s] driver check failed\n",
> +				       connector->base.id, connector->name);
>  			return ret;
> +		}
>  	}
>  
>  	/*
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index c6abfd3d4b62..4aa05b626b57 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -702,8 +702,12 @@  drm_atomic_helper_check_modeset(struct drm_device *dev,
 
 		if (funcs->atomic_check)
 			ret = funcs->atomic_check(connector, state);
-		if (ret)
+		if (ret) {
+			drm_dbg_atomic(dev,
+				       "[CONNECTOR:%d:%s] driver check failed\n",
+				       connector->base.id, connector->name);
 			return ret;
+		}
 
 		connectors_mask |= BIT(i);
 	}
@@ -745,8 +749,12 @@  drm_atomic_helper_check_modeset(struct drm_device *dev,
 
 		if (funcs->atomic_check)
 			ret = funcs->atomic_check(connector, state);
-		if (ret)
+		if (ret) {
+			drm_dbg_atomic(dev,
+				       "[CONNECTOR:%d:%s] driver check failed\n",
+				       connector->base.id, connector->name);
 			return ret;
+		}
 	}
 
 	/*