[Intel-gfx] [PATCH v2 11/21] drm/i915: Make GEN6_FEATURES inherit from GEN5

Carlos Santa carlos.santa at intel.com
Thu Jul 28 19:12:26 UTC 2016


Introduce GEN5_FEATURES and make GEN6 inherit from it so that we can
reduce code duplication.

Use GEN5_FEATURES for ilk.

Signed-off-by: Carlos Santa <carlos.santa at intel.com>
---
 drivers/gpu/drm/i915/i915_pci.c | 28 +++++++++++++---------------
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index c57006a..693943f 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -177,35 +177,33 @@ static const struct intel_device_info intel_pineview_info = {
 	CURSOR_OFFSETS,
 };
 
+#define GEN5_FEATURES \
+	.gen = 5, .num_pipes = 2, \
+	.need_gfx_hws = 1, .has_hotplug = 1, \
+	.ring_mask = RENDER_RING | BSD_RING, \
+	GEN_DEFAULT_PIPEOFFSETS, \
+	CURSOR_OFFSETS
+
 static const struct intel_device_info intel_ironlake_d_info = {
-	.gen = 5, .num_pipes = 2,
-	.need_gfx_hws = 1, .has_hotplug = 1,
-	.ring_mask = RENDER_RING | BSD_RING,
-	GEN_DEFAULT_PIPEOFFSETS,
-	CURSOR_OFFSETS,
+	GEN5_FEATURES
 };
 
 static const struct intel_device_info intel_ironlake_m_info = {
-	.gen = 5, .is_mobile = 1, .num_pipes = 2,
-	.need_gfx_hws = 1, .has_hotplug = 1,
+	GEN5_FEATURES,
+	.is_mobile = 1,
 	.has_fbc = 1,
-	.ring_mask = RENDER_RING | BSD_RING,
-	GEN_DEFAULT_PIPEOFFSETS,
-	CURSOR_OFFSETS,
 };
 
 #define GEN6_FEATURES \
-	.gen = 6, .num_pipes = 2, \
-	.need_gfx_hws = 1, .has_hotplug = 1, \
+	GEN5_FEATURES, \
+	.gen = 6, \
 	.has_fbc = 1, \
 	.has_runtime_pm = 1, \
 	.has_core_ring_freq = 1, \
 	.has_rc6 = 1, \
 	.has_rc6p = 1, \
 	.ring_mask = RENDER_RING | BSD_RING | BLT_RING, \
-	.has_llc = 1, \
-	GEN_DEFAULT_PIPEOFFSETS, \
-	CURSOR_OFFSETS
+	.has_llc = 1
 
 static const struct intel_device_info intel_sandybridge_d_info = {
 	GEN6_FEATURES
-- 
1.9.1



More information about the Intel-gfx mailing list