anv/drirc: Add option to control implicit sync on external BOs

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10546
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27704>
This commit is contained in:
Matt Turner 2024-02-20 14:15:00 -05:00 committed by Marge Bot
parent cfc8cf198c
commit 9f32e1a489
3 changed files with 9 additions and 1 deletions

View file

@ -78,6 +78,7 @@ static const driOptionDescription anv_dri_options[] = {
DRI_CONF_VK_XWAYLAND_WAIT_READY(false) DRI_CONF_VK_XWAYLAND_WAIT_READY(false)
DRI_CONF_ANV_ASSUME_FULL_SUBGROUPS(0) DRI_CONF_ANV_ASSUME_FULL_SUBGROUPS(0)
DRI_CONF_ANV_DISABLE_FCV(false) DRI_CONF_ANV_DISABLE_FCV(false)
DRI_CONF_ANV_EXTERNAL_MEMORY_IMPLICIT_SYNC(true)
DRI_CONF_ANV_SAMPLE_MASK_OUT_OPENGL_BEHAVIOUR(false) DRI_CONF_ANV_SAMPLE_MASK_OUT_OPENGL_BEHAVIOUR(false)
DRI_CONF_ANV_FORCE_FILTER_ADDR_ROUNDING(false) DRI_CONF_ANV_FORCE_FILTER_ADDR_ROUNDING(false)
DRI_CONF_ANV_FP64_WORKAROUND_ENABLED(false) DRI_CONF_ANV_FP64_WORKAROUND_ENABLED(false)
@ -2505,6 +2506,8 @@ anv_init_dri_options(struct anv_instance *instance)
instance->enable_tbimr = driQueryOptionb(&instance->dri_options, "intel_tbimr"); instance->enable_tbimr = driQueryOptionb(&instance->dri_options, "intel_tbimr");
instance->disable_fcv = instance->disable_fcv =
driQueryOptionb(&instance->dri_options, "anv_disable_fcv"); driQueryOptionb(&instance->dri_options, "anv_disable_fcv");
instance->external_memory_implicit_sync =
driQueryOptionb(&instance->dri_options, "anv_external_memory_implicit_sync");
} }
VkResult anv_CreateInstance( VkResult anv_CreateInstance(
@ -4135,7 +4138,8 @@ VkResult anv_AllocateMemory(
alloc_flags |= ANV_BO_ALLOC_EXTERNAL; alloc_flags |= ANV_BO_ALLOC_EXTERNAL;
/* wsi has its own way of synchronizing with the compositor */ /* wsi has its own way of synchronizing with the compositor */
if (!wsi_info && dedicated_info && if (pdevice->instance->external_memory_implicit_sync &&
!wsi_info && dedicated_info &&
dedicated_info->image != VK_NULL_HANDLE) { dedicated_info->image != VK_NULL_HANDLE) {
ANV_FROM_HANDLE(anv_image, image, dedicated_info->image); ANV_FROM_HANDLE(anv_image, image, dedicated_info->image);

View file

@ -1197,6 +1197,7 @@ struct anv_instance {
int mesh_conv_prim_attrs_to_vert_attrs; int mesh_conv_prim_attrs_to_vert_attrs;
bool enable_tbimr; bool enable_tbimr;
bool external_memory_implicit_sync;
/** /**
* Workarounds for game bugs. * Workarounds for game bugs.

View file

@ -780,6 +780,9 @@
DRI_CONF_OPT_B(anv_disable_fcv, def, \ DRI_CONF_OPT_B(anv_disable_fcv, def, \
"Disable FCV optimization") "Disable FCV optimization")
#define DRI_CONF_ANV_EXTERNAL_MEMORY_IMPLICIT_SYNC(def) \
DRI_CONF_OPT_B(anv_external_memory_implicit_sync, def, "Implicit sync on external BOs")
#define DRI_CONF_ANV_HASVK_OVERRIDE_API_VERSION(def) \ #define DRI_CONF_ANV_HASVK_OVERRIDE_API_VERSION(def) \
DRI_CONF_OPT_B(hasvk_report_vk_1_3_version, def, \ DRI_CONF_OPT_B(hasvk_report_vk_1_3_version, def, \
"Override intel_hasvk API version") "Override intel_hasvk API version")