All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH 07/15] drm/i915: Track the psr dp connector in dev_priv->psr.enabled
Date: Tue, 17 Jun 2014 09:26:09 +0200	[thread overview]
Message-ID: <20140617072609.GQ5821@phenom.ffwll.local> (raw)
In-Reply-To: <CABVU7+tWvBGtxQFct0Ay1Q-6GTsPsev=xkv-pEv+e-vbM_5u=w@mail.gmail.com>

On Mon, Jun 16, 2014 at 05:10:14PM -0700, Rodrigo Vivi wrote:
> On Mon, Jun 16, 2014 at 10:51 AM, Daniel Vetter <daniel.vetter@ffwll.ch>
> wrote:
> 
> > Trying to fish that one out through looping is a bit a locking
> > nightmare. So just set it and use it in the work struct.
> >
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.h |  3 ++-
> >  drivers/gpu/drm/i915/intel_dp.c | 21 +++++++--------------
> >  2 files changed, 9 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h
> > b/drivers/gpu/drm/i915/i915_drv.h
> > index f5db29428406..759f7c6d1622 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -633,10 +633,11 @@ struct i915_drrs {
> >         struct intel_connector *connector;
> >  };
> >
> > +struct intel_dp;
> >  struct i915_psr {
> >         bool sink_support;
> >         bool source_ok;
> > -       bool enabled;
> > +       struct intel_dp *enabled;
> >         bool active;
> >         struct delayed_work work;
> >  };
> > diff --git a/drivers/gpu/drm/i915/intel_dp.c
> > b/drivers/gpu/drm/i915/intel_dp.c
> > index ac1cef459a7b..10bcc052df4b 100644
> > --- a/drivers/gpu/drm/i915/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > @@ -1826,7 +1826,7 @@ static void intel_edp_psr_do_enable(struct intel_dp
> > *intel_dp)
> >         /* Enable PSR on the host */
> >         intel_edp_psr_enable_source(intel_dp);
> >
> > -       dev_priv->psr.enabled = true;
> > +       dev_priv->psr.enabled = intel_dp;
> >
> 
> I liked this very much...
> 
> 
> >         dev_priv->psr.active = true;
> >  }
> >
> > @@ -1867,26 +1867,19 @@ void intel_edp_psr_disable(struct intel_dp
> > *intel_dp)
> >                        EDP_PSR_STATUS_STATE_MASK) == 0, 2000, 10))
> >                 DRM_ERROR("Timed out waiting for PSR Idle State\n");
> >
> > -       dev_priv->psr.enabled = false;
> > +       dev_priv->psr.enabled = NULL;
> >  }
> >
> >  static void intel_edp_psr_work(struct work_struct *work)
> >  {
> >         struct drm_i915_private *dev_priv =
> >                 container_of(work, typeof(*dev_priv), psr.work.work);
> > -       struct drm_device *dev = dev_priv->dev;
> > -       struct intel_encoder *encoder;
> > -       struct intel_dp *intel_dp = NULL;
> > -
> > -       list_for_each_entry(encoder, &dev->mode_config.encoder_list,
> > base.head)
> > -               if (encoder->type == INTEL_OUTPUT_EDP) {
> > -                       intel_dp = enc_to_intel_dp(&encoder->base);
> > +       struct intel_dp *intel_dp = dev_priv->psr.enabled;
> >
> >
> but I'm afraid to give NULL to below functions...
> Shouldn't we add a if(!intel_dp) return;  at least just to be on the safe
> side?

Good catch, I'll put that into the series since it breaks bisect. With the
fixup from last night the end result is safe again.
-Daniel

> 
> -                       if (!intel_edp_psr_match_conditions(intel_dp))
> > -                               intel_edp_psr_disable(intel_dp);
> > -                       else
> > -                               intel_edp_psr_do_enable(intel_dp);
> > -               }
> > +       if (!intel_edp_psr_match_conditions(intel_dp))
> > +               intel_edp_psr_disable(intel_dp);
> > +       else
> > +               intel_edp_psr_do_enable(intel_dp);
> >  }
> >
> >  static void intel_edp_psr_inactivate(struct drm_device *dev)
> > --
> > 2.0.0
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> >
> 
> 
> 
> -- 
> Rodrigo Vivi
> Blog: http://blog.vivi.eng.br

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-06-17  7:26 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-16 17:51 [PATCH 00/15] Accurate frontbuffer tracking and psr conversion Daniel Vetter
2014-06-16 17:51 ` [PATCH 01/15] drm/i915: Add missing statics to recent psr functions Daniel Vetter
2014-06-16 23:57   ` Rodrigo Vivi
2014-06-17  8:22     ` Daniel Vetter
2014-06-16 17:51 ` [PATCH 02/15] drm/i915: Drop unecessary complexity from psr_inactivate Daniel Vetter
2014-06-16 23:58   ` Rodrigo Vivi
2014-06-16 17:51 ` [PATCH 03/15] drm/i915: Ditch intel_edp_psr_update Daniel Vetter
2014-06-17  0:00   ` Rodrigo Vivi
2014-06-16 17:51 ` [PATCH 04/15] drm/i915: Run psr_setup unconditionally Daniel Vetter
2014-06-17  0:03   ` Rodrigo Vivi
2014-06-17  6:43     ` Chris Wilson
2014-06-17  7:23       ` Daniel Vetter
2014-06-17  8:26         ` Daniel Vetter
2014-06-16 17:51 ` [PATCH 05/15] drm/i915: Drop schedule_back from psr_exit Daniel Vetter
2014-06-17  0:06   ` Rodrigo Vivi
2014-06-17  7:25     ` Daniel Vetter
2014-06-16 17:51 ` [PATCH 06/15] drm/i915: Add a FIXME about drrs/psr interactions Daniel Vetter
2014-06-16 17:51 ` [PATCH 07/15] drm/i915: Track the psr dp connector in dev_priv->psr.enabled Daniel Vetter
2014-06-17  0:10   ` Rodrigo Vivi
2014-06-17  7:26     ` Daniel Vetter [this message]
2014-06-16 17:51 ` [PATCH 08/15] drm/i915: Don't try to disable psr harder from the work item Daniel Vetter
2014-06-17  0:20   ` Rodrigo Vivi
2014-06-17  7:29     ` Daniel Vetter
2014-06-16 17:51 ` [PATCH 09/15] drm/i915: Lock down psr sw/hw state tracking Daniel Vetter
2014-06-16 17:51 ` [PATCH 10/15] drm/i915: More checks for psr.enabled Daniel Vetter
2014-06-16 17:51 ` [PATCH 11/15] drm/i915: Add locking to psr code Daniel Vetter
2014-06-16 17:51 ` [PATCH 12/15] drm/i915: Introduce accurate frontbuffer tracking Daniel Vetter
2014-06-16 17:51 ` [PATCH 13/15] drm/i915: Use new frontbuffer bits to increase pll clock Daniel Vetter
2014-06-16 17:51 ` [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing Daniel Vetter
2014-06-17  6:41   ` Chris Wilson
2014-06-17  7:32     ` Daniel Vetter
2014-06-17  7:36       ` Chris Wilson
2014-06-17  9:01         ` Daniel Vetter
2014-06-17  6:46   ` Chris Wilson
2014-06-17  7:33     ` Daniel Vetter
2014-06-17  6:49   ` Chris Wilson
2014-06-17  7:36     ` Daniel Vetter
2014-06-17  6:50   ` Chris Wilson
2014-06-17  7:37     ` Daniel Vetter
2014-06-17  7:40       ` Chris Wilson
2014-06-17  7:42         ` Chris Wilson
2014-06-17  6:52   ` Chris Wilson
2014-06-17  7:39     ` Daniel Vetter
2014-06-17  6:54   ` Chris Wilson
2014-06-17  7:45     ` Daniel Vetter
2014-06-17  7:53       ` Chris Wilson
2014-06-17  9:17         ` Daniel Vetter
2014-06-17  6:57   ` Chris Wilson
2014-06-17  7:48     ` Daniel Vetter
2014-06-17  7:55       ` Chris Wilson
2014-06-17  7:00   ` Chris Wilson
2014-06-17  7:52     ` Daniel Vetter
2014-06-17  8:10       ` Chris Wilson
2014-06-17  9:33         ` Daniel Vetter
2014-06-17  9:42           ` Chris Wilson
2014-06-17  9:54             ` Daniel Vetter
2014-06-17 10:00               ` Chris Wilson
2014-06-16 17:51 ` [PATCH 15/15] drm/i915: Fix up PSR frontbuffer tracking Daniel Vetter
2014-06-17  7:02   ` Chris Wilson
2014-06-17  8:06     ` Daniel Vetter
2014-06-17  7:07   ` Chris Wilson
2014-06-17  8:08     ` Daniel Vetter
2014-06-16 19:37 ` [PATCH 00/15] Accurate frontbuffer tracking and psr conversion Chris Wilson
2014-06-16 20:37   ` Daniel Vetter
2014-06-17  7:09 ` Chris Wilson
2014-06-17  9:30   ` 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=20140617072609.GQ5821@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@gmail.com \
    --cc=rodrigo.vivi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.