drm/amdgpu: don't call drm_fb_helper_lastclose in lastclose()
Subsystems (2)
Alex Deucher
maintainerPATCH 1/1 drm/amdgpu: don't call drm_fb_helper_lastclose in lastclose()
It's used to restore the fbdev console, but as amdgpu uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the call to drm_client_dev_restore() in drm_lastclose().
--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -1
@@ -1106,7 +1106,6 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)*/ void amdgpu_driver_lastclose_kms (struct drm_device *dev) { -drm_fb_helper_lastclose (dev);vga_switcheroo_process_delayed_switch (); }
Signature · 1 line
2.37.3
[AMD Official Use Only - General]
Quoted 39 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, October 20, 2022 10:36 PM
To: [email protected]; [email protected]
Cc: Deucher, Alexander <[email protected]>; Thomas Zimmermann <[email protected]>
Subject: [PATCH] drm/amdgpu: don't calldrm_fb_helper_lastcloseinlastclose()It's used to restore the fbdev console, but as amdgpu uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the call to
drm_client_dev_restore()indrm_lastclose().Fixes 087451f372bf76 ("drm/amdgpu: use generic fb helpers instead ofsetting up AMD own's.")
Cc Thomas Zimmermann <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 1 - 1 file changed, 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0
-2@@ -1106,7 +1106,6 @@ int amdgpu_info_ioctl(struct drm_device *dev,void *data, struct drm_file *filp) */ void amdgpu_driver_lastclose_kms (struct drm_device *dev) { -drm_fb_helper_lastclose (dev);vga_switcheroo_process_delayed_switch (); } --2.37.3
Hi
Am 24.10.22 um 08:20 schrieb Quan, Evan:
Quoted 27 lines
[AMD Official Use Only - General]
Reviewed-by Evan Quan <[email protected]>Quoted 23 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, October 20, 2022 10:36 PM
To: [email protected]; [email protected]
Cc: Deucher, Alexander <[email protected]>; Thomas Zimmermann <[email protected]>
Subject: [PATCH] drm/amdgpu: don't calldrm_fb_helper_lastcloseinlastclose()It's used to restore the fbdev console, but as amdgpu uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the call to
drm_client_dev_restore()indrm_lastclose().Fixes 087451f372bf76 ("drm/amdgpu: use generic fb helpers instead ofsetting up AMD own's.")
Cc Thomas Zimmermann <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 1 - 1 file changed, 1 deletion(-)
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c int amdgpu_info_ioctl(struct drm_device *dev, · line 1111
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0
-1@@ -1106,7 +1106,6 @@ int amdgpu_info_ioctl(struct drm_device *dev,void *data, struct drm_file *filp) */ void amdgpu_driver_lastclose_kms (struct drm_device *dev) { -drm_fb_helper_lastclose (dev);vga_switcheroo_process_delayed_switch (); }
Without the call to drm_fb_helper_lastclose(), the console emulation will be restored by drm_client_dev_restore() from drm_lastclose(). [1] It means that it's now changing order with the call to vga_switcheroo_process_delay_switch(). Can this become a problem?
I looked at the other callers of that function. Most restore the console before doing the switcheroo. Nouveau doesn't seem to care about the console at all.
Best regards
Thomas
[1] https://elixir.bootlin.com/linux/v6.0.3/source/drivers/gpu/drm/drm_file.c#L467
Quoted 3 lines
Quoted 3 lines
--
2.37.3
Signature · 6 lines
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
Quoted 50 lines · Thomas Zimmermann
Hi
Am 24.10.22 um 08:20 schrieb Quan, Evan:
Quoted 27 lines
[AMD Official Use Only - General]
Reviewed-by Evan Quan <[email protected]>Quoted 23 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, October 20, 2022 10:36 PM
To: [email protected]; [email protected]
Cc: Deucher, Alexander <[email protected]>; Thomas Zimmermann <[email protected]>
Subject: [PATCH] drm/amdgpu: don't calldrm_fb_helper_lastcloseinlastclose()It's used to restore the fbdev console, but as amdgpu uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the call to
drm_client_dev_restore()indrm_lastclose().Fixes 087451f372bf76 ("drm/amdgpu: use generic fb helpers instead ofsetting up AMD own's.")
Cc Thomas Zimmermann <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 1 - 1 file changed, 1 deletion(-)Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c int amdgpu_info_ioctl(struct drm_device *dev, · line 1111
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0
-1@@ -1106,7 +1106,6 @@ int amdgpu_info_ioctl(struct drm_device *dev,void *data, struct drm_file *filp) */ void amdgpu_driver_lastclose_kms (struct drm_device *dev) { -drm_fb_helper_lastclose (dev);vga_switcheroo_process_delayed_switch (); }Without the call to
drm_fb_helper_lastclose(), the console emulation will be restored bydrm_client_dev_restore()fromdrm_lastclose(). [1] It means that it's now changing order with the call tovga_switcheroo_process_delay_switch(). Can this become a problem?
Quoted 3 lines
I looked at the other callers of that function. Most restore the console before doing the switcheroo. Nouveau doesn't seem to care about the console at all.
I don't know off hand. I suppose if the switch powered down the GPU and then we tried to restore it's console state that would be a problem, but it looks like vga_switchto_stage2() just powers down the GPU without going through suspend so I'm not sure if this actually worked correctly? What are the potential problems with calling drm_fb_helper_lastclose twice?
Alex
Quoted 18 lines
Best regards
Thomas[1]
https://elixir.bootlin.com/linux/v6.0.3/source/drivers/gpu/drm/drm_file.c#L467Quoted 3 lines
Quoted 3 lines
--
2.37.3--
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
Hi
Am 24.10.22 um 18:48 schrieb Alex Deucher:
Quoted 55 lines · Thomas Zimmermann
Quoted 50 lines
Hi
Am 24.10.22 um 08:20 schrieb Quan, Evan:
Quoted 27 lines
[AMD Official Use Only - General]
Reviewed-by Evan Quan <[email protected]>Quoted 23 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, October 20, 2022 10:36 PM
To: [email protected]; [email protected]
Cc: Deucher, Alexander <[email protected]>; Thomas Zimmermann <[email protected]>
Subject: [PATCH] drm/amdgpu: don't calldrm_fb_helper_lastcloseinlastclose()It's used to restore the fbdev console, but as amdgpu uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the call to
drm_client_dev_restore()indrm_lastclose().Fixes 087451f372bf76 ("drm/amdgpu: use generic fb helpers instead ofsetting up AMD own's.")
Cc Thomas Zimmermann <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 1 - 1 file changed, 1 deletion(-)Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c int amdgpu_info_ioctl(struct drm_device *dev, · line 1111
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0
-1@@ -1106,7 +1106,6 @@ int amdgpu_info_ioctl(struct drm_device *dev,void *data, struct drm_file *filp) */ void amdgpu_driver_lastclose_kms (struct drm_device *dev) { -drm_fb_helper_lastclose (dev);vga_switcheroo_process_delayed_switch (); }Without the call to
drm_fb_helper_lastclose(), the console emulation will be restored bydrm_client_dev_restore()fromdrm_lastclose(). [1] It means that it's now changing order with the call tovga_switcheroo_process_delay_switch(). Can this become a problem?Quoted 3 lines
I looked at the other callers of that function. Most restore the console before doing the switcheroo. Nouveau doesn't seem to care about the console at all.
Quoted 6 lines
I don't know off hand. I suppose if the switch powered down the GPU and then we tried to restore it's console state that would be a problem, but it looks like
vga_switchto_stage2()just powers down the GPU without going through suspend so I'm not sure if this actually worked correctly? What are the potential problems with callingdrm_fb_helper_lastclosetwice?
It should do fbdev console modesetting twice; so no problem.
AFAIU calling vga switcheroo does nothing for devices without support. So let's call vga_switcheroo_process_delayed_switch() at the very end of drm_lastclose() and remove the amdgpu callback entirely. [1] This should not be a problem and if, we can refactor the whole function.
Best regards
Thomas
[1] https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/drm_file.c#L468
Quoted 21 lines
Alex
Quoted 18 lines
Best regards
Thomas[1]
https://elixir.bootlin.com/linux/v6.0.3/source/drivers/gpu/drm/drm_file.c#L467Quoted 3 lines
Quoted 3 lines
--
2.37.3--
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
Signature · 6 lines
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
Quoted 66 lines · Thomas Zimmermann
Hi
Am 24.10.22 um 18:48 schrieb Alex Deucher:
Quoted 55 lines · Thomas Zimmermann
Quoted 50 lines
Hi
Am 24.10.22 um 08:20 schrieb Quan, Evan:
Quoted 27 lines
[AMD Official Use Only - General]
Reviewed-by Evan Quan <[email protected]>Quoted 23 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, October 20, 2022 10:36 PM
To: [email protected]; [email protected]
Cc: Deucher, Alexander <[email protected]>; Thomas Zimmermann <[email protected]>
Subject: [PATCH] drm/amdgpu: don't calldrm_fb_helper_lastcloseinlastclose()It's used to restore the fbdev console, but as amdgpu uses generic fbdev emulation, the console is being restored by the DRM client helpers already. See the call to
drm_client_dev_restore()indrm_lastclose().Fixes 087451f372bf76 ("drm/amdgpu: use generic fb helpers instead ofsetting up AMD own's.")
Cc Thomas Zimmermann <[email protected]>Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 1 - 1 file changed, 1 deletion(-)Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c int amdgpu_info_ioctl(struct drm_device *dev, · line 1111
Quoted 13 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0
-1@@ -1106,7 +1106,6 @@ int amdgpu_info_ioctl(struct drm_device *dev,void *data, struct drm_file *filp) */ void amdgpu_driver_lastclose_kms (struct drm_device *dev) { -drm_fb_helper_lastclose (dev);vga_switcheroo_process_delayed_switch (); }Without the call to
drm_fb_helper_lastclose(), the console emulation will be restored bydrm_client_dev_restore()fromdrm_lastclose(). [1] It means that it's now changing order with the call tovga_switcheroo_process_delay_switch(). Can this become a problem?Quoted 3 lines
I looked at the other callers of that function. Most restore the console before doing the switcheroo. Nouveau doesn't seem to care about the console at all.
Quoted 6 lines
I don't know off hand. I suppose if the switch powered down the GPU and then we tried to restore it's console state that would be a problem, but it looks like
vga_switchto_stage2()just powers down the GPU without going through suspend so I'm not sure if this actually worked correctly? What are the potential problems with callingdrm_fb_helper_lastclosetwice?
Quoted 6 lines
It should do fbdev console modesetting twice; so no problem.
AFAIU calling vga switcheroo does nothing for devices without support. So let's call
vga_switcheroo_process_delayed_switch()at the very end ofdrm_lastclose()and remove the amdgpu callback entirely. [1] This should not be a problem and if, we can refactor the whole function.
Sounds like a plan. Thanks!
Alex
Quoted 36 lines
Best regards
Thomas[1]
https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/drm_file.c#L468Quoted 21 lines
Alex
Quoted 18 lines
Best regards
Thomas[1]
https://elixir.bootlin.com/linux/v6.0.3/source/drivers/gpu/drm/drm_file.c#L467Quoted 3 lines
Quoted 3 lines
--
2.37.3--
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--
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