mirror of
https://github.com/elwrcl/intel-hard-graphics.git
synced 2026-10-31 10:58:03 +03:00
hasvk: Gate video decode behind HASVK_DEBUG=video-decode.
Assisted-by: Claude
This commit is contained in:
1 parent
31fd4c3ded
commit
bd3d4fc732
3 files changed
+20
-3
No files matched your search
@@ -96,6 +96,13 @@ static const driOptionDescription anv_dri_options[] = {
|
|||||||
/* Render engine timestamp register */
|
/* Render engine timestamp register */
|
||||||
#define TIMESTAMP 0x2358
|
#define TIMESTAMP 0x2358
|
||||||
|
|
||||||
|
static const struct debug_control debug_control[] = {
|
||||||
|
{ "video-decode", ANV_DEBUG_VIDEO_DECODE },
|
||||||
|
{ NULL, 0 }
|
||||||
|
};
|
||||||
|
|
||||||
|
enum anv_debug anv_debug;
|
||||||
|
|
||||||
/* The "RAW" clocks on Linux are called "FAST" on FreeBSD */
|
/* The "RAW" clocks on Linux are called "FAST" on FreeBSD */
|
||||||
#if !defined(CLOCK_MONOTONIC_RAW) && defined(CLOCK_MONOTONIC_FAST)
|
#if !defined(CLOCK_MONOTONIC_RAW) && defined(CLOCK_MONOTONIC_FAST)
|
||||||
#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_FAST
|
#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_FAST
|
||||||
@@ -198,7 +205,7 @@ get_device_extensions(const struct anv_physical_device *device,
|
|||||||
const bool has_syncobj_wait =
|
const bool has_syncobj_wait =
|
||||||
(device->sync_syncobj_type.features & VK_SYNC_FEATURE_CPU_WAIT) != 0;
|
(device->sync_syncobj_type.features & VK_SYNC_FEATURE_CPU_WAIT) != 0;
|
||||||
|
|
||||||
const bool video_decode = VIDEO_CODEC_H264DEC;
|
const bool video_decode = VIDEO_CODEC_H264DEC && ANV_DEBUG(VIDEO_DECODE);
|
||||||
|
|
||||||
*ext = (struct vk_device_extension_table) {
|
*ext = (struct vk_device_extension_table) {
|
||||||
.KHR_8bit_storage = device->info.ver >= 8,
|
.KHR_8bit_storage = device->info.ver >= 8,
|
||||||
@@ -1582,7 +1589,7 @@ anv_physical_device_init_queue_families(struct anv_physical_device *pdevice)
|
|||||||
.engine_class = INTEL_ENGINE_CLASS_RENDER,
|
.engine_class = INTEL_ENGINE_CLASS_RENDER,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (v_count > 0 && VIDEO_CODEC_H264DEC) {
|
if (v_count > 0 && VIDEO_CODEC_H264DEC && ANV_DEBUG(VIDEO_DECODE)) {
|
||||||
pdevice->queue.families[family_count++] = (struct anv_queue_family) {
|
pdevice->queue.families[family_count++] = (struct anv_queue_family) {
|
||||||
.queueFlags = VK_QUEUE_VIDEO_DECODE_BIT_KHR,
|
.queueFlags = VK_QUEUE_VIDEO_DECODE_BIT_KHR,
|
||||||
.queueCount = v_count,
|
.queueCount = v_count,
|
||||||
@@ -2024,6 +2031,7 @@ VkResult anv_CreateInstance(
|
|||||||
anv_init_dri_options(instance);
|
anv_init_dri_options(instance);
|
||||||
|
|
||||||
process_intel_debug_variable();
|
process_intel_debug_variable();
|
||||||
|
anv_debug = parse_debug_string(os_get_option("HASVK_DEBUG"), debug_control);
|
||||||
instance->vk.enable_debug_logging = INTEL_DEBUG(DEBUG_PERF);
|
instance->vk.enable_debug_logging = INTEL_DEBUG(DEBUG_PERF);
|
||||||
|
|
||||||
intel_driver_ds_init();
|
intel_driver_ds_init();
|
||||||
|
|||||||
@@ -606,7 +606,7 @@ anv_get_image_format_features2(const struct intel_device_info *devinfo,
|
|||||||
|
|
||||||
if ((anv_format->flags & ANV_FORMAT_FLAG_CAN_VIDEO) &&
|
if ((anv_format->flags & ANV_FORMAT_FLAG_CAN_VIDEO) &&
|
||||||
(anv_format->n_planes > 1 || vk_tiling == VK_IMAGE_TILING_OPTIMAL)) {
|
(anv_format->n_planes > 1 || vk_tiling == VK_IMAGE_TILING_OPTIMAL)) {
|
||||||
flags |= VIDEO_CODEC_H264DEC ?
|
flags |= (VIDEO_CODEC_H264DEC && ANV_DEBUG(VIDEO_DECODE)) ?
|
||||||
VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR |
|
VK_FORMAT_FEATURE_2_VIDEO_DECODE_OUTPUT_BIT_KHR |
|
||||||
VK_FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR : 0;
|
VK_FORMAT_FEATURE_2_VIDEO_DECODE_DPB_BIT_KHR : 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -940,6 +940,15 @@ struct anv_instance {
|
|||||||
bool no_16bit;
|
bool no_16bit;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Parsed from the HASVK_DEBUG environment variable. */
|
||||||
|
enum anv_debug {
|
||||||
|
ANV_DEBUG_VIDEO_DECODE = BITFIELD_BIT(0),
|
||||||
|
};
|
||||||
|
|
||||||
|
extern enum anv_debug anv_debug;
|
||||||
|
|
||||||
|
#define ANV_DEBUG(name) unlikely(anv_debug & ANV_DEBUG_##name)
|
||||||
|
|
||||||
VkResult anv_init_wsi(struct anv_physical_device *physical_device);
|
VkResult anv_init_wsi(struct anv_physical_device *physical_device);
|
||||||
void anv_finish_wsi(struct anv_physical_device *physical_device);
|
void anv_finish_wsi(struct anv_physical_device *physical_device);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user