dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/gma500/cdv: Check vbt config bits when detecting lvds panels
@ 2019-04-16 11:46 Patrik Jakobsson
  2019-04-21 18:46 ` Hans de Goede
  0 siblings, 1 reply; 4+ messages in thread
From: Patrik Jakobsson @ 2019-04-16 11:46 UTC (permalink / raw)
  To: dri-devel; +Cc: Hans de Goede

Some machines have an lvds child device in vbt even though a panel is
not attached. To make detection more reliable we now also check the lvds
config bits available in the vbt.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1665766
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/gma500/cdv_intel_lvds.c | 3 +++
 drivers/gpu/drm/gma500/intel_bios.c     | 3 +++
 drivers/gpu/drm/gma500/psb_drv.h        | 1 +
 3 files changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
index de9531caaca0..9c8446184b17 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
@@ -594,6 +594,9 @@ void cdv_intel_lvds_init(struct drm_device *dev,
 	int pipe;
 	u8 pin;
 
+	if (!dev_priv->lvds_enabled_in_vbt)
+		return;
+
 	pin = GMBUS_PORT_PANEL;
 	if (!lvds_is_present_in_vbt(dev, &pin)) {
 		DRM_DEBUG_KMS("LVDS is not present in VBT\n");
diff --git a/drivers/gpu/drm/gma500/intel_bios.c b/drivers/gpu/drm/gma500/intel_bios.c
index 63bde4e86c6a..e019ea271ffc 100644
--- a/drivers/gpu/drm/gma500/intel_bios.c
+++ b/drivers/gpu/drm/gma500/intel_bios.c
@@ -436,6 +436,9 @@ parse_driver_features(struct drm_psb_private *dev_priv,
 	if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP)
 		dev_priv->edp.support = 1;
 
+	dev_priv->lvds_enabled_in_vbt = driver->lvds_config != 0;
+	DRM_DEBUG_KMS("LVDS VBT config bits: 0x%x\n", driver->lvds_config);
+
 	/* This bit means to use 96Mhz for DPLL_A or not */
 	if (driver->primary_lfp_id)
 		dev_priv->dplla_96mhz = true;
diff --git a/drivers/gpu/drm/gma500/psb_drv.h b/drivers/gpu/drm/gma500/psb_drv.h
index 941b238bdcc9..bc608ddc3bd1 100644
--- a/drivers/gpu/drm/gma500/psb_drv.h
+++ b/drivers/gpu/drm/gma500/psb_drv.h
@@ -537,6 +537,7 @@ struct drm_psb_private {
 	int lvds_ssc_freq;
 	bool is_lvds_on;
 	bool is_mipi_on;
+	bool lvds_enabled_in_vbt;
 	u32 mipi_ctrl_display;
 
 	unsigned int core_freq;
-- 
2.16.4

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

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

* Re: [PATCH] drm/gma500/cdv: Check vbt config bits when detecting lvds panels
  2019-04-16 11:46 [PATCH] drm/gma500/cdv: Check vbt config bits when detecting lvds panels Patrik Jakobsson
@ 2019-04-21 18:46 ` Hans de Goede
  2019-04-22 17:54   ` Patrik Jakobsson
  0 siblings, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2019-04-21 18:46 UTC (permalink / raw)
  To: Patrik Jakobsson, dri-devel

Hi,

On 16-04-19 13:46, Patrik Jakobsson wrote:
> Some machines have an lvds child device in vbt even though a panel is
> not attached. To make detection more reliable we now also check the lvds
> config bits available in the vbt.
> 
> Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1665766
> Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>

The reporter of https://bugzilla.redhat.com/show_bug.cgi?id=1665766
just got back to me and he confirms that this patch fixes the
false-positive LVDS panel detection on his NAS, without needing
a DMI blacklist.

So it looks like this patch indeed is a better fix then my initial
DMI blacklist approach and from my pov this patch is ready to
go upstream.

Regards,

Hans


> ---
>   drivers/gpu/drm/gma500/cdv_intel_lvds.c | 3 +++
>   drivers/gpu/drm/gma500/intel_bios.c     | 3 +++
>   drivers/gpu/drm/gma500/psb_drv.h        | 1 +
>   3 files changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> index de9531caaca0..9c8446184b17 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> @@ -594,6 +594,9 @@ void cdv_intel_lvds_init(struct drm_device *dev,
>   	int pipe;
>   	u8 pin;
>   
> +	if (!dev_priv->lvds_enabled_in_vbt)
> +		return;
> +
>   	pin = GMBUS_PORT_PANEL;
>   	if (!lvds_is_present_in_vbt(dev, &pin)) {
>   		DRM_DEBUG_KMS("LVDS is not present in VBT\n");
> diff --git a/drivers/gpu/drm/gma500/intel_bios.c b/drivers/gpu/drm/gma500/intel_bios.c
> index 63bde4e86c6a..e019ea271ffc 100644
> --- a/drivers/gpu/drm/gma500/intel_bios.c
> +++ b/drivers/gpu/drm/gma500/intel_bios.c
> @@ -436,6 +436,9 @@ parse_driver_features(struct drm_psb_private *dev_priv,
>   	if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP)
>   		dev_priv->edp.support = 1;
>   
> +	dev_priv->lvds_enabled_in_vbt = driver->lvds_config != 0;
> +	DRM_DEBUG_KMS("LVDS VBT config bits: 0x%x\n", driver->lvds_config);
> +
>   	/* This bit means to use 96Mhz for DPLL_A or not */
>   	if (driver->primary_lfp_id)
>   		dev_priv->dplla_96mhz = true;
> diff --git a/drivers/gpu/drm/gma500/psb_drv.h b/drivers/gpu/drm/gma500/psb_drv.h
> index 941b238bdcc9..bc608ddc3bd1 100644
> --- a/drivers/gpu/drm/gma500/psb_drv.h
> +++ b/drivers/gpu/drm/gma500/psb_drv.h
> @@ -537,6 +537,7 @@ struct drm_psb_private {
>   	int lvds_ssc_freq;
>   	bool is_lvds_on;
>   	bool is_mipi_on;
> +	bool lvds_enabled_in_vbt;
>   	u32 mipi_ctrl_display;
>   
>   	unsigned int core_freq;
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/gma500/cdv: Check vbt config bits when detecting lvds panels
  2019-04-21 18:46 ` Hans de Goede
