Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Gupta, Sourab" <sourab.gupta@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Goel, Akash" <akash.goel@intel.com>
Subject: Re: [PATCH v6 1/3] drm/i915: Replaced Blitter ring based flips with MMIO flips
Date: Tue, 20 May 2014 18:01:49 +0000	[thread overview]
Message-ID: <1400608955.9396.88.camel@sourabgu-desktop> (raw)
In-Reply-To: <20140520115931.GM11754@nuc-i3427.alporthouse.com>

On Tue, 2014-05-20 at 11:59 +0000, Chris Wilson wrote:
> On Tue, May 20, 2014 at 04:19:46PM +0530, sourab.gupta@intel.com wrote:
> > +int i915_gem_check_olr(struct intel_ring_buffer *ring, u32 seqno);
> 
> Be strict and add __must_check
> 
We'll add this.

> > +static bool intel_use_mmio_flip(struct drm_device *dev)
> > +{
> > +	/* If module parameter is disabled, use CS flips.
> > +	 * Otherwise, use MMIO flips starting from Gen5.
> > +	 * This is not being used for older platforms because of
> > +	 * non-availability of flip done interrupt.
> > +	 */
> 
> What? Where is the dependence on flip-done?

Hi Chris,
>From an earlier mail by Ville, 
"It should work on gen5+ since all of those have a flip done interrupt.
For older platforms we use some clever tricks involving the flip_pending
status bits and vblank irqs. That code won't work for mmio flips. We'd
need to add another way to complete the flips based. That would involve
using the frame counter to make it accurate. To avoid races there we'd
definitely need to use the vblank evade mechanism to make sure we sample
the frame counter within the same frame as when we write the registers.
Also gen2 has the extra complication that it lacks a hardware frame
counter."
So, we had put the Gen5+ check here.

> 
> > +	if (i915.use_mmio_flip == 0)
> > +		return false;
> > +
> > +	if (INTEL_INFO(dev)->gen >= 5)
> > +		return true;
> > +	else
> > +		return false;
> 
> You have not justified the change in default settings for existing hw.
> Your argument is based on media power wells which does not support the
> general change. It would seem that we may want to mix mmio / CS flips
> depending on workload based on your vague statements.
> 

> I quite fancy a tristate here for force-CS flips, force-MMIO flips, at
> driver discretion. Then enabling it on an architecture as a seperate
> patch with justification - it is then easier to do each architecture on
> a case-by-case basis and revert if need be.
> 
We agree that the using mmio flips gives better residency in cases where
render and blitter engines reside in different power wells. This is
helpful in case of pure 3D workloads on valleyview. We have enabled it
in the second patch of series for valleyview.
This patch has put forth 2 states - 0 for force-CS flips and 1 for
force-MMIO flips. The second patch in this series enables it for
Valleyview architecture.

> > +static int intel_postpone_flip(struct drm_i915_gem_object *obj)
> > +{
> > +	int ret;
> 
> if (WARN_ON(crtc->mmio_flip_data.seqno)) return -EBUSY;
> 
> You need a tiling check here as you do not update dspcntr. Or fix
> mmio_done.
> 
We were not updating dspcntr here because atomicity concerns. We could
add tiling update also if its ok in that regard.
Ville, what's your opinion here.
> > +	if (!obj->ring)
> > +		return 0;
> > +
> > +	if (i915_seqno_passed(obj->ring->get_seqno(obj->ring, true),
> > +				obj->last_write_seqno))
> > +		return 0;
> > +
> > +	if (ret = i915_gem_check_olr(obj->ring, obj->last_write_seqno))
> > +		return ret;
> 
> Please don't anger gcc.
> 
> > +
> > +	if (WARN_ON(!obj->ring->irq_get(obj->ring)))
> > +		return 0;
> > +
> > +	return 1;
> > +}
> 
> > @@ -11377,6 +11497,9 @@ static void intel_init_display(struct drm_device *dev)
> >  		break;
> >  	}
> >  
> > +	if(intel_use_mmio_flip(dev))
> 
> Please don't anger checkpatch.
> 
> > +		dev_priv->display.queue_flip = intel_queue_mmio_flip;
> > +
> >  	intel_panel_init_backlight_funcs(dev);
> >  }
> >  
> > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> > index 32a74e1..08d65a4 100644
> > --- a/drivers/gpu/drm/i915/intel_drv.h
> > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > @@ -351,6 +351,11 @@ struct intel_pipe_wm {
> >  	bool sprites_scaled;
> >  };
> >  
> > +struct intel_mmio_flip {
> > +	u32 seqno;
> > +	u32 ring_id;
> > +};
> > +
> >  struct intel_crtc {
> >  	struct drm_crtc base;
> >  	enum pipe pipe;
> > @@ -403,6 +408,7 @@ struct intel_crtc {
> >  	} wm;
> >  
> >  	wait_queue_head_t vbl_wait;
> > +	struct intel_mmio_flip mmio_flip_data;
> 
> Does _data add anything meaningful here to the description of mmio_flip?
> Just mmio_flip will suffice, as pending_mmio_flip is overkill but would
> make a useful comment.
> -Chris

  reply	other threads:[~2014-05-20 18:02 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ä
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 [this message]
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=1400608955.9396.88.camel@sourabgu-desktop \
    --to=sourab.gupta@intel.com \
    --cc=akash.goel@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.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