From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: Ben Widawsky <ben@bwidawsk.net>
Subject: Re: [PATCH 1/2] drm/i915: extract ring sync code
Date: Thu, 22 Mar 2012 09:50:02 +0000 [thread overview]
Message-ID: <d08817$3k7ptv@azsmga001.ch.intel.com> (raw)
In-Reply-To: <1332375553-7174-2-git-send-email-ben@bwidawsk.net>
On Wed, 21 Mar 2012 17:19:12 -0700, Ben Widawsky <ben@bwidawsk.net> wrote:
> We want to use this function elsewhere...
>
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> ---
> drivers/gpu/drm/i915/i915_drv.h | 19 +++++++++
> drivers/gpu/drm/i915/i915_gem.c | 43 ++++++++++++++++++++
> drivers/gpu/drm/i915/i915_gem_execbuffer.c | 60 +---------------------------
> 3 files changed, 63 insertions(+), 59 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index b6098b0..ee691ce 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -38,6 +38,7 @@
> #include <linux/i2c-algo-bit.h>
> #include <drm/intel-gtt.h>
> #include <linux/backlight.h>
> +#include <linux/intel-iommu.h>
>
> /* General customization:
> */
> @@ -1188,6 +1189,8 @@ void i915_gem_lastclose(struct drm_device *dev);
>
> int __must_check i915_mutex_lock_interruptible(struct drm_device *dev);
> int __must_check i915_gem_object_wait_rendering(struct drm_i915_gem_object *obj);
> +int i915_gem_object_sync(struct drm_i915_gem_object *obj,
> + struct intel_ring_buffer *to);
> void i915_gem_object_move_to_active(struct drm_i915_gem_object *obj,
> struct intel_ring_buffer *ring,
> u32 seqno);
> @@ -1282,6 +1285,22 @@ i915_gem_get_unfenced_gtt_alignment(struct drm_device *dev,
> int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
> enum i915_cache_level cache_level);
>
> +static inline bool
> +intel_enable_semaphores(struct drm_device *dev)
> +{
> + if (INTEL_INFO(dev)->gen < 6)
> + return 0;
> +
> + if (i915_semaphores >= 0)
> + return i915_semaphores;
> +
> + /* Enable semaphores on SNB when IO remapping is off */
> + if (INTEL_INFO(dev)->gen == 6)
> + return !intel_iommu_enabled;
> +
> + return 1;
> +}
This doesn't need to go in a header as it is still only used in one
location, unless you are planning more?
> +
> /* i915_gem_gtt.c */
> int __must_check i915_gem_init_aliasing_ppgtt(struct drm_device *dev);
> void i915_gem_cleanup_aliasing_ppgtt(struct drm_device *dev);
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 863e14a..ce2fee5 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2026,6 +2026,49 @@ i915_gem_object_wait_rendering(struct drm_i915_gem_object *obj)
> return 0;
> }
>
> +int
> +i915_gem_object_sync(struct drm_i915_gem_object *obj,
> + struct intel_ring_buffer *to)
> +{
> + struct intel_ring_buffer *from = obj->ring;
> + u32 seqno;
> + int ret, idx;
> +
> + if (from == NULL || to == from)
> + return 0;
> +
> + /* XXX gpu semaphores are implicated in various hard hangs on SNB */
This comment is antiquated as we now know the exact hw snafu that
trigger those hangs. And since you already have explained this comment in
intel_enable_semaphores() we can kill it here.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
next prev parent reply other threads:[~2012-03-22 9:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-22 0:19 [PATCH 0/2] semaphorify the pageflip BO (if possible) Ben Widawsky
2012-03-22 0:19 ` [PATCH 1/2] drm/i915: extract ring sync code Ben Widawsky
2012-03-22 9:50 ` Chris Wilson [this message]
2012-03-22 0:19 ` [PATCH 2/2] drm/i915: use semaphores for the display plane Ben Widawsky
2012-03-22 9:56 ` Chris Wilson
2012-03-22 16:07 ` Ben Widawsky
2012-03-22 16:18 ` Chris Wilson
2012-03-22 16:48 ` Ben Widawsky
2012-03-30 23:38 ` Daniel Vetter
2012-03-30 23:42 ` Chris Wilson
2012-03-29 0:23 ` [PATCH 0/2] semaphorify the pageflip BO (if possible) Ben Widawsky
2012-03-29 8:49 ` 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='d08817$3k7ptv@azsmga001.ch.intel.com' \
--to=chris@chris-wilson.co.uk \
--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