[Mesa-dev] [PATCH 1/5] winsys/radeon: fix killing the CS thread

Marek Olšák maraeo at gmail.com
Sat Sep 21 08:29:09 PDT 2013


For all patches except NV_vdpau_interop:

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

For NV_vdpau_interop, I sent another review a while ago.

Mare

On Sat, Sep 21, 2013 at 4:41 PM, Christian König
<deathsimple at vodafone.de> wrote:
> From: Christian König <christian.koenig at amd.com>
>
> Kill the thread only after we checked that it's not used any more, not before.
>
> Signed-off-by: Christian König <christian.koenig at amd.com>
> ---
>  src/gallium/winsys/radeon/drm/radeon_drm_winsys.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
> index 69c42a0..0a3b932 100644
> --- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
> +++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
> @@ -421,6 +421,10 @@ static void radeon_winsys_destroy(struct radeon_winsys *rws)
>  {
>      struct radeon_drm_winsys *ws = (struct radeon_drm_winsys*)rws;
>
> +    if (!pipe_reference(&ws->base.reference, NULL)) {
> +        return;
> +    }
> +
>      if (ws->thread) {
>          ws->kill_thread = 1;
>          pipe_semaphore_signal(&ws->cs_queued);
> @@ -429,10 +433,6 @@ static void radeon_winsys_destroy(struct radeon_winsys *rws)
>      pipe_semaphore_destroy(&ws->cs_queued);
>      pipe_condvar_destroy(ws->cs_queue_empty);
>
> -    if (!pipe_reference(&ws->base.reference, NULL)) {
> -        return;
> -    }
> -
>      pipe_mutex_destroy(ws->hyperz_owner_mutex);
>      pipe_mutex_destroy(ws->cmask_owner_mutex);
>      pipe_mutex_destroy(ws->cs_stack_lock);
> --
> 1.8.1.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list