public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Gupta, Sourab" <sourab.gupta@intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Goel, Akash" <akash.goel@intel.com>
Subject: Re: [PATCH v4] drm/i915: Replaced Blitter ring based flips with MMIO flips for VLV
Date: Fri, 16 May 2014 15:51:15 +0300	[thread overview]
Message-ID: <20140516125115.GR27580@intel.com> (raw)
In-Reply-To: <1400243696.9396.66.camel@sourabgu-desktop>

On Fri, May 16, 2014 at 12:34:08PM +0000, Gupta, Sourab wrote:
> On Thu, 2014-05-15 at 12:27 +0000, Ville Syrjälä wrote:
> > On Thu, May 15, 2014 at 11:47:37AM +0530, sourab.gupta@intel.com wrote:
> > > From: Sourab Gupta <sourab.gupta@intel.com>
> > > 
> > > Using MMIO based flips on Gen5+ for Media power well residency optimization.
> > > The blitter ring is currently being used just for command streamer based
> > > flip calls. For pure 3D workloads, with MMIO flips, there will be no use
> > > of blitter ring and this will ensure the 100% residency for Media well.
> > > 
> > > In a subsequent patch, we can make the selection between CS vs MMIO flip
> > > based on a module parameter to give more testing coverage.
> > > 
> > > v2: The MMIO flips now use the interrupt driven mechanism for issuing the
> > > flips when target seqno is reached. (Incorporating Ville's idea)
> > > 
> > > v3: Rebasing on latest code. Code restructuring after incorporating
> > > Damien's comments
> > > 
> > > v4: Addressing Ville's review comments
> > >     -general cleanup
> > >     -updating only base addr instead of calling update_primary_plane
> > >     -extending patch for gen5+ platforms
> > > 
> > > Signed-off-by: Sourab Gupta <sourab.gupta@intel.com>
> > > Signed-off-by: Akash Goel <akash.goel@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/i915_dma.c      |   1 +
> > >  drivers/gpu/drm/i915/i915_drv.h      |   6 ++
> > >  drivers/gpu/drm/i915/i915_gem.c      |   2 +-
> > >  drivers/gpu/drm/i915/i915_irq.c      |   2 +
> > >  drivers/gpu/drm/i915/intel_display.c | 115 +++++++++++++++++++++++++++++++++++
> > >  drivers/gpu/drm/i915/intel_drv.h     |   6 ++
> > >  6 files changed, 131 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> > > index 46f1dec..672c28f 100644
> > > --- a/drivers/gpu/drm/i915/i915_dma.c
> > > +++ b/drivers/gpu/drm/i915/i915_dma.c
> > > @@ -1570,6 +1570,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
> > >  	spin_lock_init(&dev_priv->backlight_lock);
> > >  	spin_lock_init(&dev_priv->uncore.lock);
> > >  	spin_lock_init(&dev_priv->mm.object_stat_lock);
> > > +	spin_lock_init(&dev_priv->mmio_flip_lock);
> > >  	dev_priv->ring_index = 0;
> > >  	mutex_init(&dev_priv->dpio_lock);
> > >  	mutex_init(&dev_priv->modeset_restore_lock);
> > > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > > index 4006dfe..38c0820 100644
> > > --- a/drivers/gpu/drm/i915/i915_drv.h
> > > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > > @@ -1543,6 +1543,8 @@ struct drm_i915_private {
> > >  	struct i915_ums_state ums;
> > >  	/* the indicator for dispatch video commands on two BSD rings */
> > >  	int ring_index;
> > > +	/* protects the mmio flip data */
> > > +	spinlock_t mmio_flip_lock;
> > >  };
> > >  
> > >  static inline struct drm_i915_private *to_i915(const struct drm_device *dev)
> > > @@ -2209,6 +2211,7 @@ bool i915_gem_retire_requests(struct drm_device *dev);
> > >  void i915_gem_retire_requests_ring(struct intel_ring_buffer *ring);
> > >  int __must_check i915_gem_check_wedge(struct i915_gpu_error *error,
> > >  				      bool interruptible);
> > > +int i915_gem_check_olr(struct intel_ring_buffer *ring, u32 seqno);
> > >  static inline bool i915_reset_in_progress(struct i915_gpu_error *error)
> > >  {
> > >  	return unlikely(atomic_read(&error->reset_counter)
> > > @@ -2580,6 +2583,9 @@ int i915_reg_read_ioctl(struct drm_device *dev, void *data,
> > >  int i915_get_reset_stats_ioctl(struct drm_device *dev, void *data,
> > >  			       struct drm_file *file);
> > >  
> > > +void intel_notify_mmio_flip(struct drm_device *dev,
> > > +			struct intel_ring_buffer *ring);
> > > +
> > >  /* overlay */
> > >  extern struct intel_overlay_error_state *intel_overlay_capture_error_state(struct drm_device *dev);
> > >  extern void intel_overlay_print_error_state(struct drm_i915_error_state_buf *e,
> > > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> > > index fa5b5ab..5b4e953 100644
> > > --- a/drivers/gpu/drm/i915/i915_gem.c
> > > +++ b/drivers/gpu/drm/i915/i915_gem.c
> > > @@ -975,7 +975,7 @@ i915_gem_check_wedge(struct i915_gpu_error *error,
> > >   * Compare seqno against outstanding lazy request. Emit a request if they are
> > >   * equal.
> > >   */
> > > -static int
> > > +int
> > >  i915_gem_check_olr(struct intel_ring_buffer *ring, u32 seqno)
> > >  {
> > >  	int ret;
> > > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> > > index b10fbde..a353693 100644
> > > --- a/drivers/gpu/drm/i915/i915_irq.c
> > > +++ b/drivers/gpu/drm/i915/i915_irq.c
> > > @@ -1084,6 +1084,8 @@ static void notify_ring(struct drm_device *dev,
> > >  
> > >  	trace_i915_gem_request_complete(ring);
> > >  
> > > +	intel_notify_mmio_flip(dev, ring);
> > > +
> > 
> > Hmm. How badly is this going to explode with UMS?
> 
> Hi Ville,
> It seems there would be a small race between the page filp done intr and
> the flip done interrupt from previous set base. But it seems to be the
> case for CS flips also. In both cases, once we do the
> mark_page_flip_active, there may be a window in which page flip intr
> from previous set base may arrive.
> Have we interpreted the race correctly? Or are we missing something
> here?

Yes. See here for my patches to fix the mmio vs. CS race:
http://lists.freedesktop.org/archives/intel-gfx/2014-April/043759.html
Feel free to review that stuff if you have a bit of time.

I've not had time to think about the mmio vs. mmio case yet. Perhaps my
patches would fix that too?

> 
> Also, notify_mmio_flip is being called from notify_ring function.
> Not sure of the scenario in which it may explode with UMS. Can you
> please elaborate more.

With UMS we have no modeset structures (drm_crtcs and whatnot). So the
crtc list walk will probably explode.

Hmm. I guess we could just init all the mode_config lists even w/ UMS,
so that the code will just see an empty list. Does anyone see any
problems with that?

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2014-05-16 12:51 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-09 11:26 [PATCH 0/2] Using MMIO based flips on VLV akash.goel
2014-01-09 11:26 ` [PATCH 1/2] drm/i915: Creating a new workqueue to handle MMIO flip work items akash.goel
2014-01-09 11:26 ` [PATCH 2/2] drm/i915/vlv: Replaced Blitter ring based flips with MMIO Flips for VLV akash.goel
2014-01-09 11:31   ` Chris Wilson
2014-01-13  9:47     ` Goel, Akash
2014-02-07 11:59       ` Goel, Akash
2014-02-07 14:47         ` Daniel Vetter
2014-02-07 17:17           ` Goel, Akash
     [not found]           ` <8BF5CF93467D8C498F250C96583BC09CC718E3@BGSMSX103.gar.corp.intel.com>
2014-03-07 13:17             ` Gupta, Sourab
2014-03-07 13:30               ` Ville Syrjälä
2014-03-13  7:21                 ` [PATCH] drm/i915: Replaced Blitter ring based flips with MMIO flips " sourab.gupta
2014-03-13  9:01                 ` [PATCH v2] " sourab.gupta
2014-03-17  4:33                   ` Gupta, Sourab
2014-03-21 17:10                   ` Gupta, Sourab
2014-03-21 18:15                   ` Damien Lespiau
2014-03-23  9:01                     ` [PATCH v3] " sourab.gupta
2014-03-26  7:49                       ` Gupta, Sourab
2014-04-03  8:40                         ` Gupta, Sourab
2014-04-07 11:19                           ` Gupta, Sourab
2014-05-09 11:59                       ` Ville Syrjälä
2014-05-09 13:28                         ` Ville Syrjälä
2014-05-09 17:18                         ` Ville Syrjälä
2014-05-15  6:17                           ` [PATCH v4] " sourab.gupta
2014-05-15 12:27                             ` Ville Syrjälä
2014-05-16 12:34                               ` Gupta, Sourab
2014-05-16 12:51                                 ` Ville Syrjälä [this message]
2014-05-19  9:19                                   ` Gupta, Sourab
2014-05-19 10:58                                   ` [PATCH v5] " sourab.gupta
2014-05-19 11:47                                     ` Ville Syrjälä
2014-05-19 12:29                                       ` Daniel Vetter
2014-05-19 13:06                                         ` Ville Syrjälä
2014-05-19 13:41                                           ` Daniel Vetter
2014-05-20 10:49                                             ` [PATCH 0/3] Replace Blitter ring based flips with MMIO flips sourab.gupta
2014-05-20 10:49                                               ` [PATCH v6 1/3] drm/i915: Replaced " sourab.gupta
2014-05-20 11:59                                                 ` Chris Wilson
2014-05-20 18:01                                                   ` Gupta, Sourab
2014-05-22 14:36                                                     ` [PATCH v2 0/3] Replace " sourab.gupta
2014-05-22 14:36                                                       ` [PATCH v7 1/3] drm/i915: Replaced " sourab.gupta
2014-05-27 12:52                                                         ` Ville Syrjälä
2014-05-27 13:09                                                           ` Daniel Vetter
2014-05-28  7:12                                                             ` [PATCH v3 0/2] Replace " sourab.gupta
2014-05-28  7:12                                                               ` [PATCH 1/2] drm/i915: Replaced " sourab.gupta
2014-05-28  7:30                                                                 ` Chris Wilson
2014-05-28  9:42                                                                   ` Gupta, Sourab
2014-05-28  7:31                                                                 ` Chris Wilson
2014-05-28  8:12                                                                   ` Ville Syrjälä
2014-05-28  7:12                                                               ` [PATCH 2/2] drm/i915: Default to mmio flips on VLV sourab.gupta
2014-05-28  9:56                                                                 ` Chris Wilson
2014-05-29  9:40                                                                   ` [PATCH v4 0/3] Replace Blitter ring based flips with MMIO flips sourab.gupta
2014-05-29  9:40                                                                     ` [PATCH v9 1/3] drm/i915: Replaced " sourab.gupta
2014-05-30 10:31                                                                       ` Chris Wilson
2014-05-29  9:40                                                                     ` [PATCH 2/3] drm/i915: Selection of MMIO vs CS flip at page flip time sourab.gupta
2014-05-29  9:40                                                                     ` [PATCH 3/3] drm/i915: Make module param for MMIO flip selection as tristate sourab.gupta
2014-05-30 10:49                                                                       ` Chris Wilson
2014-06-01 11:13                                                                         ` [PATCH v10] drm/i915: Replaced Blitter ring based flips with MMIO flips sourab.gupta
2014-06-02  6:56                                                                           ` Chris Wilson
2014-06-02 10:38                                                                             ` Gupta, Sourab
2014-06-02 10:56                                                                               ` Chris Wilson
2014-06-02 11:17                                                                                 ` [PATCH v11] " sourab.gupta
2014-06-17 14:14                                                                                   ` Daniel Vetter
2014-06-17 14:17                                                                                     ` Chris Wilson
2014-05-22 14:36                                                       ` [PATCH 2/3] drm/i915: Default to mmio flips on VLV sourab.gupta
2014-05-22 14:36                                                       ` [PATCH 3/3] drm/i915: Fix mmio page flip vs mmio set base race sourab.gupta
2014-05-26  8:51                                                       ` [PATCH v2 0/3] Replace Blitter ring based flips with MMIO flips Gupta, Sourab
2014-05-20 10:49                                               ` [PATCH 2/3] drm/i915: Default to mmio flips on VLV sourab.gupta
2014-05-20 10:49                                               ` [PATCH 3/3] drm/i915: Fix mmio page flip vs mmio set base race sourab.gupta
2014-01-09 11:29 ` [PATCH 0/2] Using MMIO based flips on VLV Chris Wilson

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=20140516125115.GR27580@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=akash.goel@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=sourab.gupta@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