diff --git a/.pick_status.json b/.pick_status.json index 00fccf318f7..d2ffedd512c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3444,7 +3444,7 @@ "description": "drirc/iris: add drirc to disable threaded context", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/iris/driinfo_iris.h b/src/gallium/drivers/iris/driinfo_iris.h index b44ff4aa32e..e781c41a33b 100644 --- a/src/gallium/drivers/iris/driinfo_iris.h +++ b/src/gallium/drivers/iris/driinfo_iris.h @@ -8,6 +8,7 @@ DRI_CONF_SECTION_DEBUG DRI_CONF_LIMIT_TRIG_INPUT_RANGE(false) DRI_CONF_INTEL_ENABLE_WA_14018912822(false) DRI_CONF_INTEL_SAMPLER_ROUTE_TO_LSC(false) + DRI_CONF_INTEL_DISABLE_THREADED_CONTEXT(false) DRI_CONF_SECTION_END DRI_CONF_SECTION_PERFORMANCE diff --git a/src/gallium/drivers/iris/iris_context.c b/src/gallium/drivers/iris/iris_context.c index 5c25d5e60e9..f67585649cd 100644 --- a/src/gallium/drivers/iris/iris_context.c +++ b/src/gallium/drivers/iris/iris_context.c @@ -405,6 +405,10 @@ iris_create_context(struct pipe_screen *pscreen, void *priv, unsigned flags) if (flags & PIPE_CONTEXT_COMPUTE_ONLY) return ctx; + /* Threaded context disabled via drirc. */ + if (screen->driconf.disable_threaded_context) + return ctx; + return threaded_context_create(ctx, &screen->transfer_pool, iris_replace_buffer_storage, &(struct threaded_context_options){ diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c index 63d15410743..a36d62e7291 100644 --- a/src/gallium/drivers/iris/iris_screen.c +++ b/src/gallium/drivers/iris/iris_screen.c @@ -737,6 +737,8 @@ iris_screen_create(int fd, const struct pipe_screen_config *config) driQueryOptionb(config->options, "intel_te_distribution"); screen->driconf.generated_indirect_threshold = driQueryOptioni(config->options, "generated_indirect_threshold"); + screen->driconf.disable_threaded_context = + driQueryOptionb(config->options, "intel_disable_threaded_context"); screen->precompile = debug_get_bool_option("shader_precompile", true); diff --git a/src/gallium/drivers/iris/iris_screen.h b/src/gallium/drivers/iris/iris_screen.h index 927d20e0ce1..bc83b78db7f 100644 --- a/src/gallium/drivers/iris/iris_screen.h +++ b/src/gallium/drivers/iris/iris_screen.h @@ -207,6 +207,7 @@ struct iris_screen { bool enable_vf_distribution; bool enable_te_distribution; unsigned generated_indirect_threshold; + bool disable_threaded_context; } driconf; /** Does the kernel support various features (KERNEL_HAS_* bitfield)? */ diff --git a/src/util/driconf.h b/src/util/driconf.h index fed59cc370b..78778ebbbbb 100644 --- a/src/util/driconf.h +++ b/src/util/driconf.h @@ -367,6 +367,9 @@ DRI_CONF_OPT_B(intel_sampler_route_to_lsc, def, \ "Intel specific toggle to enable sampler route to LSC") +#define DRI_CONF_INTEL_DISABLE_THREADED_CONTEXT(def) \ + DRI_CONF_OPT_B(intel_disable_threaded_context, def, "Disable threaded context") + #define DRI_CONF_VK_REQUIRE_ETC2(def) \ DRI_CONF_OPT_B(vk_require_etc2, def, \ "Implement emulated ETC2 on HW that does not support it")