aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJyoti Yadav <jyoti.r.yadav@intel.com>2018-08-31 02:00:23 -0400
committerImre Deak <imre.deak@intel.com>2018-08-31 09:46:46 -0400
commita64f88874930be944f2c78c7df501d5d1d19becc (patch)
tree193d131b553a17c66217789d04901e2b267154e9
parent3f51b7e1f36a37cfc6ed281a231485e4e6b511c3 (diff)
drm/i915/intel_csr.c Fix DMC FW Loading issue on ICL.
This patch resolves the DMC FW loading issue. Earlier DMC FW package have only one DMC FW for one stepping. But as such there is no such restriction from Package side. For ICL icl_dmc_ver1_07.bin binary package has DMC FW for 2 steppings. So while reading the dmc_offset from package header, for 1st stepping offset used to come 0x0 and was working fine till now. But for second stepping and other steppings, offset is non zero number and is in dwords. So we need to convert into bytes to fetch correct DMC FW from correct place. v2 : Added check for DMC FW max size for various gen. (Imre Deak) v3 : Corrected naming convention for various gen. (Imre Deak) v4 : Initialized max_fw_size to 0 v5 : Corrected DMC FW MAX_SIZE for various gen. (Imre Deak) v6 : Fixed the typo issues. Reviewed-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/1535695223-4648-1-git-send-email-jyoti.r.yadav@intel.com
-rw-r--r--drivers/gpu/drm/i915/intel_csr.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
index 1ec4f09c61f6..14cf4c367e36 100644
--- a/drivers/gpu/drm/i915/intel_csr.c
+++ b/drivers/gpu/drm/i915/intel_csr.c
@@ -55,7 +55,9 @@ MODULE_FIRMWARE(I915_CSR_BXT);
55#define BXT_CSR_VERSION_REQUIRED CSR_VERSION(1, 7) 55#define BXT_CSR_VERSION_REQUIRED CSR_VERSION(1, 7)
56 56
57 57
58#define CSR_MAX_FW_SIZE 0x2FFF 58#define BXT_CSR_MAX_FW_SIZE 0x3000
59#define GLK_CSR_MAX_FW_SIZE 0x4000
60#define ICL_CSR_MAX_FW_SIZE 0x6000
59#define CSR_DEFAULT_FW_OFFSET 0xFFFFFFFF 61#define CSR_DEFAULT_FW_OFFSET 0xFFFFFFFF
60 62
61struct intel_css_header { 63struct intel_css_header {
@@ -279,6 +281,7 @@ static uint32_t *parse_csr_fw(struct drm_i915_private *dev_priv,
279 struct intel_csr *csr = &dev_priv->csr; 281 struct intel_csr *csr = &dev_priv->csr;
280 const struct stepping_info *si = intel_get_stepping_info(dev_priv); 282 const struct stepping_info *si = intel_get_stepping_info(dev_priv);
281 uint32_t dmc_offset = CSR_DEFAULT_FW_OFFSET, readcount = 0, nbytes; 283 uint32_t dmc_offset = CSR_DEFAULT_FW_OFFSET, readcount = 0, nbytes;
284 uint32_t max_fw_size = 0;
282 uint32_t i; 285 uint32_t i;
283 uint32_t *dmc_payload; 286 uint32_t *dmc_payload;
284 uint32_t required_version; 287 uint32_t required_version;
@@ -359,6 +362,8 @@ static uint32_t *parse_csr_fw(struct drm_i915_private *dev_priv,
359 si->stepping); 362 si->stepping);
360 return NULL; 363 return NULL;
361 } 364 }
365 /* Convert dmc_offset into number of bytes. By default it is in dwords*/
366 dmc_offset *= 4;
362 readcount += dmc_offset; 367 readcount += dmc_offset;
363 368
364 /* Extract dmc_header information. */ 369 /* Extract dmc_header information. */
@@ -391,8 +396,16 @@ static uint32_t *parse_csr_fw(struct drm_i915_private *dev_priv,
391 396
392 /* fw_size is in dwords, so multiplied by 4 to convert into bytes. */ 397 /* fw_size is in dwords, so multiplied by 4 to convert into bytes. */
393 nbytes = dmc_header->fw_size * 4; 398 nbytes = dmc_header->fw_size * 4;
394 if (nbytes > CSR_MAX_FW_SIZE) { 399 if (INTEL_GEN(dev_priv) >= 11)
395 DRM_ERROR("DMC firmware too big (%u bytes)\n", nbytes); 400 max_fw_size = ICL_CSR_MAX_FW_SIZE;
401 else if (IS_CANNONLAKE(dev_priv) || IS_GEMINILAKE(dev_priv))
402 max_fw_size = GLK_CSR_MAX_FW_SIZE;
403 else if (IS_GEN9(dev_priv))
404 max_fw_size = BXT_CSR_MAX_FW_SIZE;
405 else
406 MISSING_CASE(INTEL_REVID(dev_priv));
407 if (nbytes > max_fw_size) {
408 DRM_ERROR("DMC FW too big (%u bytes)\n", nbytes);
396 return NULL; 409 return NULL;
397 } 410 }
398 csr->dmc_fw_size = dmc_header->fw_size; 411 csr->dmc_fw_size = dmc_header->fw_size;