All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 07/15] drm/i915: clean up PPGTT checking logic
Date: Wed, 6 Aug 2014 10:21:19 +0200	[thread overview]
Message-ID: <20140806082119.GU8727@phenom.ffwll.local> (raw)
In-Reply-To: <1407250286-1801-8-git-send-email-rodrigo.vivi@intel.com>

On Tue, Aug 05, 2014 at 07:51:18AM -0700, Rodrigo Vivi wrote:
> From: Jesse Barnes <jbarnes@virtuousgeek.org>
> 
> sanitize_enable_ppgtt is the function that checks all the conditions,
> honoring a forced ppgtt status or doing auto-detect as necessary.  Just
> make sure it returns the right value in all cases and use that in the
> macros instead of the confusing intel_enable_ppgtt() function.
> 
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h     |  4 ++--
>  drivers/gpu/drm/i915/i915_gem_gtt.c | 14 +++-----------
>  drivers/gpu/drm/i915/i915_gem_gtt.h |  1 -
>  3 files changed, 5 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 5de27f9..67e9da0 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2048,8 +2048,8 @@ struct drm_i915_cmd_table {
>  #define HAS_HW_CONTEXTS(dev)	(INTEL_INFO(dev)->gen >= 6)
>  #define HAS_ALIASING_PPGTT(dev)	(INTEL_INFO(dev)->gen >= 6)
>  #define HAS_PPGTT(dev)		(INTEL_INFO(dev)->gen >= 7 && !IS_GEN8(dev))
> -#define USES_PPGTT(dev)		intel_enable_ppgtt(dev, false)
> -#define USES_FULL_PPGTT(dev)	intel_enable_ppgtt(dev, true)
> +#define USES_PPGTT(dev)		(i915.enable_ppgtt)
> +#define USES_FULL_PPGTT(dev)	(i915.enable_ppgtt == 2)
>  
>  #define HAS_OVERLAY(dev)		(INTEL_INFO(dev)->has_overlay)
>  #define OVERLAY_NEEDS_PHYSICAL(dev)	(INTEL_INFO(dev)->overlay_needs_physical)
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 5188936..ffa4bb3 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -33,17 +33,6 @@
>  static void bdw_setup_private_ppat(struct drm_i915_private *dev_priv);
>  static void chv_setup_private_ppat(struct drm_i915_private *dev_priv);
>  
> -bool intel_enable_ppgtt(struct drm_device *dev, bool full)
> -{
> -	if (i915.enable_ppgtt == 0)
> -		return false;
> -
> -	if (i915.enable_ppgtt == 1 && full)
> -		return false;
> -
> -	return true;
> -}
> -
>  static int sanitize_enable_ppgtt(struct drm_device *dev, int enable_ppgtt)
>  {
>  	if (enable_ppgtt == 0 || !HAS_ALIASING_PPGTT(dev))
> @@ -70,6 +59,9 @@ static int sanitize_enable_ppgtt(struct drm_device *dev, int enable_ppgtt)
>  		return 0;
>  	}
>  
> +	if (HAS_PPGTT(dev))
> +		return 2;

This reeneables ppgtt throught the backdoor. Dropped this hunk and merged
the patch.
-Daniel

> +
>  	return HAS_ALIASING_PPGTT(dev) ? 1 : 0;
>  }
>  
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h
> index 8d6f7c1..666c938 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.h
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
> @@ -272,7 +272,6 @@ void i915_gem_init_global_gtt(struct drm_device *dev);
>  void i915_gem_setup_global_gtt(struct drm_device *dev, unsigned long start,
>  			       unsigned long mappable_end, unsigned long end);
>  
> -bool intel_enable_ppgtt(struct drm_device *dev, bool full);
>  int i915_gem_init_ppgtt(struct drm_device *dev, struct i915_hw_ppgtt *ppgtt);
>  
>  void i915_check_and_clear_faults(struct drm_device *dev);
> -- 
> 1.9.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-08-06  8:21 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-05 14:51 [PATCH 00/15] drm-intel-collector - update Rodrigo Vivi
2014-08-05 14:51 ` [PATCH 01/15] drm/i915: Bring UP Power Wells before disabling RC6 Rodrigo Vivi
2014-08-05 14:51 ` [PATCH 02/15] drm/i915: Don't save/restore RS when not used Rodrigo Vivi
2014-08-05 14:51 ` [PATCH 03/15] drm/i915: Upgrade execbuffer fail after resume failure to EIO Rodrigo Vivi
2014-08-06  7:56   ` Daniel Vetter
2014-08-06  8:12     ` Chris Wilson
2014-08-06  8:39       ` Daniel Vetter
2014-08-08  9:17         ` Chris Wilson
2014-08-08  9:46           ` Daniel Vetter
2014-08-08  9:52             ` Chris Wilson
2014-08-05 14:51 ` [PATCH 04/15] drm/i915: honour forced connector modes Rodrigo Vivi
2014-08-06  8:15   ` Daniel Vetter
2014-08-06 15:00   ` Jesse Barnes
2014-08-05 14:51 ` [PATCH 05/15] drm/i915: Don't promote UC to WT automagically Rodrigo Vivi
2014-08-06  7:57   ` Daniel Vetter
2014-08-05 14:51 ` [PATCH 06/15] drm/i915: Refactor the physical and virtual page hws setup Rodrigo Vivi
2014-08-06  8:17   ` Daniel Vetter
2014-08-05 14:51 ` [PATCH 07/15] drm/i915: clean up PPGTT checking logic Rodrigo Vivi
2014-08-06  8:21   ` Daniel Vetter [this message]
2014-08-05 14:51 ` [PATCH 08/15] drm/i915: re-order ppgtt sanitize logic v2 Rodrigo Vivi
2014-08-06  8:22   ` Daniel Vetter
2014-08-05 14:51 ` [PATCH 09/15] drm/i915: Bring GPU Freq to min while suspending Rodrigo Vivi
2014-08-06  8:23   ` Daniel Vetter
2014-08-05 14:51 ` [PATCH 10/15] drm/i915/bdw: Map unused PDPs to a scratch page Rodrigo Vivi
2014-08-05 14:51 ` [PATCH 11/15] drm/i915: Set M2_N2 registers during mode set Rodrigo Vivi
2014-08-05 21:55   ` Jesse Barnes
2014-08-05 14:51 ` [PATCH 12/15] drm/i915: State readout and cross-checking for dp_m2_n2 Rodrigo Vivi
2014-08-06  8:25   ` Daniel Vetter
2014-08-05 14:51 ` [PATCH 13/15] drm/i915: HDMI detection based on HPD pin live status Rodrigo Vivi
2014-08-06  3:32   ` Sharma, Shashank
2014-08-06  6:44   ` Dave Airlie
2014-08-05 14:51 ` [PATCH 14/15] drm/i915: capture_reg_state interrupt registers for Gen8 Rodrigo Vivi
2014-08-06  8:27   ` Daniel Vetter
2014-08-06  8:56     ` Thierry, Michel
2014-08-05 14:51 ` [PATCH 15/15] drm/i915/chv: Use timeout mode for RC6 on chv Rodrigo Vivi
2014-08-06  0:51   ` O'Rourke, Tom

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=20140806082119.GU8727@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.