public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Update bits to check in device class from VBT to detect eDP
@ 2014-06-05 12:55 Shobhit Kumar
  2014-06-05 13:09 ` Ville Syrjälä
  0 siblings, 1 reply; 5+ messages in thread
From: Shobhit Kumar @ 2014-06-05 12:55 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter, Jesse Barnes

The DEVICE_TYPE_eDP has been changed to 0x1806 in case of BYT which
can causes wrong detection failures for eDP. Reduce the number of bits
of interest in DEVICE_TYPE_eDP_BITS to just check most relevant and
conclusive ones and ensure they are set in device_class from VBT. This
will ensure that eDP detection works across platforms

Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
---
 drivers/gpu/drm/i915/intel_bios.h | 10 +---------
 drivers/gpu/drm/i915/intel_dp.c   |  4 ++--
 2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h
index b986677..30d02b7 100644
--- a/drivers/gpu/drm/i915/intel_bios.h
+++ b/drivers/gpu/drm/i915/intel_bios.h
@@ -710,16 +710,8 @@ int intel_parse_bios(struct drm_device *dev);
  */
 #define DEVICE_TYPE_eDP_BITS \
 	(DEVICE_TYPE_INTERNAL_CONNECTOR | \
-	 DEVICE_TYPE_NOT_HDMI_OUTPUT | \
-	 DEVICE_TYPE_MIPI_OUTPUT | \
-	 DEVICE_TYPE_COMPOSITE_OUTPUT | \
-	 DEVICE_TYPE_DUAL_CHANNEL | \
-	 DEVICE_TYPE_LVDS_SINGALING | \
-	 DEVICE_TYPE_TMDS_DVI_SIGNALING | \
-	 DEVICE_TYPE_VIDEO_SIGNALING | \
 	 DEVICE_TYPE_DISPLAYPORT_OUTPUT | \
-	 DEVICE_TYPE_DIGITAL_OUTPUT | \
-	 DEVICE_TYPE_ANALOG_OUTPUT)
+	 DEVICE_TYPE_DIGITAL_OUTPUT)
 
 /* define the DVO port for HDMI output type */
 #define		DVO_B		1
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index dad3780..68f7380 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3842,8 +3842,8 @@ bool intel_dp_is_edp(struct drm_device *dev, enum port port)
 		p_child = dev_priv->vbt.child_dev + i;
 
 		if (p_child->common.dvo_port == port_mapping[port] &&
-		    (p_child->common.device_type & DEVICE_TYPE_eDP_BITS) ==
-		    (DEVICE_TYPE_eDP & DEVICE_TYPE_eDP_BITS))
+		    ((p_child->common.device_type & DEVICE_TYPE_eDP_BITS) ==
+		     DEVICE_TYPE_eDP_BITS))
 			return true;
 	}
 	return false;
-- 
1.9.1

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

* Re: [PATCH] drm/i915: Update bits to check in device class from VBT to detect eDP
  2014-06-05 12:55 [PATCH] drm/i915: Update bits to check in device class from VBT to detect eDP Shobhit Kumar
@ 2014-06-05 13:09 ` Ville Syrjälä
  2014-06-05 16:04   ` Jesse Barnes
  0 siblings, 1 reply; 5+ messages in thread
From: Ville Syrjälä @ 2014-06-05 13:09 UTC (permalink / raw)
  To: Shobhit Kumar; +Cc: Daniel Vetter, intel-gfx, Jesse Barnes

On Thu, Jun 05, 2014 at 06:25:13PM +0530, Shobhit Kumar wrote:
> The DEVICE_TYPE_eDP has been changed to 0x1806 in case of BYT which
> can causes wrong detection failures for eDP. Reduce the number of bits
> of interest in DEVICE_TYPE_eDP_BITS to just check most relevant and
> conclusive ones and ensure they are set in device_class from VBT. This
> will ensure that eDP detection works across platforms

The current bits will match correctly for 0x1806. I don't have a problem
with the patch per-say but would be nice to know what the troublesome
device type really was, if indeed there was one. I'm just slightly
worried that we might start to get false positives on some platforms if
we make it too relaxed.

> 
> Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_bios.h | 10 +---------
>  drivers/gpu/drm/i915/intel_dp.c   |  4 ++--
>  2 files changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_bios.h b/drivers/gpu/drm/i915/intel_bios.h
> index b986677..30d02b7 100644
> --- a/drivers/gpu/drm/i915/intel_bios.h
> +++ b/drivers/gpu/drm/i915/intel_bios.h
> @@ -710,16 +710,8 @@ int intel_parse_bios(struct drm_device *dev);
>   */
>  #define DEVICE_TYPE_eDP_BITS \
>  	(DEVICE_TYPE_INTERNAL_CONNECTOR | \
> -	 DEVICE_TYPE_NOT_HDMI_OUTPUT | \
> -	 DEVICE_TYPE_MIPI_OUTPUT | \
> -	 DEVICE_TYPE_COMPOSITE_OUTPUT | \
> -	 DEVICE_TYPE_DUAL_CHANNEL | \
> -	 DEVICE_TYPE_LVDS_SINGALING | \
> -	 DEVICE_TYPE_TMDS_DVI_SIGNALING | \
> -	 DEVICE_TYPE_VIDEO_SIGNALING | \
>  	 DEVICE_TYPE_DISPLAYPORT_OUTPUT | \
> -	 DEVICE_TYPE_DIGITAL_OUTPUT | \
> -	 DEVICE_TYPE_ANALOG_OUTPUT)
> +	 DEVICE_TYPE_DIGITAL_OUTPUT)
>  
>  /* define the DVO port for HDMI output type */
>  #define		DVO_B		1
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index dad3780..68f7380 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3842,8 +3842,8 @@ bool intel_dp_is_edp(struct drm_device *dev, enum port port)
>  		p_child = dev_priv->vbt.child_dev + i;
>  
>  		if (p_child->common.dvo_port == port_mapping[port] &&
> -		    (p_child->common.device_type & DEVICE_TYPE_eDP_BITS) ==
> -		    (DEVICE_TYPE_eDP & DEVICE_TYPE_eDP_BITS))
> +		    ((p_child->common.device_type & DEVICE_TYPE_eDP_BITS) ==
> +		     DEVICE_TYPE_eDP_BITS))
>  			return true;
>  	}
>  	return false;
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC

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

* Re: [PATCH] drm/i915: Update bits to check in device class from VBT to detect eDP
  2014-06-05 13:09 ` Ville Syrjälä
