diff mbox

[v8,1/5] drm/i915: Factor out setup_private_pat()

Message ID 1504861553-19815-1-git-send-email-zhi.a.wang@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wang, Zhi A Sept. 8, 2017, 9:05 a.m. UTC
Factor out setup_private_pat() for introducing the following patches.

Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> v7
Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

Comments

Joonas Lahtinen Sept. 8, 2017, 11:54 a.m. UTC | #1
On Fri, 2017-09-08 at 17:05 +0800, Zhi Wang wrote:
> Factor out setup_private_pat() for introducing the following patches.
> 
> Cc: Ben Widawsky <benjamin.widawsky@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> v7
> Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>

Keep this in chronological order when you add things, so R-b after S-o-
b. Only add the version after R-b *if* the review might have been
invalidated due to some changes, in this case there are no changes and
no changelog, so you can keep the R-b.

If there was substantial enough changes, changelog would be added and
#v7 added to previous reviews to indicate they do not apply to latest
changes.

Regards, Joonas
Wang, Zhi A Sept. 8, 2017, 4:21 p.m. UTC | #2
Thanks! Learned. :) 

-----Original Message-----
From: Joonas Lahtinen [mailto:joonas.lahtinen@linux.intel.com] 

Sent: Friday, September 8, 2017 2:54 PM
To: Wang, Zhi A <zhi.a.wang@intel.com>; intel-gfx@lists.freedesktop.org; intel-gvt-dev@lists.freedesktop.org
Cc: chris@chris-wilson.co.uk; zhenyuw@linux.intel.com; Widawsky, Benjamin <benjamin.widawsky@intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com>
Subject: Re: [PATCH v8 1/5] drm/i915: Factor out setup_private_pat()

On Fri, 2017-09-08 at 17:05 +0800, Zhi Wang wrote:
> Factor out setup_private_pat() for introducing the following patches.

> 

> Cc: Ben Widawsky <benjamin.widawsky@intel.com>

> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>

> Cc: Chris Wilson <chris@chris-wilson.co.uk>

> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> v7

> Signed-off-by: Zhi Wang <zhi.a.wang@intel.com>


Keep this in chronological order when you add things, so R-b after S-o- b. Only add the version after R-b *if* the review might have been invalidated due to some changes, in this case there are no changes and no changelog, so you can keep the R-b.

If there was substantial enough changes, changelog would be added and
#v7 added to previous reviews to indicate they do not apply to latest changes.

Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index c33c2f9..2fc0656 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -2915,6 +2915,16 @@  static void gen6_gmch_remove(struct i915_address_space *vm)
 	cleanup_scratch_page(vm);
 }
 
+static void setup_private_pat(struct drm_i915_private *dev_priv)
+{
+	if (INTEL_GEN(dev_priv) >= 10)
+		cnl_setup_private_ppat(dev_priv);
+	else if (IS_CHERRYVIEW(dev_priv) || IS_GEN9_LP(dev_priv))
+		chv_setup_private_ppat(dev_priv);
+	else
+		bdw_setup_private_ppat(dev_priv);
+}
+
 static int gen8_gmch_probe(struct i915_ggtt *ggtt)
 {
 	struct drm_i915_private *dev_priv = ggtt->base.i915;
@@ -2947,14 +2957,6 @@  static int gen8_gmch_probe(struct i915_ggtt *ggtt)
 	}
 
 	ggtt->base.total = (size / sizeof(gen8_pte_t)) << PAGE_SHIFT;
-
-	if (INTEL_GEN(dev_priv) >= 10)
-		cnl_setup_private_ppat(dev_priv);
-	else if (IS_CHERRYVIEW(dev_priv) || IS_GEN9_LP(dev_priv))
-		chv_setup_private_ppat(dev_priv);
-	else
-		bdw_setup_private_ppat(dev_priv);
-
 	ggtt->base.cleanup = gen6_gmch_remove;
 	ggtt->base.bind_vma = ggtt_bind_vma;
 	ggtt->base.unbind_vma = ggtt_unbind_vma;
@@ -2975,6 +2977,8 @@  static int gen8_gmch_probe(struct i915_ggtt *ggtt)
 
 	ggtt->invalidate = gen6_ggtt_invalidate;
 
+	setup_private_pat(dev_priv);
+
 	return ggtt_probe_common(ggtt, size);
 }