[meta-freescale] [meta-fsl-arm][PATCH v3 1/5] imx-gpu-viv: Update to 5.0.11-p7.4 version

Otavio Salvador otavio.salvador at ossystems.com.br
Mon Jan 11 08:19:28 PST 2016


On Tue, Jan 5, 2016 at 1:03 PM, Neena Busireddy
<neenareddy.busireddy at nxp.com> wrote:
> Hi Richard,
>
> Hi again,
>
> I also hit a deadlock on exit when running on one framebuffer like
> this: (and when pressing ctrl-c it hangs forever) /usr/bin/weston --tty=1 --use-gal2d=1 --use-gl=0 --device=/dev/fb2
>
> The worker thread and cleanup code didn't look tight so I changed it a bit and avoid the deadlock.
> Will you fix this our should I send a patch?
>
> Here is what I did:
>
> --- weston-1.8.0/src/gal2d-renderer.c.org 2016-01-05 15:08:48.000000000 +0100
> +++ weston-1.8.0/src/gal2d-renderer.c 2016-01-05 15:12:41.000000000
> +++ +0100
> @@ -495,21 +495,21 @@
>  {
>      struct weston_output *output = (struct weston_output *)arg;
>      struct gal2d_output_state *go = get_output_state(output);
> +    int go_on = 1;
>
> -    while(1)
> +    while(go_on)
>      {
> -        if(gcoOS_WaitSignal(gcvNULL, go->signal, gcvINFINITE) == gcvSTATUS_OK )
> +        int ok = gcoOS_WaitSignal(gcvNULL, go->signal, gcvINFINITE)
> == gcvSTATUS_OK;
> +
> +        pthread_mutex_lock(&go->workerMutex);
> +        go_on = go->exitWorker == 0;
> +        pthread_mutex_unlock(&go->workerMutex);
> +
> +        if (ok && go_on)
>          {
>              gal2d_flip_surface(output);
>              gcoOS_Signal(gcvNULL,go->busySignal, gcvTRUE);
>          }
> -        pthread_mutex_lock(&go->workerMutex);
> -        if(go->exitWorker == 1)
> -        {
> -            pthread_mutex_unlock(&go->workerMutex);
> -            break;
> -        }
> -        pthread_mutex_unlock(&go->workerMutex);
>      }
>      return 0;
>  }
> @@ -1169,10 +1169,10 @@
>   }
>      else
>      {
> -        gcoOS_Signal(gcvNULL,go->signal, gcvTRUE);
>          pthread_mutex_lock(&go->workerMutex);
>          go->exitWorker = 1;
>          pthread_mutex_unlock(&go->workerMutex);
> +        gcoOS_Signal(gcvNULL,go->signal, gcvTRUE);
>          pthread_join(go->workerId, NULL);
>      }
>
> Thanks for bringing this up.
>
> Hi Prabhu,
>
> Could you please comment on this one?

Prabhu, please comment.

Richard, please send a formal patch on top of master-next (I applied
the patches there for test).

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


More information about the meta-freescale mailing list