diff options
author | Maarten Maathuis <madman2003@gmail.com> | 2007-11-30 22:50:34 +0100 |
---|---|---|
committer | Maarten Maathuis <madman2003@gmail.com> | 2007-11-30 22:50:34 +0100 |
commit | 887b920a7fd2cfa70b41425d26e4d3707d4075b9 (patch) | |
tree | 0e7e3eb1e2a201cb0743113c8fcfab3e55fe7339 /shared-core | |
parent | 309b2c4c05d02a7e7311a9491b74044f6c7f06a4 (diff) |
nouveau: Properly identify NV40 and NV44 generation.
Diffstat (limited to 'shared-core')
-rw-r--r-- | shared-core/nouveau_state.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c index 7c9503e8..16c86494 100644 --- a/shared-core/nouveau_state.c +++ b/shared-core/nouveau_state.c @@ -454,6 +454,9 @@ int nouveau_firstopen(struct drm_device *dev) return 0; } +#define NV40_CHIPSET_MASK 0x00000baf +#define NV44_CHIPSET_MASK 0x00005450 + int nouveau_load(struct drm_device *dev, unsigned long flags) { struct drm_nouveau_private *dev_priv; @@ -497,10 +500,16 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) if (architecture >= 0x50) { dev_priv->card_type = NV_50; - } else if (architecture >= 0x44) { - dev_priv->card_type = NV_44; } else if (architecture >= 0x40) { - dev_priv->card_type = NV_40; + uint8_t subarch = architecture & 0xf; + /* Selection criteria borrowed from NV40EXA */ + if (NV40_CHIPSET_MASK & (1 << subarch)) { + dev_priv->card_type = NV_40; + } else if (NV44_CHIPSET_MASK & (1 << subarch)) { + dev_priv->card_type = NV_44; + } else { + dev_priv->card_type = NV_UNKNOWN; + } } else if (architecture >= 0x30) { dev_priv->card_type = NV_30; } else if (architecture >= 0x20) { |