close(device->local_fd);
if (device->master_fd >= 0)
close(device->master_fd);
+
+#if using_v3d_simulator
+ v3d_simulator_destroy(device->sim_file);
+#endif
}
void
snprintf(device->path, ARRAY_SIZE(device->path), "%s", path);
/* FIXME: we will have to do plenty more here */
- device->name = "Broadcom Video Core VI";
device->local_fd = fd;
device->master_fd = -1;
uint8_t zeroes[VK_UUID_SIZE] = { 0 };
memcpy(device->pipeline_cache_uuid, zeroes, VK_UUID_SIZE);
+#if using_v3d_simulator
+ device->sim_file = v3d_simulator_init(device->local_fd);
+#endif
+
return VK_SUCCESS;
}
#include <vulkan/vulkan.h>
#include <vulkan/vk_icd.h>
+#include <xf86drm.h>
+
#ifdef HAVE_VALGRIND
#include <valgrind/valgrind.h>
#include <valgrind/memcheck.h>
#include "v3dv_extensions.h"
#include "vk_alloc.h"
+#include "simulator/v3d_simulator.h"
/*
* FIXME: confirm value
struct v3dv_instance;
+#ifdef USE_V3D_SIMULATOR
+#define using_v3d_simulator true
+#else
+#define using_v3d_simulator false
+#endif
+
+struct v3d_simulator_file;
+
struct v3dv_device {
VK_LOADER_DATA _loader_data;
uint8_t pipeline_cache_uuid[VK_UUID_SIZE];
/* FIXME: stub */
+ struct v3d_device_info devinfo;
+
+ struct v3d_simulator_file *sim_file;
};
struct v3dv_app_info {
V3DV_DEFINE_NONDISP_HANDLE_CASTS(v3dv_device_memory, VkDeviceMemory)
+static inline int
+v3dv_ioctl(int fd, unsigned long request, void *arg)
+{
+ if (using_v3d_simulator)
+ return v3d_simulator_ioctl(fd, request, arg);
+ else
+ return drmIoctl(fd, request, arg);
+}
+
#endif /* V3DV_PRIVATE_H */