@ 2014-06-05 16:04   ` Jesse Barnes
  2014-06-06  4:03     ` Kumar, Shobhit
  0 siblings, 1 reply; 5+ messages in thread
From: Jesse Barnes @ 2014-06-05 16:04 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx, Daniel Vetter

On Thu, 5 Jun 2014 16:09:29 +0300
Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:

> On Thu, Jun 05, 2014 at 06:25:13PM +0530, Shobhit Kumar wrote:
> > The DEVICE_TYPE_eDP has been changed to 0x1806 in case of BYT which
> > can causes wrong detection failures for eDP. Reduce the number of bits
> > of interest in DEVICE_TYPE_eDP_BITS to just check most relevant and
> > conclusive ones and ensure they are set in device_class from VBT. This
> > will ensure that eDP detection works across platforms
> 
> The current bits will match correctly for 0x1806. I don't have a problem
> with the patch per-say but would be nice to know what the troublesome
> device type really was, if indeed there was one. I'm just slightly
> worried that we might start to get false positives on some platforms if
> we make it too relaxed.

Still waiting for results, but
https://bugs.freedesktop.org/show_bug.cgi?id=78795 was what motivated this.

Jesse
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Update bits to check in device class from VBT to detect eDP
  2014-06-05 16:04   ` Jesse Barnes
@ 2014-06-06  4:03     ` Kumar, Shobhit
  2014-06-06  5:36       ` Kumar, Shobhit
  0 siblings, 1 reply; 5+ messages in thread
From: Kumar, Shobhit @ 2014-06-06  4:03 UTC (permalink / raw)
  To: Jesse Barnes, Ville Syrjälä; +Cc: Daniel Vetter, intel-gfx

On 6/5/2014 9:34 PM, Jesse Barnes wrote:
> On Thu, 5 Jun 2014 16:09:29 +0300
> Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
>
>> On Thu, Jun 05, 2014 at 06:25:13PM +0530, Shobhit Kumar wrote:
>>> The DEVICE_TYPE_eDP has been changed to 0x1806 in case of BYT which
>>> can causes wrong detection failures for eDP. Reduce the number of bits
>>> of interest in DEVICE_TYPE_eDP_BITS to just check most relevant and
>>> conclusive ones and ensure they are set in device_class from VBT. This
>>> will ensure that eDP detection works across platforms
>>
>> The current bits will match correctly for 0x1806. I don't have a problem
>> with the patch per-say but would be nice to know what the troublesome
>> device type really was, if indeed there was one. I'm just slightly
>> worried that we might start to get false positives on some platforms if
>> we make it too relaxed.
>
> Still waiting for results, but
> https://bugs.freedesktop.org/show_bug.cgi?id=78795 was what motivated this.
>

Yeah and update from Jesse that forcefully returning true from the 
function make things work, I assumed this is the reason, without really 
checking that even the old values will result DEVIVE_TYPE_eDP & 
DEVICE_TYPE_eDP_BITS = 0x1806 :)

Nevertheless I still feel that a simplified bit mask is good to have. We 
need to check further on this issue Jesse. Let me know once you have 
results. It would be still better to spit out the device_type being read 
from VBT as a log to confirm that indeed it is coming as 0x1806 or can 
just ask to get the opregion dump from debugfs and we can check ourselves.

Regards
Shobhit
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Update bits to check in device class from VBT to detect eDP
  2014-06-06  4:03     ` Kumar, Shobhit
