Message ID | 20180125222524.22059-1-rodrigo.vivi@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Jan 25, 2018 at 02:25:24PM -0800, Rodrigo Vivi wrote: > If the table result is out of bounds on the array map > there is something really wrong with VBT pin so we don't > return that vbt_pin, but only return 0 instead. > > This basically reverts commit 'a8e6f3888b05 ("drm/i915/cnp: > Ignore VBT request for know invalid DDC pin.")' In this version it's not really a revert anymore as the debug message is still there. I'd say it fixes, but doesn't revert. > > Also this properly fixes commit 9c3b2689d01f ("drm/i915/cnl: > Map VBT DDC Pin to BSpec DDC Pin.") > > v2: Do in a way that we don't break other platforms. (Jani) > > v3: Keep debug message (Jani) > > v4: Don't mess with 0 mapping was noticed by Jani and > addressed with a simple solution suggested by Lucas > that makes this even simpler. > > Fixes: a8e6f3888b05 ("drm/i915/cnp: Ignore VBT request for know invalid DDC pin.") > Fixes: 9c3b2689d01f ("drm/i915/cnl: Map VBT DDC Pin to BSpec DDC Pin.") > Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com> > Cc: Jani Nikula <jani.nikula@intel.com> > Cc: Kai Heng Feng <kai.heng.feng@canonical.com> > Cc: Lucas De Marchi <lucas.demarchi@intel.com> > Suggested-by: Lucas De Marchi <lucas.demarchi@intel.com> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Not sure about the suggested-by vs reviewed-by, but: Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Lucas De Marchi > --- > drivers/gpu/drm/i915/intel_bios.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c > index 95f0b310d656..cf3f8f1ba6f7 100644 > --- a/drivers/gpu/drm/i915/intel_bios.c > +++ b/drivers/gpu/drm/i915/intel_bios.c > @@ -1107,6 +1107,7 @@ static void sanitize_aux_ch(struct drm_i915_private *dev_priv, > } > > static const u8 cnp_ddc_pin_map[] = { > + [0] = 0, /* N/A */ > [DDC_BUS_DDI_B] = GMBUS_PIN_1_BXT, > [DDC_BUS_DDI_C] = GMBUS_PIN_2_BXT, > [DDC_BUS_DDI_D] = GMBUS_PIN_4_CNP, /* sic */ > @@ -1116,9 +1117,9 @@ static const u8 cnp_ddc_pin_map[] = { > static u8 map_ddc_pin(struct drm_i915_private *dev_priv, u8 vbt_pin) > { > if (HAS_PCH_CNP(dev_priv)) { > - if (vbt_pin > 0 && vbt_pin < ARRAY_SIZE(cnp_ddc_pin_map)) > + if (vbt_pin < ARRAY_SIZE(cnp_ddc_pin_map)) { > return cnp_ddc_pin_map[vbt_pin]; > - if (vbt_pin > GMBUS_PIN_4_CNP) { > + } else { > DRM_DEBUG_KMS("Ignoring alternate pin: VBT claims DDC pin %d, which is not valid for this platform\n", vbt_pin); > return 0; > } > -- > 2.13.6 >
> On 26 Jan 2018, at 6:25 AM, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote: > > If the table result is out of bounds on the array map > there is something really wrong with VBT pin so we don't > return that vbt_pin, but only return 0 instead. > > This basically reverts commit 'a8e6f3888b05 ("drm/i915/cnp: > Ignore VBT request for know invalid DDC pin.")' > > Also this properly fixes commit 9c3b2689d01f ("drm/i915/cnl: > Map VBT DDC Pin to BSpec DDC Pin.") > > v2: Do in a way that we don't break other platforms. (Jani) > > v3: Keep debug message (Jani) > > v4: Don't mess with 0 mapping was noticed by Jani and > addressed with a simple solution suggested by Lucas > that makes this even simpler. > > Fixes: a8e6f3888b05 ("drm/i915/cnp: Ignore VBT request for know invalid DDC pin.") > Fixes: 9c3b2689d01f ("drm/i915/cnl: Map VBT DDC Pin to BSpec DDC Pin.") > Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com> > Cc: Jani Nikula <jani.nikula@intel.com> > Cc: Kai Heng Feng <kai.heng.feng@canonical.com> > Cc: Lucas De Marchi <lucas.demarchi@intel.com> > Suggested-by: Lucas De Marchi <lucas.demarchi@intel.com> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> > --- > drivers/gpu/drm/i915/intel_bios.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c > index 95f0b310d656..cf3f8f1ba6f7 100644 > --- a/drivers/gpu/drm/i915/intel_bios.c > +++ b/drivers/gpu/drm/i915/intel_bios.c > @@ -1107,6 +1107,7 @@ static void sanitize_aux_ch(struct drm_i915_private *dev_priv, > } > > static const u8 cnp_ddc_pin_map[] = { > + [0] = 0, /* N/A */ > [DDC_BUS_DDI_B] = GMBUS_PIN_1_BXT, > [DDC_BUS_DDI_C] = GMBUS_PIN_2_BXT, > [DDC_BUS_DDI_D] = GMBUS_PIN_4_CNP, /* sic */ > @@ -1116,9 +1117,9 @@ static const u8 cnp_ddc_pin_map[] = { > static u8 map_ddc_pin(struct drm_i915_private *dev_priv, u8 vbt_pin) > { > if (HAS_PCH_CNP(dev_priv)) { > - if (vbt_pin > 0 && vbt_pin < ARRAY_SIZE(cnp_ddc_pin_map)) > + if (vbt_pin < ARRAY_SIZE(cnp_ddc_pin_map)) { > return cnp_ddc_pin_map[vbt_pin]; > - if (vbt_pin > GMBUS_PIN_4_CNP) { > + } else { > DRM_DEBUG_KMS("Ignoring alternate pin: VBT claims DDC pin %d, which is not valid for this platform\n", vbt_pin); > return 0; > } > -- > 2.13.6 >
On Mon, Jan 29, 2018 at 05:42:53AM +0000, Kai Heng Feng wrote: > > > On 26 Jan 2018, at 6:25 AM, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote: > > > > If the table result is out of bounds on the array map > > there is something really wrong with VBT pin so we don't > > return that vbt_pin, but only return 0 instead. > > > > This basically reverts commit 'a8e6f3888b05 ("drm/i915/cnp: > > Ignore VBT request for know invalid DDC pin.")' > > > > Also this properly fixes commit 9c3b2689d01f ("drm/i915/cnl: > > Map VBT DDC Pin to BSpec DDC Pin.") > > > > v2: Do in a way that we don't break other platforms. (Jani) > > > > v3: Keep debug message (Jani) > > > > v4: Don't mess with 0 mapping was noticed by Jani and > > addressed with a simple solution suggested by Lucas > > that makes this even simpler. > > > > Fixes: a8e6f3888b05 ("drm/i915/cnp: Ignore VBT request for know invalid DDC pin.") > > Fixes: 9c3b2689d01f ("drm/i915/cnl: Map VBT DDC Pin to BSpec DDC Pin.") > > Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com> > > Cc: Jani Nikula <jani.nikula@intel.com> > > Cc: Kai Heng Feng <kai.heng.feng@canonical.com> > > Cc: Lucas De Marchi <lucas.demarchi@intel.com> > > Suggested-by: Lucas De Marchi <lucas.demarchi@intel.com> > > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> > > Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> merged. thanks for suggestions, reviews, tests and patience ;) > > > --- > > drivers/gpu/drm/i915/intel_bios.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c > > index 95f0b310d656..cf3f8f1ba6f7 100644 > > --- a/drivers/gpu/drm/i915/intel_bios.c > > +++ b/drivers/gpu/drm/i915/intel_bios.c > > @@ -1107,6 +1107,7 @@ static void sanitize_aux_ch(struct drm_i915_private *dev_priv, > > } > > > > static const u8 cnp_ddc_pin_map[] = { > > + [0] = 0, /* N/A */ > > [DDC_BUS_DDI_B] = GMBUS_PIN_1_BXT, > > [DDC_BUS_DDI_C] = GMBUS_PIN_2_BXT, > > [DDC_BUS_DDI_D] = GMBUS_PIN_4_CNP, /* sic */ > > @@ -1116,9 +1117,9 @@ static const u8 cnp_ddc_pin_map[] = { > > static u8 map_ddc_pin(struct drm_i915_private *dev_priv, u8 vbt_pin) > > { > > if (HAS_PCH_CNP(dev_priv)) { > > - if (vbt_pin > 0 && vbt_pin < ARRAY_SIZE(cnp_ddc_pin_map)) > > + if (vbt_pin < ARRAY_SIZE(cnp_ddc_pin_map)) { > > return cnp_ddc_pin_map[vbt_pin]; > > - if (vbt_pin > GMBUS_PIN_4_CNP) { > > + } else { > > DRM_DEBUG_KMS("Ignoring alternate pin: VBT claims DDC pin %d, which is not valid for this platform\n", vbt_pin); > > return 0; > > } > > -- > > 2.13.6 > > >
On 30.01.2018 00:12, Rodrigo Vivi wrote: > On Mon, Jan 29, 2018 at 05:42:53AM +0000, Kai Heng Feng wrote: >> >>> On 26 Jan 2018, at 6:25 AM, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote: >>> >>> If the table result is out of bounds on the array map >>> there is something really wrong with VBT pin so we don't >>> return that vbt_pin, but only return 0 instead. >>> >>> This basically reverts commit 'a8e6f3888b05 ("drm/i915/cnp: >>> Ignore VBT request for know invalid DDC pin.")' >>> >>> Also this properly fixes commit 9c3b2689d01f ("drm/i915/cnl: >>> Map VBT DDC Pin to BSpec DDC Pin.") >>> >>> v2: Do in a way that we don't break other platforms. (Jani) >>> >>> v3: Keep debug message (Jani) >>> >>> v4: Don't mess with 0 mapping was noticed by Jani and >>> addressed with a simple solution suggested by Lucas >>> that makes this even simpler. >>> >>> Fixes: a8e6f3888b05 ("drm/i915/cnp: Ignore VBT request for know invalid DDC pin.") >>> Fixes: 9c3b2689d01f ("drm/i915/cnl: Map VBT DDC Pin to BSpec DDC Pin.") >>> Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com> >>> Cc: Jani Nikula <jani.nikula@intel.com> >>> Cc: Kai Heng Feng <kai.heng.feng@canonical.com> >>> Cc: Lucas De Marchi <lucas.demarchi@intel.com> >>> Suggested-by: Lucas De Marchi <lucas.demarchi@intel.com> >>> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> >> >> Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> > > merged. thanks for suggestions, reviews, tests and patience ;) Shouldn't this and drm/i915/cnp: Ignore VBT request for know invalid DDC pin. be cc:stable? Though they aren't even in 4.16 yet.
On Fri, 23 Mar 2018, Timo Aaltonen <tjaalton@ubuntu.com> wrote: > On 30.01.2018 00:12, Rodrigo Vivi wrote: >> On Mon, Jan 29, 2018 at 05:42:53AM +0000, Kai Heng Feng wrote: >>> >>>> On 26 Jan 2018, at 6:25 AM, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote: >>>> >>>> If the table result is out of bounds on the array map >>>> there is something really wrong with VBT pin so we don't >>>> return that vbt_pin, but only return 0 instead. >>>> >>>> This basically reverts commit 'a8e6f3888b05 ("drm/i915/cnp: >>>> Ignore VBT request for know invalid DDC pin.")' >>>> >>>> Also this properly fixes commit 9c3b2689d01f ("drm/i915/cnl: >>>> Map VBT DDC Pin to BSpec DDC Pin.") >>>> >>>> v2: Do in a way that we don't break other platforms. (Jani) >>>> >>>> v3: Keep debug message (Jani) >>>> >>>> v4: Don't mess with 0 mapping was noticed by Jani and >>>> addressed with a simple solution suggested by Lucas >>>> that makes this even simpler. >>>> >>>> Fixes: a8e6f3888b05 ("drm/i915/cnp: Ignore VBT request for know invalid DDC pin.") >>>> Fixes: 9c3b2689d01f ("drm/i915/cnl: Map VBT DDC Pin to BSpec DDC Pin.") >>>> Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com> >>>> Cc: Jani Nikula <jani.nikula@intel.com> >>>> Cc: Kai Heng Feng <kai.heng.feng@canonical.com> >>>> Cc: Lucas De Marchi <lucas.demarchi@intel.com> >>>> Suggested-by: Lucas De Marchi <lucas.demarchi@intel.com> >>>> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> >>> >>> Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> >> >> merged. thanks for suggestions, reviews, tests and patience ;) > > Shouldn't this and > > drm/i915/cnp: Ignore VBT request for know invalid DDC pin. > > be cc:stable? Though they aren't even in 4.16 yet. Apologies for nobody replying. The commits are in v4.16, and I've made a stable backport request for v4.15. BR, Jani.
On Mon, Apr 09, 2018 at 12:48:15PM +0300, Jani Nikula wrote: > On Fri, 23 Mar 2018, Timo Aaltonen <tjaalton@ubuntu.com> wrote: > > On 30.01.2018 00:12, Rodrigo Vivi wrote: > >> On Mon, Jan 29, 2018 at 05:42:53AM +0000, Kai Heng Feng wrote: > >>> > >>>> On 26 Jan 2018, at 6:25 AM, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote: > >>>> > >>>> If the table result is out of bounds on the array map > >>>> there is something really wrong with VBT pin so we don't > >>>> return that vbt_pin, but only return 0 instead. > >>>> > >>>> This basically reverts commit 'a8e6f3888b05 ("drm/i915/cnp: > >>>> Ignore VBT request for know invalid DDC pin.")' > >>>> > >>>> Also this properly fixes commit 9c3b2689d01f ("drm/i915/cnl: > >>>> Map VBT DDC Pin to BSpec DDC Pin.") > >>>> > >>>> v2: Do in a way that we don't break other platforms. (Jani) > >>>> > >>>> v3: Keep debug message (Jani) > >>>> > >>>> v4: Don't mess with 0 mapping was noticed by Jani and > >>>> addressed with a simple solution suggested by Lucas > >>>> that makes this even simpler. > >>>> > >>>> Fixes: a8e6f3888b05 ("drm/i915/cnp: Ignore VBT request for know invalid DDC pin.") > >>>> Fixes: 9c3b2689d01f ("drm/i915/cnl: Map VBT DDC Pin to BSpec DDC Pin.") > >>>> Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com> > >>>> Cc: Jani Nikula <jani.nikula@intel.com> > >>>> Cc: Kai Heng Feng <kai.heng.feng@canonical.com> > >>>> Cc: Lucas De Marchi <lucas.demarchi@intel.com> > >>>> Suggested-by: Lucas De Marchi <lucas.demarchi@intel.com> > >>>> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> > >>> > >>> Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com> > >> > >> merged. thanks for suggestions, reviews, tests and patience ;) > > > > Shouldn't this and > > > > drm/i915/cnp: Ignore VBT request for know invalid DDC pin. > > > > be cc:stable? Though they aren't even in 4.16 yet. > > Apologies for nobody replying. The commits are in v4.16, and I've made a > stable backport request for v4.15. Ops, my bad. I'm sorry... I had missed those. Thank you very much Jani. > > BR, > Jani. > > -- > Jani Nikula, Intel Open Source Technology Center > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index 95f0b310d656..cf3f8f1ba6f7 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c @@ -1107,6 +1107,7 @@ static void sanitize_aux_ch(struct drm_i915_private *dev_priv, } static const u8 cnp_ddc_pin_map[] = { + [0] = 0, /* N/A */ [DDC_BUS_DDI_B] = GMBUS_PIN_1_BXT, [DDC_BUS_DDI_C] = GMBUS_PIN_2_BXT, [DDC_BUS_DDI_D] = GMBUS_PIN_4_CNP, /* sic */ @@ -1116,9 +1117,9 @@ static const u8 cnp_ddc_pin_map[] = { static u8 map_ddc_pin(struct drm_i915_private *dev_priv, u8 vbt_pin) { if (HAS_PCH_CNP(dev_priv)) { - if (vbt_pin > 0 && vbt_pin < ARRAY_SIZE(cnp_ddc_pin_map)) + if (vbt_pin < ARRAY_SIZE(cnp_ddc_pin_map)) { return cnp_ddc_pin_map[vbt_pin]; - if (vbt_pin > GMBUS_PIN_4_CNP) { + } else { DRM_DEBUG_KMS("Ignoring alternate pin: VBT claims DDC pin %d, which is not valid for this platform\n", vbt_pin); return 0; }
If the table result is out of bounds on the array map there is something really wrong with VBT pin so we don't return that vbt_pin, but only return 0 instead. This basically reverts commit 'a8e6f3888b05 ("drm/i915/cnp: Ignore VBT request for know invalid DDC pin.")' Also this properly fixes commit 9c3b2689d01f ("drm/i915/cnl: Map VBT DDC Pin to BSpec DDC Pin.") v2: Do in a way that we don't break other platforms. (Jani) v3: Keep debug message (Jani) v4: Don't mess with 0 mapping was noticed by Jani and addressed with a simple solution suggested by Lucas that makes this even simpler. Fixes: a8e6f3888b05 ("drm/i915/cnp: Ignore VBT request for know invalid DDC pin.") Fixes: 9c3b2689d01f ("drm/i915/cnl: Map VBT DDC Pin to BSpec DDC Pin.") Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Kai Heng Feng <kai.heng.feng@canonical.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Suggested-by: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> --- drivers/gpu/drm/i915/intel_bios.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)