1. 20 3月, 2015 10 次提交
  2. 21 1月, 2015 1 次提交
  3. 20 11月, 2014 1 次提交
  4. 15 11月, 2014 1 次提交
  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. 05 11月, 2014 1 次提交
  7. 20 10月, 2014 1 次提交
  8. 24 9月, 2014 1 次提交
  9. 10 9月, 2014 1 次提交
  10. 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
  11. 12 7月, 2014 3 次提交
  12. 09 7月, 2014 1 次提交
  13. 08 7月, 2014 5 次提交
    • T
      drm: Introduce drm_fb_helper_prepare() · 10a23102
      Thierry Reding 提交于
      To implement hotplug detection in a race-free manner, drivers must call
      drm_kms_helper_poll_init() before hotplug events can be triggered. Such
      events can be triggered right after any of the encoders or connectors
      are initialized. At the same time, if the drm_fb_helper_hotplug_event()
      helper is used by a driver, then the poll helper requires some parts of
      the FB helper to be initialized to prevent a crash.
      
      At the same time, drm_fb_helper_init() requires information that is not
      necessarily available at such an early stage (number of CRTCs and
      connectors), so it cannot be used yet.
      
      Add a new helper, drm_fb_helper_prepare(), that initializes the bare
      minimum needed to allow drm_kms_helper_poll_init() to execute and any
      subsequent hotplug events to be processed properly.
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      10a23102
    • T
      drm: Constify struct drm_fb_helper_funcs · 3a493879
      Thierry Reding 提交于
      There's no need for this to be modifiable. Make it const so that it can
      be put into the .rodata section.
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      3a493879
    • 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
  14. 04 7月, 2014 1 次提交
  15. 19 6月, 2014 1 次提交
  16. 05 6月, 2014 2 次提交
  17. 04 6月, 2014 1 次提交
    • D
      drm: Split connection_mutex out of mode_config.mutex (v3) · 6e9f798d
      Daniel Vetter 提交于
      After the split-out of crtc locks from the big mode_config.mutex
      there's still two major areas it protects:
      - Various connector probe states, like connector->status, EDID
        properties, probed mode lists and similar information.
      - The links from connector->encoder and encoder->crtc and other
        modeset-relevant connector state (e.g. properties which control the
        panel fitter).
      
      The later is used by modeset operations. But they don't really care
      about the former since it's allowed to e.g. enable a disconnected VGA
      output or with a mode not in the probed list.
      
      Thus far this hasn't been a problem, but for the atomic modeset
      conversion Rob Clark needs to convert all modeset relevant locks into
      w/w locks. This is required because the order of acquisition is
      determined by how userspace supplies the atomic modeset data. This has
      run into troubles in the detect path since the i915 load detect code
      needs _both_ protections offered by the mode_config.mutex: It updates
      probe state and it needs to change the modeset configuration to enable
      the temporary load detect pipe.
      
      The big deal here is that for the probe/detect users of this lock a
      plain mutex fits best, but for atomic modesets we really want a w/w
      mutex. To fix this lets split out a new connection_mutex lock for the
      modeset relevant parts.
      
      For simplicity I've decided to only add one additional lock for all
      connector/encoder links and modeset configuration states. We have
      piles of different modeset objects in addition to those (like bridges
      or panels), so adding per-object locks would be much more effort.
      
      Also, we're guaranteed (at least for now) to do a full modeset if we
      need to acquire this lock. Which means that fine-grained locking is
      fairly irrelevant compared to the amount of time the full modeset will
      take.
      
      I've done a full audit, and there's just a few things that justify
      special focus:
      - Locking in drm_sysfs.c is almost completely absent. We should
        sprinkle mode_config.connection_mutex over this file a bit, but
        since it already lacks mode_config.mutex this patch wont make the
        situation any worse. This is material for a follow-up patch.
      
      - omap has a omap_framebuffer_flush function which walks the
        connector->encoder->crtc links and is called from many contexts.
        Some look like they don't acquire mode_config.mutex, so this is
        already racy. Again fixing this is material for a separate patch.
      
      - The radeon hot_plug function to retrain DP links looks at
        connector->dpms. Currently this happens without any locking, so is
        already racy. I think radeon_hotplug_work_func should gain
        mutex_lock/unlock calls for the mode_config.connection_mutex.
      
      - Same applies to i915's intel_dp_hot_plug. But again, this is already
        racy.
      
      - i915 load_detect code needs to acquire this lock. Which means the
        w/w dance due to Rob's work will be nicely contained to _just_ this
        function.
      
      I've added fixme comments everywhere where it looks suspicious but in
      the sysfs code. After a quick irc discussion with Dave Airlie it
      sounds like the lack of locking in there is due to sysfs cleanup fun
      at module unload.
      
      v1: original (only compile tested)
      
      v2: missing mutex_init(), etc (from Rob Clark)
      
      v3: i915 needs more care in the conversion:
      - Protect the edp pp logic with the connection_mutex.
      - Use connection_mutex in the backlight code due to
        get_pipe_from_connector.
      - Use drm_modeset_lock_all in suspend/resume paths.
      - Update lock checks in the overlay code.
      
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      6e9f798d
  18. 15 4月, 2014 7 次提交