示例#1
0
文件: drm.c 项目: tizbac/Mesa-3D
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);

    strncpy(drvid->Driver, "libd3dadapter9.so", sizeof(drvid->Driver));
    strncpy(drvid->DeviceName, ctx->hal->get_name(ctx->hal), 32);
    snprintf(drvid->Description, sizeof(drvid->Description),
             "Gallium 0.4 with %s", ctx->hal->get_vendor(ctx->hal));

    drvid->DriverVersionLowPart = VERSION_LOW;
    drvid->DriverVersionHighPart = VERSION_HIGH;

    /* To make a pseudo-real GUID we use the PCI bus data and some string */
    drvid->DeviceIdentifier.Data1 = drvid->VendorId;
    drvid->DeviceIdentifier.Data2 = drvid->DeviceId;
    drvid->DeviceIdentifier.Data3 = drvid->SubSysId;
    memcpy(drvid->DeviceIdentifier.Data4, "Gallium3D", 8);

    drvid->WHQLLevel = 1; /* This fakes WHQL validaion */

    /* XXX Fake NVIDIA binary driver on Windows.
     *
     * OS version: 4=95/98/NT4, 5=2000, 6=2000/XP, 7=Vista, 8=Win7
     */
    strncpy(drvid->Driver, "nvd3dum.dll", sizeof(drvid->Driver));
    strncpy(drvid->Description, "NVIDIA GeForce GTX 680", sizeof(drvid->Description));
    drvid->DriverVersionLowPart = VERSION_DWORD(12, 6658); /* minor, build */
    drvid->DriverVersionHighPart = VERSION_DWORD(6, 15); /* OS, major */
    drvid->SubSysId = 0;
    drvid->Revision = 0;
    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;
    drvid->WHQLLevel = 0;
}
示例#2
0
文件: drm.c 项目: dumbbell/mesa
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;
}
示例#3
0
文件: drm.c 项目: iXit/Mesa-3D
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;
}