Skip to contentSkip to conversation

Update generation checks to provide basic support for Ivybridge.

PATCH In review Kenneth Graunke 3 participants 3 messages Feb 8, 2012 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Update generation checks to provide basic support for Ivybridge.

There may be some updates required, but assuming Ivybridge is similar to Sandybridge is a decent start; previously it fell through to the Gen2/3 case and nothing worked.

---
 lib/intel_reg_map.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
lib/intel_reg_map.c +3 -2
index 86cf9a6..0c8d49c 100644
@@ -128,14 +128,15 @@ struct intel_register_map
 intel_get_register_map(uint32_t devid)
 {
 	struct intel_register_map map;
+	const int gen = intel_gen(devid);
 
-	if (IS_GEN6(devid)) {
+	if (gen >= 6) {
 		map.map = gen6_gt_register_map;
 		map.top = 0x180000;
 	} else if (IS_BROADWATER(devid) || IS_CRESTLINE(devid)) {
 		map.map = gen_bwcl_register_map;
 		map.top = 0x80000;
-	} else if (IS_GEN4(devid) || IS_GEN5(devid)) {
+	} else if (gen >= 4) {
 		map.map = gen4_register_map;
 		map.top = 0x80000;
 	} else {
Signature · 1 line
1.7.7.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Kenneth Graunke

There may be some updates required, but assuming Ivybridge is similar to Sandybridge is a decent start; previously it fell through to the Gen2/3 case and nothing worked.

I didn't think anyone actually used this register map... so I never bothered to update it myself :-).

For the record, I bet if I did this someone would yell at me that this should be two patches, since you also moved to the new intel_gen stuff. But you're definitely cooler than me.

Quoted 2 lines
Quoted 26 lines
---
 lib/intel_reg_map.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
lib/intel_reg_map.c +3 -2
index 86cf9a6..0c8d49c 100644
@@ -128,14 +128,15 @@ struct intel_register_map
 intel_get_register_map(uint32_t devid)
 {
 	struct intel_register_map map;
+	const int gen = intel_gen(devid);
 
-	if (IS_GEN6(devid)) {
+	if (gen >= 6) {
 		map.map = gen6_gt_register_map;
 		map.top = 0x180000;
 	} else if (IS_BROADWATER(devid) || IS_CRESTLINE(devid)) {
 		map.map = gen_bwcl_register_map;
 		map.top = 0x80000;
-	} else if (IS_GEN4(devid) || IS_GEN5(devid)) {
+	} else if (gen >= 4) {
 		map.map = gen4_register_map;
 		map.top = 0x80000;
 	} else {
#2 lore raw
In reply to Kenneth Graunke
Quoted 5 lines · Kenneth Graunke

There may be some updates required, but assuming Ivybridge is similar to Sandybridge is a decent start; previously it fell through to the Gen2/3 case and nothing worked.

intel_reg_read/write don't use this facility and everything that does probably only access regs that aren't prohibited. We might want to kill this eventually, I'm not really sold on it's value. Anyway, for the time being, slurped into i-g-t. Thanks for the patch&review. -Daniel

Signature · 3 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48