drm/radeon: only init fbdev if we have connectors
Subsystems (2)
PATCH 1/1 drm/radeon: only init fbdev if we have connectors
This fixes an issue that was noticed on an optimus/prime laptop with a kernel that was old enough to not support the integrated intel gfx (which was driving all the outputs), but did have support for the discrete radeon gpu. The end result was not falling back to VESA and leaving the user with a black screen.
(Plus it is kind of silly to create an framebuffer device if there are no outputs hooked up to the gpu.)
--- drivers/gpu/drm/radeon/radeon_display.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/radeon_display.c +4 -2
@@ -1670,8 +1670,10 @@ int radeon_modeset_init(struct radeon_device *rdev)/* setup afmt */ radeon_afmt_init (rdev); -radeon_fbdev_init (rdev); -drm_kms_helper_poll_init (rdev->ddev); +if (!list_empty (&rdev->ddev->mode_config.connector_list)) { +radeon_fbdev_init (rdev); +drm_kms_helper_poll_init (rdev->ddev); + }/* do pm late init */ ret =radeon_pm_late_init (rdev);
Signature · 6 lines
2.5.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Is something similar required for AMDGPU too?
Quoted 35 lines · On Mon, 25 Jan 2016 at 23:06 Rob Clark <[email protected]> wrote:
This fixes an issue that was noticed on an optimus/prime laptop with a kernel that was old enough to not support the integrated intel gfx (which was driving all the outputs), but did have support for the discrete radeon gpu. The end result was not falling back to VESA and leaving the user with a black screen.
(Plus it is kind of silly to create an framebuffer device if there are no outputs hooked up to the gpu.)
Signed-off-by Rob Clark <[email protected]>--- drivers/gpu/drm/radeon/radeon_display.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/radeon/radeon_display.c +4
-3@@ -1670,8 +1670,10 @@ int radeon_modeset_init(struct radeon_device *rdev)/* setup afmt */ radeon_afmt_init (rdev); -radeon_fbdev_init (rdev); -drm_kms_helper_poll_init (rdev->ddev); +if (!list_empty (&rdev->ddev->mode_config.connector_list)) { +radeon_fbdev_init (rdev); +drm_kms_helper_poll_init (rdev->ddev); + }/* do pm late init */ ret =radeon_pm_late_init (rdev); --2.5.0
Quoted 5 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
from a quick look, I think so..
It was something I ran across on an older kernel which didn't have amdgpu, but I don't see anything obvious that would cause drm_fb_helper_init() to be skipped in amdgpu if there are no connectors.. (but nouveau seems to check for dev->mode_config.num_crtc, for (I assume) similar reasons)
BR,
-R
Quoted 39 lines · Mike Lothian
Is something similar required for AMDGPU too?
Quoted 36 lines · On Mon, 25 Jan 2016 at 23:06 Rob Clark <[email protected]> wrote:
This fixes an issue that was noticed on an optimus/prime laptop with a kernel that was old enough to not support the integrated intel gfx (which was driving all the outputs), but did have support for the discrete radeon gpu. The end result was not falling back to VESA and leaving the user with a black screen.
(Plus it is kind of silly to create an framebuffer device if there are no outputs hooked up to the gpu.)
Signed-off-by Rob Clark <[email protected]>--- drivers/gpu/drm/radeon/radeon_display.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/radeon/radeon_display.c +4
-3@@ -1670,8 +1670,10 @@ int radeon_modeset_init(struct radeon_device *rdev)/* setup afmt */ radeon_afmt_init (rdev); -radeon_fbdev_init (rdev); -drm_kms_helper_poll_init (rdev->ddev); +if (!list_empty (&rdev->ddev->mode_config.connector_list)) { +radeon_fbdev_init (rdev); +drm_kms_helper_poll_init (rdev->ddev); + }/* do pm late init */ ret =radeon_pm_late_init (rdev); --2.5.0
Quoted 4 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 7 lines · Rob Clark
from a quick look, I think so..
It was something I ran across on an older kernel which didn't have amdgpu, but I don't see anything obvious that would cause
drm_fb_helper_init()to be skipped in amdgpu if there are no connectors.. (but nouveau seems to check fordev->mode_config.num_crtc, for (I assume) similar reasons)
We don't enable fbdev on amdgpu if the chip in question has no display block, but we still could enable it if the chip has a display block, but no connectors. The same may be true in nouveau so the check for num_crtc may not be enough. Attached patch should rectify that.
Alex
Quoted 44 lines
BR,
-RQuoted 39 lines · Mike Lothian
Is something similar required for AMDGPU too?
Quoted 36 lines · On Mon, 25 Jan 2016 at 23:06 Rob Clark <[email protected]> wrote:
This fixes an issue that was noticed on an optimus/prime laptop with a kernel that was old enough to not support the integrated intel gfx (which was driving all the outputs), but did have support for the discrete radeon gpu. The end result was not falling back to VESA and leaving the user with a black screen.
(Plus it is kind of silly to create an framebuffer device if there are no outputs hooked up to the gpu.)
Signed-off-by Rob Clark <[email protected]>--- drivers/gpu/drm/radeon/radeon_display.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/radeon/radeon_display.c +4
-3@@ -1670,8 +1670,10 @@ int radeon_modeset_init(struct radeon_device *rdev)/* setup afmt */ radeon_afmt_init (rdev); -radeon_fbdev_init (rdev); -drm_kms_helper_poll_init (rdev->ddev); +if (!list_empty (&rdev->ddev->mode_config.connector_list)) { +radeon_fbdev_init (rdev); +drm_kms_helper_poll_init (rdev->ddev); + }/* do pm late init */ ret =radeon_pm_late_init (rdev); --2.5.0
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
From 55a9c63c7a20f07cb77864346ac21ea962f00068 Mon Sep 17 00:00:00 2001
From: Alex Deucher <[email protected]>
Date: Tue, 26 Jan 2016 00:30:33 -0500
Subject: [PATCH] drm/amdgpu: don't init fbdev if we don't have any connectors
Don't init fbdev if we don't have connectors. E.g., if you have a PX laptop with the displays attached to an IGP with no driver support, you may end up with a blank screen rather than falling back to vesa, etc.
Based on a similar radeon patch from Rob Clark.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +4 -0
@@ -333,6 +333,10 @@ int amdgpu_fbdev_init(struct amdgpu_device *adev)if (!adev->mode_info.mode_config_initialized)return 0 ; +/* don't init fbdev if there are no connectors */ +if (list_empty (&adev->ddev->mode_config.connector_list)) +return 0 ; +/* select 8 bpp console on low vram cards */ if (adev->mc.real_vram_size <= (32 *1024 *1024 )) bpp_sel =8 ;
Signature · 1 line
2.5.0
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Alex Deucher
AppliedQuoted 10 lines · Rob Clark
This fixes an issue that was noticed on an optimus/prime laptop with a kernel that was old enough to not support the integrated intel gfx (which was driving all the outputs), but did have support for the discrete radeon gpu. The end result was not falling back to VESA and leaving the user with a black screen.
(Plus it is kind of silly to create an framebuffer device if there are no outputs hooked up to the gpu.)
Signed-off-by Rob Clark <[email protected]>
Applied. thanks!
Alex
Quoted 24 lines
--- drivers/gpu/drm/radeon/radeon_display.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/radeon/radeon_display.c +4
-3@@ -1670,8 +1670,10 @@ int radeon_modeset_init(struct radeon_device *rdev)/* setup afmt */ radeon_afmt_init (rdev); -radeon_fbdev_init (rdev); -drm_kms_helper_poll_init (rdev->ddev); +if (!list_empty (&rdev->ddev->mode_config.connector_list)) { +radeon_fbdev_init (rdev); +drm_kms_helper_poll_init (rdev->ddev); + }/* do pm late init */ ret =radeon_pm_late_init (rdev); --2.5.0
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel