00001 00032 #ifndef LL_LLDXHARDWARE_H 00033 #define LL_LLDXHARDWARE_H 00034 00035 #include <map> 00036 00037 #include "stdtypes.h" 00038 #include "llstring.h" 00039 #include "llsd.h" 00040 00041 class LLVersion 00042 { 00043 public: 00044 LLVersion(); 00045 BOOL set(const std::string &version_string); 00046 S32 getField(const S32 field_num); 00047 protected: 00048 std::string mVersionString; 00049 S32 mFields[4]; 00050 BOOL mValid; 00051 }; 00052 00053 class LLDXDriverFile 00054 { 00055 public: 00056 LLString dump(); 00057 00058 public: 00059 std::string mFilepath; 00060 std::string mName; 00061 std::string mVersionString; 00062 LLVersion mVersion; 00063 std::string mDateString; 00064 }; 00065 00066 class LLDXDevice 00067 { 00068 public: 00069 ~LLDXDevice(); 00070 std::string dump(); 00071 00072 LLDXDriverFile *findDriver(const std::string &driver); 00073 public: 00074 std::string mName; 00075 std::string mPCIString; 00076 std::string mVendorID; 00077 std::string mDeviceID; 00078 00079 typedef std::map<std::string, LLDXDriverFile *> driver_file_map_t; 00080 driver_file_map_t mDriverFiles; 00081 }; 00082 00083 00084 class LLDXHardware 00085 { 00086 public: 00087 LLDXHardware(); 00088 00089 void setWriteDebugFunc(void (*func)(const char*)); 00090 void cleanup(); 00091 00092 // Returns TRUE on success. 00093 // vram_only TRUE does a "light" probe. 00094 BOOL getInfo(BOOL vram_only); 00095 00096 S32 getVRAM() const { return mVRAM; } 00097 00098 LLSD getDisplayInfo(); 00099 00100 // Find a particular device that matches the following specs. 00101 // Empty strings indicate that you don't care. 00102 // You can separate multiple devices with '|' chars to indicate you want 00103 // ANY of them to match and return. 00104 // LLDXDevice *findDevice(const std::string &vendor, const std::string &devices); 00105 00106 // LLString dumpDevices(); 00107 public: 00108 typedef std::map<std::string, LLDXDevice *> device_map_t; 00109 // device_map_t mDevices; 00110 protected: 00111 S32 mVRAM; 00112 }; 00113 00114 extern void (*gWriteDebug)(const char* msg); 00115 extern LLDXHardware gDXHardware; 00116 00117 #endif // LL_LLDXHARDWARE_H