1. 02 8月, 2010 1 次提交
    • C
      drm: Free the idr layers before calling idr_destroy() · ddd3d069
      Chris Wilson 提交于
      /* A typical clean-up sequence for objects stored in an idr tree, will
       * use idr_for_each() to free all objects, if necessary, then
       * idr_remove_all() to remove all ids, and idr_destroy() to free
       * up the cached idr_layers.
       */
      
      We were missing the vital idr_rmove_all() step and so were leaking
      the used layers for every dri client:
      
      unreferenced object 0xf32133c0 (size 148):
        comm "plymouthd", pid 131, jiffies 4294678490 (age 2308.030s)
        hex dump (first 32 bytes):
          04 00 00 00 00 00 00 00 00 00 00 00 00 40 19 f3  .............@..
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<c04e5657>] create_object+0x124/0x1f1
          [<c07cf100>] kmemleak_alloc+0x4c/0x90
          [<c04db6a9>] kmem_cache_alloc+0xee/0x13c
          [<c05c3d25>] idr_pre_get+0x24/0x61
          [<f8315c9c>] drm_gem_handle_create+0x27/0x7f [drm]
          [<f89925b2>] i915_gem_create_ioctl+0x4f/0x71 [i915]
          [<f83148ac>] drm_ioctl+0x272/0x356 [drm]
          [<c04f27c4>] vfs_ioctl+0x33/0x91
          [<c04f31cf>] do_vfs_ioctl+0x46b/0x496
          [<c04f3240>] sys_ioctl+0x46/0x66
          [<c040325f>] sysenter_do_call+0x12/0x38
          [<ffffffff>] 0xffffffff
      
      Fixes https://bugzilla.kernel.org/show_bug.cgi?id=15803Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      ddd3d069
  2. 01 6月, 2010 1 次提交
  3. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  4. 11 2月, 2010 1 次提交
  5. 18 12月, 2009 1 次提交
    • A
      drm: convert drm_ioctl to unlocked_ioctl · ed8b6704
      Arnd Bergmann 提交于
      drm_ioctl is called with the Big Kernel Lock held,
      which shows up very high in statistics on vfs_ioctl.
      
      Moving the lock into the drm_ioctl function itself
      makes sure we blame the right subsystem and it gets
      us one step closer to eliminating the locked version
      of fops->ioctl.
      
      Since drm_ioctl does not require the lock itself,
      we only need to hold it while calling the specific
      handler. The 32 bit conversion handlers do not
      interact with any other code, so they don't need
      the BKL here either and can just call drm_ioctl.
      
      As a bonus, this cleans up all the other users
      of drm_ioctl which now no longer have to find
      the inode or call lock_kernel.
      
      [airlied: squashed the non-driver bits
      of the second patch in here, this provides
      the flag for drivers to use to select unlocked
      ioctls - but doesn't modify any drivers].
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: dri-devel@lists.sourceforge.net
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      ed8b6704
  6. 04 12月, 2009 1 次提交
    • J
      drm: Add dirty ioctl and property · 884840aa
      Jakob Bornecrantz 提交于
      This commit adds a ioctl and property to allow userspace
      to notify the kernel that a framebuffer has changed. Instead
      of snooping the command stream this allows finer grained
      tracking of which areas have changed.
      
      The primary user for this functionality is virtual hardware
      like the vmware svga device, but also Xen hardware likes to
      be notify. There is also real hardware like DisplayLink and
      DisplayPort that might take advantage of this ioctl.
      Signed-off-by: NJakob Bornecrantz <jakob@vmware.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      884840aa
  7. 18 11月, 2009 4 次提交
  8. 19 8月, 2009 1 次提交
  9. 19 6月, 2009 1 次提交
  10. 16 6月, 2009 1 次提交
    • G
      debugfs: Fix terminology inconsistency of dir name to mount debugfs filesystem. · 156f5a78
      GeunSik Lim 提交于
      Many developers use "/debug/" or "/debugfs/" or "/sys/kernel/debug/"
      directory name to mount debugfs filesystem for ftrace according to
      ./Documentation/tracers/ftrace.txt file.
      
      And, three directory names(ex:/debug/, /debugfs/, /sys/kernel/debug/) is
      existed in kernel source like ftrace, DRM, Wireless, Documentation,
      Network[sky2]files to mount debugfs filesystem.
      
      debugfs means debug filesystem for debugging easy to use by greg kroah
      hartman. "/sys/kernel/debug/" name is suitable as directory name
      of debugfs filesystem.
      - debugfs related reference: http://lwn.net/Articles/334546/
      
      Fix inconsistency of directory name to mount debugfs filesystem.
      
      * From Steven Rostedt
        - find_debugfs() and tracing_files() in this patch.
      Signed-off-by: NGeunSik Lim <geunsik.lim@samsung.com>
      Acked-by     : Inaky Perez-Gonzalez <inaky@linux.intel.com>
      Reviewed-by  : Steven Rostedt <rostedt@goodmis.org>
      Reviewed-by  : James Smart <james.smart@emulex.com>
      CC: Jiri Kosina <trivial@kernel.org>
      CC: David Airlie <airlied@linux.ie>
      CC: Peter Osterlund <petero2@telia.com>
      CC: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
      CC: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
      CC: Masami Hiramatsu <mhiramat@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      156f5a78
  11. 21 5月, 2009 1 次提交
  12. 24 4月, 2009 1 次提交
  13. 29 3月, 2009 1 次提交
  14. 28 3月, 2009 1 次提交
  15. 13 3月, 2009 3 次提交
    • B
      drm: Convert proc files to seq_file and introduce debugfs · 955b12de
      Ben Gamari 提交于
      The old mechanism to formatting proc files is extremely ugly. The
      seq_file API was designed specifically for cases like this and greatly
      simplifies the process.
      
      Also, most of the files in /proc really don't belong there. This patch
      introduces the infrastructure for putting these into debugfs and exposes
      all of the proc files in debugfs as well.
      
      This contains the i915 hooks rewrite as well, to make bisectability better.
      Signed-off-by: NBen Gamari <bgamari@gmail.com>
      Signed-off-by: NEric Anholt <eric@anholt.net>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      955b12de
    • K
      drm: claim PCI device when running in modesetting mode. · 112b715e
      Kristian Høgsberg 提交于
      Under kernel modesetting, we manage the device at all times, regardless
      of VT switching and X servers, so the only decent thing to do is to
      claim the PCI device.  In that case, we call the suspend/resume hooks
      directly from the pci driver hooks instead of the current class device detour.
      Signed-off-by: NKristian Høgsberg <krh@redhat.com>
      Signed-off-by: NDave Airlie <airlied@linux.ie>
      112b715e
    • B
      drm: Split drm_map and drm_local_map · f77d390c
      Benjamin Herrenschmidt 提交于
      Once upon a time, the DRM made the distinction between the drm_map
      data structure exchanged with user space and the drm_local_map used
      in the kernel.
      
      For some reasons, while the BSD port still has that "feature", the
      linux part abused drm_map for kernel internal usage as the local
      map only existed as a typedef of the struct drm_map.
      
      This patch fixes it by declaring struct drm_local_map separately
      (though its content is currently identical to the userspace variant),
      and changing the kernel code to only use that, except when it's a
      user<->kernel interface (ie. ioctl).
      
      This allows subsequent changes to the in-kernel format
      
      I've also replaced the use of drm_local_map_t with struct drm_local_map
      in a couple of places. Mostly by accident but they are the same (the
      former is a typedef of the later) and I have some remote plans and
      half finished patch to completely kill the drm_local_map_t typedef
      so I left those bits in.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NEric Anholt <eric@anholt.net>
      Signed-off-by: NDave Airlie <airlied@linux.ie>
      f77d390c
  16. 19 1月, 2009 1 次提交
  17. 07 1月, 2009 1 次提交
  18. 29 12月, 2008 8 次提交
  19. 25 11月, 2008 1 次提交
  20. 11 11月, 2008 1 次提交
    • D
      drm/i915: Filter pci devices based on PCI_CLASS_DISPLAY_VGA · afa21e05
      Dave Airlie 提交于
      This fixes hangs on 855-class hardware by avoiding double attachment of the
      driver due to the stub second head device having the same pci id as the real
      device.
      
      Other DRM drivers probably want this treatment as well, but I'm applying it
      just to this one for safety. But we should clean up the drm_pciids.h mess
      now so that each driver has its own pci id list header in its own directory.
      Lets do that in the next release.
      Signed-off-by: NEric Anholt <eric@anholt.net>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      afa21e05
  21. 18 10月, 2008 2 次提交
    • E
      drm: Add GEM ("graphics execution manager") to i915 driver. · 673a394b
      Eric Anholt 提交于
      GEM allows the creation of persistent buffer objects accessible by the
      graphics device through new ioctls for managing execution of commands on the
      device.  The userland API is almost entirely driver-specific to ensure that
      any driver building on this model can easily map the interface to individual
      driver requirements.
      
      GEM is used by the 2d driver for managing its internal state allocations and
      will be used for pixmap storage to reduce memory consumption and enable
      zero-copy GLX_EXT_texture_from_pixmap, and in the 3d driver is used to enable
      GL_EXT_framebuffer_object and GL_ARB_pixel_buffer_object.
      Signed-off-by: NEric Anholt <eric@anholt.net>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      673a394b
    • J
      drm: Rework vblank-wait handling to allow interrupt reduction. · 0a3e67a4
      Jesse Barnes 提交于
      Previously, drivers supporting vblank interrupt waits would run the interrupt
      all the time, or all the time that any 3d client was running, preventing the
      CPU from sleeping for long when the system was otherwise idle.  Now, interrupts
      are disabled any time that no client is waiting on a vblank event. The new
      method uses vblank counters on the chipsets when the interrupts are turned
      off, rather than counting interrupts, so that we can continue to present
      accurate vblank numbers.
      
      Co-author: Michel Dänzer <michel@tungstengraphics.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NEric Anholt <eric@anholt.net>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      0a3e67a4
  22. 27 7月, 2008 1 次提交
  23. 14 7月, 2008 1 次提交
    • D
      drm: reorganise drm tree to be more future proof. · c0e09200
      Dave Airlie 提交于
      With the coming of kernel based modesetting and the memory manager stuff,
      the everything in one directory approach was getting very ugly and
      starting to be unmanageable.
      
      This restructures the drm along the lines of other kernel components.
      
      It creates a drivers/gpu/drm directory and moves the hw drivers into
      subdirectores. It moves the includes into an include/drm, and
      sets up the unifdef for the userspace headers we should be exporting.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      c0e09200
  24. 20 6月, 2008 1 次提交
  25. 13 6月, 2008 1 次提交
  26. 26 4月, 2008 1 次提交
  27. 07 2月, 2008 1 次提交