#include "block/block_int.h"
#include "sysemu/block-backend.h"
#include "net/net.h"
+#include "qmp-commands.h"
#include "emulator_options.h"
#include "skin/maruskin_server.h"
return _emul_info.skin_path;
}
-/* GPU virtualization */
-void set_emul_gpu_accel(bool enable)
-{
- _emul_info.gpu_accel_enable = enable;
-}
-
-bool get_emul_gpu_accel(void)
-{
- return _emul_info.gpu_accel_enable;
-}
-
/* CPU virtualization */
bool get_emul_cpu_accel(void)
{
return vm_data_path;
}
+
+/* GPU virtualization */
+static bool is_gpu_accel;
+
+bool get_emul_gpu_accel(void)
+{
+ static bool is_done;
+ PciInfoList *info_list, *info;
+ Error *err = NULL;
+
+ if (is_done) {
+ return is_gpu_accel;
+ }
+
+ info_list = qmp_query_pci(&err);
+ if (err) {
+ LOG_WARNING("PCI devices not supported\n");
+ error_free(err);
+ is_done = true;
+ return false;
+ }
+
+ for (info = info_list; info; info = info->next) {
+ PciDeviceInfoList *dev;
+
+ for (dev = info->value->devices; dev; dev = dev->next) {
+ /* TODO: use defines in the pci_regs.h
+ instead of the hard coding */
+ if (dev->value->id.vendor == 0x19B1
+ && dev->value->id.device == 0x1010) {
+ is_gpu_accel = true;
+ }
+ }
+ }
+
+ qapi_free_PciInfoList(info_list);
+ is_done = true;
+
+ return is_gpu_accel;
+}
int spice_port;
const char *skin_path;
- bool gpu_accel_enable;
const char *file_sharing_path;
const char *vm_ram_size;
int serial_port;
void set_emul_ecs_port(int port);
void set_emul_guest_ip(char *ip);
void set_emul_host_ip(char *ip);
-void set_emul_gpu_accel(bool enable);
void set_emul_file_sharing_path(const char *path);
void set_emul_ram_size(const char *size);
case QEMU_OPTION_enable_yagl:
#if defined(CONFIG_YAGL)
enable_yagl = 1;
-#ifdef CONFIG_MARU
- set_emul_gpu_accel(true);
-#endif
#else
fprintf(stderr, "YaGL openGLES passthrough support is disabled,"
" ignoring -enable-yagl\n");