int i;
for(i=0;i<sizeof(nouveau_card_list)/sizeof(nouveau_card)-1;i++)
if (nouveau_card_list[i].id==(device_id&0xffff))
- break;
- return &(nouveau_card_list[i]);
+ return &(nouveau_card_list[i]);
+ return NULL;
}
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);
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;
}