diff mbox

drm/i915: Use the first mode if there is no preferred mode in the EDID

Message ID 1399993657-4544-1-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson May 13, 2014, 3:07 p.m. UTC
This matches the algorithm used by earlier kernels when selecting the
mode for the fbcon. And only if there is no modes at all, do we fall
back to using the BIOS configuration. Seamless transition is still
preserved (from the BIOS configuration to ours) so long as the BIOS has
also chosen what we hope is the native configuration.

Reported-by: Knut Petersen <Knut_Petersen@t-online.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78655
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/i915/intel_fbdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Chris Wilson May 13, 2014, 3:50 p.m. UTC | #1
On Tue, May 13, 2014 at 04:07:37PM +0100, Chris Wilson wrote:
> This matches the algorithm used by earlier kernels when selecting the
> mode for the fbcon. And only if there is no modes at all, do we fall
> back to using the BIOS configuration. Seamless transition is still
> preserved (from the BIOS configuration to ours) so long as the BIOS has
> also chosen what we hope is the native configuration.
> 
> Reported-by: Knut Petersen <Knut_Petersen@t-online.de>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78655
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: stable@vger.kernel.org
> ---
>  drivers/gpu/drm/i915/intel_fbdev.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
> index 1d3f0a9cce31..05beec4badd5 100644
> --- a/drivers/gpu/drm/i915/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> @@ -397,6 +397,14 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
>  							  height);
>  		}
>  
> +		/* No preferred mode marked by the EDID? Are there any modes? */
> +		if (!modes[i] && !list_empty(&connector->modes)) {
> +			DRM_DEBUG_KMS("using first mode listed on connector %s\n",
> +				      drm_get_connector_name(connector));
> +			modes[i] = list_first_entry(struct drm_display_mode,
> +						    &connector->modes, head);

Please imagine that I wrote this correctly.
-Chris
Jesse Barnes May 13, 2014, 8:24 p.m. UTC | #2
On Tue, 13 May 2014 16:50:12 +0100
Chris Wilson <chris@chris-wilson.co.uk> wrote:

> On Tue, May 13, 2014 at 04:07:37PM +0100, Chris Wilson wrote:
> > This matches the algorithm used by earlier kernels when selecting the
> > mode for the fbcon. And only if there is no modes at all, do we fall
> > back to using the BIOS configuration. Seamless transition is still
> > preserved (from the BIOS configuration to ours) so long as the BIOS has
> > also chosen what we hope is the native configuration.
> > 
> > Reported-by: Knut Petersen <Knut_Petersen@t-online.de>
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78655
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: stable@vger.kernel.org
> > ---
> >  drivers/gpu/drm/i915/intel_fbdev.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
> > index 1d3f0a9cce31..05beec4badd5 100644
> > --- a/drivers/gpu/drm/i915/intel_fbdev.c
> > +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> > @@ -397,6 +397,14 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
> >  							  height);
> >  		}
> >  
> > +		/* No preferred mode marked by the EDID? Are there any modes? */
> > +		if (!modes[i] && !list_empty(&connector->modes)) {
> > +			DRM_DEBUG_KMS("using first mode listed on connector %s\n",
> > +				      drm_get_connector_name(connector));
> > +			modes[i] = list_first_entry(struct drm_display_mode,
> > +						    &connector->modes, head);
> 
> Please imagine that I wrote this correctly.

Imagining you wrote it correctly:
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Knut Petersen May 14, 2014, 5:35 a.m. UTC | #3
On 13.05.2014 22:24, Jesse Barnes wrote:
> On Tue, 13 May 2014 16:50:12 +0100
> Chris Wilson <chris@chris-wilson.co.uk> wrote:
>
>> On Tue, May 13, 2014 at 04:07:37PM +0100, Chris Wilson wrote:
>>> This matches the algorithm used by earlier kernels when selecting the
>>> mode for the fbcon. And only if there is no modes at all, do we fall
>>> back to using the BIOS configuration. Seamless transition is still
>>> preserved (from the BIOS configuration to ours) so long as the BIOS has
>>> also chosen what we hope is the native configuration.
>>>
>>> Reported-by: Knut Petersen <Knut_Petersen@t-online.de>
>>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78655
>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>> Cc: stable@vger.kernel.org
I don't think that  Cc: stable@vger.kernel.org is necessary, kernels up to 3.14.x don't
expose the problem. And as this fixes a post-3.14 regression this is a clear candidate for
3.15

>>> ---
>>>   drivers/gpu/drm/i915/intel_fbdev.c | 8 ++++++++
>>>   1 file changed, 8 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
>>> index 1d3f0a9cce31..05beec4badd5 100644
>>> --- a/drivers/gpu/drm/i915/intel_fbdev.c
>>> +++ b/drivers/gpu/drm/i915/intel_fbdev.c
>>> @@ -397,6 +397,14 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
>>>   							  height);
>>>   		}
>>>   
>>> +		/* No preferred mode marked by the EDID? Are there any modes? */
>>> +		if (!modes[i] && !list_empty(&connector->modes)) {
>>> +			DRM_DEBUG_KMS("using first mode listed on connector %s\n",
>>> +				      drm_get_connector_name(connector));
>>> +			modes[i] = list_first_entry(struct drm_display_mode,
>>> +						    &connector->modes, head);
>> Please imagine that I wrote this correctly.
> Imagining you wrote it correctly:
> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>

After proper imagination Tested-by: Knut Petersen <Knut_Petersen@t-online.de>.
Jani Nikula May 15, 2014, 8:13 a.m. UTC | #4
On Wed, 14 May 2014, Knut Petersen <Knut_Petersen@t-online.de> wrote:
> On 13.05.2014 22:24, Jesse Barnes wrote:
>> On Tue, 13 May 2014 16:50:12 +0100
>> Chris Wilson <chris@chris-wilson.co.uk> wrote:
>>
>>> On Tue, May 13, 2014 at 04:07:37PM +0100, Chris Wilson wrote:
>>>> This matches the algorithm used by earlier kernels when selecting the
>>>> mode for the fbcon. And only if there is no modes at all, do we fall
>>>> back to using the BIOS configuration. Seamless transition is still
>>>> preserved (from the BIOS configuration to ours) so long as the BIOS has
>>>> also chosen what we hope is the native configuration.
>>>>
>>>> Reported-by: Knut Petersen <Knut_Petersen@t-online.de>
>>>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78655
>>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>>> Cc: stable@vger.kernel.org

> I don't think that Cc: stable@vger.kernel.org is necessary, kernels up
> to 3.14.x don't expose the problem. And as this fixes a post-3.14
> regression this is a clear candidate for 3.15

Chris, do we drop cc: stable?

Jani.
Chris Wilson May 15, 2014, 8:19 a.m. UTC | #5
On Thu, May 15, 2014 at 11:13:01AM +0300, Jani Nikula wrote:
> On Wed, 14 May 2014, Knut Petersen <Knut_Petersen@t-online.de> wrote:
> > On 13.05.2014 22:24, Jesse Barnes wrote:
> >> On Tue, 13 May 2014 16:50:12 +0100
> >> Chris Wilson <chris@chris-wilson.co.uk> wrote:
> >>
> >>> On Tue, May 13, 2014 at 04:07:37PM +0100, Chris Wilson wrote:
> >>>> This matches the algorithm used by earlier kernels when selecting the
> >>>> mode for the fbcon. And only if there is no modes at all, do we fall
> >>>> back to using the BIOS configuration. Seamless transition is still
> >>>> preserved (from the BIOS configuration to ours) so long as the BIOS has
> >>>> also chosen what we hope is the native configuration.
> >>>>
> >>>> Reported-by: Knut Petersen <Knut_Petersen@t-online.de>
> >>>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78655
> >>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >>>> Cc: stable@vger.kernel.org
> 
> > I don't think that Cc: stable@vger.kernel.org is necessary, kernels up
> > to 3.14.x don't expose the problem. And as this fixes a post-3.14
> > regression this is a clear candidate for 3.15
> 
> Chris, do we drop cc: stable?

The switch-over was in 3.15, then yes the regression is only limited to
3.15
-Chris
Jani Nikula May 15, 2014, 8:57 a.m. UTC | #6
On Wed, 14 May 2014, Knut Petersen <Knut_Petersen@t-online.de> wrote:
> On 13.05.2014 22:24, Jesse Barnes wrote:
>> On Tue, 13 May 2014 16:50:12 +0100
>> Chris Wilson <chris@chris-wilson.co.uk> wrote:
>>>> diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
>>>> index 1d3f0a9cce31..05beec4badd5 100644
>>>> --- a/drivers/gpu/drm/i915/intel_fbdev.c
>>>> +++ b/drivers/gpu/drm/i915/intel_fbdev.c
>>>> @@ -397,6 +397,14 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
>>>>   							  height);
>>>>   		}
>>>>   
>>>> +		/* No preferred mode marked by the EDID? Are there any modes? */
>>>> +		if (!modes[i] && !list_empty(&connector->modes)) {
>>>> +			DRM_DEBUG_KMS("using first mode listed on connector %s\n",
>>>> +				      drm_get_connector_name(connector));
>>>> +			modes[i] = list_first_entry(struct drm_display_mode,
>>>> +						    &connector->modes, head);
>>> Please imagine that I wrote this correctly.
>> Imagining you wrote it correctly:
>> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
>
> After proper imagination Tested-by: Knut Petersen <Knut_Petersen@t-online.de>.

Pushed the imagined version to -fixes, thanks for the patch, review,
testing, and imagination.

BR,
Jani.
Knut Petersen May 19, 2014, 5:20 p.m. UTC | #7
On 15.05.2014 10:19, Chris Wilson wrote:
> On Thu, May 15, 2014 at 11:13:01AM +0300, Jani Nikula wrote:
>> On Wed, 14 May 2014, Knut Petersen <Knut_Petersen@t-online.de> wrote:
>>> On 13.05.2014 22:24, Jesse Barnes wrote:
>>>> On Tue, 13 May 2014 16:50:12 +0100
>>>> Chris Wilson <chris@chris-wilson.co.uk> wrote:
>>>>
>>>>> On Tue, May 13, 2014 at 04:07:37PM +0100, Chris Wilson wrote:
>>>>>> This matches the algorithm used by earlier kernels when selecting the
>>>>>> mode for the fbcon. And only if there is no modes at all, do we fall
>>>>>> back to using the BIOS configuration. Seamless transition is still
>>>>>> preserved (from the BIOS configuration to ours) so long as the BIOS has
>>>>>> also chosen what we hope is the native configuration.
>>>>>>
>>>>>> Reported-by: Knut Petersen <Knut_Petersen@t-online.de>
>>>>>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78655
>>>>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>>>>> Cc: stable@vger.kernel.org
>>> I don't think that Cc: stable@vger.kernel.org is necessary, kernels up
>>> to 3.14.x don't expose the problem. And as this fixes a post-3.14
>>> regression this is a clear candidate for 3.15
>> Chris, do we drop cc: stable?
> The switch-over was in 3.15, then yes the regression is only limited to
> 3.15
> -Chris
>
Still missing in git master ...

cu,
  Knut
Daniel Vetter May 19, 2014, 9:58 p.m. UTC | #8
On Mon, May 19, 2014 at 7:20 PM, Knut Petersen
<Knut_Petersen@t-online.de> wrote:
> Still missing in git master ...

It's in drm-intel-fixes and waiting for Dave to forward the pull
request to Linus.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index 1d3f0a9cce31..05beec4badd5 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -397,6 +397,14 @@  static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper,
 							  height);
 		}
 
+		/* No preferred mode marked by the EDID? Are there any modes? */
+		if (!modes[i] && !list_empty(&connector->modes)) {
+			DRM_DEBUG_KMS("using first mode listed on connector %s\n",
+				      drm_get_connector_name(connector));
+			modes[i] = list_first_entry(struct drm_display_mode,
+						    &connector->modes, head);
+		}
+
 		/* last resort: use current mode */
 		if (!modes[i]) {
 			/*