GPU: hard codes QEMU virtual GPU

This commit is contained in:
Carter Li
2026-04-20 22:25:19 +08:00
parent 910ba413da
commit 69c86c95b7
3 changed files with 9 additions and 0 deletions
+3
View File
@@ -22,6 +22,7 @@ const char* FF_GPU_VENDOR_NAME_LOONGSON = "Loongson";
const char* FF_GPU_VENDOR_NAME_JINGJIA_MICRO = "Jingjia Micro";
const char* FF_GPU_VENDOR_NAME_HUAWEI = "Huawei";
const char* FF_GPU_VENDOR_NAME_ZHAOXIN = "Zhaoxin";
const char* FF_GPU_VENDOR_NAME_QEMU = "QEMU";
const char* ffGPUGetVendorString(unsigned vendorId) {
// https://devicehunt.com/all-pci-vendors
@@ -69,6 +70,8 @@ const char* ffGPUGetVendorString(unsigned vendorId) {
return FF_GPU_VENDOR_NAME_HUAWEI;
case 0x1d17:
return FF_GPU_VENDOR_NAME_ZHAOXIN;
case 0x1234: // https://admin.pci-ids.ucw.cz/read/PC/1234
return FF_GPU_VENDOR_NAME_QEMU;
default:
return NULL;
}
+1
View File
@@ -27,6 +27,7 @@ extern const char* FF_GPU_VENDOR_NAME_LOONGSON;
extern const char* FF_GPU_VENDOR_NAME_JINGJIA_MICRO;
extern const char* FF_GPU_VENDOR_NAME_HUAWEI;
extern const char* FF_GPU_VENDOR_NAME_ZHAOXIN;
extern const char* FF_GPU_VENDOR_NAME_QEMU;
typedef struct FFGPUMemory {
uint64_t total;
+5
View File
@@ -199,6 +199,11 @@ static bool loadPciidsInc(uint8_t subclass, uint16_t vendor, uint16_t device, FF
#endif
void ffGPUFillVendorAndName(uint8_t subclass, uint16_t vendor, uint16_t device, FFGPUResult* gpu) {
if (vendor == 0x1234 && device == 0x1111 && subclass == 0) { // Not exist in pci.ids
ffStrbufSetStatic(&gpu->name, "Virtual Video Controller");
return;
}
#if FF_HAVE_EMBEDDED_PCIIDS
bool ok = loadPciidsInc(subclass, vendor, device, gpu);
if (ok) {