[Intel-gfx] [PATCH] drm/i915: Always program CSR if CSR is uninitialized

Patrik Jakobsson patrik.jakobsson at linux.intel.com
Wed Oct 21 07:57:40 PDT 2015

The current CSR loading code depends on the CSR program memory to be
cleared after boot. This is unfortunately not true on all hardware.
Instead make use of the FW_UNINITIALIZED state in init and check for
FW_LOADED to prevent init path from skipping the actual programming.

Signed-off-by: Patrik Jakobsson <patrik.jakobsson at linux.intel.com>
 drivers/gpu/drm/i915/intel_csr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
index 9e530a7..0f7c49e 100644
--- a/drivers/gpu/drm/i915/intel_csr.c
+++ b/drivers/gpu/drm/i915/intel_csr.c
@@ -271,7 +271,7 @@ void intel_csr_load_program(struct drm_device *dev)
 	 * Unfortunately the ACPI subsystem doesn't yet give us a way to
 	 * differentiate this, hence figure it out with this hack.
-	if (I915_READ(CSR_PROGRAM(0)))
+	if (I915_READ(CSR_PROGRAM(0)) && dev_priv->csr.state == FW_LOADED)
@@ -425,6 +425,8 @@ void intel_csr_ucode_init(struct drm_device *dev)
 	struct intel_csr *csr = &dev_priv->csr;
 	int ret;
+	intel_csr_load_status_set(dev_priv, FW_UNINITIALIZED);
 	if (!HAS_CSR(dev))

More information about the Intel-gfx mailing list