All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Refactor the code storing the reason why we disable FBC
@ 2015-02-27  1:30 Damien Lespiau
  2015-02-27  1:30 ` [PATCH 1/4] drm/i915: Refactor where we display the reason to " Damien Lespiau
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Damien Lespiau @ 2015-02-27  1:30 UTC (permalink / raw)
  To: intel-gfx

There was a bit of duplicated logic here and we can have easier code to deal
with when adding a reason why we decided to disable FBC: we don't need to add
an enum, change the debugfs logic and code the check (3 sites), we can just
code the check (1 site).

That also removes 50 lines of code, which is always a happy event.

-- 
Damien

-- 
Damien Lespiau (4):
  drm/i915: Refactor where we display the reason to disable FBC
  drm/i915: Use the original FBC reason strings in debugfs
  drm/i915: Remove the no FBC reason enum
  drm/i915: Rename no_fbc_str to no_fbc_reason

 drivers/gpu/drm/i915/i915_debugfs.c | 50 +++++++------------------------------
 drivers/gpu/drm/i915/i915_drv.h     | 14 +----------
 drivers/gpu/drm/i915/intel_fbc.c    | 45 +++++++++++++--------------------
 3 files changed, 28 insertions(+), 81 deletions(-)

-- 
1.8.3.1

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

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

* [PATCH 1/4] drm/i915: Refactor where we display the reason to disable FBC
  2015-02-27  1:30 [PATCH 0/4] Refactor the code storing the reason why we disable FBC Damien Lespiau
@ 2015-02-27  1:30 ` Damien Lespiau
  2015-02-27  1:30 ` [PATCH 2/4] drm/i915: Use the original FBC reason strings in debugfs Damien Lespiau
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Damien Lespiau @ 2015-02-27  1:30 UTC (permalink / raw)
  To: intel-gfx

How we log the reason to disable FBC isn't very normalized and we can
store the logic to only display the string once directly in
set_no_fbc_reason() instead of having ifs all over the place.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/intel_fbc.c | 47 +++++++++++++++++++---------------------
 1 file changed, 22 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index 618f7bd..0cad32c 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -463,14 +463,15 @@ void intel_fbc_disable(struct drm_device *dev)
 	dev_priv->fbc.crtc = NULL;
 }
 
-static bool set_no_fbc_reason(struct drm_i915_private *dev_priv,
-			      enum no_fbc_reason reason)
+static void set_no_fbc_reason(struct drm_i915_private *dev_priv,
+			      enum no_fbc_reason reason,
+			      const char *reason_str /* a static string */)
 {
 	if (dev_priv->fbc.no_fbc_reason == reason)
-		return false;
+		return;
 
 	dev_priv->fbc.no_fbc_reason = reason;
-	return true;
+	DRM_DEBUG_KMS("Disabling FBC: %s\n", reason_str);
 }
 
 static struct drm_crtc *intel_fbc_find_crtc(struct drm_i915_private *dev_priv)
@@ -490,8 +491,8 @@ static struct drm_crtc *intel_fbc_find_crtc(struct drm_i915_private *dev_priv)
 		if (intel_crtc_active(tmp_crtc) &&
 		    to_intel_crtc(tmp_crtc)->primary_enabled) {
 			if (one_pipe_only && crtc) {
-				if (set_no_fbc_reason(dev_priv, FBC_MULTIPLE_PIPES))
-					DRM_DEBUG_KMS("more than one pipe active, disabling compression\n");
+				set_no_fbc_reason(dev_priv, FBC_MULTIPLE_PIPES,
+						  "more than one pipe active");
 				return NULL;
 			}
 			crtc = tmp_crtc;
@@ -502,8 +503,7 @@ static struct drm_crtc *intel_fbc_find_crtc(struct drm_i915_private *dev_priv)
 	}
 
 	if (!crtc || crtc->primary->fb == NULL) {
-		if (set_no_fbc_reason(dev_priv, FBC_NO_OUTPUT))
-			DRM_DEBUG_KMS("no output, disabling\n");
+		set_no_fbc_reason(dev_priv, FBC_NO_OUTPUT, "no output");
 		return NULL;
 	}
 
@@ -547,14 +547,12 @@ void intel_fbc_update(struct drm_device *dev)
 		i915.enable_fbc = 0;
 
 	if (i915.enable_fbc < 0) {
-		if (set_no_fbc_reason(dev_priv, FBC_CHIP_DEFAULT))
-			DRM_DEBUG_KMS("disabled per chip default\n");
+		set_no_fbc_reason(dev_priv, FBC_CHIP_DEFAULT, "chip default");
 		goto out_disable;
 	}
 
 	if (!i915.enable_fbc || !i915.powersave) {
-		if (set_no_fbc_reason(dev_priv, FBC_MODULE_PARAM))
-			DRM_DEBUG_KMS("fbc disabled per module param\n");
+		set_no_fbc_reason(dev_priv, FBC_MODULE_PARAM, "module param");
 		goto out_disable;
 	}
 
@@ -578,9 +576,8 @@ void intel_fbc_update(struct drm_device *dev)
 
 	if ((adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) ||
 	    (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN)) {
-		if (set_no_fbc_reason(dev_priv, FBC_UNSUPPORTED_MODE))
-			DRM_DEBUG_KMS("mode incompatible with compression, "
-				      "disabling\n");
+		set_no_fbc_reason(dev_priv, FBC_UNSUPPORTED_MODE,
+				  "incompatible mode");
 		goto out_disable;
 	}
 
@@ -596,14 +593,14 @@ void intel_fbc_update(struct drm_device *dev)
 	}
 	if (intel_crtc->config->pipe_src_w > max_width ||
 	    intel_crtc->config->pipe_src_h > max_height) {
-		if (set_no_fbc_reason(dev_priv, FBC_MODE_TOO_LARGE))
-			DRM_DEBUG_KMS("mode too large for compression, disabling\n");
+		set_no_fbc_reason(dev_priv, FBC_MODE_TOO_LARGE,
+				  "mode too large");
 		goto out_disable;
 	}
+
 	if ((INTEL_INFO(dev)->gen < 4 || HAS_DDI(dev)) &&
 	    intel_crtc->plane != PLANE_A) {
-		if (set_no_fbc_reason(dev_priv, FBC_BAD_PLANE))
-			DRM_DEBUG_KMS("plane not A, disabling compression\n");
+		set_no_fbc_reason(dev_priv, FBC_BAD_PLANE, "plane not A");
 		goto out_disable;
 	}
 
@@ -612,14 +609,14 @@ void intel_fbc_update(struct drm_device *dev)
 	 */
 	if (obj->tiling_mode != I915_TILING_X ||
 	    obj->fence_reg == I915_FENCE_REG_NONE) {
-		if (set_no_fbc_reason(dev_priv, FBC_NOT_TILED))
-			DRM_DEBUG_KMS("framebuffer not tiled or fenced, disabling compression\n");
+		set_no_fbc_reason(dev_priv, FBC_NOT_TILED,
+				  "framebuffer not tiled or fenced");
 		goto out_disable;
 	}
 	if (INTEL_INFO(dev)->gen <= 4 && !IS_G4X(dev) &&
 	    crtc->primary->state->rotation != BIT(DRM_ROTATE_0)) {
-		if (set_no_fbc_reason(dev_priv, FBC_UNSUPPORTED_MODE))
-			DRM_DEBUG_KMS("Rotation unsupported, disabling\n");
+		set_no_fbc_reason(dev_priv, FBC_UNSUPPORTED_MODE,
+				  "rotation unsupported");
 		goto out_disable;
 	}
 
@@ -629,8 +626,8 @@ void intel_fbc_update(struct drm_device *dev)
 
 	if (i915_gem_stolen_setup_compression(dev, obj->base.size,
 					      drm_format_plane_cpp(fb->pixel_format, 0))) {
-		if (set_no_fbc_reason(dev_priv, FBC_STOLEN_TOO_SMALL))
-			DRM_DEBUG_KMS("framebuffer too large, disabling compression\n");
+		set_no_fbc_reason(dev_priv, FBC_STOLEN_TOO_SMALL,
+				  "no space in stolen memory");
 		goto out_disable;
 	}
 
-- 
1.8.3.1

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

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

* [PATCH 2/4] drm/i915: Use the original FBC reason strings in debugfs
  2015-02-27  1:30 [PATCH 0/4] Refactor the code storing the reason why we disable FBC Damien Lespiau
  2015-02-27  1:30 ` [PATCH 1/4] drm/i915: Refactor where we display the reason to " Damien Lespiau
