nvidiadevicetodrivermapper.java
来自「纯java操作系统jnode,安装简单和操作简单的个人使用的Java操作系统」· Java 代码 · 共 177 行
JAVA
177 行
/*
* $Id: NVidiaDeviceToDriverMapper.java,v 1.1 2003/11/25 11:51:40 epr Exp $
*/
package org.jnode.driver.video.nvidia;
import org.jnode.driver.Device;
import org.jnode.driver.DeviceToDriverMapper;
import org.jnode.driver.Driver;
import org.jnode.driver.pci.PCIDevice;
import org.jnode.driver.pci.PCIDeviceConfig;
import org.jnode.driver.pci.PCI_IDs;
/**
* @author Ewout Prangsma (epr@users.sourceforge.net)
*
* The following information is copied from http://developer.nvidia.com
*
* <pre>
// Device ID Chip ID name Adapter ID Name
{ 0x0020, "RIVA TNT", "RIVA TNT" },
{ 0x0028, "RIVA TNT2/TNT2 Pro", "RIVA TNT2/TNT2 Pro" },
{ 0x0029, "RIVA TNT2 Ultra", "RIVA TNT2 Ultra" },
{ 0x002C, "Vanta/Vanta LT", "Vanta/Vanta LT" },
{ 0x002D, "RIVA TNT2 Model 64/Model 64 Pro", "RIVA TNT2 Model 64/Model 64 Pro" },
{ 0x00A0, "Aladdin TNT2", "Aladdin TNT2" },
{ 0x0100, "GeForce 256", "GeForce 256" },
{ 0x0101, "GeForce DDR", "GeForce DDR" },
{ 0x0103, "Quadro", "Quadro" },
{ 0x0110, "GeForce2 MX/MX 400", "GeForce2 MX/MX 400" },
{ 0x0111, "GeForce2 MX 100/200", "GeForce2 MX 100/200" },
{ 0x0113, "Quadro2 MXR/EX/Go", "Quadro2 MXR/EX/Go" },
{ 0x01A0, "GeForce2 Integrated GPU", "GeForce2 Integrated GPU" },
{ 0x0150, "GeForce2 GTS/GeForce2 Pro", "GeForce2 GTS/GeForce2 Pro" },
{ 0x0151, "GeForce2 Ti", "GeForce2 Ti" },
{ 0x0152, "GeForce2 Ultra", "GeForce2 Ultra" },
{ 0x0153, "Quadro2 Pro", "Quadro2 Pro" },
{ 0x0170, "GeForce4 MX 460", "GeForce4 MX 460" },
{ 0x0171, "GeForce4 MX 440", "GeForce4 MX 440" },
{ 0x0172, "GeForce4 MX 420", "GeForce4 MX 420" },
{ 0x0173, "GeForce4 MX 440-SE", "GeForce4 MX 440-SE" },
{ 0x0178, "Quadro4 550 XGL", "Quadro4 550 XGL" },
{ 0x017A, "Quadro NVS", "Quadro NVS" },
{ 0x0181, "GeForce4 MX 440 with AGP8X", "GeForce4 MX 440 with AGP8X" },
{ 0x0182, "GeForce4 MX 440SE with AGP8X", "GeForce4 MX 440SE with AGP8X" },
{ 0x0183, "GeForce4 MX 420 with AGP8X", "GeForce4 MX 420 with AGP8X" },
{ 0x0188, "Quadro4 580 XGL", "Quadro4 580 XGL" },
{ 0x018A, "Quadro NVS with AGP8X", "Quadro NVS with AGP8X" },
{ 0x018B, "Quadro4 380 XGL", "Quadro4 380 XGL" },
{ 0x01F0, "GeForce4 MX Integrated GPU", "GeForce4 MX Integrated GPU" },
{ 0x0200, "GeForce3", "GeForce3" },
{ 0x0201, "GeForce3 Ti 200", "GeForce3 Ti 200" },
{ 0x0202, "GeForce3 Ti 500", "GeForce3 Ti 500" },
{ 0x0203, "Quadro DCC", "Quadro DCC" },
{ 0x0250, "GeForce4 Ti 4600", "GeForce4 Ti 4600" },
{ 0x0251, "GeForce4 Ti 4400", "GeForce4 Ti 4400" },
{ 0x0252, "NV25", "NV25" },
{ 0x0253, "GeForce4 Ti 4200", "GeForce4 Ti 4200" },
{ 0x0258, "Quadro4 900 XGL", "Quadro4 900 XGL" },
{ 0x0259, "Quadro4 750 XGL", "Quadro4 750 XGL" },
{ 0x025B, "Quadro4 700 XGL", "Quadro4 700 XGL" },
{ 0x0280, "GeForce4 Ti 4800", "GeForce4 Ti 4800" },
{ 0x0281, "GeForce4 Ti 4200 with AGP8X", "GeForce4 Ti 4200 with AGP8X" },
{ 0x0282, "GeForce4 Ti 4800 SE", "GeForce4 Ti 4800 SE" },
{ 0x0288, "Quadro4 980 XGL", "Quadro4 980 XGL" },
{ 0x0289, "Quadro4 780 XGL", "Quadro4 780 XGL" },
{ 0x0301, "GeForce FX 5800 Ultra", "GeForce FX 5800 Ultra" },
{ 0x0302, "GeForce FX 5800", "GeForce FX 5800" },
{ 0x0308, "Quadro FX 2000", "Quadro FX 2000" },
{ 0x0309, "Quadro FX 1000", "Quadro FX 1000" },
{ 0x030A, "ICE FX 2000", "ICE FX 2000" },
{ 0x0311, "GeForce FX 5600 Ultra", "GeForce FX 5600 Ultra" },
{ 0x0312, "GeForce FX 5600", "GeForce FX 5600" },
{ 0x0313, "NV31", "NV31" },
{ 0x0314, "GeForce FX 5600SE", "GeForce FX 5600SE" },
{ 0x0321, "GeForce FX 5200 Ultra", "GeForce FX 5200 Ultra" },
{ 0x0322, "GeForce FX 5200", "GeForce FX 5200" },
{ 0x0323, "GeForce FX 5200SE", "GeForce FX 5200SE" },
{ 0x032A, "NV34GL", "NV34GL" },
{ 0x032B, "Quadro FX 500", "Quadro FX 500" },
{ 0x032F, "NV34GL", "NV34GL" },
{ 0x0330, "GeForce FX 5900 Ultra", "GeForce FX 5900 Ultra" },
{ 0x0331, "GeForce FX 5900", "GeForce FX 5900" },
{ 0x0332, "NV35", "NV35" },
{ 0x0112, "GeForce2 Go", "GeForce2 Go" },
{ 0x0174, "GeForce4 440 Go", "GeForce4 440 Go" },
{ 0x0175, "GeForce4 420 Go", "GeForce4 420 Go" },
{ 0x0176, "GeForce4 420 Go 32M", "GeForce4 420 Go 32M" },
{ 0x0177, "GeForce4 460 Go", "GeForce4 460 Go" },
{ 0x0179, "GeForce4 440 Go 64M", "GeForce4 440 Go 64M" },
{ 0x017D, "GeForce4 410 Go 16M", "GeForce4 410 Go 16M" },
{ 0x017C, "Quadro4 500 GoGL", "Quadro4 500 GoGL" },
{ 0x0186, "GeForce4 448 Go", "GeForce4 448 Go" },
{ 0x0187, "GeForce4 488 Go", "GeForce4 488 Go" },
{ 0x0286, "GeForce4 4200 Go", "GeForce4 4200 Go" },
{ 0x028C, "Quadro4 700 GoGL", "Quadro4 700 GoGL" },
{ 0x0316, "NV31M", "NV31M" },
{ 0x0317, "NV31M Pro", "NV31M Pro" },
{ 0x031A, "GeForce FX Go5600", "GeForce FX Go5600" },
{ 0x031B, "GeForce FX Go5650", "GeForce FX Go5650" },
{ 0x031C, "Quadro FX Go700", "Quadro FX Go700" },
{ 0x031D, "NV31GLM", "NV31GLM" },
{ 0x031E, "NV31GLM Pro", "NV31GLM Pro" },
{ 0x031F, "NV31GLM Pro", "NV31GLM Pro" },
{ 0x0324, "GeForce FX Go5200", "GeForce FX Go5200" },
{ 0x0325, "GeForce FX Go5250", "GeForce FX Go5250" },
{ 0x0328, "GeForce FX Go5200 32M/64M", "GeForce FX Go5200 32M/64M" },
{ 0x032D, "GeForce FX Go5100", "GeForce FX Go5100" },
</pre>
*/
public class NVidiaDeviceToDriverMapper implements DeviceToDriverMapper, PCI_IDs, NVidiaConstants {
/**
* @see org.jnode.driver.DeviceToDriverMapper#findDriver(org.jnode.driver.Device)
*/
public Driver findDriver(Device device) {
if (!(device instanceof PCIDevice)) {
return null;
}
final PCIDevice dev = (PCIDevice) device;
final PCIDeviceConfig config = dev.getConfig();
if (config.getVendorID() != PCI_VENDOR_ID_NVIDIA) {
return null;
}
switch (config.getDeviceID()) {
case 0x0020:
// NOT TESTED
return new NVidiaDriver(NV04A, "RIVA TNT");
case 0x0028:
// NOT TESTED
return new NVidiaDriver(NV04A, "RIVA TNT2/TNT2 Pro");
case 0x0029:
// NOT TESTED
return new NVidiaDriver(NV04A, "RIVA TNT2 Ultra");
case 0x002C:
// Tested: OK
return new NVidiaDriver(NV04A, "Vanta/Vanta LT");
case 0x002D:
// Tested: OK
return new NVidiaDriver(NV04A, "RIVA TNT2 Model 64/Model 64 Pro");
case 0x00A0:
// NOT TESTED
return new NVidiaDriver(NV04A, "Aladdin TNT2");
case 0x0100:
// Tested: OK
return new NVidiaDriver(NV10A, "GeForce 256");
case 0x0101:
// NOT TESTED
return new NVidiaDriver(NV10A, "GeForce DDR");
default :
return null;
}
}
/**
* Gets the matching level of this mapper.
* The mappers are queried in order of match level. This will ensure
* the best available driver for a device.
*
* @return One of the MATCH_xxx constants.
* @see #MATCH_DEVICE_REVISION
* @see #MATCH_DEVICE
* @see #MATCH_DEVCLASS
*/
public int getMatchLevel() {
return MATCH_DEVICE;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?