[PATCH 12/15] drm/i915: infrastructure to support scheduler types

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

 



As of now there are only two types, fairness, and none. This can be set
using the same module parameter, and will use default values for
whatever type is chosen. Those values should be readable through
debugfs.
---
 drivers/gpu/drm/i915/i915_drv.h            |    4 ++++
 drivers/gpu/drm/i915/i915_gem.c            |    9 ++++++---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |    2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 3ce03a0..a12445b 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -744,6 +744,10 @@ typedef struct drm_i915_private {
 	 * we'd want to abstract this better.
 	 */
 	struct {
+		#define I915_SCHEDULER_NONE 0
+		#define I915_SCHEDULER_FAIR 1
+		#define I915_SCHEDULER_INVALID 2
+		unsigned type;
 		/* Point at which we consider blocking */
 		unsigned high_watermark;
 		/* Point when we consider unblocking */
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 5b7072d..69d4a59 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3943,9 +3943,12 @@ i915_gem_load(struct drm_device *dev)
 	dev_priv->mm.inactive_shrinker.seeks = DEFAULT_SEEKS;
 	register_shrinker(&dev_priv->mm.inactive_shrinker);
 
-	/* Set some decent defaults for the scheudler */
-	dev_priv->scheduler.high_watermark = 50;
-	dev_priv->scheduler.low_watermark = 5;
+	if (i915_scheduler <= I915_SCHEDULER_INVALID) {
+		dev_priv->scheduler.type = i915_scheduler;
+		/* Set some decent defaults for the fair scheduler */
+		dev_priv->scheduler.high_watermark = 50;
+		dev_priv->scheduler.low_watermark = 5;
+	}
 }
 
 /*
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 744ff9b..c2e96be 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -970,7 +970,7 @@ i915_schedule(struct drm_device *dev, struct intel_ring_buffer *ring, struct drm
 	int ret, i = 0;
 
 #define BLOCK_CONDITION ( \
-	i915_scheduler && \
+	(dev_priv->scheduler.type != I915_SCHEDULER_NONE) && \
 	(file_priv->outstanding_requests > dev_priv->scheduler.high_watermark))
 #define OUT_CONDITION ( \
 	(atomic_read(&dev_priv->mm.wedged)) || \
-- 
1.7.7.3



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