From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com ([134.134.136.126]:28810 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752908AbeDKMwX (ORCPT ); Wed, 11 Apr 2018 08:52:23 -0400 From: Jani Nikula To: Chris Wilson , intel-gfx@lists.freedesktop.org Cc: Fei Li , stable@vger.kernel.org Subject: Re: [Intel-gfx] [PATCH] drm/i915/bios: filter out invalid DDC pins from VBT child devices In-Reply-To: <152344909140.13225.16972948414004225113@mail.alporthouse.com> References: <20180411090146.12689-1-jani.nikula@intel.com> <152344909140.13225.16972948414004225113@mail.alporthouse.com> Date: Wed, 11 Apr 2018 15:53:09 +0300 Message-ID: <87in8xhpl6.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: stable-owner@vger.kernel.org List-ID: On Wed, 11 Apr 2018, Chris Wilson 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 -- Jani Nikula, Intel Open Source Technology Center