All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: only init fbdev if we have connectors
@ 2016-01-25 23:06 Rob Clark
  2016-01-25 23:57 ` Mike Lothian
  2016-01-26  5:36 ` Alex Deucher
  0 siblings, 2 replies; 5+ messages in thread
From: Rob Clark @ 2016-01-25 23:06 UTC (permalink / raw)
  To: dri-devel

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 <robdclark@gmail.com>
---
 drivers/gpu/drm/radeon/radeon_display.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
index 1eca0ac..f8e776c 100644
--- a/drivers/gpu/drm/radeon/radeon_display.c
+++ b/drivers/gpu/drm/radeon/radeon_display.c
@@ -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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/radeon: only init fbdev if we have connectors
  2016-01-25 23:06 [PATCH] drm/radeon: only init fbdev if we have connectors Rob Clark
@ 2016-01-25 23:57 ` Mike Lothian
  2016-01-26  0:49   ` Rob Clark
  2016-01-26  5:36 ` Alex Deucher
  1 sibling, 1 reply; 5+ messages in thread
From: Mike Lothian @ 2016-01-25 23:57 UTC (permalink / raw)
  To: Rob Clark, dri-devel


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

Is something similar required for AMDGPU too?

On Mon, 25 Jan 2016 at 23:06 Rob Clark <robdclark@gmail.com> 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 <robdclark@gmail.com>
> ---
>  drivers/gpu/drm/radeon/radeon_display.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_display.c
> b/drivers/gpu/drm/radeon/radeon_display.c
> index 1eca0ac..f8e776c 100644
> --- a/drivers/gpu/drm/radeon/radeon_display.c
> +++ b/drivers/gpu/drm/radeon/radeon_display.c
> @@ -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
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>

[-- Attachment #1.2: Type: text/html, Size: 2264 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/radeon: only init fbdev if we have connectors
  2016-01-25 23:57 ` Mike Lothian
@ 2016-01-26  0:49   ` Rob Clark
  2016-01-26  5:34     ` Alex Deucher
  0 siblings, 1 reply; 5+ messages in thread
From: Rob Clark @ 2016-01-26  0:49 UTC (permalink / raw)
  To: Mike Lothian; +Cc: 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

On Mon, Jan 25, 2016 at 6:57 PM, Mike Lothian <mike@fireburn.co.uk> wrote:
> Is something similar required for AMDGPU too?
>
> On Mon, 25 Jan 2016 at 23:06 Rob Clark <robdclark@gmail.com> 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 <robdclark@gmail.com>
>> ---
>>  drivers/gpu/drm/radeon/radeon_display.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/radeon/radeon_display.c
>> b/drivers/gpu/drm/radeon/radeon_display.c
>> index 1eca0ac..f8e776c 100644
>> --- a/drivers/gpu/drm/radeon/radeon_display.c
>> +++ b/drivers/gpu/drm/radeon/radeon_display.c
>> @@ -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
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/radeon: only init fbdev if we have connectors
  2016-01-26  0:49   ` Rob Clark
@ 2016-01-26  5:34     ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2016-01-26  5:34 UTC (permalink / raw)
  To: Rob Clark; +Cc: dri-devel

[-- Attachment #1: Type: text/plain, Size: 2643 bytes --]

On Mon, Jan 25, 2016 at 7:49 PM, Rob Clark <robdclark@gmail.com> wrote:
> 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)

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


>
> BR,
> -R
>
> On Mon, Jan 25, 2016 at 6:57 PM, Mike Lothian <mike@fireburn.co.uk> wrote:
>> Is something similar required for AMDGPU too?
>>
>> On Mon, 25 Jan 2016 at 23:06 Rob Clark <robdclark@gmail.com> 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 <robdclark@gmail.com>
>>> ---
>>>  drivers/gpu/drm/radeon/radeon_display.c | 6 ++++--
>>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/radeon/radeon_display.c
>>> b/drivers/gpu/drm/radeon/radeon_display.c
>>> index 1eca0ac..f8e776c 100644
>>> --- a/drivers/gpu/drm/radeon/radeon_display.c
>>> +++ b/drivers/gpu/drm/radeon/radeon_display.c
>>> @@ -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
>>>
>>> _______________________________________________
>>> dri-devel mailing list
>>> dri-devel@lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

[-- Attachment #2: 0001-drm-amdgpu-don-t-init-fbdev-if-we-don-t-have-any-con.patch --]
[-- Type: text/x-diff, Size: 1236 bytes --]

From 55a9c63c7a20f07cb77864346ac21ea962f00068 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexander.deucher@amd.com>
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.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
index cfb6caa..9191467 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
@@ -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;
-- 
2.5.0


[-- Attachment #3: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/radeon: only init fbdev if we have connectors
  2016-01-25 23:06 [PATCH] drm/radeon: only init fbdev if we have connectors Rob Clark
  2016-01-25 23:57 ` Mike Lothian
@ 2016-01-26  5:36 ` Alex Deucher
  1 sibling, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2016-01-26  5:36 UTC (permalink / raw)
  To: Rob Clark; +Cc: Maling list - DRI developers

On Mon, Jan 25, 2016 at 6:06 PM, Rob Clark <robdclark@gmail.com> 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 <robdclark@gmail.com>

Applied. thanks!

Alex


> ---
>  drivers/gpu/drm/radeon/radeon_display.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c
> index 1eca0ac..f8e776c 100644
> --- a/drivers/gpu/drm/radeon/radeon_display.c
> +++ b/drivers/gpu/drm/radeon/radeon_display.c
> @@ -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
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-26  5:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-25 23:06 [PATCH] drm/radeon: only init fbdev if we have connectors Rob Clark
2016-01-25 23:57 ` Mike Lothian
2016-01-26  0:49   ` Rob Clark
2016-01-26  5:34     ` Alex Deucher
2016-01-26  5:36 ` Alex Deucher

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.