st/mesa: fold GLThread.enabled into pin_thread_counter to skip that checking

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20287>
This commit is contained in:
Marek Olšák 2022-12-11 17:16:39 -05:00
parent 23f9f6787a
commit ea11f48a53
2 changed files with 3 additions and 2 deletions

View file

@ -152,6 +152,9 @@ _mesa_glthread_init(struct gl_context *ctx)
glthread->LastDListChangeBatchIndex = -1;
/* glthread takes over all L3 pinning */
ctx->st->pin_thread_counter = ST_L3_PINNING_DISABLED;
/* Execute the thread initialization function in the thread. */
struct util_queue_fence fence;
util_queue_fence_init(&fence);

View file

@ -91,8 +91,6 @@ prepare_draw(struct st_context *st, struct gl_context *ctx, uint64_t state_mask)
* running on. The main thread can move between CCXs.
*/
if (unlikely(st->pin_thread_counter != ST_L3_PINNING_DISABLED &&
/* no glthread */
!ctx->GLThread.enabled &&
/* do it occasionally */
++st->pin_thread_counter % 512 == 0)) {
st->pin_thread_counter = 0;