public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Luca Coelho <luca@coelho.fi>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 06/15] drm/i915: Extract intel_edp_backlight_setup()
Date: Mon, 26 Sep 2022 14:16:29 +0300	[thread overview]
Message-ID: <YzGKDRz0412ilvVI@intel.com> (raw)
In-Reply-To: <6992a0ec208145381c0d587f7d7241684e3e1d09.camel@coelho.fi>

On Mon, Sep 26, 2022 at 01:58:42PM +0300, Luca Coelho wrote:
> On Mon, 2022-09-12 at 14:18 +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Pull the eDP backlight setup ino its own function. No
> > reason to pollute intel_edp_init_connector() with all
> > the mundane details.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_dp.c | 51 +++++++++++++++----------
> >  1 file changed, 30 insertions(+), 21 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> > index a5eca5396fed..de5a4d2df78e 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > @@ -5217,6 +5217,35 @@ intel_edp_add_properties(struct intel_dp *intel_dp)
> >  						       fixed_mode->vdisplay);
> >  }
> >  
> > +static void intel_edp_backlight_setup(struct intel_dp *intel_dp,
> > +				      struct intel_connector *connector)
> > +{
> > +	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
> > +	enum pipe pipe = INVALID_PIPE;
> > +
> > +	if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915)) {
> 
> Isn't this too restrictive? Isn't there another way to check whether
> the hardware supports backlight?

That's not what we're checking.

Only VLV/CHV have per-pipe backlight registers, whereas
other platforms have less insane design. So we only need
to figure out the pipe on VLV/CHV.

> 
> 
> > +		/*
> > +		 * Figure out the current pipe for the initial backlight setup.
> > +		 * If the current pipe isn't valid, try the PPS pipe, and if that
> > +		 * fails just assume pipe A.
> > +		 */
> > +		pipe = vlv_active_pipe(intel_dp);
> > +
> > +		if (pipe != PIPE_A && pipe != PIPE_B)
> > +			pipe = intel_dp->pps.pps_pipe;
> > +
> > +		if (pipe != PIPE_A && pipe != PIPE_B)
> > +			pipe = PIPE_A;
> > +
> > +		drm_dbg_kms(&i915->drm,
> > +			    "[CONNECTOR:%d:%s] using pipe %c for initial backlight setup\n",
> > +			    connector->base.base.id, connector->base.name,
> > +			    pipe_name(pipe));
> > +	}
> > +
> > +	intel_backlight_setup(connector, pipe);
> 
> In most cases we will call intel_backlight_setup() with INVALID_PIPE. 
> Wouldn't it be better to skip this call completely in that case?

INVALD_PIPE doesn't mean "no backlight", it just means we don't
care about the pipe.

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2022-09-26 11:16 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12 11:17 [Intel-gfx] [PATCH 00/15] drm/i915: Some house cleaning Ville Syrjala
2022-09-12 11:18 ` [Intel-gfx] [PATCH 01/15] drm/i915: Drop pointless middle man variable Ville Syrjala
2022-09-26 10:33   ` Luca Coelho
2022-09-26 10:43     ` Jani Nikula
2022-09-26 11:05       ` Luca Coelho
2022-09-12 11:18 ` [Intel-gfx] [PATCH 02/15] drm/i915: Clean up transcoder_to_stream_enc_status() Ville Syrjala
2022-09-26 10:34   ` Luca Coelho
2022-09-12 11:18 ` [Intel-gfx] [PATCH 03/15] drm/i915: Drop pointless 'budget' variable Ville Syrjala
2022-09-26 10:37   ` Luca Coelho
2022-09-12 11:18 ` [Intel-gfx] [PATCH 04/15] drm/i915: Use BIT() when dealing with output types Ville Syrjala
2022-09-26 10:40   ` Luca Coelho
2022-09-12 11:18 ` [Intel-gfx] [PATCH 05/15] drm/i915: Pass intel_encoder to to_lvds_encoder() Ville Syrjala
2022-09-26 10:46   ` Luca Coelho
2022-09-12 11:18 ` [Intel-gfx] [PATCH 06/15] drm/i915: Extract intel_edp_backlight_setup() Ville Syrjala
2022-09-12 11:57   ` Jani Nikula
2022-09-26 10:58   ` Luca Coelho
2022-09-26 11:16     ` Ville Syrjälä [this message]
2022-09-26 11:33       ` Luca Coelho
2022-09-26 11:38         ` Luca Coelho
2022-09-12 11:18 ` [Intel-gfx] [PATCH 07/15] drm/i915: Extract intel_tv_add_properties() Ville Syrjala
2022-09-12 11:18 ` [Intel-gfx] [PATCH 08/15] drm/i915: Extract intel_dp_mst_add_properties() Ville Syrjala
2022-09-12 11:18 ` [Intel-gfx] [PATCH 09/15] drm/i915: Extract intel_lvds_add_properties() Ville Syrjala
2022-09-12 11:18 ` [Intel-gfx] [PATCH 10/15] drm/i915: Move eDP scaling_mode prop setup to the proper place Ville Syrjala
2022-09-12 11:18 ` [Intel-gfx] [PATCH 11/15] drm/i915: Extract intel_attach_scaling_mode_property() Ville Syrjala
2022-09-12 11:18 ` [Intel-gfx] [PATCH 12/15] drm/i915: Clean up connector->*_allowed setup Ville Syrjala
2022-09-12 11:18 ` [Intel-gfx] [PATCH 13/15] drm/i915: Don't init eDP if we can't find a fixed mode Ville Syrjala
2022-09-12 12:02   ` Jani Nikula
2022-09-12 17:36     ` Ville Syrjälä
2022-09-12 11:18 ` [Intel-gfx] [PATCH 14/15] drm/i915: Finish s/intel_encoder/encoder/ rename Ville Syrjala
2022-09-12 11:18 ` [Intel-gfx] [PATCH 15/15] drm/i915: s/intel_connector/connector/ in init code Ville Syrjala
2022-09-12 17:56 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Some house cleaning Patchwork
2022-09-12 18:17 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-09-12 23:20 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=YzGKDRz0412ilvVI@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=luca@coelho.fi \
    /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