From: Daniel Vetter <daniel@ffwll.ch>
To: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Intel GFX <intel-gfx@lists.freedesktop.org>,
Ben Widawsky <ben@bwidawsk.net>
Subject: Re: [PATCH 1/7] [v2] drm/i915: Create a USES_PPGTT macro
Date: Tue, 28 Jan 2014 09:14:12 +0100 [thread overview]
Message-ID: <20140128081412.GN9772@phenom.ffwll.local> (raw)
In-Reply-To: <1390892826-26973-1-git-send-email-benjamin.widawsky@intel.com>
On Mon, Jan 27, 2014 at 11:07:00PM -0800, Ben Widawsky wrote:
> There are cases where we want to know if there is a full, or aliased
> PPGTT. Currently, in fact the only distinction we ever need to make is
> when we're using full PPGTT.
>
> This patch is simply to promote readability and clarify for the
> confusing existing usage where "aliasing" meant aliasing and full.
>
> v2: Remove USES_ALIASING_PPGTT since there are currently no cases where
> we need to check if we're using aliasing, but not full PPGTT. (Daniel)
>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Queued for -next, thanks for the patch.
-Daniel
> ---
> drivers/gpu/drm/i915/i915_drv.h | 5 +++--
> drivers/gpu/drm/i915/i915_gem_context.c | 6 +++---
> 2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 4a86d56..d08064e 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1839,8 +1839,9 @@ struct drm_i915_file_private {
>
> #define HAS_HW_CONTEXTS(dev) (INTEL_INFO(dev)->gen >= 6)
> #define HAS_ALIASING_PPGTT(dev) (INTEL_INFO(dev)->gen >= 6 && !IS_VALLEYVIEW(dev))
> -#define HAS_PPGTT(dev) (INTEL_INFO(dev)->gen >= 7 && !IS_VALLEYVIEW(dev) && !IS_BROADWELL(dev))
> -#define USES_ALIASING_PPGTT(dev) intel_enable_ppgtt(dev, false)
> +#define HAS_PPGTT(dev) (INTEL_INFO(dev)->gen >= 7 && !IS_VALLEYVIEW(dev) \
> + && !IS_BROADWELL(dev))
> +#define USES_PPGTT(dev) intel_enable_ppgtt(dev, false)
> #define USES_FULL_PPGTT(dev) intel_enable_ppgtt(dev, true)
>
> #define HAS_OVERLAY(dev) (INTEL_INFO(dev)->has_overlay)
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> index 1c94082..5d4183f 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> @@ -142,7 +142,7 @@ void i915_gem_context_free(struct kref *ctx_ref)
> struct i915_hw_ppgtt *ppgtt = NULL;
>
> /* We refcount even the aliasing PPGTT to keep the code symmetric */
> - if (USES_ALIASING_PPGTT(ctx->obj->base.dev))
> + if (USES_PPGTT(ctx->obj->base.dev))
> ppgtt = ctx_to_ppgtt(ctx);
>
> /* XXX: Free up the object before tearing down the address space, in
> @@ -291,7 +291,7 @@ i915_gem_create_context(struct drm_device *dev,
>
> dev_priv->mm.aliasing_ppgtt = ppgtt;
> }
> - } else if (USES_ALIASING_PPGTT(dev)) {
> + } else if (USES_PPGTT(dev)) {
> /* For platforms which only have aliasing PPGTT, we fake the
> * address space and refcounting. */
> ctx->vm = &dev_priv->mm.aliasing_ppgtt->base;
> @@ -373,7 +373,7 @@ int i915_gem_context_init(struct drm_device *dev)
> }
>
> dev_priv->ring[RCS].default_context =
> - i915_gem_create_context(dev, NULL, USES_ALIASING_PPGTT(dev));
> + i915_gem_create_context(dev, NULL, USES_PPGTT(dev));
>
> if (IS_ERR_OR_NULL(dev_priv->ring[RCS].default_context)) {
> DRM_DEBUG_DRIVER("Disabling HW Contexts; create failed %ld\n",
> --
> 1.8.5.3
>
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
prev parent reply other threads:[~2014-01-28 8:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-28 7:07 [PATCH 1/7] [v2] drm/i915: Create a USES_PPGTT macro Ben Widawsky
2014-01-28 7:07 ` [PATCH 2/7] drm/i915: Extract register state error capture Ben Widawsky
2014-01-28 11:33 ` Chris Wilson
2014-01-28 7:07 ` [PATCH 3/7] drm/i915: Logically reorder error register capture Ben Widawsky
2014-01-28 11:37 ` Chris Wilson
2014-01-28 7:07 ` [PATCH 4/7] drm/i915: Reorder struct members Ben Widawsky
2014-01-28 11:39 ` Chris Wilson
2014-01-28 7:07 ` [PATCH 5/7] drm/i915: Move per ring error state to ring_error Ben Widawsky
2014-01-28 11:42 ` Chris Wilson
2014-01-28 7:07 ` [PATCH 6/7] drm/i915: Add some more registers to error state Ben Widawsky
2014-01-28 11:43 ` Chris Wilson
2014-01-28 7:07 ` [PATCH 7/7] [v2] drm/i915: Capture PPGTT info on error capture Ben Widawsky
2014-01-28 11:47 ` Chris Wilson
2014-01-28 8:14 ` Daniel Vetter [this message]
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=20140128081412.GN9772@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=ben@bwidawsk.net \
--cc=benjamin.widawsky@intel.com \
--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