vkphysicaldevice: fetch queue family query result support

And merged in a single structure the queue family operations report.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4716>
This commit is contained in:
Víctor Manuel Jáquez Leal 2023-05-23 12:26:37 +02:00
parent e2a40c58bf
commit 365454790a
4 changed files with 46 additions and 10 deletions

View file

@ -4528,8 +4528,8 @@ called.</doc>
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkphysicaldevice.h">number of elements in @queue_family_props</doc>
<type name="guint32" c:type="guint32"/>
</field>
<field name="queue_family_video_ops">
<type name="guint32" c:type="guint32*"/>
<field name="queue_family_ops">
<type name="VulkanQueueFamilyOps" c:type="GstVulkanQueueFamilyOps*"/>
</field>
<field name="_reserved" readable="0" private="1">
<array zero-terminated="0" fixed-size="4">
@ -4702,6 +4702,17 @@ See gst_vulkan_queue_submit_lock() for details on when this call is needed.</doc
</array>
</field>
</record>
<record name="VulkanQueueFamilyOps" c:type="GstVulkanQueueFamilyOps" version="1.24">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkphysicaldevice.h"/>
<field name="video" writable="1">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkphysicaldevice.h">video operation supported by queue family</doc>
<type name="guint32" c:type="guint32"/>
</field>
<field name="query" writable="1">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/gstvkphysicaldevice.h">if queue family supports queries</doc>
<type name="gboolean" c:type="gboolean"/>
</field>
</record>
<record name="VulkanQueuePrivate" c:type="GstVulkanQueuePrivate" disguised="1">
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/vulkan/vulkan_fwd.h"/>
</record>

View file

@ -261,7 +261,7 @@ gst_vulkan_physical_device_finalize (GObject * object)
g_free (priv->available_extensions);
priv->available_extensions = NULL;
g_free (device->queue_family_video_ops);
g_free (device->queue_family_ops);
g_free (device->queue_family_props);
device->queue_family_props = NULL;
@ -565,7 +565,7 @@ dump_queue_properties (GstVulkanPhysicalDevice * device, GError ** error)
" timestamp bits and a minimum image transfer granuality of %"
GST_VULKAN_EXTENT3D_FORMAT, i, device->queue_family_props[i].queueCount,
device->queue_family_props[i].queueFlags, queue_flags_str,
device->queue_family_video_ops[i],
device->queue_family_ops[i].video,
device->queue_family_props[i].timestampValidBits,
GST_VULKAN_EXTENT3D_ARGS (device->
queue_family_props[i].minImageTransferGranularity));
@ -1009,15 +1009,24 @@ gst_vulkan_physical_device_fill_info (GstVulkanPhysicalDevice * device,
void *next = NULL;
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
VkQueueFamilyVideoPropertiesKHR *queue_family_video_props;
VkQueueFamilyQueryResultStatusPropertiesKHR *queue_family_query_props;
queue_family_video_props =
g_new0 (VkQueueFamilyVideoPropertiesKHR, device->n_queue_families);
queue_family_query_props =
g_new0 (VkQueueFamilyQueryResultStatusPropertiesKHR,
device->n_queue_families);
#endif
props = g_new0 (VkQueueFamilyProperties2, device->n_queue_families);
for (i = 0; i < device->n_queue_families; i++) {
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
queue_family_query_props[i].sType =
VK_STRUCTURE_TYPE_QUEUE_FAMILY_QUERY_RESULT_STATUS_PROPERTIES_KHR;
queue_family_video_props[i].sType =
VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR;
queue_family_video_props[i].pNext = &queue_family_query_props[i];
next = &queue_family_video_props[i];
#endif
props[i].sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2;
@ -1028,15 +1037,17 @@ gst_vulkan_physical_device_fill_info (GstVulkanPhysicalDevice * device,
device->queue_family_props =
g_new0 (VkQueueFamilyProperties, device->n_queue_families);
device->queue_family_video_ops =
g_new (guint32, device->n_queue_families);
device->queue_family_ops =
g_new0 (GstVulkanQueueFamilyOps, device->n_queue_families);
for (i = 0; i < device->n_queue_families; i++) {
memcpy (&device->queue_family_props[i], &props[i].queueFamilyProperties,
sizeof (device->queue_family_props[i]));
#if GST_VULKAN_HAVE_VIDEO_EXTENSIONS
device->queue_family_video_ops[i] =
device->queue_family_ops[i].video =
queue_family_video_props[i].videoCodecOperations;
device->queue_family_ops[i].query =
queue_family_query_props[i].queryResultStatusSupport;
#endif
}
g_free (props);

View file

@ -35,6 +35,19 @@ G_BEGIN_DECLS
GST_VULKAN_API
GType gst_vulkan_physical_device_get_type (void);
/**
* GstVulkanQueueFamilyOps:
* @video: video operation supported by queue family
* @query: if queue family supports queries
*
* Since: 1.24
*/
struct _GstVulkanQueueFamilyOps
{
guint32 video;
gboolean query;
};
/**
* GstVulkanPhysicalDevice:
* @parent: the parent #GstObject
@ -66,13 +79,13 @@ struct _GstVulkanPhysicalDevice
guint32 n_queue_families;
/**
* GstVulkanPhysicalDevice.queue_family_video_ops:
* GstVulkanPhysicalDevice.queue_family_ops:
*
* vulkan video operations allowed per queue family
* vulkan operations allowed per queue family
*
* Since: 1.24
*/
guint32 *queue_family_video_ops;
GstVulkanQueueFamilyOps *queue_family_ops;
/* <private> */
gpointer _reserved [GST_PADDING];

View file

@ -111,6 +111,7 @@ typedef struct _GstVulkanFullScreenQuad GstVulkanFullScreenQuad;
typedef struct _GstVulkanFullScreenQuadClass GstVulkanFullScreenQuadClass;
typedef struct _GstVulkanFullScreenQuadPrivate GstVulkanFullScreenQuadPrivate;
typedef struct _GstVulkanQueueFamilyOps GstVulkanQueueFamilyOps;
typedef struct _GstVulkanVideoProfile GstVulkanVideoProfile;
G_END_DECLS