All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Jocelyn Falempe <jfalempe@redhat.com>,
	airlied@redhat.com, kuohsiang_chou@aspeedtech.com,
	jammy_huang@aspeedtech.com
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/ast: Fix default resolution when no monitor is connected on DP
Date: Tue, 4 Jul 2023 16:19:25 +0200	[thread overview]
Message-ID: <2422ef03-a309-2789-04ec-a8c4559f5024@suse.de> (raw)
In-Reply-To: <20230623094639.434293-1-jfalempe@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 3773 bytes --]

Hi Jocelyn

Am 23.06.23 um 11:46 schrieb Jocelyn Falempe:
> Since commit fae7d186403e ("drm/probe-helper: Default to 640x480 if no
>   EDID on DP")
> The default resolution is now 640x480 when no monitor is connected.
> But Aspeed graphics is mostly used in servers, where no monitor
> is attached. This also affects the "remote" resolution to 640x480, which is
> inconvenient, and breaks the anaconda installer.

By "remote resolution", you mean the display mode that the BMC uses?

> So when no EDID is present, set 1024x768 as preferred resolution.
> 
> Fixes: fae7d186403e ("drm/probe-helper: Default to 640x480 if no EDID on DP")

This commit says that 640x480 is the designated failsafe mode if no EDID 
is available. Therefore, I think we should not override it 
unconditionally. The ast driver is no special in that case.

But I see why you're doing this change. I think any solution should be 
implemented in drm_helper_probe_single_connector_modes().

But before we solve this in the kernel, is it possible to delegate this 
to userspace? If no EDID has been given, userspace could try a 
non-failsafe display mode.

Best regards
Thomas

> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
> ---
>   drivers/gpu/drm/ast/ast_mode.c | 26 ++++++++++++++++++++++++--
>   1 file changed, 24 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
> index 36374828f6c8..8f7b7cc021c7 100644
> --- a/drivers/gpu/drm/ast/ast_mode.c
> +++ b/drivers/gpu/drm/ast/ast_mode.c
> @@ -1589,9 +1589,31 @@ static const struct drm_connector_helper_funcs ast_dp501_connector_helper_funcs
>   	.get_modes = ast_dp501_connector_helper_get_modes,
>   };
>   
> +static int ast_dp_probe_single_connector_modes(struct drm_connector *connector,
> +					       uint32_t maxX, uint32_t maxY)
> +{
> +	int ret;
> +	struct drm_display_mode *mode;
> +
> +	ret = drm_helper_probe_single_connector_modes(connector, maxX, maxY);
> +	/*
> +	 * When no monitor are detected, DP now default to 640x480
> +	 * As aspeed is mostly used in remote server, and DP monitors are
> +	 * rarely attached, it's better to default to 1024x768
> +	 */
> +	if (!connector->edid_blob_ptr) {
> +		list_for_each_entry(mode, &connector->modes, head) {
> +			if (mode->hdisplay == 1024 && mode->vdisplay == 768)
> +				mode->type |= DRM_MODE_TYPE_PREFERRED;
> +			drm_mode_sort(&connector->modes);
> +		}
> +	}
> +	return ret;
> +}
> +
>   static const struct drm_connector_funcs ast_dp501_connector_funcs = {
>   	.reset = drm_atomic_helper_connector_reset,
> -	.fill_modes = drm_helper_probe_single_connector_modes,
> +	.fill_modes = ast_dp_probe_single_connector_modes,
>   	.destroy = drm_connector_cleanup,
>   	.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
>   	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
> @@ -1678,7 +1700,7 @@ static const struct drm_connector_helper_funcs ast_astdp_connector_helper_funcs
>   
>   static const struct drm_connector_funcs ast_astdp_connector_funcs = {
>   	.reset = drm_atomic_helper_connector_reset,
> -	.fill_modes = drm_helper_probe_single_connector_modes,
> +	.fill_modes = ast_dp_probe_single_connector_modes,
>   	.destroy = drm_connector_cleanup,
>   	.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
>   	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
> 
> base-commit: 0adec22702d497385dbdc52abb165f379a00efba

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2023-07-04 14:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-23  9:46 [PATCH] drm/ast: Fix default resolution when no monitor is connected on DP Jocelyn Falempe
2023-07-04 14:19 ` Thomas Zimmermann [this message]
2023-07-04 14:21   ` Thomas Zimmermann
2023-07-04 14:54 ` Jani Nikula
2023-07-04 16:45   ` Jocelyn Falempe
2023-07-06  9:16     ` Jocelyn Falempe
2023-07-06  9:32       ` Jani Nikula
2023-07-06 10:07         ` Jocelyn Falempe
2023-07-06 10:14           ` Jani Nikula
2023-07-06 10:26       ` Thomas Zimmermann
2023-07-06 11:31         ` Jocelyn Falempe
2023-07-06 16:37           ` Jocelyn Falempe
2023-07-07  7:30             ` Thomas Zimmermann
2023-07-10  8:07               ` Jocelyn Falempe
2023-07-12 15:05                 ` Sui Jingfeng
2023-07-12 15:25                   ` Jocelyn Falempe
2023-07-13  8:32                     ` Michel Dänzer
2023-07-13  8:49                       ` Thomas Zimmermann
2023-07-13  8:53                         ` Michel Dänzer
2023-07-13  9:09                           ` Thomas Zimmermann
2023-07-13  9:41                             ` Michel Dänzer
2023-07-13  8:53                       ` Jocelyn Falempe
2023-07-13  8:55                         ` Michel Dänzer
2023-07-13  8:50                   ` Thomas Zimmermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2422ef03-a309-2789-04ec-a8c4559f5024@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jammy_huang@aspeedtech.com \
    --cc=jfalempe@redhat.com \
    --cc=kuohsiang_chou@aspeedtech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.