diff mbox series

[1/3] drm: Always warn if user-defined modes are not supported

Message ID 20220511183125.14294-2-tzimmermann@suse.de (mailing list archive)
State New, archived
Headers show
Series drm/client: Fix display-mode selection | expand

Commit Message

Thomas Zimmermann May 11, 2022, 6:31 p.m. UTC
Print a warning if a user-specifed display mode is not supported by
the display pipeline. Users specified the display mode on the kernel
command line with the use of the video= parameter. Setting an
unsupported mode will leave the console blank, so we should at least
let the user know why.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/drm_modes.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Javier Martinez Canillas May 12, 2022, 7:13 a.m. UTC | #1
Hello Thomas,

On 5/11/22 20:31, Thomas Zimmermann wrote:
> Print a warning if a user-specifed display mode is not supported by
> the display pipeline. Users specified the display mode on the kernel
> command line with the use of the video= parameter. Setting an
> unsupported mode will leave the console blank, so we should at least
> let the user know why.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>  drivers/gpu/drm/drm_modes.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 14b746f7ba97..40b7b245e98c 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -1328,6 +1328,10 @@ void drm_mode_prune_invalid(struct drm_device *dev,
>  	list_for_each_entry_safe(mode, t, mode_list, head) {
>  		if (mode->status != MODE_OK) {
>  			list_del(&mode->head);
> +			if (mode->type & DRM_MODE_TYPE_USERDEF) {
> +				drm_warn(dev, "User-defined mode not supported: "
> +					 DRM_MODE_FMT "\n", DRM_MODE_ARG(mode));

I wonder if should be more explicit here like "... and it will not be used".

> +			}
>  			if (verbose) {
>  				drm_mode_debug_printmodeline(mode);
>  				DRM_DEBUG_KMS("Not using %s mode: %s\n",

Does it make sense to keep this line when verbose is set if there's a warn
now. Maybe just keep the drm_mode_debug_printmode() but remove the rest ?

I think the patch is good as is too, so regardless you do:

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 14b746f7ba97..40b7b245e98c 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -1328,6 +1328,10 @@  void drm_mode_prune_invalid(struct drm_device *dev,
 	list_for_each_entry_safe(mode, t, mode_list, head) {
 		if (mode->status != MODE_OK) {
 			list_del(&mode->head);
+			if (mode->type & DRM_MODE_TYPE_USERDEF) {
+				drm_warn(dev, "User-defined mode not supported: "
+					 DRM_MODE_FMT "\n", DRM_MODE_ARG(mode));
+			}
 			if (verbose) {
 				drm_mode_debug_printmodeline(mode);
 				DRM_DEBUG_KMS("Not using %s mode: %s\n",