@ 2019-04-22 17:54   ` Patrik Jakobsson
  2019-04-29 14:44     ` Hans de Goede
  0 siblings, 1 reply; 4+ messages in thread
From: Patrik Jakobsson @ 2019-04-22 17:54 UTC (permalink / raw)
  To: Hans de Goede; +Cc: dri-devel

On Sun, Apr 21, 2019 at 8:46 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi,
>
> On 16-04-19 13:46, Patrik Jakobsson wrote:
> > Some machines have an lvds child device in vbt even though a panel is
> > not attached. To make detection more reliable we now also check the lvds
> > config bits available in the vbt.
> >
> > Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1665766
> > Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
> > Cc: Hans de Goede <hdegoede@redhat.com>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The reporter of https://bugzilla.redhat.com/show_bug.cgi?id=1665766
> just got back to me and he confirms that this patch fixes the
> false-positive LVDS panel detection on his NAS, without needing
> a DMI blacklist.
>
> So it looks like this patch indeed is a better fix then my initial
> DMI blacklist approach and from my pov this patch is ready to
> go upstream.

Thanks Hans, can I add your review tag?

>
> Regards,
>
> Hans
>
>
> > ---
> >   drivers/gpu/drm/gma500/cdv_intel_lvds.c | 3 +++
> >   drivers/gpu/drm/gma500/intel_bios.c     | 3 +++
> >   drivers/gpu/drm/gma500/psb_drv.h        | 1 +
> >   3 files changed, 7 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> > index de9531caaca0..9c8446184b17 100644
> > --- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> > +++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
> > @@ -594,6 +594,9 @@ void cdv_intel_lvds_init(struct drm_device *dev,
> >       int pipe;
> >       u8 pin;
> >
> > +     if (!dev_priv->lvds_enabled_in_vbt)
> > +             return;
> > +
> >       pin = GMBUS_PORT_PANEL;
> >       if (!lvds_is_present_in_vbt(dev, &pin)) {
> >               DRM_DEBUG_KMS("LVDS is not present in VBT\n");
> > diff --git a/drivers/gpu/drm/gma500/intel_bios.c b/drivers/gpu/drm/gma500/intel_bios.c
> > index 63bde4e86c6a..e019ea271ffc 100644
> > --- a/drivers/gpu/drm/gma500/intel_bios.c
> > +++ b/drivers/gpu/drm/gma500/intel_bios.c
> > @@ -436,6 +436,9 @@ parse_driver_features(struct drm_psb_private *dev_priv,
> >       if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP)
> >               dev_priv->edp.support = 1;
> >
> > +     dev_priv->lvds_enabled_in_vbt = driver->lvds_config != 0;
> > +     DRM_DEBUG_KMS("LVDS VBT config bits: 0x%x\n", driver->lvds_config);
> > +
> >       /* This bit means to use 96Mhz for DPLL_A or not */
> >       if (driver->primary_lfp_id)
> >               dev_priv->dplla_96mhz = true;
> > diff --git a/drivers/gpu/drm/gma500/psb_drv.h b/drivers/gpu/drm/gma500/psb_drv.h
> > index 941b238bdcc9..bc608ddc3bd1 100644
> > --- a/drivers/gpu/drm/gma500/psb_drv.h
> > +++ b/drivers/gpu/drm/gma500/psb_drv.h
> > @@ -537,6 +537,7 @@ struct drm_psb_private {
> >       int lvds_ssc_freq;
> >       bool is_lvds_on;
> >       bool is_mipi_on;
> > +     bool lvds_enabled_in_vbt;
> >       u32 mipi_ctrl_display;
> >
> >       unsigned int core_freq;
> >
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/gma500/cdv: Check vbt config bits when detecting lvds panels
  2019-04-22 17:54   ` Patrik Jakobsson
@ 2019-04-29 14:44     ` Hans de Goede
  0 siblings, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2019-04-29 14:44 UTC (permalink / raw)
  To: Patrik Jakobsson; +Cc: dri-devel

Hi,

On 22-04-19 19:54, Patrik Jakobsson wrote:
> On Sun, Apr 21, 2019 at 8:46 PM Hans de Goede <hdegoede@redhat.com> wrote:
>>
>> Hi,
>>
>> On 16-04-19 13:46, Patrik Jakobsson wrote:
>>> Some machines have an lvds child device in vbt even though a panel is
>>> not attached. To make detection more reliable we now also check the lvds
>>> config bits available in the vbt.
>>>
>>> Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1665766
>>> Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
>>> Cc: Hans de Goede <hdegoede@redhat.com>
>>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>
>> The reporter of https://bugzilla.redhat.com/show_bug.cgi?id=1665766
>> just got back to me and he confirms that this patch fixes the
>> false-positive LVDS panel detection on his NAS, without needing
>> a DMI blacklist.
>>
>> So it looks like this patch indeed is a better fix then my initial
>> DMI blacklist approach and from my pov this patch is ready to
>> go upstream.
> 
> Thanks Hans, can I add your review tag?

Erm, then I would need to actually review it first ... done:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


>>> ---
>>>    drivers/gpu/drm/gma500/cdv_intel_lvds.c | 3 +++
>>>    drivers/gpu/drm/gma500/intel_bios.c     | 3 +++
>>>    drivers/gpu/drm/gma500/psb_drv.h        | 1 +
>>>    3 files changed, 7 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/gma500/cdv_intel_lvds.c b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
>>> index de9531caaca0..9c8446184b17 100644
>>> --- a/drivers/gpu/drm/gma500/cdv_intel_lvds.c
>>> +++ b/drivers/gpu/drm/gma500/cdv_intel_lvds.c
>>> @@ -594,6 +594,9 @@ void cdv_intel_lvds_init(struct drm_device *dev,
>>>        int pipe;
>>>        u8 pin;
>>>
>>> +     if (!dev_priv->lvds_enabled_in_vbt)
>>> +             return;
>>> +
>>>        pin = GMBUS_PORT_PANEL;
>>>        if (!lvds_is_present_in_vbt(dev, &pin)) {
>>>                DRM_DEBUG_KMS("LVDS is not present in VBT\n");
>>> diff --git a/drivers/gpu/drm/gma500/intel_bios.c b/drivers/gpu/drm/gma500/intel_bios.c
>>> index 63bde4e86c6a..e019ea271ffc 100644
>>> --- a/drivers/gpu/drm/gma500/intel_bios.c
>>> +++ b/drivers/gpu/drm/gma500/intel_bios.c
>>> @@ -436,6 +436,9 @@ parse_driver_features(struct drm_psb_private *dev_priv,
>>>        if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP)
>>>                dev_priv->edp.support = 1;
>>>
>>> +     dev_priv->lvds_enabled_in_vbt = driver->lvds_config != 0;
>>> +     DRM_DEBUG_KMS("LVDS VBT config bits: 0x%x\n", driver->lvds_config);
>>> +
>>>        /* This bit means to use 96Mhz for DPLL_A or not */
>>>        if (driver->primary_lfp_id)
>>>                dev_priv->dplla_96mhz = true;
>>> diff --git a/drivers/gpu/drm/gma500/psb_drv.h b/drivers/gpu/drm/gma500/psb_drv.h
>>> index 941b238bdcc9..bc608ddc3bd1 100644
>>> --- a/drivers/gpu/drm/gma500/psb_drv.h
>>> +++ b/drivers/gpu/drm/gma500/psb_drv.h
>>> @@ -537,6 +537,7 @@ struct drm_psb_private {
>>>        int lvds_ssc_freq;
>>>        bool is_lvds_on;
>>>        bool is_mipi_on;
>>> +     bool lvds_enabled_in_vbt;
>>>        u32 mipi_ctrl_display;
>>>
>>>        unsigned int core_freq;
>>>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2019-04-29 14:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-16 11:46 [PATCH] drm/gma500/cdv: Check vbt config bits when detecting lvds panels Patrik Jakobsson
2019-04-21 18:46 ` Hans de Goede
2019-04-22 17:54   ` Patrik Jakobsson
2019-04-29 14:44     ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).