Skip to contentSkip to conversation

intel: Fix bufmgr_gem->gen for gen > 4

PATCH In review Chad Versace 4 participants 5 messages Jan 30, 2012 – Jan 31, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 intel: Fix bufmgr_gem->gen for gen > 4

If the pci_device's actual gen was > 4, then we stupidly set bufmgr_gem->gen = 6.

---
 intel/intel_bufmgr_gem.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
intel/intel_bufmgr_gem.c +7 -1
index 2b4fab1..26e3a5c 100644
@@ -2321,8 +2321,14 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
 		bufmgr_gem->gen = 3;
 	else if (IS_GEN4(bufmgr_gem->pci_device))
 		bufmgr_gem->gen = 4;
-	else
+	else if (IS_GEN5(bufmgr_gem->pci_device))
+		bufmgr_gem->gen = 5;
+	else if (IS_GEN6(bufmgr_gem->pci_device))
 		bufmgr_gem->gen = 6;
+	else if (IS_GEN7(bufmgr_gem->pci_device))
+        	bufmgr_gem->gen = 7;
+	else
+        	assert(0);
 
 	if (IS_GEN3(bufmgr_gem->pci_device) &&
 	    bufmgr_gem->gtt_size > 256*1024*1024) {
Signature · 1 line
1.7.7.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Chad Versace

If the pci_device's actual gen was > 4, then we stupidly set bufmgr_gem->gen = 6.

I was thinking on maybe making this more future-proof to help the possible

Quoted 1 line

=7 gen devices, but I guess we can add a new check for them when the time

comes.

Signature · 2 lines
Eugeni Dodonov
 <http://eugeni.dodonov.net/>

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
Quoted 7 lines · Eric Anholt
Quoted 2 lines · Chad Versace

If the pci_device's actual gen was > 4, then we stupidly set bufmgr_gem->gen = 6.

Might be worth a note to say that no behavior should change. Still,

Pushed, with a note about no change in behavior.

----
Chad Versace
[email protected]