浏览代码

drm/i915: Remove redundant flip_work->flip_queued_ring

Similar to the patch from John which removed obj->ring.

Cc: John Harrison <John.C.Harrison@Intel.com>
Cc: Thomas Daniel <Thomas.Daniel@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Daniel Vetter 10 年之前
父节点
当前提交
3a8a946efb
共有 3 个文件被更改,包括 9 次插入12 次删除
  1. 6 3
      drivers/gpu/drm/i915/i915_debugfs.c
  2. 3 8
      drivers/gpu/drm/i915/intel_display.c
  3. 0 1
      drivers/gpu/drm/i915/intel_drv.h

+ 6 - 3
drivers/gpu/drm/i915/i915_debugfs.c

@@ -542,12 +542,15 @@ static int i915_gem_pageflip_info(struct seq_file *m, void *data)
 				seq_printf(m, "Flip pending (waiting for vsync) on pipe %c (plane %c)\n",
 				seq_printf(m, "Flip pending (waiting for vsync) on pipe %c (plane %c)\n",
 					   pipe, plane);
 					   pipe, plane);
 			}
 			}
-			if (work->flip_queued_ring) {
+			if (work->flip_queued_req) {
+				struct intel_engine_cs *ring =
+					i915_gem_request_get_ring(work->flip_queued_req);
+
 				seq_printf(m, "Flip queued on %s at seqno %u, next seqno %u [current breadcrumb %u], completed? %d\n",
 				seq_printf(m, "Flip queued on %s at seqno %u, next seqno %u [current breadcrumb %u], completed? %d\n",
-					   work->flip_queued_ring->name,
+					   ring->name,
 					   i915_gem_request_get_seqno(work->flip_queued_req),
 					   i915_gem_request_get_seqno(work->flip_queued_req),
 					   dev_priv->next_seqno,
 					   dev_priv->next_seqno,
-					   work->flip_queued_ring->get_seqno(work->flip_queued_ring, true),
+					   ring->get_seqno(ring, true),
 					   i915_gem_request_completed(work->flip_queued_req, true));
 					   i915_gem_request_completed(work->flip_queued_req, true));
 			} else
 			} else
 				seq_printf(m, "Flip not associated with any ring\n");
 				seq_printf(m, "Flip not associated with any ring\n");

+ 3 - 8
drivers/gpu/drm/i915/intel_display.c

@@ -9132,7 +9132,6 @@ static void intel_unpin_work_fn(struct work_struct *__work)
 	if (work->flip_queued_req)
 	if (work->flip_queued_req)
 		i915_gem_request_unreference(work->flip_queued_req);
 		i915_gem_request_unreference(work->flip_queued_req);
 	work->flip_queued_req  = NULL;
 	work->flip_queued_req  = NULL;
-	work->flip_queued_ring = NULL;
 	mutex_unlock(&dev->struct_mutex);
 	mutex_unlock(&dev->struct_mutex);
 
 
 	intel_frontbuffer_flip_complete(dev, INTEL_FRONTBUFFER_PRIMARY(pipe));
 	intel_frontbuffer_flip_complete(dev, INTEL_FRONTBUFFER_PRIMARY(pipe));
@@ -9741,10 +9740,9 @@ static bool __intel_pageflip_stall_check(struct drm_device *dev,
 		return false;
 		return false;
 
 
 	if (work->flip_ready_vblank == 0) {
 	if (work->flip_ready_vblank == 0) {
-		if (work->flip_queued_ring) {
-			if (!i915_gem_request_completed(work->flip_queued_req, true))
-				return false;
-		}
+		if (work->flip_queued_req &&
+		    !i915_gem_request_completed(work->flip_queued_req, true))
+			return false;
 
 
 		work->flip_ready_vblank = drm_vblank_count(dev, intel_crtc->pipe);
 		work->flip_ready_vblank = drm_vblank_count(dev, intel_crtc->pipe);
 	}
 	}
@@ -9910,8 +9908,6 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 
 
 		i915_gem_request_assign(&work->flip_queued_req,
 		i915_gem_request_assign(&work->flip_queued_req,
 					obj->last_write_req);
 					obj->last_write_req);
-		work->flip_queued_ring =
-				i915_gem_request_get_ring(obj->last_write_req);
 	} else {
 	} else {
 		ret = dev_priv->display.queue_flip(dev, crtc, fb, obj, ring,
 		ret = dev_priv->display.queue_flip(dev, crtc, fb, obj, ring,
 						   page_flip_flags);
 						   page_flip_flags);
@@ -9920,7 +9916,6 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc,
 
 
 		i915_gem_request_assign(&work->flip_queued_req,
 		i915_gem_request_assign(&work->flip_queued_req,
 					intel_ring_get_request(ring));
 					intel_ring_get_request(ring));
-		work->flip_queued_ring = ring;
 	}
 	}
 
 
 	work->flip_queued_vblank = drm_vblank_count(dev, intel_crtc->pipe);
 	work->flip_queued_vblank = drm_vblank_count(dev, intel_crtc->pipe);

+ 0 - 1
drivers/gpu/drm/i915/intel_drv.h

@@ -707,7 +707,6 @@ struct intel_unpin_work {
 #define INTEL_FLIP_COMPLETE	2
 #define INTEL_FLIP_COMPLETE	2
 	u32 flip_count;
 	u32 flip_count;
 	u32 gtt_offset;
 	u32 gtt_offset;
-	struct intel_engine_cs *flip_queued_ring;
 	struct drm_i915_gem_request *flip_queued_req;
 	struct drm_i915_gem_request *flip_queued_req;
 	int flip_queued_vblank;
 	int flip_queued_vblank;
 	int flip_ready_vblank;
 	int flip_ready_vblank;