diff --git a/docs/envvars.rst b/docs/envvars.rst index c84ed7a09c5..084e37fa1fd 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -703,6 +703,14 @@ Intel driver environment variables ``INTEL_MEASURE=cpu {workload}`` +.. envvar:: INTEL_MODIFIER_OVERRIDE + + if set, determines the single DRM modifier reported back to (Vulkan) + applications, in order to make selecting modifier deterministic + between Vulkan driver and applications. The value can be one of the + supported modifiers on a platform, but other values are also acceptable + for debug purposes. + .. envvar:: INTEL_NO_HW if set to 1, true or yes, prevents batches from being submitted to the diff --git a/src/intel/isl/isl_drm.c b/src/intel/isl/isl_drm.c index 499acf7921b..2a154e64f12 100644 --- a/src/intel/isl/isl_drm.c +++ b/src/intel/isl/isl_drm.c @@ -190,6 +190,14 @@ uint32_t isl_drm_modifier_get_score(const struct intel_device_info *devinfo, uint64_t modifier) { + /* We want to know the absence of the debug environment variable + * and don't want to provide a default value either, so we don't + * use debug_get_num_option() here. + */ + const char *mod_str = getenv("INTEL_MODIFIER_OVERRIDE"); + if (mod_str != NULL) { + return modifier == strtoul(mod_str, NULL, 0); + } /* FINISHME: Add gfx12 modifiers */ switch (modifier) { default: