public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/i915: add PWM and BLC assertion checks
Date: Wed, 25 Jun 2014 15:45:03 +0300	[thread overview]
Message-ID: <87k3856tv4.fsf@intel.com> (raw)
In-Reply-To: <20140401091352.3b579029@jbarnes-desktop>

On Tue, 01 Apr 2014, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> On Tue, 01 Apr 2014 10:19:29 +0300
> Jani Nikula <jani.nikula@linux.intel.com> wrote:
>
>> On Mon, 31 Mar 2014, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
>> > To make sure we properly follow the enable/disable sequences.
>> >
>> > Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
>> > ---
>> >  drivers/gpu/drm/i915/intel_dp.c    | 62 ++++++++++++++++++++++++++++++++++++--
>> >  drivers/gpu/drm/i915/intel_drv.h   |  1 +
>> >  drivers/gpu/drm/i915/intel_panel.c |  5 ++-
>> >  3 files changed, 65 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
>> > index bf73771..b6f7087 100644
>> > --- a/drivers/gpu/drm/i915/intel_dp.c
>> > +++ b/drivers/gpu/drm/i915/intel_dp.c
>> > @@ -301,6 +301,20 @@ static u32 _pp_stat_reg(struct intel_dp *intel_dp)
>> >  		return VLV_PIPE_PP_STATUS(vlv_power_sequencer_pipe(intel_dp));
>> >  }
>> >  
>> > +static void assert_pwm(struct intel_connector *connector,
>> > +		       bool expected_state)
>> > +{
>> > +	bool state;
>> > +
>> > +	state = intel_panel_get_backlight(connector);
>> 
>> If the duty cycle is regarded as a binary on/off, I'd rather add an
>> additional "is enabled" call to intel_panel.c. Especially so because the
>> duty cycle value returned by intel_panel_get_backlight is meaningless
>> without the max value.
>
> Hm I guess that would be cleaner; for my purposes I thought any
> non-zero PWM duty cycle would be sufficient, but of course other checks
> are needed as well, like whether the PWM enable bit is on, and checks
> against the BLC_EN bit in the PP regs, but those are logically
> separate.  is_enabled might better map back to the PWM_EN bit rather
> than a non-zero duty cycle though.

We could add intel_panel_backlight_enabled() call that returns
connector->panel.backlight.enabled.

BR,
Jani.






>
>> >  
>> > +	if (I915_READ(VLV_BLC_PWM_CTL2(pipe) & BLM_PWM_ENABLE))
>> > +		return 0;
>> > +
>> 
>> If our internal state is consistent, I don't think this should be
>> necessary. And if our internal state isn't consistent, we should fix
>> that and maybe add internal asserts within intel_panel.c.
>
> Yeah this could be covered with other asserts as long as we have them
> in all the right places.
>
> -- 
> Jesse Barnes, Intel Open Source Technology Center

-- 
Jani Nikula, Intel Open Source Technology Center

      reply	other threads:[~2014-06-25 12:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-31 18:13 [PATCH 1/3] drm/i915: add PWM and BLC assertion checks Jesse Barnes
2014-03-31 18:13 ` [PATCH 2/3] drm/i915: correct BLC vs PWM enable/disable ordering Jesse Barnes
2014-06-19 18:00   ` Jesse Barnes
2014-07-07 21:45     ` Daniel Vetter
2014-06-25 12:21   ` Jani Nikula
2014-06-25 15:02     ` Jesse Barnes
2014-06-26  7:58       ` Jani Nikula
2014-03-31 18:13 ` [PATCH 3/3] drm/i915/vlv: use min brightness from VBT Jesse Barnes
2014-03-31 19:07   ` Daniel Vetter
2014-03-31 19:14     ` Jesse Barnes
2014-04-01  8:08   ` Jani Nikula
2014-04-01 16:16     ` Jesse Barnes
2014-04-01  7:19 ` [PATCH 1/3] drm/i915: add PWM and BLC assertion checks Jani Nikula
2014-04-01  9:27   ` Jani Nikula
2014-04-01 16:14     ` Jesse Barnes
2014-04-01 16:13   ` Jesse Barnes
2014-06-25 12:45     ` Jani Nikula [this message]

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=87k3856tv4.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jbarnes@virtuousgeek.org \
    /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