Re: [PATCH v2 9/9] drm/i915/gvt: Do not allocate initial ring scan buffer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ah... sorry. This patchset shouldn't be here.

-----Original Message-----
From: Wang, Zhi A 
Sent: Tuesday, September 12, 2017 8:40 AM
To: intel-gfx@xxxxxxxxxxxxxxxxxxxxx
Cc: Wang, Zhi A <zhi.a.wang@xxxxxxxxx>
Subject: [PATCH v2 9/9] drm/i915/gvt: Do not allocate initial ring scan buffer

Theoretically, the largest bulk of commands in the ring buffer of an engine might be the first submission, which usually contains a lot of commands to initialize the HW. After removing the initial allocation of the ring scan buffer and let krealloc() do everything we need, we still have a big chance to get the buffer of suitable size in the first submission.

Tested on my SKL NUC.

Signed-off-by: Zhi Wang <zhi.a.wang@xxxxxxxxx>
---
 drivers/gpu/drm/i915/gvt/execlist.c | 21 ---------------------
 drivers/gpu/drm/i915/gvt/gvt.h      |  1 -
 2 files changed, 22 deletions(-)

diff --git a/drivers/gpu/drm/i915/gvt/execlist.c b/drivers/gpu/drm/i915/gvt/execlist.c
index fae7459..86d3cc8 100644
--- a/drivers/gpu/drm/i915/gvt/execlist.c
+++ b/drivers/gpu/drm/i915/gvt/execlist.c
@@ -873,36 +873,15 @@ void intel_vgpu_clean_execlist(struct intel_vgpu *vgpu)
 	}
 }
 
-#define RESERVE_RING_BUFFER_SIZE		((1 * PAGE_SIZE)/8)
 int intel_vgpu_init_execlist(struct intel_vgpu *vgpu)  {
-	struct intel_vgpu_submission *s = &vgpu->submission;
 	enum intel_engine_id i;
 	struct intel_engine_cs *engine;
 
 	for_each_engine(engine, vgpu->gvt->dev_priv, i)
 		init_vgpu_execlist(vgpu, i);
 
-	/* each ring has a shadow ring buffer until vgpu destroyed */
-	for_each_engine(engine, vgpu->gvt->dev_priv, i) {
-		s->ring_scan_buffer[i] =
-			kmalloc(RESERVE_RING_BUFFER_SIZE, GFP_KERNEL);
-		if (!s->ring_scan_buffer[i]) {
-			gvt_vgpu_err("fail to alloc ring scan buffer\n");
-			goto out;
-		}
-		s->ring_scan_buffer_size[i] = RESERVE_RING_BUFFER_SIZE;
-	}
 	return 0;
-out:
-	for_each_engine(engine, vgpu->gvt->dev_priv, i) {
-		if (s->ring_scan_buffer_size[i]) {
-			kfree(s->ring_scan_buffer[i]);
-			s->ring_scan_buffer[i] = NULL;
-			s->ring_scan_buffer_size[i] = 0;
-		}
-	}
-	return -ENOMEM;
 }
 
 void intel_vgpu_reset_execlist(struct intel_vgpu *vgpu, diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h index 49fe548..7a770b1 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.h
+++ b/drivers/gpu/drm/i915/gvt/gvt.h
@@ -150,7 +150,6 @@ struct intel_vgpu_submission {
 	struct i915_gem_context *shadow_ctx;
 	DECLARE_BITMAP(shadow_ctx_desc_updated, I915_NUM_ENGINES);
 	DECLARE_BITMAP(tlb_handle_pending, I915_NUM_ENGINES);
-	/* 1/2K for each engine */
 	void *ring_scan_buffer[I915_NUM_ENGINES];
 	int ring_scan_buffer_size[I915_NUM_ENGINES];
 };
--
2.7.4

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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux