All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Jocelyn Falempe <jfalempe@redhat.com>,
	dri-devel@lists.freedesktop.org, kuohsiang_chou@aspeedtech.com
Cc: charles_kuan@aspeedtech.com, michel@daenzer.net,
	luke_chen@aspeedtech.com,
	Venkat Tadikonda <venkateswara.rao@intel.com>,
	hungju_huang@aspeedtech.com
Subject: Re: [PATCH] drm/ast: Fix black screen when getting out of suspend
Date: Fri, 24 Jun 2022 09:31:19 +0200	[thread overview]
Message-ID: <6ae07bc7-7cde-0554-e939-0873998fd423@suse.de> (raw)
In-Reply-To: <20220622124815.356035-1-jfalempe@redhat.com>


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

Hi

Am 22.06.22 um 14:48 schrieb Jocelyn Falempe:
> With an AST2600, the screen is garbage when going out of suspend.
> This is because color settings are lost, and not restored on resume.
> Force the color settings on DPMS_ON, to make sure the settings are correct.
> 
> I didn't write this code, it comes from the out-of-tree aspeed driver v1.13
> https://www.aspeedtech.com/support_driver/
> 
> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
> Tested-by: Venkat Tadikonda <venkateswara.rao@intel.com>
> ---
>   drivers/gpu/drm/ast/ast_mode.c | 13 +++++++++++++
>   1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
> index 3eb9afecd9d4..cdddcb5c4439 100644
> --- a/drivers/gpu/drm/ast/ast_mode.c
> +++ b/drivers/gpu/drm/ast/ast_mode.c
> @@ -990,6 +990,9 @@ static void ast_crtc_dpms(struct drm_crtc *crtc, int mode)
>   {
>   	struct ast_private *ast = to_ast_private(crtc->dev);
>   	u8 ch = AST_DPMS_VSYNC_OFF | AST_DPMS_HSYNC_OFF;
> +	struct ast_crtc_state *ast_state;
> +	const struct drm_format_info *format;
> +	struct ast_vbios_mode_info *vbios_mode_info;
>   
>   	/* TODO: Maybe control display signal generation with
>   	 *       Sync Enable (bit CR17.7).
> @@ -1007,6 +1010,16 @@ static void ast_crtc_dpms(struct drm_crtc *crtc, int mode)
>   			ast_dp_set_on_off(crtc->dev, 1);
>   		}
>   
> +		ast_state = to_ast_crtc_state(crtc->state);
> +		format = ast_state->format;
> +
> +		if (format){
> +			vbios_mode_info = &ast_state->vbios_mode_info;
> +
> +			ast_set_color_reg(ast, format);
> +			ast_set_vbios_color_reg(ast, format, vbios_mode_info);
> +		}
> +

I've seen suspend issues on other AST devices besides the 2600. This 
seems to be an improvement on AST2300 at least. Therefore

Tested-by: Thomas Zimmermann <tzimmermann@suse.de>

The DPMS code need to be integrated into atomic_enable at some point. 
(It's for a later patchset.) It's a relict of the old non-atomic 
modesetting that never got done correctly.

Best regards
Thomas

>   		ast_crtc_load_lut(ast, crtc);
>   		break;
>   	case DRM_MODE_DPMS_STANDBY:

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

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

      parent reply	other threads:[~2022-06-24  7:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22 12:48 [PATCH] drm/ast: Fix black screen when getting out of suspend Jocelyn Falempe
2022-06-22 18:34 ` Lyude Paul
2022-06-23  8:21   ` Jocelyn Falempe
2022-06-27  7:31     ` Jocelyn Falempe
2022-06-27  7:39       ` Thomas Zimmermann
2022-06-27  8:45         ` Jocelyn Falempe
2022-06-23  8:20 ` Thomas Zimmermann
2022-06-24  7:31 ` Thomas Zimmermann [this message]

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=6ae07bc7-7cde-0554-e939-0873998fd423@suse.de \
    --to=tzimmermann@suse.de \
    --cc=charles_kuan@aspeedtech.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hungju_huang@aspeedtech.com \
    --cc=jfalempe@redhat.com \
    --cc=kuohsiang_chou@aspeedtech.com \
    --cc=luke_chen@aspeedtech.com \
    --cc=michel@daenzer.net \
    --cc=venkateswara.rao@intel.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.