diff mbox series

drm/i915: Add feature flag for platforms with DRAM info

Message ID 20191009190613.168376-1-stuart.summers@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Add feature flag for platforms with DRAM info | expand

Commit Message

Summers, Stuart Oct. 9, 2019, 7:06 p.m. UTC
Platforms prior to gen9 to not supply this info to software.
Instead of checking the platform directly, add a new feature
flag, HAS_DRAM_INFO, to allow us to quickly tell if the platform
supports this feature.

v2: Fix commit message and change feature flag name to HAS_DRAM_INFO

Signed-off-by: Stuart Summers <stuart.summers@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c          | 2 +-
 drivers/gpu/drm/i915/i915_drv.h          | 2 ++
 drivers/gpu/drm/i915/i915_pci.c          | 3 ++-
 drivers/gpu/drm/i915/intel_device_info.h | 1 +
 4 files changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index f02a34722217..f5590559f828 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1053,7 +1053,7 @@  intel_get_dram_info(struct drm_i915_private *dev_priv)
 	 */
 	dram_info->is_16gb_dimm = !IS_GEN9_LP(dev_priv);
 
-	if (INTEL_GEN(dev_priv) < 9)
+	if (!HAS_DRAM_INFO(dev_priv))
 		return;
 
 	if (IS_GEN9_LP(dev_priv))
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index d284b04c492b..f2e2d2a7b925 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1763,6 +1763,8 @@  IS_SUBPLATFORM(const struct drm_i915_private *i915,
 
 #define HAS_DP_MST(dev_priv)	(INTEL_INFO(dev_priv)->display.has_dp_mst)
 
+#define HAS_DRAM_INFO(dev_priv)	(INTEL_INFO(dev_priv)->has_dram_info)
+
 #define HAS_DDI(dev_priv)		 (INTEL_INFO(dev_priv)->display.has_ddi)
 #define HAS_FPGA_DBG_UNCLAIMED(dev_priv) (INTEL_INFO(dev_priv)->has_fpga_dbg)
 #define HAS_PSR(dev_priv)		 (INTEL_INFO(dev_priv)->display.has_psr)
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 1cbf3998b361..9d7377f21926 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -601,7 +601,8 @@  static const struct intel_device_info intel_cherryview_info = {
 	.display.has_csr = 1, \
 	.has_gt_uc = 1, \
 	.display.has_ipc = 1, \
-	.ddb_size = 896
+	.ddb_size = 896, \
+	.has_dram_info = 1
 
 #define SKL_PLATFORM \
 	GEN9_FEATURES, \
diff --git a/drivers/gpu/drm/i915/intel_device_info.h b/drivers/gpu/drm/i915/intel_device_info.h
index 0cdc2465534b..67a487d93ce4 100644
--- a/drivers/gpu/drm/i915/intel_device_info.h
+++ b/drivers/gpu/drm/i915/intel_device_info.h
@@ -109,6 +109,7 @@  enum intel_ppgtt_type {
 	func(require_force_probe); \
 	/* Keep has_* in alphabetical order */ \
 	func(has_64bit_reloc); \
+	func(has_dram_info); \
 	func(gpu_reset_clobbers_display); \
 	func(has_reset_engine); \
 	func(has_fpga_dbg); \