static inline void read_descriptor( struct d3dadapter9_context *ctx, int fd ) { D3DADAPTER_IDENTIFIER9 *drvid = &ctx->identifier; memset(drvid, 0, sizeof(*drvid)); get_bus_info(fd, &drvid->VendorId, &drvid->DeviceId, &drvid->SubSysId, &drvid->Revision); snprintf(drvid->DeviceName, sizeof(drvid->DeviceName), "Gallium 0.4 with %s", ctx->hal->get_vendor(ctx->hal)); strncpy(drvid->Description, ctx->hal->get_name(ctx->hal), sizeof(drvid->Description)); /* choose fall-back vendor if necessary to allow * the following functions to return sane results */ d3d_match_vendor_id(drvid, FALLBACK_VENID, FALLBACK_DEVID, FALLBACK_NAME); /* fill in driver name and version info */ d3d_fill_driver_version(drvid); /* override Description field with Windows like names */ d3d_fill_cardname(drvid); /* this driver isn't WHQL certified */ drvid->WHQLLevel = 0; /* this value is fixed */ drvid->DeviceIdentifier.Data1 = 0xaeb2cdd4; drvid->DeviceIdentifier.Data2 = 0x6e41; drvid->DeviceIdentifier.Data3 = 0x43ea; drvid->DeviceIdentifier.Data4[0] = 0x94; drvid->DeviceIdentifier.Data4[1] = 0x1c; drvid->DeviceIdentifier.Data4[2] = 0x83; drvid->DeviceIdentifier.Data4[3] = 0x61; drvid->DeviceIdentifier.Data4[4] = 0xcc; drvid->DeviceIdentifier.Data4[5] = 0x76; drvid->DeviceIdentifier.Data4[6] = 0x07; drvid->DeviceIdentifier.Data4[7] = 0x81; }
static inline void read_descriptor( struct d3dadapter9_context *ctx, int fd, int override_vendorid ) { unsigned i; BOOL found; D3DADAPTER_IDENTIFIER9 *drvid = &ctx->identifier; memset(drvid, 0, sizeof(*drvid)); get_bus_info(fd, &drvid->VendorId, &drvid->DeviceId, &drvid->SubSysId, &drvid->Revision); snprintf(drvid->DeviceName, sizeof(drvid->DeviceName), "Gallium 0.4 with %s", ctx->hal->get_vendor(ctx->hal)); snprintf(drvid->Description, sizeof(drvid->Description), "%s", ctx->hal->get_name(ctx->hal)); if (override_vendorid > 0) { found = FALSE; /* fill in device_id and card name for fake vendor */ for (i = 0; i < sizeof(fallback_cards)/sizeof(fallback_cards[0]); i++) { if (fallback_cards[i].vendor_id == override_vendorid) { DBG("Faking card '%s' vendor 0x%04x, device 0x%04x\n", fallback_cards[i].name, fallback_cards[i].vendor_id, fallback_cards[i].device_id); drvid->VendorId = fallback_cards[i].vendor_id; drvid->DeviceId = fallback_cards[i].device_id; snprintf(drvid->Description, sizeof(drvid->Description), "%s", fallback_cards[i].name); found = TRUE; break; } } if (!found) { DBG("Unknown fake vendor 0x%04x! Using detected vendor !\n", override_vendorid); } } /* choose fall-back vendor if necessary to allow * the following functions to return sane results */ d3d_match_vendor_id(drvid, fallback_cards[0].vendor_id, fallback_cards[0].device_id, fallback_cards[0].name); /* fill in driver name and version info */ d3d_fill_driver_version(drvid); /* override Description field with Windows like names */ d3d_fill_cardname(drvid); /* this driver isn't WHQL certified */ drvid->WHQLLevel = 0; /* this value is fixed */ drvid->DeviceIdentifier.Data1 = 0xaeb2cdd4; drvid->DeviceIdentifier.Data2 = 0x6e41; drvid->DeviceIdentifier.Data3 = 0x43ea; drvid->DeviceIdentifier.Data4[0] = 0x94; drvid->DeviceIdentifier.Data4[1] = 0x1c; drvid->DeviceIdentifier.Data4[2] = 0x83; drvid->DeviceIdentifier.Data4[3] = 0x61; drvid->DeviceIdentifier.Data4[4] = 0xcc; drvid->DeviceIdentifier.Data4[5] = 0x76; drvid->DeviceIdentifier.Data4[6] = 0x07; drvid->DeviceIdentifier.Data4[7] = 0x81; }