1. 02 7月, 2015 1 次提交
    • T
      drm/omap: fix omap_gem_put_paddr() error handling · 393a949f
      Tomi Valkeinen 提交于
      If tiler_unpin() call in omap_gem_put_paddr() fails,
      omap_gem_put_paddr() will immediately stop processing and return an
      error.
      
      This patch remoes that error checking, and also removes
      omap_gem_put_paddr()'s return value, because:
      
       * The caller of omap_gem_put_paddr() can do nothing if an error
         happens, so it's pointless to return an error value
      
       * If tiler_unpin() fails, the GEM object will possibly be left in an
         undefined state, where the DMM mapping may have been removed, but the
         GEM object still thinks everything is as it should be, leading to
         crashes later.
      
       * There's no point in returning an error from a "free" call, as the
         caller can do nothing about it. So it's better to clean up as much as
         possible.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      393a949f
  2. 24 6月, 2015 1 次提交
  3. 13 6月, 2015 1 次提交
  4. 24 3月, 2015 3 次提交
    • T
      drm/omap: fix race condition with dev->obj_list · 76c4055f
      Tomi Valkeinen 提交于
      omap_gem_objects are added to dev->obj_list in omap_gem_new, and removed
      in omap_gem_free_object. Unfortunately there's no locking for
      dev->obj_list, which eventually leads to a crash:
      
      WARNING: CPU: 1 PID: 1123 at lib/list_debug.c:59 __list_del_entry+0xa4/0xe0()
      list_del corruption. prev->next should be e9281344, but was ea722b84
      
      Add a spinlock to protect dev->obj_list.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      76c4055f
    • T
      drm/omap: fix TILER on OMAP5 · 7cb0d6c1
      Tomi Valkeinen 提交于
      On OMAP5 it is not possible to use TILER buffer with CPU when caching or
      write-combining is used. Doing so leads to errors from the memory
      manager.
      
      However, on OMAP4, write-combining works fine.
      
      This patch adds platform specific data for the TILER, and a function
      tiler_get_cpu_cache_flags() which can be used to get the caching mode to
      be used.
      
      Note that without write-combining the use of the TILER buffer with CPU
      is unusably slow. It's still good to have it operational for testing
      purposes.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      7cb0d6c1
    • T
      drm/omap: clear omap_obj->paddr in omap_gem_put_paddr() · 3f4d17c4
      Tomi Valkeinen 提交于
      Clear omap_obj's paddr when unmapping the memory, so that it's easier to
      catch bad use of the paddr.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      3f4d17c4
  5. 13 11月, 2014 1 次提交
    • T
      drm/omap: gem: dumb: pitch is an output · bdb2b933
      Thierry Reding 提交于
      When creating a dumb buffer object using the DRM_IOCTL_MODE_CREATE_DUMB
      IOCTL, only the width, height, bpp and flags fields are inputs. The
      caller is not guaranteed to zero out or set handle, pitch and size.
      Drivers must not treat these values as possible inputs, otherwise they
      may use uninitialized memory during the computation of the framebuffer
      size.
      
      The OMAP driver uses the pitch field passed in by userspace as a minimum
      and only override it if the driver-computed pitch is larger than what
      userspace provided. To prevent this from causing overallocation, fix the
      minimum pitch to 0 to enforce the driver-computed pitch.
      
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Acked-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      bdb2b933
  6. 22 7月, 2014 1 次提交
    • R
      drm: omapdrm: fix compiler errors · 2d31ca3a
      Russell King 提交于
      Regular randconfig nightly testing has detected problems with omapdrm.
      
      omapdrm fails to build when the kernel is built to support 64-bit DMA
      addresses and/or 64-bit physical addresses due to an assumption about
      the width of these types.
      
      Use %pad to print DMA addresses, rather than %x or %Zx (which is even
      more wrong than %x).  Avoid passing a uint32_t pointer into a function
      which expects dma_addr_t pointer.
      
      drivers/gpu/drm/omapdrm/omap_plane.c: In function 'omap_plane_pre_apply':
      drivers/gpu/drm/omapdrm/omap_plane.c:145:2: error: format '%x' expects argument of type 'unsigned int', but argument 5 has type 'dma_addr_t' [-Werror=format]
      drivers/gpu/drm/omapdrm/omap_plane.c:145:2: error: format '%x' expects argument of type 'unsigned int', but argument 6 has type 'dma_addr_t' [-Werror=format]
      make[5]: *** [drivers/gpu/drm/omapdrm/omap_plane.o] Error 1
      drivers/gpu/drm/omapdrm/omap_gem.c: In function 'omap_gem_get_paddr':
      drivers/gpu/drm/omapdrm/omap_gem.c:794:4: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'dma_addr_t' [-Werror=format]
      drivers/gpu/drm/omapdrm/omap_gem.c: In function 'omap_gem_describe':
      drivers/gpu/drm/omapdrm/omap_gem.c:991:4: error: format '%Zx' expects argument of type 'size_t', but argument 7 has type 'dma_addr_t' [-Werror=format]
      drivers/gpu/drm/omapdrm/omap_gem.c: In function 'omap_gem_init':
      drivers/gpu/drm/omapdrm/omap_gem.c:1470:4: error: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'dma_addr_t' [-Werror=format]
      make[5]: *** [drivers/gpu/drm/omapdrm/omap_gem.o] Error 1
      drivers/gpu/drm/omapdrm/omap_dmm_tiler.c: In function 'dmm_txn_append':
      drivers/gpu/drm/omapdrm/omap_dmm_tiler.c:226:2: error: passing argument 3 of 'alloc_dma' from incompatible pointer type [-Werror]
      make[5]: *** [drivers/gpu/drm/omapdrm/omap_dmm_tiler.o] Error 1
      make[5]: Target `__build' not remade because of errors.
      make[4]: *** [drivers/gpu/drm/omapdrm] Error 2
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      2d31ca3a
  7. 08 7月, 2014 3 次提交
    • F
      drm/omap: remove null test before kfree · d2c87e2d
      Fabian Frederick 提交于
      Fix checkpatch warning:
      WARNING: kfree(NULL) is safe this check is probably not required
      
      Cc: David Airlie <airlied@linux.ie>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Signed-off-by: NFabian Frederick <fabf@skynet.be>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      d2c87e2d
    • D
      drm/gem: remove misleading gfp parameter to get_pages() · 0cdbe8ac
      David Herrmann 提交于
      drm_gem_get_pages() currently allows passing a 'gfp' parameter that is
      passed to shmem combined with mapping_gfp_mask(). Given that the default
      mapping_gfp_mask() is GFP_HIGHUSER, it is _very_ unlikely that anyone will
      ever make use of that parameter. In fact, all drivers currently pass
      redundant flags or 0.
      
      This patch removes the 'gfp' parameter. The only reason to keep it is to
      remove flags like __GFP_WAIT. But in its current form, it can only be used
      to add flags. So to remove __GFP_WAIT, you'd have to drop it from the
      mapping_gfp_mask, which again is stupid as this mask is used by shmem-core
      for other allocations, too.
      
      If any driver ever requires that parameter, we can introduce a new helper
      that takes the raw 'gfp' parameter. The caller'd be responsible to combine
      it with mapping_gfp_mask() in a suitable way. The current
      drm_gem_get_pages() helper would then simply use mapping_gfp_mask() and
      call the new helper. This is what shmem_read_mapping_pages{_gfp,} does
      right now.
      
      Moreover, the gfp-zone flag-usage is not obvious: If you pass a modified
      zone, shmem core will WARN() or even BUG(). In other words, the following
      must be true for 'gfp' passed to shmem_read_mapping_pages_gfp():
          gfp_zone(mapping_gfp_mask(mapping)) == gfp_zone(gfp)
      Add a comment to drm_gem_read_pages() explaining that constraint.
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      0cdbe8ac
    • D
      drm/omap: use __GFP_DMA32 for shmem-backed gem · ab5a60c3
      David Herrmann 提交于
      OMAP requires bo-pages to be in the DMA32 zone. Explicitly request this by
      setting __GFP_DMA32 as mapping-gfp-mask during shmem initialization. This
      drops HIGHMEM from the gfp-mask and uses DMA32 instead. shmem-core takes
      care to relocate pages during swap-in in case they have been loaded into
      the wrong zone.
      
      It is _not_ possible to pass __GFP_DMA32 to shmem_read_mapping_page_gfp()
      as the page might have already been swapped-in at that time. The zone-mask
      must be set during initialization and be kept constant for now.
      
      Remove the now superfluous TODO in omap_gem.c.
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Tested-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      ab5a60c3
  8. 15 4月, 2014 3 次提交
  9. 16 3月, 2014 1 次提交
    • D
      drm: use anon-inode instead of relying on cdevs · 6796cb16
      David Herrmann 提交于
      DRM drivers share a common address_space across all character-devices of a
      single DRM device. This allows simple buffer eviction and mapping-control.
      However, DRM core currently waits for the first ->open() on any char-dev
      to mark the underlying inode as backing inode of the device. This delayed
      initialization causes ugly conditions all over the place:
        if (dev->dev_mapping)
          do_sth();
      
      To avoid delayed initialization and to stop reusing the inode of the
      char-dev, we allocate an anonymous inode for each DRM device and reset
      filp->f_mapping to it on ->open().
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      6796cb16
  10. 09 10月, 2013 1 次提交
    • D
      drm: kill ->gem_init_object() and friends · 16eb5f43
      David Herrmann 提交于
      All drivers embed gem-objects into their own buffer objects. There is no
      reason to keep drm_gem_object_alloc(), gem->driver_private and
      ->gem_init_object() anymore.
      
      New drivers are highly encouraged to do the same. There is no benefit in
      allocating gem-objects separately.
      
      Cc: Dave Airlie <airlied@gmail.com>
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Inki Dae <inki.dae@samsung.com>
      Cc: Ben Skeggs <skeggsb@gmail.com>
      Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Acked-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      16eb5f43
  11. 19 8月, 2013 1 次提交
  12. 07 8月, 2013 1 次提交
  13. 25 7月, 2013 1 次提交
    • D
      drm/gem: convert to new unified vma manager · 0de23977
      David Herrmann 提交于
      Use the new vma manager instead of the old hashtable. Also convert all
      drivers to use the new convenience helpers. This drops all the
      (map_list.hash.key << PAGE_SHIFT) non-sense.
      
      Locking and access-management is exactly the same as before with an
      additional lock inside of the vma-manager, which strictly wouldn't be
      needed for gem.
      
      v2:
       - rebase on drm-next
       - init nodes via drm_vma_node_reset() in drm_gem.c
      v3:
       - fix tegra
      v4:
       - remove duplicate if (drm_vma_node_has_offset()) checks
       - inline now trivial drm_vma_node_offset_addr() calls
      v5:
       - skip node-reset on gem-init due to kzalloc()
       - do not allow mapping gem-objects with offsets (backwards compat)
       - remove unneccessary casts
      
      Cc: Inki Dae <inki.dae@samsung.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Acked-by: NPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@gmail.com>
      0de23977
  14. 23 7月, 2013 1 次提交
  15. 17 2月, 2013 3 次提交
  16. 12 2月, 2013 1 次提交
  17. 30 1月, 2013 1 次提交
  18. 18 1月, 2013 1 次提交
    • A
      drm/omap: Add PM capabilities · e78edba1
      Andy Gross 提交于
      Added power management capabilities into the omapdrm and DMM drivers.
      During suspend, we don't need to do anything to maintain the state of
      the LUT.  We have all the necessary information to recreate the mappings
      of the GEM object list maintained by the omapdrm driver.
      
      On resume, the DMM resume handler will first reprogram the LUT to point
      to the dummy page.  The subsequent resume handler in the omapdrm will call
      into the DMM and reprogram each of the buffer objects.  This will ensure
      that all of the necessary objects will be pinned into the DMM properly.
      
      Order of suspend/resume handlers is done by device creation.  We create
      the DMM device before the omapdrm, so the correct order is maintained.
      Signed-off-by: NAndy Gross <andy.gross@ti.com>
      Signed-off-by: NRob Clark <rob@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e78edba1
  19. 15 11月, 2012 3 次提交
  20. 23 10月, 2012 2 次提交
  21. 27 9月, 2012 1 次提交
  22. 05 9月, 2012 1 次提交
  23. 16 8月, 2012 1 次提交
  24. 17 5月, 2012 1 次提交
  25. 11 4月, 2012 1 次提交
  26. 08 3月, 2012 4 次提交