Add code to few more essential methods in libresoc_device.c
[mesa.git] / src / libre-soc / vulkan / libresoc_private.h
index 5aba3eb4142e058bd67c20e23a7d980ec52e601b..1cb3b0519b4e6cbf678888c7166d830031a6ab55 100644 (file)
@@ -4,7 +4,7 @@
  * based in part on anv driver which is:
  * Copyright © 2015 Intel Corporation
  *
- * based in part on radv driver which is:
+ * based in part on libresoc driver which is:
  * Copyright © 2016 Red Hat.
  * Copyright © 2016 Bas Nieuwenhuizen
  *
 #include <vulkan/vulkan.h>
 #include <vulkan/vk_icd.h>
 
-//#include "common/libresoc_device_info.h"
-
 #include "vk_debug_report.h"
 #include "util/xmlconfig.h"
 
 #include "vk_object.h"
 #include "libresoc_entrypoints.h"
 #include "libresoc_extensions.h"
+#include "libresoc_constants.h"
 
+#define LIBRESOC_MAX_QUEUE_FAMILIES 1 
 struct libresoc_instance;
 
 struct libresoc_device {
    VK_LOADER_DATA _loader_data;
 
+   struct vk_device vk;
    VkAllocationCallbacks alloc;
 
    struct libresoc_instance *instance;
@@ -56,6 +57,11 @@ struct libresoc_device {
    struct libresoc_device_extension_table enabled_extensions;
    struct libresoc_device_dispatch_table dispatch;
 
+   struct libresoc_queue *queues[LIBRESOC_MAX_QUEUE_FAMILIES];
+   int queue_count[LIBRESOC_MAX_QUEUE_FAMILIES];
+   struct radeon_cmdbuf *empty_cs[LIBRESOC_MAX_QUEUE_FAMILIES];
+   struct libresoc_physical_device                  *physical_device;
+
    /* FIXME: stub */
 };
 
@@ -63,11 +69,13 @@ struct libresoc_device {
 struct libresoc_physical_device {
    VK_LOADER_DATA _loader_data;
 
+   struct list_head                            link;
    struct libresoc_instance *instance;
 
    struct libresoc_device_extension_table supported_extensions;
    struct libresoc_physical_device_dispatch_table dispatch;
 
+   char                                        name[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE];
    /* FIXME: stub */
 };
 
@@ -85,14 +93,19 @@ struct libresoc_instance {
 
    VkAllocationCallbacks alloc;
 
+   uint32_t                                    apiVersion;
+
+   char *                                      engineName;
+   uint32_t                                    engineVersion;
    struct libresoc_app_info app_info;
 
+   bool                                        physical_devices_enumerated;
    struct libresoc_instance_extension_table enabled_extensions;
    struct libresoc_instance_dispatch_table dispatch;
    struct libresoc_device_dispatch_table device_dispatch;
-
+   struct libresoc_physical_device_dispatch_table   physical_device_dispatch;
    int physical_device_count;
-   struct libresoc_physical_device physical_device;
+   struct list_head physical_devices;
 
    struct vk_debug_report_instance debug_report_callbacks;
 };
@@ -102,6 +115,8 @@ struct libresoc_queue {
 
    struct libresoc_device *device;
 
+   uint32_t queue_family_index;
+   int queue_idx;
    VkDeviceQueueCreateFlags flags;
 
    /* FIXME: stub */