Re: [Intel-gfx] [PATCH] drm/i915/bios: filter out invalid DDC pins from VBT child devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 11 Apr 2018, Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> wrote:
> Quoting Jani Nikula (2018-04-11 10:01:46)
>> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
>> index c5c7530ba157..6db845991a69 100644
>> --- a/drivers/gpu/drm/i915/intel_bios.c
>> +++ b/drivers/gpu/drm/i915/intel_bios.c
>> @@ -1256,7 +1256,6 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
>>                 return;
>>  
>>         aux_channel = child->aux_channel;
>> -       ddc_pin = child->ddc_pin;
>
> Could we scope ddc_pin better?

I thought I'd leave that for follow-up, scoping aux_channel similarly.

>
>>         is_dvi = child->device_type & DEVICE_TYPE_TMDS_DVI_SIGNALING;
>>         is_dp = child->device_type & DEVICE_TYPE_DISPLAYPORT_OUTPUT;
>> @@ -1303,9 +1302,15 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port,
>>                 DRM_DEBUG_KMS("Port %c is internal DP\n", port_name(port));
>>  
>>         if (is_dvi) {
>> -               info->alternate_ddc_pin = map_ddc_pin(dev_priv, ddc_pin);
>> -
>> -               sanitize_ddc_pin(dev_priv, port);
>> +               ddc_pin = map_ddc_pin(dev_priv, child->ddc_pin);
>> +               if (intel_gmbus_is_valid_pin(dev_priv, ddc_pin)) {
>> +                       info->alternate_ddc_pin = ddc_pin;
>> +                       sanitize_ddc_pin(dev_priv, port);
>> +               } else {
>> +                       DRM_DEBUG_KMS("Port %c has invalid DDC pin %d, "
>> +                                     "reverting to defaults\n",
>> +                                     port_name(port), ddc_pin);
>
> Do we know what the default pin is here?

It's in intel_hdmi_ddc_pin(). I'd rather not call that from here, as all
such functions need to be independent of a lot of driver and output
setup.

> s/reverting/sticking/?
>
> "invalid DDC pin %d in VBT" ? Not sure if that would be clear from the
> message otherwise.

It's a debug, it'll be surrounded by other VBT stuff and will include a
BIOS-related function name.

So...

			DRM_DEBUG_KMS("Port %c has invalid DDC pin %d, "
				      "sticking to defaults\n",
				      port_name(port), ddc_pin);

is this fine?

BR,
Jani.



>
> Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> -Chris

-- 
Jani Nikula, Intel Open Source Technology Center



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]