public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Damien Lespiau <damien.lespiau@intel.com>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: Intel GFX <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 01/18] [v2] drm/i915: Comments for semaphore clarification
Date: Wed, 29 May 2013 17:02:40 +0100	[thread overview]
Message-ID: <20130529160240.GD17389@strange.amr.corp.intel.com> (raw)
In-Reply-To: <1369794154-1639-2-git-send-email-ben@bwidawsk.net>

On Tue, May 28, 2013 at 07:22:17PM -0700, Ben Widawsky wrote:
> Semaphores are tied very closely to the rings in the GPU. Trivial patch
> adds comments to the existing code so that when we add new rings we can
> include comments there as well. It also helps distinguish the ring to
> semaphore mailbox interactions by using the ringname in the semaphore
> data structures.
> 
> This patch should have no functional impact.
> 
> v2: The English parts (as opposed to register names) of the comments
> were reversed. (Damien)
> 
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>

-- 
Damien

> ---
>  drivers/gpu/drm/i915/i915_reg.h         | 12 ++++++------
>  drivers/gpu/drm/i915/intel_ringbuffer.c | 18 +++++++++---------
>  drivers/gpu/drm/i915/intel_ringbuffer.h |  4 ++--
>  3 files changed, 17 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index dbd9de5..6579d0c 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -265,12 +265,12 @@
>  #define  MI_SEMAPHORE_UPDATE	    (1<<21)
>  #define  MI_SEMAPHORE_COMPARE	    (1<<20)
>  #define  MI_SEMAPHORE_REGISTER	    (1<<18)
> -#define  MI_SEMAPHORE_SYNC_RV	    (2<<16)
> -#define  MI_SEMAPHORE_SYNC_RB	    (0<<16)
> -#define  MI_SEMAPHORE_SYNC_VR	    (0<<16)
> -#define  MI_SEMAPHORE_SYNC_VB	    (2<<16)
> -#define  MI_SEMAPHORE_SYNC_BR	    (2<<16)
> -#define  MI_SEMAPHORE_SYNC_BV	    (0<<16)
> +#define  MI_SEMAPHORE_SYNC_RB	    (0<<16) /* BCS wait for RCS  (BRSYNC) */
> +#define  MI_SEMAPHORE_SYNC_RV	    (2<<16) /* VCS wait for RCS  (VRSYNC) */
> +#define  MI_SEMAPHORE_SYNC_VR	    (0<<16) /* RCS wait for VCS  (RVSYNC) */
> +#define  MI_SEMAPHORE_SYNC_VB	    (2<<16) /* BCS wait for VCS  (BVSYNC) */
> +#define  MI_SEMAPHORE_SYNC_BV	    (0<<16) /* VCS wait for BCS  (VBSYNC) */
> +#define  MI_SEMAPHORE_SYNC_BR	    (2<<16) /* RCS wait for BCS  (RBSYNC) */
>  #define  MI_SEMAPHORE_SYNC_INVALID  (1<<0)
>  /*
>   * 3D instructions used by the kernel
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index 9b97cf6..2d2a362 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -1671,9 +1671,9 @@ int intel_init_render_ring_buffer(struct drm_device *dev)
>  		ring->get_seqno = gen6_ring_get_seqno;
>  		ring->set_seqno = ring_set_seqno;
>  		ring->sync_to = gen6_ring_sync;
> -		ring->semaphore_register[0] = MI_SEMAPHORE_SYNC_INVALID;
> -		ring->semaphore_register[1] = MI_SEMAPHORE_SYNC_RV;
> -		ring->semaphore_register[2] = MI_SEMAPHORE_SYNC_RB;
> +		ring->semaphore_register[RCS] = MI_SEMAPHORE_SYNC_INVALID;
> +		ring->semaphore_register[VCS] = MI_SEMAPHORE_SYNC_RV;
> +		ring->semaphore_register[BCS] = MI_SEMAPHORE_SYNC_RB;
>  		ring->signal_mbox[0] = GEN6_VRSYNC;
>  		ring->signal_mbox[1] = GEN6_BRSYNC;
>  	} else if (IS_GEN5(dev)) {
> @@ -1830,9 +1830,9 @@ int intel_init_bsd_ring_buffer(struct drm_device *dev)
>  		ring->irq_put = gen6_ring_put_irq;
>  		ring->dispatch_execbuffer = gen6_ring_dispatch_execbuffer;
>  		ring->sync_to = gen6_ring_sync;
> -		ring->semaphore_register[0] = MI_SEMAPHORE_SYNC_VR;
> -		ring->semaphore_register[1] = MI_SEMAPHORE_SYNC_INVALID;
> -		ring->semaphore_register[2] = MI_SEMAPHORE_SYNC_VB;
> +		ring->semaphore_register[RCS] = MI_SEMAPHORE_SYNC_VR;
> +		ring->semaphore_register[VCS] = MI_SEMAPHORE_SYNC_INVALID;
> +		ring->semaphore_register[BCS] = MI_SEMAPHORE_SYNC_VB;
>  		ring->signal_mbox[0] = GEN6_RVSYNC;
>  		ring->signal_mbox[1] = GEN6_BVSYNC;
>  	} else {
> @@ -1876,9 +1876,9 @@ int intel_init_blt_ring_buffer(struct drm_device *dev)
>  	ring->irq_put = gen6_ring_put_irq;
>  	ring->dispatch_execbuffer = gen6_ring_dispatch_execbuffer;
>  	ring->sync_to = gen6_ring_sync;
> -	ring->semaphore_register[0] = MI_SEMAPHORE_SYNC_BR;
> -	ring->semaphore_register[1] = MI_SEMAPHORE_SYNC_BV;
> -	ring->semaphore_register[2] = MI_SEMAPHORE_SYNC_INVALID;
> +	ring->semaphore_register[RCS] = MI_SEMAPHORE_SYNC_BR;
> +	ring->semaphore_register[VCS] = MI_SEMAPHORE_SYNC_BV;
> +	ring->semaphore_register[BCS] = MI_SEMAPHORE_SYNC_INVALID;
>  	ring->signal_mbox[0] = GEN6_RBSYNC;
>  	ring->signal_mbox[1] = GEN6_VBSYNC;
>  	ring->init = init_ring_common;
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
> index ef374a8..24268fb 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.h
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
> @@ -105,8 +105,8 @@ struct  intel_ring_buffer {
>  	int		(*sync_to)(struct intel_ring_buffer *ring,
>  				   struct intel_ring_buffer *to,
>  				   u32 seqno);
> -
> -	u32		semaphore_register[3]; /*our mbox written by others */
> +	/* our mbox written by others */
> +	u32		semaphore_register[I915_NUM_RINGS];
>  	u32		signal_mbox[2]; /* mboxes this ring signals to */
>  	/**
>  	 * List of objects currently involved in rendering from the
> -- 
> 1.8.3
> 

  reply	other threads:[~2013-05-29 16:02 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-28  0:59 [PATCH 00/18] Introduce the Haswell VECS Ben Widawsky
2013-04-28  0:59 ` [PATCH 01/18] drm/i915: Comments for semaphore clarification Ben Widawsky
2013-05-07 13:54   ` Damien Lespiau
2013-05-07 16:51     ` Ben Widawsky
2013-05-07 17:00       ` Ben Widawsky
2013-04-28  0:59 ` [PATCH 02/18] drm/i915: Semaphore MBOX update generalization Ben Widawsky
2013-05-07 15:34   ` Damien Lespiau
2013-05-08  5:17     ` Ben Widawsky
2013-04-28  0:59 ` [PATCH 03/18] drm/i915: Introduce VECS: the 4th ring Ben Widawsky
2013-05-07 15:35   ` Damien Lespiau
2013-04-28  0:59 ` [PATCH 04/18] drm/i915: Add VECS semaphore bits Ben Widawsky
2013-05-07 14:49   ` Damien Lespiau
2013-05-08  5:59     ` Ben Widawsky
2013-04-28  0:59 ` [PATCH 05/18] drm/i915: Rename ring flush functions Ben Widawsky
2013-05-07 17:28   ` Damien Lespiau
2013-04-28  0:59 ` [PATCH 06/18] drm/i915: add HAS_VEBOX Ben Widawsky
2013-05-07 14:59   ` Damien Lespiau
2013-04-28  0:59 ` [PATCH 07/18] drm/i915: Vebox ringbuffer init Ben Widawsky
2013-05-07 17:16   ` Damien Lespiau
2013-04-28  0:59 ` [PATCH 08/18] drm/i915: Create a more generic pm handler for hsw+ Ben Widawsky
2013-05-28 13:00   ` Damien Lespiau
2013-04-28  0:59 ` [PATCH 09/18] drm/i915: make PM interrupt writes non-destructive Ben Widawsky
2013-05-28 13:30   ` Damien Lespiau
2013-05-28 18:02     ` Ben Widawsky
2013-04-28  0:59 ` [PATCH 10/18] drm/i915: Create an ivybridge_irq_preinstall Ben Widawsky
2013-05-28 13:37   ` Damien Lespiau
2013-04-28  0:59 ` [PATCH 11/18] drm/i915: Add PM regs to pre install Ben Widawsky
2013-05-28 13:38   ` Damien Lespiau
2013-04-28  0:59 ` [PATCH 12/18] drm/i915: Convert irq_refounct to struct Ben Widawsky
2013-05-28 13:40   ` Damien Lespiau
2013-04-28  0:59 ` [PATCH 13/18] drm/i915: consolidate interrupt naming scheme Ben Widawsky
2013-05-28 14:01   ` Damien Lespiau
2013-05-28 18:50     ` Ben Widawsky
2013-05-29 15:51       ` Damien Lespiau
2013-04-28  0:59 ` [PATCH 14/18] drm/i915: vebox interrupt get/put Ben Widawsky
2013-05-28 14:38   ` Damien Lespiau
2013-04-28  0:59 ` [PATCH 15/18] drm/i915: Enable vebox interrupts Ben Widawsky
2013-05-28 14:52   ` Damien Lespiau
2013-04-28  0:59 ` [PATCH 16/18] drm/i915: add VEBOX into debugfs Ben Widawsky
2013-05-28 15:06   ` Damien Lespiau
2013-05-28 18:44     ` Ben Widawsky
2013-04-28  0:59 ` [PATCH 17/18] drm/i915: add I915_EXEC_VEBOX to i915_gem_do_execbuffer() Ben Widawsky
2013-05-28 15:08   ` Damien Lespiau
2013-04-28  0:59 ` [PATCH 18/18] drm/i915: add I915_PARAM_HAS_VEBOX to i915_getparam Ben Widawsky
2013-05-28 15:10   ` Damien Lespiau
2013-04-30 21:25 ` [PATCH 00/18] Introduce the Haswell VECS Jesse Barnes
2013-05-08  6:13 ` Ben Widawsky
2013-05-09  9:07   ` Li, Zhong
2013-05-29  2:22 ` [PATCH 00/18] Introduce the Haswell VECS v2 Ben Widawsky
2013-05-29  2:22   ` [PATCH 01/18] [v2] drm/i915: Comments for semaphore clarification Ben Widawsky
2013-05-29 16:02     ` Damien Lespiau [this message]
2013-05-29  2:22   ` [PATCH 02/18] drm/i915: Semaphore MBOX update generalization Ben Widawsky
2013-05-29 16:05     ` Damien Lespiau
2013-05-29  2:22   ` [PATCH 03/18] drm/i915: Introduce VECS: the 4th ring Ben Widawsky
2013-05-29 19:10     ` Daniel Vetter
2013-05-29  2:22   ` [PATCH 04/18] [v2] drm/i915: Add VECS semaphore bits Ben Widawsky
2013-05-29 16:06     ` Damien Lespiau
2013-05-29  2:22   ` [PATCH 05/18] drm/i915: Rename ring flush functions Ben Widawsky
2013-05-29  2:22   ` [PATCH 06/18] drm/i915: add HAS_VEBOX Ben Widawsky
2013-05-29  2:22   ` [PATCH 07/18] [v2] drm/i915: Vebox ringbuffer init Ben Widawsky
2013-05-29  2:22   ` [PATCH 08/18] drm/i915: Create a more generic pm handler for hsw+ Ben Widawsky
2013-05-29 19:19     ` Daniel Vetter
2013-05-31 18:25       ` Daniel Vetter
2013-05-29  2:22   ` [PATCH 09/18] [v2] drm/i915: Create an ivybridge_irq_preinstall Ben Widawsky
2013-05-29 16:23     ` Damien Lespiau
2013-05-29 19:48       ` Daniel Vetter
2013-05-29  2:22   ` [PATCH 10/18] [v2] drm/i915: Add PM regs to pre/post install Ben Widawsky
2013-05-29 17:04     ` Damien Lespiau
2013-05-29  2:22   ` [PATCH 11/18] [v5] drm/i915: make PM interrupt writes non-destructive Ben Widawsky
2013-05-29 17:02     ` Damien Lespiau
2013-05-29  2:22   ` [PATCH 12/18] drm/i915: Convert irq_refounct to struct Ben Widawsky
2013-05-29  2:22   ` [PATCH 13/18] [v2] drm/i915: consolidate interrupt naming scheme Ben Widawsky
2013-05-29  2:22   ` [PATCH 14/18] [v2] drm/i915: vebox interrupt get/put Ben Widawsky
2013-05-29  2:22   ` [PATCH 15/18] [v3] drm/i915: Enable vebox interrupts Ben Widawsky
2013-05-29  2:22   ` [PATCH 16/18] [v2] drm/i915: add VEBOX into debugfs Ben Widawsky
2013-05-29 16:22     ` [PATCH 16/18] [v3] " Ben Widawsky
2013-05-29 16:44       ` Damien Lespiau
2013-05-29  2:22   ` [PATCH 17/18] drm/i915: add I915_EXEC_VEBOX to i915_gem_do_execbuffer() Ben Widawsky
2013-05-29  2:22   ` [PATCH 18/18] drm/i915: add I915_PARAM_HAS_VEBOX to i915_getparam Ben Widawsky
2013-05-31 18:52     ` Daniel Vetter
2013-05-31 19:52       ` Ben Widawsky
2013-05-31 20:08         ` 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=20130529160240.GD17389@strange.amr.corp.intel.com \
    --to=damien.lespiau@intel.com \
    --cc=ben@bwidawsk.net \
    --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