1. 07 8月, 2013 1 次提交
  2. 28 2月, 2013 2 次提交
  3. 03 10月, 2012 1 次提交
  4. 06 9月, 2012 1 次提交
    • K
      drm: use drm_compat_ioctl for 32-bit apps · 804d74ab
      Keith Packard 提交于
      Most of the DRM drivers appear to be missing the .compat_ioctl file
      operation entry necessary for 32-bit application compatibility.
      
      This patch  uses drm_compat_ioctl for all drivers which don't have
      their own, and which are using drm_ioctl for .unlocked_ioctl.
      
      This leaves drivers/gpu/drm/psb/psb_drv.c unchanged; it has a custom
      .unlocked_ioctl and will presumably need a custom .compat_ioctl as
      well.
      Signed-off-by: NKeith Packard <keithp@keithp.com>
      Signed-off-by: NDave Airlie <airlied@gmail.com>
      804d74ab
  5. 20 7月, 2012 2 次提交
    • D
      drm/sis: fixup sis_mm ioctl structs · 83bc5fd2
      Daniel Vetter 提交于
      Userspace uses long in quite a few places more than the kernel. Which
      gives me neat proof that I'm the only guy on this side of the galaxy
      who ever tried to run glxgears on a 64bit machine with sis graphics on
      linux.
      
      Note that the longs in drm_sis_mem_t aren't aligned properly, so this
      won't even work with 32bit userspace on 64bit kernel as-is. Hence the
      patch can't break that, either.
      
      Nope, I'm not nuts enough to write the 32bit ioctl compat layer for
      this and test it with some wine app. Even though hunting the ebay
      dungeons for a sis card actually supported by the mesa drivers casts
      some doubts on this ...
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      83bc5fd2
    • D
      drm/sis: clean up reclaim_buffers · ea5e4374
      Daniel Vetter 提交于
      Like for via.
      
      v2: Actually drop the idlelock again if taken.
      
      v3: Fixup.
      
      v4: Fixup the "has master" vs. "is master" confusion the refactor
      introduced.
      
      v5: Drop the idlelock in the early return path.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      ea5e4374
  6. 16 6月, 2012 1 次提交
  7. 17 2月, 2012 1 次提交
    • D
      drm: move pci bus master enable into driver. · 466e69b8
      Dave Airlie 提交于
      The current enabling of bus mastering in the drm midlayer allows a large
      race condition under kexec. When a kexec'ed kernel re-enables bus mastering
      for the GPU, previously setup dma blocks may cause writes to random pieces
      of memory. On radeon the writeback mechanism can cause these sorts of issues.
      
      This patch doesn't fix the problem, but it moves the bus master enable under
      the individual drivers control so they can move enabling it until later in
      their load cycle and close the race.
      
      Fix for radeon kms driver will be in a follow-up patch.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      466e69b8
  8. 23 1月, 2012 1 次提交
  9. 09 1月, 2012 1 次提交
  10. 22 12月, 2011 4 次提交
    • D
      drm/sis: use drm_mm instead of drm_sman · be2fb9da
      Daniel Vetter 提交于
      v2: Smash compile fix from Tormod Volden <debian.tormod@gmail.com> for
      CONFIG_FB_SIS on top of this.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      be2fb9da
    • D
      6de8a748
    • D
      drm/sman: rip out owner tracking · 763240de
      Daniel Vetter 提交于
      In contrast to kms drivers, sis/via _always_ associated a buffer with
      a drm fd. So by the time we reach lastclose, all open drm fds are gone
      and with them their associated objects.
      
      So when sis/via call drm_sman_cleanup in their lastclose funcs, that
      will free 0 objects.
      
      The owner tracking now serves no purpose at all, hence rip it ou. We
      can't kill the corresponding fields in struct drm_memblock_item yet
      because we hijack these in the new driver private owner tracking. But
      now that drm_sman.c doesn't touch ->owner_list anymore, we need to
      kill the list_move hack and properly add the item to the file_priv
      list.
      
      Also leave the list_del(&obj->owner_list) in drm_sman_free for the
      moment, it will move to the drivers when sman disappears completely.
      
      v2: Remove the redundant INIT_LIST_HEAD as noted by Chris Wilson
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      763240de
    • D
      drm/sis: track obj->drm_fd relations in the driver · fdc0b8a6
      Daniel Vetter 提交于
      By attach a driver private struct to each open drm fd.
      
      Because we steal the owner_list from drm_sman until things settle,
      use list_move instead of list_add.
      
      This requires to export a drm_sman function temporarily before
      drm_sman will die for real completely.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      fdc0b8a6
  11. 11 11月, 2011 1 次提交
    • A
      drm: Make the per-driver file_operations struct const · e08e96de
      Arjan van de Ven 提交于
      From fdf1fdebaa00f81de18c227f32f8074c8b352d50 Mon Sep 17 00:00:00 2001
      From: Arjan van de Ven <arjan@linux.intel.com>
      Date: Sun, 30 Oct 2011 19:06:07 -0700
      Subject: [PATCH] drm: Make the per-driver file_operations struct const
      
      The DRM layer keeps a copy of struct file_operations inside its
      big driver struct... which prevents it from being consistent and static.
      For consistency (and the general security objective of having such things
      static), it's desirable to get this fixed.
      
      This patch splits out the file_operations field to its own struct,
      which is then "static const", and just stick a pointer to this into
      the driver struct, making it more consistent with how the rest of the
      kernel does this.
      Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      e08e96de
  12. 01 11月, 2011 1 次提交
  13. 21 7月, 2011 1 次提交
    • P
      treewide: fix potentially dangerous trailing ';' in #defined values/expressions · 497888cf
      Phil Carmody 提交于
      All these are instances of
        #define NAME value;
      or
        #define NAME(params_opt) value;
      
      These of course fail to build when used in contexts like
        if(foo $OP NAME)
        while(bar $OP NAME)
      and may silently generate the wrong code in contexts such as
        foo = NAME + 1;    /* foo = value; + 1; */
        bar = NAME - 1;    /* bar = value; - 1; */
        baz = NAME & quux; /* baz = value; & quux; */
      
      Reported on comp.lang.c,
      Message-ID: <ab0d55fe-25e5-482b-811e-c475aa6065c3@c29g2000yqd.googlegroups.com>
      Initial analysis of the dangers provided by Keith Thompson in that thread.
      
      There are many more instances of more complicated macros having unnecessary
      trailing semicolons, but this pile seems to be all of the cases of simple
      values suffering from the problem. (Thus things that are likely to be found
      in one of the contexts above, more complicated ones aren't.)
      Signed-off-by: NPhil Carmody <ext-phil.2.carmody@nokia.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      497888cf
  14. 07 2月, 2011 1 次提交
  15. 16 9月, 2010 1 次提交
    • A
      drm: use noop_llseek · dc880abe
      Arnd Bergmann 提交于
      The drm device drivers currently allow seeking on the
      character device but never care about the actual
      file position.
      
      When we change the default llseek operation to be
      no_llseek, calling llseek on a drm device would
      return an error condition, which is an API change.
      
      Explicitly setting noop_llseek lets us keep the
      current API.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: dri-devel@lists.freedesktop.org
      dc880abe
  16. 30 8月, 2010 3 次提交
  17. 17 8月, 2010 1 次提交
    • D
      drm: block userspace under allocating buffer and having drivers overwrite it (v2) · 1b2f1489
      Dave Airlie 提交于
      With the current screwed but its ABI, ioctls for the drm, Linus pointed out that we could allow userspace to specify the allocation size, but we pass it to the driver which then uses it blindly to store a struct. Now if userspace specifies the allocation size as smaller than the driver needs, the driver can possibly overwrite memory.
      
      This patch restructures the driver ioctls so we store the structure size we are expecting, and make sure we allocate at least that size. The copy from/to userspace are still restricted to the size the user specifies, this allows ioctl structs to grow on both sides of the equation.
      
      Up until now we didn't really use the DRM_IOCTL defines in the kernel, so this cleans them up and adds them for nouveau.
      
      v2:
      fix nouveau pushbuf arg (thanks to Ben for pointing it out)
      Reported-by: NLinus Torvalds <torvalds@linuxfoundation.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      1b2f1489
  18. 02 8月, 2010 1 次提交
  19. 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
  20. 19 6月, 2009 1 次提交
  21. 18 10月, 2008 2 次提交
  22. 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