All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: Combine cleanup_status_page()
@ 2018-09-03 15:23 Chris Wilson
  2018-09-03 15:23 ` [PATCH 2/2] drm/i915: Use a cached mapping for the physical HWS Chris Wilson
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Chris Wilson @ 2018-09-03 15:23 UTC (permalink / raw)
  To: intel-gfx

Pull the physical status page cleanup into a common
cleanup_status_page() for caller simplicity.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_engine_cs.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index 1a34e8ff82d5..292eae19fce2 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -530,19 +530,14 @@ void intel_engine_cleanup_scratch(struct intel_engine_cs *engine)
 	i915_vma_unpin_and_release(&engine->scratch, 0);
 }
 
-static void cleanup_phys_status_page(struct intel_engine_cs *engine)
+static void cleanup_status_page(struct intel_engine_cs *engine)
 {
-	struct drm_i915_private *dev_priv = engine->i915;
+	struct drm_dma_handle *dmah;
 
-	if (!dev_priv->status_page_dmah)
-		return;
+	dmah = fetch_and_zero(&engine->i915->status_page_dmah);
+	if (dmah)
+		drm_pci_free(&engine->i915->drm, dmah);
 
-	drm_pci_free(&dev_priv->drm, dev_priv->status_page_dmah);
-	engine->status_page.page_addr = NULL;
-}
-
-static void cleanup_status_page(struct intel_engine_cs *engine)
-{
 	i915_vma_unpin_and_release(&engine->status_page.vma,
 				   I915_VMA_RELEASE_MAP);
 }
@@ -710,10 +705,7 @@ void intel_engine_cleanup_common(struct intel_engine_cs *engine)
 
 	intel_engine_cleanup_scratch(engine);
 
-	if (HWS_NEEDS_PHYSICAL(engine->i915))
-		cleanup_phys_status_page(engine);
-	else
-		cleanup_status_page(engine);
+	cleanup_status_page(engine);
 
 	intel_engine_fini_breadcrumbs(engine);
 	intel_engine_cleanup_cmd_parser(engine);
-- 
2.19.0.rc1

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-09-03 22:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-03 15:23 [PATCH 1/2] drm/i915: Combine cleanup_status_page() Chris Wilson
2018-09-03 15:23 ` [PATCH 2/2] drm/i915: Use a cached mapping for the physical HWS Chris Wilson
2018-09-03 15:35 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/2] drm/i915: Combine cleanup_status_page() Patchwork
2018-09-03 15:54 ` ✓ Fi.CI.BAT: success " Patchwork
2018-09-03 16:39 ` [PATCH 1/2] " Matthew Auld
2018-09-03 17:14   ` Chris Wilson
2018-09-03 22:39 ` ✓ Fi.CI.IGT: success for series starting with [1/2] " Patchwork

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.