Bug 8679 - failure to release release input lock in xf86dga
Summary: failure to release release input lock in xf86dga
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: * Other (show other bugs)
Version: git
Hardware: All All
: high normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-17 02:31 UTC by Jan Lepper
Modified: 2009-09-01 00:59 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Jan Lepper 2006-10-17 02:31:40 UTC
When a client has acquired exclusive mouse or keyboard input via the xf86dga
extension version 1, and is terminated before releasing it again, the lock is
never released. In version 2 all locks held by a client are automatically
released, when the client is destroyed.
Comment 1 Daniel Stone 2007-02-27 01:34:05 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 2 Adam Jackson 2008-05-06 10:19:20 UTC
What?  Version 1 didn't have an input API:

% nm -aD --defined /usr/lib/libXxf86dga.so | grep XF86DGA
00870690 T XF86DGADirectVideo
008705a0 T XF86DGADirectVideoLL
008707f0 T XF86DGAForkApp
00870b10 T XF86DGAGetVidPage
00870ed0 T XF86DGAGetVideo
00870d80 T XF86DGAGetVideoLL
00870c40 T XF86DGAGetViewPortSize
008702d0 T XF86DGAInstallColormap
008709e0 T XF86DGAQueryDirectVideo
00871310 T XF86DGAQueryExtension
008712d0 T XF86DGAQueryVersion
008703c0 T XF86DGASetVidPage
008704b0 T XF86DGASetViewPort
008708b0 T XF86DGAViewPortChanged

None of that has anything to do with input.
Comment 3 Jan Lepper 2008-09-09 05:50:25 UTC
(In reply to comment #2)
> What?  Version 1 didn't have an input API:
> 
> % nm -aD --defined /usr/lib/libXxf86dga.so | grep XF86DGA
> 00870690 T XF86DGADirectVideo
> 008705a0 T XF86DGADirectVideoLL
> 008707f0 T XF86DGAForkApp
> 00870b10 T XF86DGAGetVidPage
> 00870ed0 T XF86DGAGetVideo
> 00870d80 T XF86DGAGetVideoLL
> 00870c40 T XF86DGAGetViewPortSize
> 008702d0 T XF86DGAInstallColormap
> 008709e0 T XF86DGAQueryDirectVideo
> 00871310 T XF86DGAQueryExtension
> 008712d0 T XF86DGAQueryVersion
> 008703c0 T XF86DGASetVidPage
> 008704b0 T XF86DGASetViewPort
> 008708b0 T XF86DGAViewPortChanged
> 
> None of that has anything to do with input.
> 


This is a bit late, as i was busy with other things - anyway i reopen this bug since it is not invalid as you claimed.
Reason: Despite not having "input" in its name, XF86DGADirectVideo also deals with input:

xorg/xserver/hw/xfree86/dixmods/extmod/xf86dga.c:
[...]
static int
ProcXF86DGADirectVideo(ClientPtr client)
{
    int num;
    PixmapPtr pix;
    XDGAModeRec mode;
    REQUEST(xXF86DGADirectVideoReq);

    if (stuff->screen > screenInfo.numScreens)
	return BadValue;

    REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq);

    if (!DGAAvailable(stuff->screen)) 
	return DGAErrorBase + XF86DGANoDirectVideoMode;

    if (stuff->enable & XF86DGADirectGraphics) {
	if(!(num = DGAGetOldDGAMode(stuff->screen)))
	    return (DGAErrorBase + XF86DGANoDirectVideoMode);
    } else
	num = 0;

    if(Success != DGASetMode(stuff->screen, num, &mode, &pix))
	return (DGAErrorBase + XF86DGAScreenNotActive);

    DGASetInputMode (stuff->screen, 
		     (stuff->enable & XF86DGADirectKeyb) != 0,
		     (stuff->enable & XF86DGADirectMouse) != 0);

    return (client->noClientException);
}
[...]

xorg/xserver/hw/xfree86/common/xf86DGA.c:
[...]
_X_EXPORT void
DGASetInputMode(int index, Bool keyboard, Bool mouse)
{
   ScreenPtr pScreen = screenInfo.screens[index];
   DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);

   if (pScreenPriv)
   {
      pScreenPriv->grabMouse = mouse;
      pScreenPriv->grabKeyboard = keyboard;

      if (!mieq_installed) {
          mieqSetHandler(*XDGAEventBase + MotionNotify, DGAHandleEvent);
          mieqSetHandler(*XDGAEventBase + ButtonPress, DGAHandleEvent);
          mieqSetHandler(*XDGAEventBase + ButtonRelease, DGAHandleEvent);
          mieqSetHandler(*XDGAEventBase + KeyPress, DGAHandleEvent);
          mieqSetHandler(*XDGAEventBase + KeyRelease, DGAHandleEvent);
          mieq_installed = 1;
      }
   }
}
[...]

As you can see, the client is able to grab both keyboard and mouse.

Comment 4 Michel Dänzer 2009-09-01 00:59:24 UTC
Should be fixed as of xserver 1.6.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.