intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tursulin@ursulin.net>
To: Intel-gfx@lists.freedesktop.org
Subject: [PATCH 03/15] drm/i915: Use dev_priv in INTEL_INFO in i915_gem_fence_reg.c
Date: Wed, 16 Nov 2016 08:55:33 +0000	[thread overview]
Message-ID: <1479286545-15020-4-git-send-email-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <1479286545-15020-1-git-send-email-tvrtko.ursulin@linux.intel.com>

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Plus a small cascade of function prototype changes.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h           |  4 ++--
 drivers/gpu/drm/i915/i915_gem.c           |  7 +++----
 drivers/gpu/drm/i915/i915_gem_fence_reg.c | 12 +++++-------
 drivers/gpu/drm/i915/i915_suspend.c       |  2 +-
 4 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 3fe3813c793f..dbc43d2bb7ff 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -3159,9 +3159,9 @@ i915_gem_object_ggtt_offset(struct drm_i915_gem_object *o,
 int __must_check i915_vma_get_fence(struct i915_vma *vma);
 int __must_check i915_vma_put_fence(struct i915_vma *vma);
 
-void i915_gem_restore_fences(struct drm_device *dev);
+void i915_gem_restore_fences(struct drm_i915_private *dev_priv);
 
-void i915_gem_detect_bit_6_swizzle(struct drm_device *dev);
+void i915_gem_detect_bit_6_swizzle(struct drm_i915_private *dev_priv);
 void i915_gem_object_do_bit_17_swizzle(struct drm_i915_gem_object *obj,
 				       struct sg_table *pages);
 void i915_gem_object_save_bit_17_swizzle(struct drm_i915_gem_object *obj,
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d7681fe0c0f8..c3b2fa4e5cdb 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2750,7 +2750,7 @@ void i915_gem_reset(struct drm_i915_private *dev_priv)
 	for_each_engine(engine, dev_priv, id)
 		i915_gem_reset_engine(engine);
 
-	i915_gem_restore_fences(&dev_priv->drm);
+	i915_gem_restore_fences(dev_priv);
 
 	if (dev_priv->gt.awake) {
 		intel_sanitize_gt_powersave(dev_priv);
@@ -4448,7 +4448,6 @@ i915_gem_cleanup_engines(struct drm_device *dev)
 void
 i915_gem_load_init_fences(struct drm_i915_private *dev_priv)
 {
-	struct drm_device *dev = &dev_priv->drm;
 	int i;
 
 	if (INTEL_INFO(dev_priv)->gen >= 7 && !IS_VALLEYVIEW(dev_priv) &&
@@ -4472,9 +4471,9 @@ i915_gem_load_init_fences(struct drm_i915_private *dev_priv)
 		fence->id = i;
 		list_add_tail(&fence->link, &dev_priv->mm.fence_list);
 	}
-	i915_gem_restore_fences(dev);
+	i915_gem_restore_fences(dev_priv);
 
-	i915_gem_detect_bit_6_swizzle(dev);
+	i915_gem_detect_bit_6_swizzle(dev_priv);
 }
 
 int
diff --git a/drivers/gpu/drm/i915/i915_gem_fence_reg.c b/drivers/gpu/drm/i915/i915_gem_fence_reg.c
index cd59dbc6588c..0efa3571afc3 100644
--- a/drivers/gpu/drm/i915/i915_gem_fence_reg.c
+++ b/drivers/gpu/drm/i915/i915_gem_fence_reg.c
@@ -368,15 +368,14 @@ i915_vma_get_fence(struct i915_vma *vma)
 
 /**
  * i915_gem_restore_fences - restore fence state
- * @dev: DRM device
+ * @dev_priv: i915 device private
  *
  * Restore the hw fence state to match the software tracking again, to be called
  * after a gpu reset and on resume. Note that on runtime suspend we only cancel
  * the fences, to be reacquired by the user later.
  */
-void i915_gem_restore_fences(struct drm_device *dev)
+void i915_gem_restore_fences(struct drm_i915_private *dev_priv)
 {
-	struct drm_i915_private *dev_priv = to_i915(dev);
 	int i;
 
 	for (i = 0; i < dev_priv->num_fence_regs; i++) {
@@ -451,15 +450,14 @@ void i915_gem_restore_fences(struct drm_device *dev)
 
 /**
  * i915_gem_detect_bit_6_swizzle - detect bit 6 swizzling pattern
- * @dev: DRM device
+ * @dev_priv: i915 device private
  *
  * Detects bit 6 swizzling of address lookup between IGD access and CPU
  * access through main memory.
  */
 void
-i915_gem_detect_bit_6_swizzle(struct drm_device *dev)
+i915_gem_detect_bit_6_swizzle(struct drm_i915_private *dev_priv)
 {
-	struct drm_i915_private *dev_priv = to_i915(dev);
 	uint32_t swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN;
 	uint32_t swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN;
 
@@ -473,7 +471,7 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev)
 		 */
 		swizzle_x = I915_BIT_6_SWIZZLE_NONE;
 		swizzle_y = I915_BIT_6_SWIZZLE_NONE;
-	} else if (INTEL_INFO(dev)->gen >= 6) {
+	} else if (INTEL_GEN(dev_priv) >= 6) {
 		if (dev_priv->preserve_bios_swizzle) {
 			if (I915_READ(DISP_ARB_CTL) &
 			    DISP_TILE_SURFACE_SWIZZLING) {
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index 344cbf39cfa9..2c747ac7c565 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -114,7 +114,7 @@ int i915_restore_state(struct drm_device *dev)
 
 	mutex_lock(&dev->struct_mutex);
 
-	i915_gem_restore_fences(dev);
+	i915_gem_restore_fences(dev_priv);
 
 	if (IS_GEN4(dev_priv))
 		pci_write_config_word(pdev, GCDGMBUS,
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-11-16  8:55 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-16  8:55 [PATCH 00/15] Remove __I915__ magic macro Tvrtko Ursulin
2016-11-16  8:55 ` [PATCH 01/15] drm/i915: dev_priv and a small cascade of cleanups in i915_gem.c Tvrtko Ursulin
2016-11-16  8:55 ` [PATCH 02/15] drm/i915: Use dev_priv in INTEL_INFO in i915_gem_execbuffer.c Tvrtko Ursulin
2016-11-16  8:55 ` Tvrtko Ursulin [this message]
2016-11-16  8:55 ` [PATCH 04/15] drm/i915: dev_priv cleanup in i915_gem_gtt.c Tvrtko Ursulin
2016-11-16  8:55 ` [PATCH 05/15] drm/i915: dev_priv cleanup in i915_gem_stolen.c Tvrtko Ursulin
2016-11-16  8:55 ` [PATCH 06/15] drm/i915: dev_priv cleanup in i915_gem_tiling.c Tvrtko Ursulin
2016-11-16  8:55 ` [PATCH 07/15] drm/i915: dev_priv cleanup in i915_gpu_error.c Tvrtko Ursulin
2016-11-16  8:55 ` [PATCH 08/15] drm/i915: dev_priv cleanup in i915_irq.c Tvrtko Ursulin
2016-11-16  8:55 ` [PATCH 09/15] drm/i915: dev_priv cleanup in i915_suspend.c Tvrtko Ursulin
2016-11-16  8:55 ` [PATCH 10/15] drm/i915: Assorted INTEL_INFO(dev) cleanups Tvrtko Ursulin
2016-11-16  8:55 ` [PATCH 11/15] drm/i915: dev_priv cleanup in intel_dp.c Tvrtko Ursulin
2016-11-17 14:21   ` Maarten Lankhorst
2016-11-16  8:55 ` [PATCH 12/15] drm/i915: dev_priv cleanup in intel_pm.c Tvrtko Ursulin
2016-11-16  8:55 ` [PATCH 13/15] drm/i915: dev_priv cleanup in intel_display.c Tvrtko Ursulin
2016-11-16 12:32   ` [PATCH v2 " Tvrtko Ursulin
2016-11-17 14:20     ` Maarten Lankhorst
2016-11-16  8:55 ` [PATCH 14/15] drm/i915: Fix for_each_pipe argument in vlv_display_power_well_init Tvrtko Ursulin
2016-11-16  8:55 ` [PATCH 15/15] drm/i915: Remove __I915__ magic macro Tvrtko Ursulin
2016-11-16  9:05 ` [PATCH 00/15] " Chris Wilson
2016-11-16  9:11   ` Chris Wilson
2016-11-16  9:52     ` Jani Nikula
2016-11-16  9:16 ` ✓ Fi.CI.BAT: success for " Patchwork
2016-11-16  9:56   ` Tvrtko Ursulin
2016-11-17 14:06   ` Tvrtko Ursulin
2016-11-16 14:16 ` ✗ Fi.CI.BAT: warning for Remove __I915__ magic macro (rev2) Patchwork

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=1479286545-15020-4-git-send-email-tvrtko.ursulin@linux.intel.com \
    --to=tursulin@ursulin.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;
as well as URLs for NNTP newsgroup(s).