@ 2015-02-27  1:30 ` Damien Lespiau
  2015-02-27  1:30 ` [PATCH 3/4] drm/i915: Remove the no FBC reason enum Damien Lespiau
  2015-02-27  1:31 ` [PATCH 4/4] drm/i915: Rename no_fbc_str to no_fbc_reason Damien Lespiau
  3 siblings, 0 replies; 6+ messages in thread
From: Damien Lespiau @ 2015-02-27  1:30 UTC (permalink / raw)
  To: intel-gfx

No need to duplicate the logic and strings in debugfs, we can just reuse
the ones from when we disabled FBC.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 50 +++++++------------------------------
 drivers/gpu/drm/i915/i915_drv.h     |  1 +
 drivers/gpu/drm/i915/intel_fbc.c    |  3 +++
 3 files changed, 13 insertions(+), 41 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 94b3984..9ceae48 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1521,48 +1521,16 @@ static int i915_fbc_status(struct seq_file *m, void *unused)
 
 	intel_runtime_pm_get(dev_priv);
 
-	if (intel_fbc_enabled(dev)) {
+	if (intel_fbc_enabled(dev))
 		seq_puts(m, "FBC enabled\n");
-	} else {
-		seq_puts(m, "FBC disabled: ");
-		switch (dev_priv->fbc.no_fbc_reason) {
-		case FBC_OK:
-			seq_puts(m, "FBC actived, but currently disabled in hardware");
-			break;
-		case FBC_UNSUPPORTED:
-			seq_puts(m, "unsupported by this chipset");
-			break;
-		case FBC_NO_OUTPUT:
-			seq_puts(m, "no outputs");
-			break;
-		case FBC_STOLEN_TOO_SMALL:
-			seq_puts(m, "not enough stolen memory");
-			break;
-		case FBC_UNSUPPORTED_MODE:
-			seq_puts(m, "mode not supported");
-			break;
-		case FBC_MODE_TOO_LARGE:
-			seq_puts(m, "mode too large");
-			break;
-		case FBC_BAD_PLANE:
-			seq_puts(m, "FBC unsupported on plane");
-			break;
-		case FBC_NOT_TILED:
-			seq_puts(m, "scanout buffer not tiled");
-			break;
-		case FBC_MULTIPLE_PIPES:
-			seq_puts(m, "multiple pipes are enabled");
-			break;
-		case FBC_MODULE_PARAM:
-			seq_puts(m, "disabled per module param (default off)");
-			break;
-		case FBC_CHIP_DEFAULT:
-			seq_puts(m, "disabled per chip default");
-			break;
-		default:
-			seq_puts(m, "unknown reason");
-		}
-		seq_putc(m, '\n');
+	else {
+		const char unknown_reason[] = "unknown reason";
+		const char *reason = dev_priv->fbc.no_fbc_str;
+
+		if (!reason)
+			reason = unknown_reason;
+
+		seq_printf(m, "FBC disabled: %s\n", reason);
 	}
 
 	intel_runtime_pm_put(dev_priv);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index a1dd8bc..e262397 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -826,6 +826,7 @@ struct i915_fbc {
 		FBC_MODULE_PARAM,
 		FBC_CHIP_DEFAULT, /* disabled by default on this chip */
 	} no_fbc_reason;
+	const char *no_fbc_str;
 };
 
 /**
diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index 0cad32c..6cdf6e2 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -471,6 +471,7 @@ static void set_no_fbc_reason(struct drm_i915_private *dev_priv,
 		return;
 
 	dev_priv->fbc.no_fbc_reason = reason;
+	dev_priv->fbc.no_fbc_str = reason_str;
 	DRM_DEBUG_KMS("Disabling FBC: %s\n", reason_str);
 }
 
@@ -671,6 +672,7 @@ void intel_fbc_update(struct drm_device *dev)
 
 	intel_fbc_enable(crtc);
 	dev_priv->fbc.no_fbc_reason = FBC_OK;
+	dev_priv->fbc.no_fbc_str = NULL;
 	return;
 
 out_disable:
@@ -693,6 +695,7 @@ void intel_fbc_init(struct drm_i915_private *dev_priv)
 	if (!HAS_FBC(dev_priv)) {
 		dev_priv->fbc.enabled = false;
 		dev_priv->fbc.no_fbc_reason = FBC_UNSUPPORTED;
+		dev_priv->fbc.no_fbc_str = "unsupported";
 		return;
 	}
 
-- 
1.8.3.1

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

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

* [PATCH 3/4] drm/i915: Remove the no FBC reason enum
  2015-02-27  1:30 [PATCH 0/4] Refactor the code storing the reason why we disable FBC Damien Lespiau
  2015-02-27  1:30 ` [PATCH 1/4] drm/i915: Refactor where we display the reason to " Damien Lespiau
  2015-02-27  1:30 ` [PATCH 2/4] drm/i915: Use the original FBC reason strings in debugfs Damien Lespiau
@ 2015-02-27  1:30 ` Damien Lespiau
  2015-02-27  1:31 ` [PATCH 4/4] drm/i915: Rename no_fbc_str to no_fbc_reason Damien Lespiau
  3 siblings, 0 replies; 6+ messages in thread
From: Damien Lespiau @ 2015-02-27  1:30 UTC (permalink / raw)
  To: intel-gfx

Now that we store the reason string in the fbc structure, we are
duplicating the no FBC reason info. We can just reuse the string pointer
instead.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h  | 13 -------------
 drivers/gpu/drm/i915/intel_fbc.c | 31 +++++++++++--------------------
 2 files changed, 11 insertions(+), 33 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index e262397..7f44ce2 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -813,19 +813,6 @@ struct i915_fbc {
 		struct drm_framebuffer *fb;
 	} *fbc_work;
 
-	enum no_fbc_reason {
-		FBC_OK, /* FBC is enabled */
-		FBC_UNSUPPORTED, /* FBC is not supported by this chipset */
-		FBC_NO_OUTPUT, /* no outputs enabled to compress */
-		FBC_STOLEN_TOO_SMALL, /* not enough space for buffers */
-		FBC_UNSUPPORTED_MODE, /* interlace or doublescanned mode */
-		FBC_MODE_TOO_LARGE, /* mode too large for compression */
-		FBC_BAD_PLANE, /* fbc not supported on plane */
-		FBC_NOT_TILED, /* buffer not tiled */
-		FBC_MULTIPLE_PIPES, /* more than one pipe active */
-		FBC_MODULE_PARAM,
-		FBC_CHIP_DEFAULT, /* disabled by default on this chip */
-	} no_fbc_reason;
 	const char *no_fbc_str;
 };
 
diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index 6cdf6e2..0098cdd 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -464,13 +464,11 @@ void intel_fbc_disable(struct drm_device *dev)
 }
 
 static void set_no_fbc_reason(struct drm_i915_private *dev_priv,
-			      enum no_fbc_reason reason,
 			      const char *reason_str /* a static string */)
 {
-	if (dev_priv->fbc.no_fbc_reason == reason)
+	if (dev_priv->fbc.no_fbc_str == reason_str)
 		return;
 
-	dev_priv->fbc.no_fbc_reason = reason;
 	dev_priv->fbc.no_fbc_str = reason_str;
 	DRM_DEBUG_KMS("Disabling FBC: %s\n", reason_str);
 }
@@ -492,7 +490,7 @@ static struct drm_crtc *intel_fbc_find_crtc(struct drm_i915_private *dev_priv)
 		if (intel_crtc_active(tmp_crtc) &&
 		    to_intel_crtc(tmp_crtc)->primary_enabled) {
 			if (one_pipe_only && crtc) {
-				set_no_fbc_reason(dev_priv, FBC_MULTIPLE_PIPES,
+				set_no_fbc_reason(dev_priv,
 						  "more than one pipe active");
 				return NULL;
 			}
@@ -504,7 +502,7 @@ static struct drm_crtc *intel_fbc_find_crtc(struct drm_i915_private *dev_priv)
 	}
 
 	if (!crtc || crtc->primary->fb == NULL) {
-		set_no_fbc_reason(dev_priv, FBC_NO_OUTPUT, "no output");
+		set_no_fbc_reason(dev_priv, "no output");
 		return NULL;
 	}
 
@@ -548,12 +546,12 @@ void intel_fbc_update(struct drm_device *dev)
 		i915.enable_fbc = 0;
 
 	if (i915.enable_fbc < 0) {
-		set_no_fbc_reason(dev_priv, FBC_CHIP_DEFAULT, "chip default");
+		set_no_fbc_reason(dev_priv, "chip default");
 		goto out_disable;
 	}
 
 	if (!i915.enable_fbc || !i915.powersave) {
-		set_no_fbc_reason(dev_priv, FBC_MODULE_PARAM, "module param");
+		set_no_fbc_reason(dev_priv, "module param");
 		goto out_disable;
 	}
 
@@ -577,8 +575,7 @@ void intel_fbc_update(struct drm_device *dev)
 
 	if ((adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) ||
 	    (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN)) {
-		set_no_fbc_reason(dev_priv, FBC_UNSUPPORTED_MODE,
-				  "incompatible mode");
+		set_no_fbc_reason(dev_priv, "incompatible mode");
 		goto out_disable;
 	}
 
@@ -594,14 +591,13 @@ void intel_fbc_update(struct drm_device *dev)
 	}
 	if (intel_crtc->config->pipe_src_w > max_width ||
 	    intel_crtc->config->pipe_src_h > max_height) {
-		set_no_fbc_reason(dev_priv, FBC_MODE_TOO_LARGE,
-				  "mode too large");
+		set_no_fbc_reason(dev_priv, "mode too large");
 		goto out_disable;
 	}
 
 	if ((INTEL_INFO(dev)->gen < 4 || HAS_DDI(dev)) &&
 	    intel_crtc->plane != PLANE_A) {
-		set_no_fbc_reason(dev_priv, FBC_BAD_PLANE, "plane not A");
+		set_no_fbc_reason(dev_priv, "plane not A");
 		goto out_disable;
 	}
 
@@ -610,14 +606,12 @@ void intel_fbc_update(struct drm_device *dev)
 	 */
 	if (obj->tiling_mode != I915_TILING_X ||
 	    obj->fence_reg == I915_FENCE_REG_NONE) {
-		set_no_fbc_reason(dev_priv, FBC_NOT_TILED,
-				  "framebuffer not tiled or fenced");
+		set_no_fbc_reason(dev_priv, "framebuffer not tiled or fenced");
 		goto out_disable;
 	}
 	if (INTEL_INFO(dev)->gen <= 4 && !IS_G4X(dev) &&
 	    crtc->primary->state->rotation != BIT(DRM_ROTATE_0)) {
-		set_no_fbc_reason(dev_priv, FBC_UNSUPPORTED_MODE,
-				  "rotation unsupported");
+		set_no_fbc_reason(dev_priv, "rotation unsupported");
 		goto out_disable;
 	}
 
@@ -627,8 +621,7 @@ void intel_fbc_update(struct drm_device *dev)
 
 	if (i915_gem_stolen_setup_compression(dev, obj->base.size,
 					      drm_format_plane_cpp(fb->pixel_format, 0))) {
-		set_no_fbc_reason(dev_priv, FBC_STOLEN_TOO_SMALL,
-				  "no space in stolen memory");
+		set_no_fbc_reason(dev_priv, "no space in stolen memory");
 		goto out_disable;
 	}
 
@@ -671,7 +664,6 @@ void intel_fbc_update(struct drm_device *dev)
 	}
 
 	intel_fbc_enable(crtc);
-	dev_priv->fbc.no_fbc_reason = FBC_OK;
 	dev_priv->fbc.no_fbc_str = NULL;
 	return;
 
@@ -694,7 +686,6 @@ void intel_fbc_init(struct drm_i915_private *dev_priv)
 {
 	if (!HAS_FBC(dev_priv)) {
 		dev_priv->fbc.enabled = false;
-		dev_priv->fbc.no_fbc_reason = FBC_UNSUPPORTED;
 		dev_priv->fbc.no_fbc_str = "unsupported";
 		return;
 	}
-- 
1.8.3.1

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

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

* [PATCH 4/4] drm/i915: Rename no_fbc_str to no_fbc_reason
  2015-02-27  1:30 [PATCH 0/4] Refactor the code storing the reason why we disable FBC Damien Lespiau
                   ` (2 preceding siblings ...)
  2015-02-27  1:30 ` [PATCH 3/4] drm/i915: Remove the no FBC reason enum Damien Lespiau
@ 2015-02-27  1:31 ` Damien Lespiau
  2015-03-01  6:45   ` shuang.he
  3 siblings, 1 reply; 6+ messages in thread
From: Damien Lespiau @ 2015-02-27  1:31 UTC (permalink / raw)
  To: intel-gfx

no_fbc_reason was a much better name, and now that we only store the
reason as a string, we can reuse that name.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c |  2 +-
 drivers/gpu/drm/i915/i915_drv.h     |  2 +-
 drivers/gpu/drm/i915/intel_fbc.c    | 12 ++++++------
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 9ceae48..4d892a6 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1525,7 +1525,7 @@ static int i915_fbc_status(struct seq_file *m, void *unused)
 		seq_puts(m, "FBC enabled\n");
 	else {
 		const char unknown_reason[] = "unknown reason";
-		const char *reason = dev_priv->fbc.no_fbc_str;
+		const char *reason = dev_priv->fbc.no_fbc_reason;
 
 		if (!reason)
 			reason = unknown_reason;
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 7f44ce2..39d0a32 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -813,7 +813,7 @@ struct i915_fbc {
 		struct drm_framebuffer *fb;
 	} *fbc_work;
 
-	const char *no_fbc_str;
+	const char *no_fbc_reason;
 };
 
 /**
diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index 0098cdd..0d5364d 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -464,13 +464,13 @@ void intel_fbc_disable(struct drm_device *dev)
 }
 
 static void set_no_fbc_reason(struct drm_i915_private *dev_priv,
-			      const char *reason_str /* a static string */)
+			      const char *reason /* a static string */)
 {
-	if (dev_priv->fbc.no_fbc_str == reason_str)
+	if (dev_priv->fbc.no_fbc_reason == reason)
 		return;
 
-	dev_priv->fbc.no_fbc_str = reason_str;
-	DRM_DEBUG_KMS("Disabling FBC: %s\n", reason_str);
+	dev_priv->fbc.no_fbc_reason = reason;
+	DRM_DEBUG_KMS("Disabling FBC: %s\n", reason);
 }
 
 static struct drm_crtc *intel_fbc_find_crtc(struct drm_i915_private *dev_priv)
@@ -664,7 +664,7 @@ void intel_fbc_update(struct drm_device *dev)
 	}
 
 	intel_fbc_enable(crtc);
-	dev_priv->fbc.no_fbc_str = NULL;
+	dev_priv->fbc.no_fbc_reason = NULL;
 	return;
 
 out_disable:
@@ -686,7 +686,7 @@ void intel_fbc_init(struct drm_i915_private *dev_priv)
 {
 	if (!HAS_FBC(dev_priv)) {
 		dev_priv->fbc.enabled = false;
-		dev_priv->fbc.no_fbc_str = "unsupported";
+		dev_priv->fbc.no_fbc_reason = "unsupported";
 		return;
 	}
 
-- 
1.8.3.1

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

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

* Re: [PATCH 4/4] drm/i915: Rename no_fbc_str to no_fbc_reason
  2015-02-27  1:31 ` [PATCH 4/4] drm/i915: Rename no_fbc_str to no_fbc_reason Damien Lespiau
