From 634b4b3487dcb22e1660959b6a7ce9a42fa50fe2 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Mon, 15 Jan 2007 17:23:04 +1100 Subject: nouveau: fail CreateScreen on unknown cards instead of guessing. --- src/mesa/drivers/dri/nouveau/nouveau_card.c | 4 ++-- src/mesa/drivers/dri/nouveau/nouveau_screen.c | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_card.c b/src/mesa/drivers/dri/nouveau/nouveau_card.c index ae4f4c7ae5a..91f12f0d704 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_card.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_card.c @@ -10,8 +10,8 @@ nouveau_card* nouveau_card_lookup(uint32_t device_id) int i; for(i=0;icard=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; } -- cgit v1.2.3