diff mbox

drm/i915/cnl: Wa to ignore VBT alternate pin on B-stepping.

Message ID 1491526466-12098-1-git-send-email-rodrigo.vivi@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rodrigo Vivi April 7, 2017, 12:54 a.m. UTC
Current VBT available for pre-production machines
tells that we need to use alternate pin. But if we use it
we end up needing to define a different table.

However if we respect the spec, ignore the VBT for now
we get a more reliable HDMI.

Cc: Clint Taylor <clinton.a.taylor@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/intel_hdmi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Ville Syrjälä April 7, 2017, 1:19 p.m. UTC | #1
On Thu, Apr 06, 2017 at 05:54:26PM -0700, Rodrigo Vivi wrote:
> Current VBT available for pre-production machines
> tells that we need to use alternate pin. But if we use it
> we end up needing to define a different table.
> 
> However if we respect the spec, ignore the VBT for now
> we get a more reliable HDMI.
> 
> Cc: Clint Taylor <clinton.a.taylor@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_hdmi.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index f8c40ae..0d389bc 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -1884,7 +1884,8 @@ static u8 intel_hdmi_ddc_pin(struct drm_i915_private *dev_priv,
>  		&dev_priv->vbt.ddi_port_info[port];
>  	u8 ddc_pin;
>  
> -	if (info->alternate_ddc_pin) {
> +	if (info->alternate_ddc_pin &&
> +	    !IS_CNL_REVID(dev_priv, CNL_REVID_B0, CNL_REVID_B0)) {

So it's got broken VBT? In that case it would make more sense to me
to put the kludge into the VBT parsing code.

>  		DRM_DEBUG_KMS("Using DDC pin 0x%x for port %c (VBT)\n",
>  			      info->alternate_ddc_pin, port_name(port));
>  		return info->alternate_ddc_pin;
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Rodrigo Vivi April 7, 2017, 1:22 p.m. UTC | #2
On Fri, 2017-04-07 at 16:19 +0300, Ville Syrjälä wrote:
> On Thu, Apr 06, 2017 at 05:54:26PM -0700, Rodrigo Vivi wrote:

> > Current VBT available for pre-production machines

> > tells that we need to use alternate pin. But if we use it

> > we end up needing to define a different table.

> > 

> > However if we respect the spec, ignore the VBT for now

> > we get a more reliable HDMI.

> > 

> > Cc: Clint Taylor <clinton.a.taylor@intel.com>

> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> > ---

> >  drivers/gpu/drm/i915/intel_hdmi.c | 3 ++-

> >  1 file changed, 2 insertions(+), 1 deletion(-)

> > 

> > diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c

> > index f8c40ae..0d389bc 100644

> > --- a/drivers/gpu/drm/i915/intel_hdmi.c

> > +++ b/drivers/gpu/drm/i915/intel_hdmi.c

> > @@ -1884,7 +1884,8 @@ static u8 intel_hdmi_ddc_pin(struct drm_i915_private *dev_priv,

> >  		&dev_priv->vbt.ddi_port_info[port];

> >  	u8 ddc_pin;

> >  

> > -	if (info->alternate_ddc_pin) {

> > +	if (info->alternate_ddc_pin &&

> > +	    !IS_CNL_REVID(dev_priv, CNL_REVID_B0, CNL_REVID_B0)) {

> 

> So it's got broken VBT? In that case it would make more sense to me

> to put the kludge into the VBT parsing code.


yeap. It makes sense. I will move that to there later.
Thanks.

> 

> >  		DRM_DEBUG_KMS("Using DDC pin 0x%x for port %c (VBT)\n",

> >  			      info->alternate_ddc_pin, port_name(port));

> >  		return info->alternate_ddc_pin;

> > -- 

> > 1.9.1

> > 

> > _______________________________________________

> > Intel-gfx mailing list

> > Intel-gfx@lists.freedesktop.org

> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx

>
kernel test robot April 7, 2017, 6:56 p.m. UTC | #3
Hi Rodrigo,

[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on v4.11-rc5 next-20170407]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Rodrigo-Vivi/drm-i915-cnl-Wa-to-ignore-VBT-alternate-pin-on-B-stepping/20170408-021103
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
config: i386-randconfig-x012-201714 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   In file included from include/uapi/linux/stddef.h:1:0,
                    from include/linux/stddef.h:4,
                    from include/uapi/linux/posix_types.h:4,
                    from include/uapi/linux/types.h:13,
                    from include/linux/types.h:5,
                    from include/linux/mod_devicetable.h:11,
                    from include/linux/i2c.h:29,
                    from drivers/gpu//drm/i915/intel_hdmi.c:29:
   drivers/gpu//drm/i915/intel_hdmi.c: In function 'intel_hdmi_ddc_pin':
>> drivers/gpu//drm/i915/intel_hdmi.c:1888:7: error: implicit declaration of function 'IS_CNL_REVID' [-Werror=implicit-function-declaration]
         !IS_CNL_REVID(dev_priv, CNL_REVID_B0, CNL_REVID_B0)) {
          ^
   include/linux/compiler.h:160:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
   drivers/gpu//drm/i915/intel_hdmi.c:1887:2: note: in expansion of macro 'if'
     if (info->alternate_ddc_pin &&
     ^~
>> drivers/gpu//drm/i915/intel_hdmi.c:1888:30: error: 'CNL_REVID_B0' undeclared (first use in this function)
         !IS_CNL_REVID(dev_priv, CNL_REVID_B0, CNL_REVID_B0)) {
                                 ^
   include/linux/compiler.h:160:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
   drivers/gpu//drm/i915/intel_hdmi.c:1887:2: note: in expansion of macro 'if'
     if (info->alternate_ddc_pin &&
     ^~
   drivers/gpu//drm/i915/intel_hdmi.c:1888:30: note: each undeclared identifier is reported only once for each function it appears in
         !IS_CNL_REVID(dev_priv, CNL_REVID_B0, CNL_REVID_B0)) {
                                 ^
   include/linux/compiler.h:160:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^~~~
   drivers/gpu//drm/i915/intel_hdmi.c:1887:2: note: in expansion of macro 'if'
     if (info->alternate_ddc_pin &&
     ^~
   cc1: some warnings being treated as errors

vim +/IS_CNL_REVID +1888 drivers/gpu//drm/i915/intel_hdmi.c

  1882	{
  1883		const struct ddi_vbt_port_info *info =
  1884			&dev_priv->vbt.ddi_port_info[port];
  1885		u8 ddc_pin;
  1886	
  1887		if (info->alternate_ddc_pin &&
> 1888		    !IS_CNL_REVID(dev_priv, CNL_REVID_B0, CNL_REVID_B0)) {
  1889			DRM_DEBUG_KMS("Using DDC pin 0x%x for port %c (VBT)\n",
  1890				      info->alternate_ddc_pin, port_name(port));
  1891			return info->alternate_ddc_pin;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index f8c40ae..0d389bc 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -1884,7 +1884,8 @@  static u8 intel_hdmi_ddc_pin(struct drm_i915_private *dev_priv,
 		&dev_priv->vbt.ddi_port_info[port];
 	u8 ddc_pin;
 
-	if (info->alternate_ddc_pin) {
+	if (info->alternate_ddc_pin &&
+	    !IS_CNL_REVID(dev_priv, CNL_REVID_B0, CNL_REVID_B0)) {
 		DRM_DEBUG_KMS("Using DDC pin 0x%x for port %c (VBT)\n",
 			      info->alternate_ddc_pin, port_name(port));
 		return info->alternate_ddc_pin;