@ 2014-06-06  5:36       ` Kumar, Shobhit
  0 siblings, 0 replies; 5+ messages in thread
From: Kumar, Shobhit @ 2014-06-06  5:36 UTC (permalink / raw)
  To: Jesse Barnes, Ville Syrjälä; +Cc: Daniel Vetter, intel-gfx

On 6/6/2014 9:33 AM, Kumar, Shobhit wrote:
> On 6/5/2014 9:34 PM, Jesse Barnes wrote:
>> On Thu, 5 Jun 2014 16:09:29 +0300
>> Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
>>
>>> On Thu, Jun 05, 2014 at 06:25:13PM +0530, Shobhit Kumar wrote:
>>>> The DEVICE_TYPE_eDP has been changed to 0x1806 in case of BYT which
>>>> can causes wrong detection failures for eDP. Reduce the number of bits
>>>> of interest in DEVICE_TYPE_eDP_BITS to just check most relevant and
>>>> conclusive ones and ensure they are set in device_class from VBT. This
>>>> will ensure that eDP detection works across platforms
>>>
>>> The current bits will match correctly for 0x1806. I don't have a problem
>>> with the patch per-say but would be nice to know what the troublesome
>>> device type really was, if indeed there was one. I'm just slightly
>>> worried that we might start to get false positives on some platforms if
>>> we make it too relaxed.
>>
>> Still waiting for results, but
>> https://bugs.freedesktop.org/show_bug.cgi?id=78795 was what motivated
>> this.
>>
>
> Yeah and update from Jesse that forcefully returning true from the
> function make things work, I assumed this is the reason, without really
> checking that even the old values will result DEVIVE_TYPE_eDP &
> DEVICE_TYPE_eDP_BITS = 0x1806 :)
>
> Nevertheless I still feel that a simplified bit mask is good to have. We
> need to check further on this issue Jesse. Let me know once you have
> results. It would be still better to spit out the device_type being read
> from VBT as a log to confirm that indeed it is coming as 0x1806 or can
> just ask to get the opregion dump from debugfs and we can check ourselves.

I see above are already been asked in BZ. Will track there for updates.

Regards
Shobhit

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2014-06-06  5:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-05 12:55 [PATCH] drm/i915: Update bits to check in device class from VBT to detect eDP Shobhit Kumar
2014-06-05 13:09 ` Ville Syrjälä
2014-06-05 16:04   ` Jesse Barnes
2014-06-06  4:03     ` Kumar, Shobhit
2014-06-06  5:36       ` Kumar, Shobhit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox