diff options
author | Ben Skeggs <[email protected]> | 2007-01-15 17:23:04 +1100 |
---|---|---|
committer | Ben Skeggs <[email protected]> | 2007-01-15 17:23:04 +1100 |
commit | 634b4b3487dcb22e1660959b6a7ce9a42fa50fe2 (patch) | |
tree | 45f0009bd5ae122aadc54169bfee75cf7265c752 /src/mesa/drivers/dri/nouveau/nouveau_screen.c | |
parent | 89f91d1804c0c4919c25d6b9931973733db1e664 (diff) |
nouveau: fail CreateScreen on unknown cards instead of guessing.
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_screen.c')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_screen.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c index 0e3901cfcab..ab7742df14f 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c @@ -71,6 +71,14 @@ static nouveauScreenPtr nouveauCreateScreen(__DRIscreenPrivate *sPriv) return NULL; } + screen->card=nouveau_card_lookup(dri_priv->device_id); + if (!screen->card) { + __driUtilMessage("%s: Unknown card type 0x%04x:0x%04x\n", + __func__, dri_priv->device_id >> 16, dri_priv->device_id & 0xFFFF); + FREE(screen); + return NULL; + } + /* parse information in __driConfigOptions */ driParseOptionInfo (&screen->optionCache,__driConfigOptions, __driNConfigOptions); @@ -82,7 +90,6 @@ static nouveauScreenPtr nouveauCreateScreen(__DRIscreenPrivate *sPriv) screen->depthOffset = dri_priv->depth_offset; screen->depthPitch = dri_priv->depth_pitch; - screen->card=nouveau_card_lookup(dri_priv->device_id); screen->driScreen = sPriv; return screen; } |