x11drv glx deadlocks.

Raphael fenix at club-internet.fr
Wed Aug 3 16:59:43 CDT 2005


On Tuesday 02 August 2005 01:17, Oliver Stieber wrote:
> --- Oliver Stieber <oliver_stieber at yahoo.co.uk> wrote:
> > Hi,
> >  Somewhere between 20-07-2005 and 26-07-2005 I've been getting deadlocks
> > when I call some glx functions e.g. glXMakeCurrent, I've tracked to
> > problem down to a deadlock, prior to calling glXMakeCurrent wined3d calls
> > wine_tsx11_lock_ptr, but the call to  glXMakeCurrent is raising an event
> > in x11drv on a different thread that then tries to call
> > wine_tsx11_lock_ptr, resulting in a
> > deadlock.
> >
> > I've looked through the patches send in between 20-07-2005 and 26-07-2005
> > but nothing looked obvious. Should I be calling wine_tsx11_lock_ptr
> > before glXMakeCurrent? or should I try to find out what patch caused the
> > problem?
>
> I've removed all the calls to wine_tsx11_lock_ptr in wined3d and it looked
> like the problem was desktop mode,
> So I switched off desktop mode, and now only one thread is running but
> calls to getDC are causing the same problem:
> 0009:err:ntdll:RtlpWaitForCriticalSection section 0x7fee5420
> "x11drv_main.c: X11DRV_CritSection" wait timed out in thread 0009, blocked
> by 0000, retrying (60 sec)
>

Are you sure you removed all x11drv locks form d3d9/d3d8/wined3d ?
else can you provide all stacks for all threads ?

Anyway ENTER_GL() / LEAVE_GL() calls must be used only for Xlib/openGL calls 
(i have done a long time ago a mini cleanup for that).

Example in IWineD3DDeviceImpl_CreateAdditionalSwapChain, this is incorrect

<snip>
    ENTER_GL();

    /* Create a new context for this swapchain */
    template.visualid = (VisualID)GetPropA(GetDesktopWindow(), 
"__wine_x11_visual_id");
    /* TODO: change this to find a similar visual, but one with a 
stencil/zbuffer buffer that matches the request
    (or the best possible if none is requested) */
    TRACE("Found x visual ID  : %ld\n", template.visualid);

    object->visInfo   = XGetVisualInfo(object->display, VisualIDMask, 
&template, &num);    
    if (NULL == object->visInfo) {
        ERR("cannot really get XVisual\n");
        LEAVE_GL();
        return D3DERR_NOTAVAILABLE;
<snip>

It should be like that

<snip>
    /* Create a new context for this swapchain */
    template.visualid = (VisualID)GetPropA(GetDesktopWindow(), 
"__wine_x11_visual_id");
    /* TODO: change this to find a similar visual, but one with a 
stencil/zbuffer buffer that matches the request
    (or the best possible if none is requested) */
    TRACE("Found x visual ID  : %ld\n", template.visualid);

    ENTER_GL();
    object->visInfo   = XGetVisualInfo(object->display, VisualIDMask, 
&template, &num);    
    LEAVE_GL();
    if (NULL == object->visInfo) {
        ERR("cannot really get XVisual\n");
        return D3DERR_NOTAVAILABLE;
<snip>

Regards,
Raphael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20050803/3d882098/attachment-0001.pgp


More information about the wine-devel mailing list