public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: "Souza\, Jose" <jose.souza@intel.com>,
	"intel-gfx\@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Cc: "Shankar\, Uma" <uma.shankar@intel.com>,
	"ville.syrjala\@linux.intel.com" <ville.syrjala@linux.intel.com>,
	"Sharma\, Swati2" <swati2.sharma@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/bios: gracefully disable dual eDP for now
Date: Thu, 14 Oct 2021 16:31:23 +0300	[thread overview]
Message-ID: <87bl3rwx5g.fsf@intel.com> (raw)
In-Reply-To: <28fd302c6dd79caf88cfde6c9bd45ae2c7c8312b.camel@intel.com>

On Tue, 05 Oct 2021, "Souza, Jose" <jose.souza@intel.com> wrote:
> On Tue, 2021-10-05 at 23:38 +0300, Jani Nikula wrote:
>> On Tue, 05 Oct 2021, "Souza, Jose" <jose.souza@intel.com> wrote:
>> > On Tue, 2021-10-05 at 20:56 +0300, Jani Nikula wrote:
>> > > For the time being, neither the power sequencer nor the backlight code
>> > > properly support two eDP panels simultaneously. While the software
>> > > states will be independent, the same sets of registers will be used for
>> > > both eDP panels, clobbering the hardware state and leading to errors.
>> > > 
>> > > Gracefully disable dual eDP until proper support has been added.
>> > > 
>> > > Cc: José Roberto de Souza <jose.souza@intel.com>
>> > > Cc: Uma Shankar <uma.shankar@intel.com>
>> > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> > > Cc: Swati Sharma <swati2.sharma@intel.com>
>> > > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> > > ---
>> > >  drivers/gpu/drm/i915/display/intel_bios.c | 47 +++++++++++++++++++++++
>> > >  1 file changed, 47 insertions(+)
>> > > 
>> > > diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
>> > > index f9776ca85de3..b99907c656bb 100644
>> > > --- a/drivers/gpu/drm/i915/display/intel_bios.c
>> > > +++ b/drivers/gpu/drm/i915/display/intel_bios.c
>> > > @@ -1930,6 +1930,50 @@ static int _intel_bios_max_tmds_clock(const struct intel_bios_encoder_data *devd
>> > >  	}
>> > >  }
>> > >  
>> > > +static enum port get_edp_port(struct drm_i915_private *i915)
>> > > +{
>> > > +	const struct intel_bios_encoder_data *devdata;
>> > > +	enum port port;
>> > > +
>> > > +	for_each_port(port) {
>> > > +		devdata = i915->vbt.ports[port];
>> > > +
>> > > +		if (devdata && intel_bios_encoder_supports_edp(devdata))
>> > > +			return port;
>> > > +	}
>> > > +
>> > > +	return PORT_NONE;
>> > > +}
>> > > +
>> > > +/*
>> > > + * FIXME: The power sequencer and backlight code currently do not support more
>> > > + * than one set registers, at least not on anything other than VLV/CHV. It will
>> > > + * clobber the registers. As a temporary workaround, gracefully prevent more
>> > > + * than one eDP from being registered.
>> > > + */
>> > > +static void sanitize_dual_edp(struct intel_bios_encoder_data *devdata,
>> > > +			      enum port port)
>> > > +{
>> > > +	struct drm_i915_private *i915 = devdata->i915;
>> > > +	struct child_device_config *child = &devdata->child;
>> > > +	enum port p;
>> > > +
>> > > +	/* CHV might not clobber PPS registers. */
>> > > +	if (IS_CHERRYVIEW(i915))
>> > > +		return;
>> > > +
>> > > +	p = get_edp_port(i915);
>> > > +	if (p == PORT_NONE)
>> > > +		return;
>> > > +
>> > > +	drm_dbg_kms(&i915->drm, "both ports %c and %c configured as eDP, "
>> > > +		    "disabling port %c eDP\n", port_name(p), port_name(port),
>> > > +		    port_name(port));
>> > > +
>> > > +	child->device_type &= ~DEVICE_TYPE_DISPLAYPORT_OUTPUT;
>> > 
>> > Why also cleaning the DEVICE_TYPE_DISPLAYPORT_OUTPUT bit? The rest lgtm.
>> 
>> Could've leaned one way or the other, but do we really want to
>> initialize a regular DP on the port?
>
> Yeah, lets go without.
>
> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>

Thanks, pushed with Swati's Tested-by.

BR,
Jani.


>
>> 
>> BR,
>> Jani.
>> 
>> > 
>> > > +	child->device_type &= ~DEVICE_TYPE_INTERNAL_CONNECTOR;
>> > > +}
>> > > +
>> > >  static bool is_port_valid(struct drm_i915_private *i915, enum port port)
>> > >  {
>> > >  	/*
>> > > @@ -1987,6 +2031,9 @@ static void parse_ddi_port(struct drm_i915_private *i915,
>> > >  		    supports_typec_usb, supports_tbt,
>> > >  		    devdata->dsc != NULL);
>> > >  
>> > > +	if (is_edp)
>> > > +		sanitize_dual_edp(devdata, port);
>> > > +
>> > >  	if (is_dvi)
>> > >  		sanitize_ddc_pin(devdata, port);
>> > >  
>> > 
>> 
>

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2021-10-14 13:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05 17:56 [Intel-gfx] [PATCH] drm/i915/bios: gracefully disable dual eDP for now Jani Nikula
2021-10-05 18:06 ` Ville Syrjälä
2021-10-05 19:30   ` Jani Nikula
2021-10-06  9:01     ` Ville Syrjälä
2021-10-05 20:21 ` Souza, Jose
2021-10-05 20:38   ` Jani Nikula
2021-10-05 20:41     ` Souza, Jose
2021-10-14 13:31       ` Jani Nikula [this message]
2021-10-05 23:52 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2021-10-06  4:28 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bl3rwx5g.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jose.souza@intel.com \
    --cc=swati2.sharma@intel.com \
    --cc=uma.shankar@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox