st/nine: Add new function to know if we are the worker

This will be useful in a later patch

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9377>
This commit is contained in:
Axel Davy 2021-02-04 22:18:25 +01:00 committed by Marge Bot
parent fd017458bc
commit 6087ff44ae
2 changed files with 14 additions and 0 deletions

View File

@ -317,6 +317,17 @@ nine_context_get_pipe_release( struct NineDevice9 *device )
nine_csmt_resume(device);
}
bool
nine_context_is_worker( struct NineDevice9 *device )
{
struct csmt_context *ctx = device->csmt_ctx;
if (!device->csmt_active)
return false;
return u_thread_is_self(ctx->worker);
}
/* Nine state functions */
/* Check if some states need to be set dirty */

View File

@ -672,4 +672,7 @@ nine_context_get_pipe_acquire( struct NineDevice9 *device );
void
nine_context_get_pipe_release( struct NineDevice9 *device );
bool
nine_context_is_worker( struct NineDevice9 *device );
#endif /* _NINE_STATE_H_ */