Re: [v2 PATCH] libpciaccess: close mtrr fd on pci_cleanup
Thanks, I reviewed and pushed this with a small modification. --Jeremy On Oct 24, 2011, at 12:15 PM, Nithin Nayak Sujir wrote: Since the fd is not closed, calling pci_system_init and pci_system_cleanup more than 1024 times results in too many files open error. v2: Modified the patch to use the destroy hook function instead of calling close in the common code based on Jeremy Huddleston's comments. It seemed appropriate to use the destroy hook since other implementations are doing clean ups here. Signed-off-by: Nithin Nayak Sujir nsu...@broadcom.com --- src/linux_sysfs.c | 12 +++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c index d5ba66a..09e7138 100644 --- a/src/linux_sysfs.c +++ b/src/linux_sysfs.c @@ -889,8 +889,18 @@ pci_device_linux_sysfs_unmap_legacy(struct pci_device *dev, void *addr, pciaddr_ return munmap(addr, size); } + +static void +pci_system_linux_destroy(void) +{ +#ifdef HAVE_MTRR + if (pci_sys-mtrr_fd 0) + close(pci_sys-mtrr_fd); +#endif +} + static const struct pci_system_methods linux_sysfs_methods = { -.destroy = NULL, +.destroy = pci_system_linux_destroy, .destroy_device = NULL, .read_rom = pci_device_linux_sysfs_read_rom, .probe = pci_device_linux_sysfs_probe, -- 1.7.1 ___ xorg@lists.freedesktop.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: http://lists.freedesktop.org/mailman/listinfo/xorg Your subscription address: arch...@mail-archive.com
Missing events sometimes
Hi all, I have been facing a bug in the xfce [1] window manager xfwm4 [2], for a very long time, no doubt the fault is with my code yet I fail to find the fix. Sometimes, when the system is heavily loaded and/or swapping intensively, the event loop does not get the ButtonReleasse or KeyRelease events it's waiting to exit the event loop. The logic used in the code is the following: 1. For keyboard, it installs a passive grab in sync mode on keyboard, ie: XGrabKey (dpy, keycode, modifier, w, TRUE, GrabModeAsync, GrabModeSync); 2. For buttons, same with Sync mode on pointer XGrabButton (dpy, button, modifier, w, FALSE, ButtonPressMask|ButtonReleaseMask, GrabModeSync, GrabModeAsync, None, None); 3. Then when the user activates a keyboard shortcut or moves a window usign the mouse, the window manager installs an active grab on the keyboard / pointer using the timestamp of the event: XGrabKeyboard (dpy, root, TRUE, GrabModeAsync, GrabModeAsync, timestamp) or XGrabPointer (dpy, root, FALSE, PointerMotionMask | ButtonMotionMask | ButtonReleaseMask | LeaveWindowMask, GrabModeAsync, GrabModeAsync, root, cursor, timestamp); 4. Then enters an event loop processing events, until a KeyRelease event (in the case of a keyboard shortcut) or a ButtonRelease is received (in the case of a mouse op). Using this logic, the code sometimes (when the system is loaded or swapping) remains in the event loop because the ButtonRelease or KeyRelease event is not received in the event loop, so I guess it's consumed somehow before the code enters the event loop, but how? As I said, there's probably a flaw somewhere in the logic, but I fail to find it (also because of the nature of the probl;em it's quite hard to reproduce and therefore investigate and test), so I am open to any suggestion... PS: Note that xfwm4 is built on gtk+ so the events here are taken from a gdk event filter, I am not sure of the influence of that on the behavior... TIA Olivier, [1] http://www.xfce.org [2] http://git.xfce.org/xfce/xfwm4/ ___ xorg@lists.freedesktop.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: http://lists.freedesktop.org/mailman/listinfo/xorg Your subscription address: arch...@mail-archive.com
No screens found on intel sandy bridge / centos 5.7 / kernel 2.6.39
Hi After successfully compiling and installing xorg-server-1.7.7, xf86-video-intel-2.13.903 when i run startx -- /opt/xorg/bin/Xorg -verbose i got Fatal server error: no screens found. xorg.cong file ** Section ServerLayout Identifier single head configuration Screen 0 Screen0 0 0 InputDeviceMouse0 CorePointer InputDeviceKeyboard0 CoreKeyboard EndSection Section Files #RgbPath /usr/share/X11/rgb ModulePath /usr/local/xf86-video-intel/lib/xorg/modules/drivers ModulePath /usr/local/xf86-input-mouse-1.5.0/lib/xorg/modules/input ModulePath /usr/local/xf86-input-keyboard-1.4.0/lib/xorg/modules/input #ModulePath /usr/lib/xorg/modules/drivers #ModulePath /usr/lib/dri #ModulePath /usr/lib/xorg/modules/extensions ModulePath /opt/xorg/lib/xorg/modules/extensions #ModulePath /usr/lib/xorg/modules ModulePath /opt/xorg/lib/xorg/modules ModulePath /opt/xorg/lib/xorg/modules/linux ModulePath /opt/xorg/lib/xorg/modules/multimedia #ModulePath /usr/lib/xorg/modules/fonts ModulePath /usr/lib/xorg/modules #FontPath unix/:7100 #FontPath built-ins EndSection Section Module #Load freetype Load glx Load dbe Load extmod Load dri #Load i915 EndSection Section ServerFlags Option AIGLX off Option AllowMouseOpenFail on Option IgnoreABI on Option ZapWarning on EndSection Section InputDevice Identifier Keyboard0 Driver kbd Option XkbModel pc105 Option XkbLayout us EndSection Section InputDevice Identifier Mouse0 Driver mouse Option Protocol auto Option Device /dev/input/mice #Option ZAxisMapping 4 5 6 7 EndSection Section Monitor Identifier Monitor0 VendorName Compaq ModelNameLCD Panel 1280x1024 HorizSync 30-55 VertRefresh 50-120 Option dpms #Option ddc EndSection Section Device Option NoLogo True #Option ShadowFB #Option DefaultRefresh #Option ModeSetClearScreen Identifier Videocard0 Driver intel VendorName Intel Corporation BoardName Intel Sandybridge Option AccelMethod EXA BusID PCI:0:2:0 EndSection Section Screen Identifier Screen0 Device Videocard0 MonitorMonitor0 #DefaultDepth 24 #SubSection Display #Viewport 0 0 #Depth 16 #Modes800x600 640x480 #EndSubSection #SubSection Display #Viewport 0 0 #Depth 16 #EndSubSection #SubSection Display #Viewport 0 0 #Depth 24 #Modes1280x1024 1280x960 1280x800 1152x864 1024x768 800x600 640x480 #EndSubSection EndSection Section DRI Group0 Mode 0666 EndSection Section Extensions #Option Composite False EndSection *** and the Xorg.0.log log file is X.Org X Server 1.7.7 Release Date: 2010-05-04 X Protocol Version 11, Revision 0 Build Operating System: Linux 2.6.39 i686 Current Operating System: Linux localhost.localdomain 2.6.39 #7 SMP Fri Oct 14 21:11:17 IST 2011 i686 Kernel command line: ro root=/dev/VolGroup00/LogVol00 Build Date: 25 October 2011 10:29:54AM Current version of pixman: 0.22.2 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: /opt/xorg/var/log/Xorg.0.log, Time: Tue Oct 25 13:30:26 2011 (==) Using config file: /etc/X11/xorg.conf (==) ServerLayout single head configuration (**) |--Screen Screen0 (0) (**) | |--Monitor Monitor0 (**) | |--Device Videocard0 (**) |--Input Device Mouse0 (**) |--Input Device Keyboard0 (**) Option AllowMouseOpenFail on (**) Option AIGLX off (**) Option IgnoreABI on (**) Ignoring ABI Version (==) Automatically adding devices (==) Automatically enabling devices (WW) The directory /opt/xorg/lib/X11/fonts/misc/ does not exist. Entry deleted from font path. (WW) The directory /opt/xorg/lib/X11/fonts/TTF/ does not exist. Entry deleted from font path. (WW) The directory /opt/xorg/lib/X11/fonts/OTF does not exist. Entry deleted from font path. (WW) The directory /opt/xorg/lib/X11/fonts/Type1/ does not exist. Entry deleted from