drm/i915/skl: Store and print the DMC firmware version we load
authorDamien Lespiau <damien.lespiau@intel.com>
Tue, 27 Oct 2015 12:46:59 +0000 (14:46 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 9 Nov 2015 17:14:11 +0000 (19:14 +0200)
That can be handy later on to tell which DMC firmware version the user
has, by just looking at the dmesg.

v2: use DRM_DEBUG_DRIVER (Chris)
v3: use DRM_INFO (Marc Herbert)

Cc: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> (v1)
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1445950025-5793-1-git-send-email-mika.kuoppala@intel.com
Reviewed-by: Imre Deak <imre.deak@intel.com>
Tested-by: Daniel Stone <daniels@collabora.com> # SKL
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_csr.c

index 75ce5d97be5cb6128744cae197c1f1ccc0650ec0..c5f36b4f4f168fd55aad6d2b48cbc6146872f841 100644 (file)
@@ -734,6 +734,10 @@ struct intel_uncore {
 #define for_each_fw_domain(domain__, dev_priv__, i__) \
        for_each_fw_domain_mask(domain__, FORCEWAKE_ALL, dev_priv__, i__)
 
+#define CSR_VERSION(major, minor)      ((major) << 16 | (minor))
+#define CSR_VERSION_MAJOR(version)     ((version) >> 16)
+#define CSR_VERSION_MINOR(version)     ((version) & 0xffff)
+
 enum csr_state {
        FW_UNINITIALIZED = 0,
        FW_LOADED,
@@ -744,6 +748,7 @@ struct intel_csr {
        const char *fw_path;
        uint32_t *dmc_payload;
        uint32_t dmc_fw_size;
+       uint32_t version;
        uint32_t mmio_count;
        uint32_t mmioaddr[8];
        uint32_t mmiodata[8];
index 9e530a73935460ddc35d357721f667f28d0d4e09..e620e853efcb544baa3b5d101a6322160985ced1 100644 (file)
@@ -321,6 +321,9 @@ static void finish_csr_load(const struct firmware *fw, void *context)
                        (css_header->header_len * 4));
                goto out;
        }
+
+       csr->version = css_header->version;
+
        readcount += sizeof(struct intel_css_header);
 
        /* Extract Package Header information*/
@@ -402,7 +405,11 @@ static void finish_csr_load(const struct firmware *fw, void *context)
        intel_csr_load_program(dev);
        fw_loaded = true;
 
-       DRM_DEBUG_KMS("Finished loading %s\n", dev_priv->csr.fw_path);
+       DRM_INFO("Finished loading %s (v%u.%u)\n",
+                dev_priv->csr.fw_path,
+                CSR_VERSION_MAJOR(csr->version),
+                CSR_VERSION_MINOR(csr->version));
+
 out:
        if (fw_loaded)
                intel_runtime_pm_put(dev_priv);