1. 19 8月, 2013 1 次提交
    • D
      drm: remove FASYNC support · b0e898ac
      Daniel Vetter 提交于
      So I've stumbled over drm_fasync and wondered what it does. Digging
      that up is quite a story.
      
      First I've had to read up on what this does and ended up being rather
      bewildered why peopled loved signals so much back in the days that
      they've created SIGIO just for that ...
      
      Then I wondered how this ever works, and what that strange "No-op."
      comment right above it should mean. After all calling the core fasync
      helper is pretty obviously not a noop. After reading through the
      kernels FASYNC implementation I've noticed that signals are only sent
      out to the processes attached with FASYNC by calling kill_fasync.
      
      No merged drm driver has ever done that.
      
      After more digging I've found out that the only driver that ever used
      this is the so called GAMMA driver. I've frankly never heard of such a
      gpu brand ever before. Now FASYNC seems to not have been the only bad
      thing with that driver, since Dave Airlie removed it from the drm
      driver with prejudice:
      
      commit 1430163b4bbf7b00367ea1066c1c5fe85dbeefed
      Author: Dave Airlie <airlied@linux.ie>
      Date:   Sun Aug 29 12:04:35 2004 +0000
      
          Drop GAMMA DRM from a great height ...
      
      Long story short, the drm fasync support seems to be doing absolutely
      nothing. And the only user of it was never merged into the upstream
      kernel. And we don't need any fops->fasync callback since the fcntl
      implementation in the kernel already implements the noop case
      correctly.
      
      So stop this particular cargo-cult and rip it all out.
      
      v2: Kill drm_fasync assignments in rcar (newly added) and imx drivers
      (somehow I've missed that one in staging). Also drop the reference in
      the drm DocBook. ARM compile-fail reported by Rob Clark.
      
      v3: Move the removal of dev->buf_asnyc assignment in drm_setup to this
      patch here.
      
      v4: Actually git add ... tsk.
      
      Cc: Dave Airlie <airlied@linux.ie>
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      b0e898ac
  2. 25 7月, 2013 1 次提交
    • D
      drm: add unified vma offset manager · fe3078fa
      David Herrmann 提交于
      If we want to map GPU memory into user-space, we need to linearize the
      addresses to not confuse mm-core. Currently, GEM and TTM both implement
      their own offset-managers to assign a pgoff to each object for user-space
      CPU access. GEM uses a hash-table, TTM uses an rbtree.
      
      This patch provides a unified implementation that can be used to replace
      both. TTM allows partial mmaps with a given offset, so we cannot use
      hashtables as the start address may not be known at mmap time. Hence, we
      use the rbtree-implementation of TTM.
      
      We could easily update drm_mm to use an rbtree instead of a linked list
      for it's object list and thus drop the rbtree from the vma-manager.
      However, this would slow down drm_mm object allocation for all other
      use-cases (rbtree insertion) and add another 4-8 bytes to each mm node.
      Hence, use the separate tree but allow for later migration.
      
      This is a rewrite of the 2012-proposal by David Airlie <airlied@linux.ie>
      
      v2:
       - fix Docbook integration
       - drop drm_mm_node_linked() and use drm_mm_node_allocated()
       - remove unjustified likely/unlikely usage (but keep for rbtree paths)
       - remove BUG_ON() as drm_mm already does that
       - clarify page-based vs. byte-based addresses
       - use drm_vma_node_reset() for initialization, too
      v4:
       - allow external locking via drm_vma_offset_un/lock_lookup()
       - add locked lookup helper drm_vma_offset_lookup_locked()
      v5:
       - fix drm_vma_offset_lookup() to correctly validate range-mismatches
         (fix (offset > start + pages))
       - fix drm_vma_offset_exact_lookup() to actually do what it says
       - remove redundant vm_pages member (add drm_vma_node_size() helper)
       - remove unneeded goto
       - fix documentation
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@gmail.com>
      fe3078fa
  3. 28 6月, 2013 3 次提交
  4. 28 5月, 2013 1 次提交
  5. 23 5月, 2013 1 次提交
  6. 01 5月, 2013 1 次提交
  7. 22 2月, 2013 2 次提交
  8. 14 2月, 2013 1 次提交
    • D
      drm/fb-helper: improve kerneldoc · 207fd329
      Daniel Vetter 提交于
      Now that the fbdev helper interface for drivers is trimmed down,
      update the kerneldoc for all the remaining exported functions.
      
      I've tried to beat the DocBook a bit by reordering the function
      references a bit into a more sensible ordering. But that didn't work
      out at all. Hence just extend the in-code DOC: section a bit.
      
      Also remove the LOCKING: sections - especially for the setup functions
      they're totally bogus. But that's not a documentation problem, but
      simply an artifact of the current rather hazardous locking around drm
      init and even more so around fbdev setup ...
      
      v2: Some further improvements:
      - Also add documentation for drm_fb_helper_single_add_all_connectors,
        Dave Airlie didn't want me to kill this one from the fb helper
        interface.
      - Update docs for drm_fb_helper_fill_var/fix - they should be used
        from the driver's ->fb_probe callback to setup the fbdev info
        structure.
      - Clarify what the ->fb_probe callback should all do - it needs to
        setup both the fbdev info and allocate the drm framebuffer used as
        backing storage.
      - Add basic documentaation for the drm_fb_helper_funcs driver callback
        vfunc.
      
      v3: Implement clarifications Laurent Pinchart suggested in his review.
      
      v4: Fix another mispelling Laurent spotted.
      
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      207fd329
  9. 08 2月, 2013 1 次提交
    • A
      drm: add prime helpers · 89177644
      Aaron Plattner 提交于
      Instead of reimplementing all of the dma_buf functionality in every driver,
      create helpers drm_prime_import and drm_prime_export that implement them in
      terms of new, lower-level hook functions:
      
        gem_prime_pin: callback when a buffer is created, used to pin buffers into GTT
        gem_prime_get_sg_table: convert a drm_gem_object to an sg_table for export
        gem_prime_import_sg_table: convert an sg_table into a drm_gem_object
        gem_prime_vmap, gem_prime_vunmap: map and unmap an object
      
      These hooks are optional; drivers can opt in by using drm_gem_prime_import and
      drm_gem_prime_export as the .gem_prime_import and .gem_prime_export fields of
      struct drm_driver.
      
      v2:
      - Drop .begin_cpu_access.  None of the drivers this code replaces implemented
        it.  Having it here was a leftover from when I was trying to include i915 in
        this rework.
      - Use mutex_lock instead of mutex_lock_interruptible, as these three drivers
        did.  This patch series shouldn't change that behavior.
      - Rename helpers to gem_prime_get_sg_table and gem_prime_import_sg_table.
        Rename struct sg_table* variables to 'sgt' for clarity.
      - Update drm.tmpl for these new hooks.
      
      v3:
      - Pass the vaddr down to the driver.  This lets drivers that just call vunmap on
        the pointer avoid having to store the pointer in their GEM private structures.
      - Move documentation into a /** DOC */ comment in drm_prime.c and include it in
        drm.tmpl with a !P line.  I tried to use !F lines to include documentation of
        the individual functions from drmP.h, but the docproc / kernel-doc scripts
        barf on that file, so hopefully this is good enough for now.
      - apply refcount fix from commit be8a42ae
        ("drm/prime: drop reference on imported dma-buf come from gem")
      Signed-off-by: NAaron Plattner <aplattner@nvidia.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: David Airlie <airlied@linux.ie>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      89177644
  10. 21 1月, 2013 1 次提交
  11. 20 1月, 2013 1 次提交
  12. 28 11月, 2012 4 次提交
  13. 20 11月, 2012 1 次提交
    • R
      drm: add drm_send_vblank_event() helper (v5) · c6eefa17
      Rob Clark 提交于
      A helper that drivers can use to send vblank event after a pageflip.
      If the driver doesn't support proper vblank irq based time/seqn then
      just pass -1 for the pipe # to get do_gettimestamp() behavior (since
      there are a lot of drivers that don't use drm_vblank_count_and_time())
      
      Also an internal send_vblank_event() helper for the various other code
      paths within drm_irq that also need to send vblank events.
      
      v1: original
      v2: add back 'vblwait->reply.sequence = seq' which should not have
          been deleted
      v3: add WARN_ON() in case lock is not held and comments
      v4: use WARN_ON_SMP() instead to fix issue with !SMP && !DEBUG_SPINLOCK
          as pointed out by Marcin Slusarz
      v5: update docbook
      Signed-off-by: NRob Clark <rob@ti.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      c6eefa17
  14. 23 8月, 2012 1 次提交
  15. 30 8月, 2011 20 次提交