From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 6/6] drm/i915: Remove most INVALID_PIPE checks from VLV backlight code
Date: Fri, 7 Nov 2014 14:51:23 +0200 [thread overview]
Message-ID: <20141107125123.GV10649@intel.com> (raw)
In-Reply-To: <87lhnn19m9.fsf@intel.com>
On Fri, Nov 07, 2014 at 02:24:46PM +0200, Jani Nikula wrote:
> On Fri, 07 Nov 2014, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Now that the backlight device no longer gets registered too early we
> > should be able to drop most of the INVALID_PIPE checks form the VLV/CHV
> > backlight code.
>
> The subject and this paragraph refer to VLV/CHV but this isn't really
> specific to those platforms.
Hmm. My assumption was that we can't get these with other platforms, but
the opregion might be a bit special I agree.
>
> > If we still manage to get here with INVALID_PIPE we will now get a WARN
> > from the lower level functions and can then actually investigate further.
> >
> > vlv_get_backlight() still needs the check since that gets called in
> > response to userspace actual_brightness reads.
>
> IIUC this bit won't be true if you add the backlight.enabled check as I
> suggested earlier.
Yeah, I think that should cover it.
>
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_panel.c | 11 ++++-------
> > 1 file changed, 4 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
> > index 2bc3309..0e2cb12 100644
> > --- a/drivers/gpu/drm/i915/intel_panel.c
> > +++ b/drivers/gpu/drm/i915/intel_panel.c
> > @@ -634,10 +634,9 @@ static void intel_panel_set_backlight(struct intel_connector *connector,
> > struct drm_device *dev = connector->base.dev;
> > struct drm_i915_private *dev_priv = dev->dev_private;
> > struct intel_panel *panel = &connector->panel;
> > - enum pipe pipe = intel_get_pipe_from_connector(connector);
> > u32 hw_level;
> >
> > - if (!panel->backlight.present || pipe == INVALID_PIPE)
> > + if (!panel->backlight.present)
> > return;
> >
> > mutex_lock(&dev_priv->backlight_lock);
> > @@ -662,10 +661,9 @@ void intel_panel_set_backlight_acpi(struct intel_connector *connector,
> > struct drm_device *dev = connector->base.dev;
> > struct drm_i915_private *dev_priv = dev->dev_private;
> > struct intel_panel *panel = &connector->panel;
> > - enum pipe pipe = intel_get_pipe_from_connector(connector);
> > u32 hw_level;
> >
> > - if (!panel->backlight.present || pipe == INVALID_PIPE)
> > + if (!panel->backlight.present)
> > return;
>
> I have a feeling we may get these requests from the BIOS whenever. In
> theory we should use the opregion ARDY field or somesuch to communicate
> whether we're ready or not (we always say we're ready like a scout) but
> even so we can't trust the BIOS to listen to what we say. Long story
> short we should probably leave this check in.
We do check backlight.enabled here as well, and I think we grab all the
required locks when servicing the opregion requests. So I'm thinking we
don't need the check here either. Or am I missing something?
>
> With those fixed this LGTM.
>
> BR,
> Jani.
>
>
> >
> > mutex_lock(&dev_priv->backlight_lock);
> > @@ -740,9 +738,8 @@ void intel_panel_disable_backlight(struct intel_connector *connector)
> > struct drm_device *dev = connector->base.dev;
> > struct drm_i915_private *dev_priv = dev->dev_private;
> > struct intel_panel *panel = &connector->panel;
> > - enum pipe pipe = intel_get_pipe_from_connector(connector);
> >
> > - if (!panel->backlight.present || pipe == INVALID_PIPE)
> > + if (!panel->backlight.present)
> > return;
> >
> > /*
> > @@ -949,7 +946,7 @@ void intel_panel_enable_backlight(struct intel_connector *connector)
> > struct intel_panel *panel = &connector->panel;
> > enum pipe pipe = intel_get_pipe_from_connector(connector);
> >
> > - if (!panel->backlight.present || pipe == INVALID_PIPE)
> > + if (!panel->backlight.present)
> > return;
> >
> > DRM_DEBUG_KMS("pipe %c\n", pipe_name(pipe));
> > --
> > 2.0.4
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Jani Nikula, Intel Open Source Technology Center
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-11-07 12:51 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-07 9:15 [PATCH 0/6] drm/i915: VLV/CHV backlight fixes ville.syrjala
2014-11-07 9:15 ` [PATCH 1/6] drm/i915: Warn if trying to poke a VLV backlight on invalid pipe ville.syrjala
2014-11-07 11:33 ` Jani Nikula
2014-11-07 9:16 ` [PATCH 2/6] drm/i915: Catch INVALID_PIPE in vlv_get_backlight() ville.syrjala
2014-11-07 11:32 ` Jani Nikula
2014-11-07 13:18 ` [PATCH v2 2/6] drm/i915: Skip .get_backlight() when backlight isn't enabled ville.syrjala
2014-11-07 13:24 ` Jani Nikula
2014-11-07 9:16 ` [PATCH 3/6] drm/i915: Don't deref NULL crtc in intel_get_pipe_from_connector() ville.syrjala
2014-11-07 11:32 ` Jani Nikula
2014-11-07 9:16 ` [PATCH 4/6] drm/i915: Pass the current pipe from eDP init to backlight setup ville.syrjala
2014-11-07 12:07 ` Jani Nikula
2014-11-07 9:16 ` [PATCH 5/6] drm/i915: Register the backlight device after the modeset init ville.syrjala
2014-11-07 12:19 ` Jani Nikula
2014-11-07 12:25 ` Jani Nikula
2014-11-07 13:19 ` [PATCH v2 " ville.syrjala
2014-11-07 13:25 ` Jani Nikula
2014-11-07 9:16 ` [PATCH 6/6] drm/i915: Remove most INVALID_PIPE checks from VLV backlight code ville.syrjala
2014-11-07 12:24 ` Jani Nikula
2014-11-07 12:51 ` Ville Syrjälä [this message]
2014-11-07 13:20 ` [PATCH v2 6/6] drm/i915: Remove most INVALID_PIPE checks from the " ville.syrjala
2014-11-07 13:26 ` Jani Nikula
2014-11-11 14:39 ` Daniel Vetter
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=20141107125123.GV10649@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@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