Make us capable of supporting driver specific issues(OSS versus official)

This commit is contained in:
Ryan Houdek 2013-08-21 05:34:42 -05:00
parent 906cbe5ddf
commit 1910f5851f
3 changed files with 56 additions and 10 deletions

View File

@ -20,6 +20,7 @@ namespace DriverDetails
// Local members // Local members
Vendor m_vendor = VENDOR_UNKNOWN; Vendor m_vendor = VENDOR_UNKNOWN;
Driver m_driver = DRIVER_UNKNOWN;
u32 m_devfamily = 0; u32 m_devfamily = 0;
double m_version = 0.0; double m_version = 0.0;
@ -36,24 +37,52 @@ namespace DriverDetails
// Private function // Private function
void InitBugMap() void InitBugMap()
{ {
switch(m_vendor) switch(m_driver)
{ {
case VENDOR_QUALCOMM: case DRIVER_QUALCOMM:
for (unsigned int a = 0; a < (sizeof(m_qualcommbugs) / sizeof(BugInfo)); ++a) for (unsigned int a = 0; a < (sizeof(m_qualcommbugs) / sizeof(BugInfo)); ++a)
m_bugs[std::make_pair(m_vendor, m_qualcommbugs[a].m_bug)] = m_qualcommbugs[a]; m_bugs[std::make_pair(m_vendor, m_qualcommbugs[a].m_bug)] = m_qualcommbugs[a];
break; break;
case VENDOR_ARM:
default: default:
break; break;
} }
} }
void Init(Vendor vendor, const u32 devfamily, const double version) void Init(Vendor vendor, Driver driver, const u32 devfamily, const double version)
{ {
m_vendor = vendor; m_vendor = vendor;
m_driver = driver;
m_devfamily = devfamily; m_devfamily = devfamily;
m_version = version; m_version = version;
InitBugMap(); InitBugMap();
if (driver == DRIVER_UNKNOWN)
switch(vendor)
{
case VENDOR_NVIDIA:
case VENDOR_TEGRA:
m_driver = DRIVER_NVIDIA;
break;
case VENDOR_ATI:
m_driver = DRIVER_ATI;
break;
case VENDOR_INTEL:
m_driver = DRIVER_INTEL;
break;
case VENDOR_ARM:
m_driver = DRIVER_ARM;
break;
case VENDOR_QUALCOMM:
m_driver = DRIVER_QUALCOMM;
break;
case VENDOR_IMGTEC:
m_driver = DRIVER_IMGTEC;
break;
case VENDOR_VIVANTE:
m_driver = DRIVER_VIVANTE;
break;
default:
break;
}
for (auto it = m_bugs.begin(); it != m_bugs.end(); ++it) for (auto it = m_bugs.begin(); it != m_bugs.end(); ++it)
if (it->second.m_devfamily == m_devfamily) if (it->second.m_devfamily == m_devfamily)

View File

@ -21,6 +21,23 @@ namespace DriverDetails
VENDOR_UNKNOWN VENDOR_UNKNOWN
}; };
// Enum of known drivers
enum Driver
{
DRIVER_NVIDIA = 0, // Official Nvidia, including mobile GPU
DRIVER_NOUVEAU, // OSS nouveau
DRIVER_ATI, // Official Nvidia
DRIVER_RADEONHD, // OSS Radeon
DRIVER_INTEL, // Official Intel
DRIVER_ARM, // Official Mali driver
DRIVER_LIMA, // OSS Mali driver
DRIVER_QUALCOMM, // Official Adreno driver
DRIVER_FREEDRENO, // OSS Adreno driver
DRIVER_IMGTEC, // OSS PowerVR driver
DRIVER_VIVANTE, // Official vivante driver
DRIVER_UNKNOWN // Unknown driver, default to official hardware driver
};
// Enum of known bugs // Enum of known bugs
// These can be vendor specific, but we put them all in here // These can be vendor specific, but we put them all in here
// For putting a new bug in here, make sure to put a detailed comment above the enum // For putting a new bug in here, make sure to put a detailed comment above the enum
@ -55,7 +72,7 @@ namespace DriverDetails
}; };
// Initializes our internal vendor, device family, and driver version // Initializes our internal vendor, device family, and driver version
void Init(Vendor vendor, const u32 devfamily, const double version); void Init(Vendor vendor, Driver driver, const u32 devfamily, const double version);
// Once Vendor and driver version is set, this will return if it has the applicable bug passed to it. // Once Vendor and driver version is set, this will return if it has the applicable bug passed to it.
bool HasBug(Bug bug); bool HasBug(Bug bug);

View File

@ -269,17 +269,17 @@ void GLAPIENTRY ClearDepthf(GLfloat depthval)
void InitDriverInfo() void InitDriverInfo()
{ {
// Get Vendor
std::string svendor = std::string(g_ogl_config.gl_vendor); std::string svendor = std::string(g_ogl_config.gl_vendor);
std::string srenderer = std::string(g_ogl_config.gl_renderer); std::string srenderer = std::string(g_ogl_config.gl_renderer);
DriverDetails::Vendor vendor = DriverDetails::VENDOR_UNKNOWN; DriverDetails::Vendor vendor = DriverDetails::VENDOR_UNKNOWN;
DriverDetails::Driver driver = DriverDetails::DRIVER_UNKNOWN;
u32 devfamily = 0; u32 devfamily = 0;
double version = 0.0; double version = 0.0;
// Get Vendor first // Get the vendor first
if (svendor == "NVIDIA Corporation" && srenderer != "NVIDIA Tegra") if (svendor == "NVIDIA Corporation" && srenderer != "NVIDIA Tegra")
vendor = DriverDetails::VENDOR_NVIDIA; vendor = DriverDetails::VENDOR_NVIDIA;
else if (svendor == "ATI Technologies Inc.") else if (svendor == "ATI Technologies Inc." || svendor == "Advanced Micro Devices, Inc.")
vendor = DriverDetails::VENDOR_ATI; vendor = DriverDetails::VENDOR_ATI;
else if (std::string::npos != svendor.find("Intel")) else if (std::string::npos != svendor.find("Intel"))
vendor = DriverDetails::VENDOR_INTEL; vendor = DriverDetails::VENDOR_INTEL;
@ -317,7 +317,7 @@ void InitDriverInfo()
default: default:
break; break;
} }
DriverDetails::Init(vendor, devfamily, version); DriverDetails::Init(vendor, driver, devfamily, version);
} }
// Init functions // Init functions