[Intel-gfx] [PATCH 05/15] drm/i915: remove mm structure from file_priv

Ben Widawsky ben at bwidawsk.net
Sat Nov 19 03:24:22 CET 2011


We will be using file_priv for scheduler things, and request list which
is useful for us isn't only mm related.

Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_dma.c |    4 ++--
 drivers/gpu/drm/i915/i915_drv.h |    7 +++----
 drivers/gpu/drm/i915/i915_gem.c |   24 ++++++++++++------------
 3 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 2eac955..43131bf 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -2202,8 +2202,8 @@ int i915_driver_open(struct drm_device *dev, struct drm_file *file)
 
 	file->driver_priv = file_priv;
 
-	spin_lock_init(&file_priv->mm.lock);
-	INIT_LIST_HEAD(&file_priv->mm.request_list);
+	spin_lock_init(&file_priv->lock);
+	INIT_LIST_HEAD(&file_priv->request_list);
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 9d9d160..fe06613 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -917,10 +917,9 @@ struct drm_i915_gem_request {
 };
 
 struct drm_i915_file_private {
-	struct {
-		struct spinlock lock;
-		struct list_head request_list;
-	} mm;
+	struct spinlock lock;
+
+	struct list_head request_list;
 };
 
 #define INTEL_INFO(dev)	(((struct drm_i915_private *) (dev)->dev_private)->info)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 9c743ae..c90c4b4 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1674,11 +1674,11 @@ i915_add_request(struct intel_ring_buffer *ring,
 	if (file) {
 		struct drm_i915_file_private *file_priv = file->driver_priv;
 
-		spin_lock(&file_priv->mm.lock);
+		spin_lock(&file_priv->lock);
 		request->file_priv = file_priv;
 		list_add_tail(&request->client_list,
-			      &file_priv->mm.request_list);
-		spin_unlock(&file_priv->mm.lock);
+			      &file_priv->request_list);
+		spin_unlock(&file_priv->lock);
 	}
 
 	ring->outstanding_lazy_request = false;
@@ -1704,12 +1704,12 @@ i915_gem_request_remove_from_client(struct drm_i915_gem_request *request)
 	if (!file_priv)
 		return;
 
-	spin_lock(&file_priv->mm.lock);
+	spin_lock(&file_priv->lock);
 	if (request->file_priv) {
 		list_del(&request->client_list);
 		request->file_priv = NULL;
 	}
-	spin_unlock(&file_priv->mm.lock);
+	spin_unlock(&file_priv->lock);
 }
 
 static void i915_gem_reset_ring_lists(struct drm_i915_private *dev_priv,
@@ -3301,15 +3301,15 @@ i915_gem_ring_throttle(struct drm_device *dev, struct drm_file *file)
 	if (atomic_read(&dev_priv->mm.wedged))
 		return -EIO;
 
-	spin_lock(&file_priv->mm.lock);
-	list_for_each_entry(request, &file_priv->mm.request_list, client_list) {
+	spin_lock(&file_priv->lock);
+	list_for_each_entry(request, &file_priv->request_list, client_list) {
 		if (time_after_eq(request->emitted_jiffies, recent_enough))
 			break;
 
 		ring = request->ring;
 		seqno = request->seqno;
 	}
-	spin_unlock(&file_priv->mm.lock);
+	spin_unlock(&file_priv->lock);
 
 	if (seqno == 0)
 		return 0;
@@ -4131,17 +4131,17 @@ void i915_gem_release(struct drm_device *dev, struct drm_file *file)
 	 * later retire_requests won't dereference our soon-to-be-gone
 	 * file_priv.
 	 */
-	spin_lock(&file_priv->mm.lock);
-	while (!list_empty(&file_priv->mm.request_list)) {
+	spin_lock(&file_priv->lock);
+	while (!list_empty(&file_priv->request_list)) {
 		struct drm_i915_gem_request *request;
 
-		request = list_first_entry(&file_priv->mm.request_list,
+		request = list_first_entry(&file_priv->request_list,
 					   struct drm_i915_gem_request,
 					   client_list);
 		list_del(&request->client_list);
 		request->file_priv = NULL;
 	}
-	spin_unlock(&file_priv->mm.lock);
+	spin_unlock(&file_priv->lock);
 }
 
 static int
-- 
1.7.7.3




More information about the Intel-gfx mailing list