Stable Archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915/bios: Tolerate devdata==NULL in intel_bios_encoder_supports_dp_dual_mode()
@ 2024-03-19  9:24 Ville Syrjala
  2024-03-19  9:29 ` Jani Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: Ville Syrjala @ 2024-03-19  9:24 UTC (permalink / raw
  To: intel-gfx; +Cc: stable

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

If we have no VBT, or the VBT didn't declare the encoder
in question, we won't have the 'devdata' for the encoder.
Instead of oopsing just bail early.

We won't be able to tell whether the port is DP++ or not,
but so be it.

Cc: stable@vger.kernel.org
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10464
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index c7841b3eede8..c13a98431a7b 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -3458,6 +3458,9 @@ bool intel_bios_encoder_supports_dp_dual_mode(const struct intel_bios_encoder_da
 {
 	const struct child_device_config *child = &devdata->child;
 
+	if (!devdata)
+		return false;
+
 	if (!intel_bios_encoder_supports_dp(devdata) ||
 	    !intel_bios_encoder_supports_hdmi(devdata))
 		return false;
-- 
2.43.2


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

* Re: [PATCH 1/2] drm/i915/bios: Tolerate devdata==NULL in intel_bios_encoder_supports_dp_dual_mode()
  2024-03-19  9:24 [PATCH 1/2] drm/i915/bios: Tolerate devdata==NULL in intel_bios_encoder_supports_dp_dual_mode() Ville Syrjala
@ 2024-03-19  9:29 ` Jani Nikula
  2024-03-19 18:11   ` Ville Syrjälä
  0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2024-03-19  9:29 UTC (permalink / raw
  To: Ville Syrjala, intel-gfx; +Cc: stable

On Tue, 19 Mar 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> If we have no VBT, or the VBT didn't declare the encoder
> in question, we won't have the 'devdata' for the encoder.
> Instead of oopsing just bail early.
>
> We won't be able to tell whether the port is DP++ or not,
> but so be it.
>
> Cc: stable@vger.kernel.org
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10464
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_bios.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index c7841b3eede8..c13a98431a7b 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -3458,6 +3458,9 @@ bool intel_bios_encoder_supports_dp_dual_mode(const struct intel_bios_encoder_da
>  {
>  	const struct child_device_config *child = &devdata->child;

The above oopses already.

BR,
Jani.

>  
> +	if (!devdata)
> +		return false;
> +
>  	if (!intel_bios_encoder_supports_dp(devdata) ||
>  	    !intel_bios_encoder_supports_hdmi(devdata))
>  		return false;

-- 
Jani Nikula, Intel

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

* Re: [PATCH 1/2] drm/i915/bios: Tolerate devdata==NULL in intel_bios_encoder_supports_dp_dual_mode()
  2024-03-19  9:29 ` Jani Nikula
@ 2024-03-19 18:11   ` Ville Syrjälä
  2024-03-25 10:32     ` Jani Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: Ville Syrjälä @ 2024-03-19 18:11 UTC (permalink / raw
  To: Jani Nikula; +Cc: intel-gfx, stable

On Tue, Mar 19, 2024 at 11:29:14AM +0200, Jani Nikula wrote:
> On Tue, 19 Mar 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > If we have no VBT, or the VBT didn't declare the encoder
> > in question, we won't have the 'devdata' for the encoder.
> > Instead of oopsing just bail early.
> >
> > We won't be able to tell whether the port is DP++ or not,
> > but so be it.
> >
> > Cc: stable@vger.kernel.org
> > Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10464
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_bios.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> > index c7841b3eede8..c13a98431a7b 100644
> > --- a/drivers/gpu/drm/i915/display/intel_bios.c
> > +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> > @@ -3458,6 +3458,9 @@ bool intel_bios_encoder_supports_dp_dual_mode(const struct intel_bios_encoder_da
> >  {
> >  	const struct child_device_config *child = &devdata->child;
> 
> The above oopses already.

Nope. It's just taking the address of the thing.

> 
> BR,
> Jani.
> 
> >  
> > +	if (!devdata)
> > +		return false;
> > +
> >  	if (!intel_bios_encoder_supports_dp(devdata) ||
> >  	    !intel_bios_encoder_supports_hdmi(devdata))
> >  		return false;
> 
> -- 
> Jani Nikula, Intel

-- 
Ville Syrjälä
Intel

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

* Re: [PATCH 1/2] drm/i915/bios: Tolerate devdata==NULL in intel_bios_encoder_supports_dp_dual_mode()
  2024-03-19 18:11   ` Ville Syrjälä
@ 2024-03-25 10:32     ` Jani Nikula
  0 siblings, 0 replies; 4+ messages in thread
From: Jani Nikula @ 2024-03-25 10:32 UTC (permalink / raw
  To: Ville Syrjälä; +Cc: intel-gfx, stable

On Tue, 19 Mar 2024, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> On Tue, Mar 19, 2024 at 11:29:14AM +0200, Jani Nikula wrote:
>> On Tue, 19 Mar 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
>> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> >
>> > If we have no VBT, or the VBT didn't declare the encoder
>> > in question, we won't have the 'devdata' for the encoder.
>> > Instead of oopsing just bail early.
>> >
>> > We won't be able to tell whether the port is DP++ or not,
>> > but so be it.
>> >
>> > Cc: stable@vger.kernel.org
>> > Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10464
>> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> > ---
>> >  drivers/gpu/drm/i915/display/intel_bios.c | 3 +++
>> >  1 file changed, 3 insertions(+)
>> >
>> > diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
>> > index c7841b3eede8..c13a98431a7b 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_bios.c
>> > +++ b/drivers/gpu/drm/i915/display/intel_bios.c
>> > @@ -3458,6 +3458,9 @@ bool intel_bios_encoder_supports_dp_dual_mode(const struct intel_bios_encoder_da
>> >  {
>> >  	const struct child_device_config *child = &devdata->child;
>> 
>> The above oopses already.
>
> Nope. It's just taking the address of the thing.

I guess. Still looks a bit suspicious. :/

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


>
>> 
>> BR,
>> Jani.
>> 
>> >  
>> > +	if (!devdata)
>> > +		return false;
>> > +
>> >  	if (!intel_bios_encoder_supports_dp(devdata) ||
>> >  	    !intel_bios_encoder_supports_hdmi(devdata))
>> >  		return false;
>> 
>> -- 
>> Jani Nikula, Intel

-- 
Jani Nikula, Intel

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

end of thread, other threads:[~2024-03-25 10:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-19  9:24 [PATCH 1/2] drm/i915/bios: Tolerate devdata==NULL in intel_bios_encoder_supports_dp_dual_mode() Ville Syrjala
2024-03-19  9:29 ` Jani Nikula
2024-03-19 18:11   ` Ville Syrjälä
2024-03-25 10:32     ` Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).