@ 2015-03-01  6:45   ` shuang.he
  0 siblings, 0 replies; 6+ messages in thread
From: shuang.he @ 2015-03-01  6:45 UTC (permalink / raw)
  To: shuang.he, ethan.gao, intel-gfx, damien.lespiau

Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 5847
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
PNV                 -1              282/282              281/282
ILK                 -1              308/308              307/308
SNB                                  326/326              326/326
IVB                                  379/379              379/379
BYT                                  294/294              294/294
HSW                 -1              387/387              386/387
BDW                 -1              316/316              315/316
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
*PNV  igt_gem_userptr_blits_minor-sync-interruptible      PASS(2)      DMESG_WARN(1)PASS(1)
*ILK  igt_gem_fenced_exec_thrash_no-spare-fences-busy      PASS(2)      DMESG_WARN(1)PASS(1)
*HSW  igt_gem_storedw_batches_loop_normal      PASS(4)      DMESG_WARN(1)PASS(1)
*BDW  igt_gem_gtt_hog      PASS(15)      DMESG_WARN(1)PASS(1)
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2015-03-01  6:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-27  1:30 [PATCH 0/4] Refactor the code storing the reason why we disable FBC Damien Lespiau
2015-02-27  1:30 ` [PATCH 1/4] drm/i915: Refactor where we display the reason to " Damien Lespiau
2015-02-27  1:30 ` [PATCH 2/4] drm/i915: Use the original FBC reason strings in debugfs Damien Lespiau
2015-02-27  1:30 ` [PATCH 3/4] drm/i915: Remove the no FBC reason enum Damien Lespiau
2015-02-27  1:31 ` [PATCH 4/4] drm/i915: Rename no_fbc_str to no_fbc_reason Damien Lespiau
2015-03-01  6:45   ` shuang.he

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.