Skip to contentSkip to conversation

drm/ast: Fix black screen after resume

PATCH In review Jammy Huang 2 participants 4 messages Jul 18, 2024 – Jul 19, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ast: Fix black screen after resume

Suspend will disable pcie device. Thus, resume should do full hw initialization again.
Add some APIs to ast_drm_thaw() before ast_post_gpu() to fix the issue.

Fixes 5b71707dd13 ("drm/ast: Enable and unlock device access early during init")
---
 drivers/gpu/drm/ast/ast_drv.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/ast/ast_drv.c +5 -0
index f8c49ba68e78..45a9c7bf49c8 100644
@@ -391,6 +391,11 @@ static int ast_drm_freeze(struct drm_device *dev)
 
 static int ast_drm_thaw(struct drm_device *dev)
 {
+	struct ast_device *ast = to_ast_device(dev);
+
+	ast_enable_vga(ioregs);
+	ast_open_key(ioregs);
+	ast_enable_mmio(dev, ioregs);
 	ast_post_gpu(dev);
 
 	return drm_mode_config_helper_resume(dev);

base-commit: e9d22f7a6655941fc8b2b942ed354ec780936b3e
prerequisite-patch-id: a03a33902f33bcc38091e2cdce9d79f630464c30
prerequisite-patch-id: 505779a1e2094f2ee2f2a55ad44aac5cd1d5342f

Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

(Cary, this looks like it fixes the problem you reported.)

Hi Jammy

Am 18.07.24 um 05:03 schrieb Jammy Huang:

Quoted 6 lines

Suspend will disable pcie device. Thus, resume should do full hw initialization again.
Add some APIs to ast_drm_thaw() before ast_post_gpu() to fix the issue.

Fixes 5b71707dd13 ("drm/ast: Enable and unlock device access early during init")

Thanks a lot for this fix.

Best regards
Thomas

Quoted 24 lines
---
  drivers/gpu/drm/ast/ast_drv.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/gpu/drm/ast/ast_drv.c +5 -0
index f8c49ba68e78..45a9c7bf49c8 100644
@@ -391,6 +391,11 @@ static int ast_drm_freeze(struct drm_device *dev)
 
  static int ast_drm_thaw(struct drm_device *dev)
  {
+	struct ast_device *ast = to_ast_device(dev);
+
+	ast_enable_vga(ioregs);
+	ast_open_key(ioregs);
+	ast_enable_mmio(dev, ioregs);
  	ast_post_gpu(dev);
 
  	return drm_mode_config_helper_resume(dev);

base-commit: e9d22f7a6655941fc8b2b942ed354ec780936b3e
prerequisite-patch-id: a03a33902f33bcc38091e2cdce9d79f630464c30
prerequisite-patch-id: 505779a1e2094f2ee2f2a55ad44aac5cd1d5342f

Signature · 7 lines
--
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)
#2 lore raw

Am 18.07.24 um 08:50 schrieb Thomas Zimmermann:

Quoted 23 lines

(Cary, this looks like it fixes the problem you reported.)

Hi Jammy

Am 18.07.24 um 05:03 schrieb Jammy Huang:

Quoted 6 lines

Suspend will disable pcie device. Thus, resume should do full hw initialization again.
Add some APIs to ast_drm_thaw() before ast_post_gpu() to fix the issue.

Fixes 5b71707dd13 ("drm/ast: Enable and unlock device access early during init")

Thanks a lot for this fix.

Best regards
Thomas

Quoted 4 lines

---
  drivers/gpu/drm/ast/ast_drv.c | 5 +++++

  1 file changed, 5 insertions(+)
Quoted 12 lines

drivers/gpu/drm/ast/ast_drv.c static int ast_drm_freeze(struct drm_device *dev) · line 397

Quoted 12 lines
drivers/gpu/drm/ast/ast_drv.c +5 -0
index f8c49ba68e78..45a9c7bf49c8 100644
@@ -391,6 +391,11 @@ static int ast_drm_freeze(struct drm_device *dev)
     static int ast_drm_thaw(struct drm_device *dev)
   {
+    struct ast_device *ast = to_ast_device(dev);
+
+    ast_enable_vga(ioregs);
+    ast_open_key(ioregs);
+    ast_enable_mmio(dev, ioregs);

BTW I got a build error. I'll fix that up before committing the patch.

Best regards
Thomas

Quoted 7 lines
Quoted 6 lines
drivers/gpu/drm/ast/ast_drv.c +0 -0
       ast_post_gpu(dev);
         return drm_mode_config_helper_resume(dev);
 

base-commit: e9d22f7a6655941fc8b2b942ed354ec780936b3e
prerequisite-patch-id: a03a33902f33bcc38091e2cdce9d79f630464c30
prerequisite-patch-id: 505779a1e2094f2ee2f2a55ad44aac5cd1d5342f

Signature · 7 lines
--
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)
#3 lore raw

Hi Thomas,

Sorry for the miss, and thanks for your help.

Regards,
Jammy Huang

Quoted 65 lines

-----Original Message-----
From: Thomas Zimmermann <[email protected]>
Sent: Thursday, July 18, 2024 4:02 PM
To: Jammy Huang <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; Cary Garrett <[email protected]>
Subject: Re: [PATCH] drm/ast: Fix black screen after resume

Am 18.07.24 um 08:50 schrieb Thomas Zimmermann:

Quoted 24 lines

(Cary, this looks like it fixes the problem you reported.)

Hi Jammy

Am 18.07.24 um 05:03 schrieb Jammy Huang:

Quoted 7 lines

Suspend will disable pcie device. Thus, resume should do full hw initialization again.
Add some APIs to ast_drm_thaw() before ast_post_gpu() to fix the issue.

Fixes 5b71707dd13 ("drm/ast: Enable and unlock device access early

during init")

Thanks a lot for this fix.

Best regards
Thomas

Quoted 4 lines
---
  drivers/gpu/drm/ast/ast_drv.c | 5 +++++
  1 file changed, 5 insertions(+)
Quoted 14 lines
Quoted 6 lines
(quoted diff) +0 -0

b/drivers/gpu/drm/ast/ast_drv.c index f8c49ba68e78..45a9c7bf49c8 100644

drivers/gpu/drm/ast/ast_drv.c static int ast_drm_freeze(struct drm_device · line 398

Quoted 8 lines
drivers/gpu/drm/ast/ast_drv.c +5 -0
@@ -391,6 +391,11 @@ static int ast_drm_freeze(struct drm_device
 *dev)
    static int ast_drm_thaw(struct drm_device *dev)
  {
+    struct ast_device *ast = to_ast_device(dev);
+
+    ast_enable_vga(ioregs);
+    ast_open_key(ioregs);
+    ast_enable_mmio(dev, ioregs);

BTW I got a build error. I'll fix that up before committing the patch.

Best regards
Thomas

Quoted 7 lines
Quoted 6 lines
drivers/gpu/drm/ast/ast_drv.c +0 -0
      ast_post_gpu(dev);
        return drm_mode_config_helper_resume(dev);
 

base-commit: e9d22f7a6655941fc8b2b942ed354ec780936b3e
prerequisite-patch-id: a03a33902f33bcc38091e2cdce9d79f630464c30
prerequisite-patch-id: 505779a1e2094f2ee2f2a55ad44aac5cd1d5342f

Quoted 8 lines

--
--
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)

************* Email Confidentiality Notice ********************
免責聲明:
本信件(或其附件)可能包含機密資訊,並受法律保護。如 台端非指定之收件者,請以電子郵件通知本電子郵件之發送者, 並請立即刪除本電子郵件及其附件和銷毀所有複印件。謝謝您的合作!

DISCLAIMER:
This message (and any attachments) may contain legally privileged and/or other confidential information. If you have received it in error, please notify the sender by reply e-mail and immediately delete the e-mail and any attachments without copying or disclosing the contents. Thank you.