1. 05 6月, 2014 1 次提交
  2. 04 6月, 2014 6 次提交
    • 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
    • R
      drm: add signed-range property type · ebc44cf3
      Rob Clark 提交于
      Like range, but values are signed.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      ebc44cf3
    • R
      drm: add object property type · 98f75de4
      Rob Clark 提交于
      An object property is an id (idr) for a drm mode object.  This
      will allow a property to be used set/get a framebuffer, CRTC, etc.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      98f75de4
    • R
      drm: add extended property types · 5ea22f24
      Rob Clark 提交于
      If we continue to use bitmask for type, we will quickly run out of room
      to add new types.  Split this up so existing part of bitmask range
      continues to function as before, but reserve a chunk of the remaining
      space for an integer type-id.  Wrap this all up in some type-check
      helpers to keep the backwards-compat uglyness contained.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5ea22f24
    • R
      drm: helpers to find mode objects · a2b34e22
      Rob Clark 提交于
      Add a few more useful helpers to find mode objects.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a2b34e22
    • J
      drm: drop drm_get_connector_name() and drm_get_encoder_name() · d5ab2b43
      Jani Nikula 提交于
      No longer used or needed as the structs have a name field.
      Acked-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      d5ab2b43
  3. 03 6月, 2014 1 次提交
  4. 02 6月, 2014 2 次提交
    • T
      drm/plane: Fix sparse warnings · f220e626
      Thierry Reding 提交于
      Include the drm_plane_helper.h header file to fix the following sparse
      warnings:
      
      	  CHECK   drivers/gpu/drm/drm_plane_helper.c
      	drivers/gpu/drm/drm_plane_helper.c:102:5: warning: symbol 'drm_primary_helper_update' was not declared. Should it be static?
      	drivers/gpu/drm/drm_plane_helper.c:219:5: warning: symbol 'drm_primary_helper_disable' was not declared. Should it be static?
      	drivers/gpu/drm/drm_plane_helper.c:233:6: warning: symbol 'drm_primary_helper_destroy' was not declared. Should it be static?
      	drivers/gpu/drm/drm_plane_helper.c:241:30: warning: symbol 'drm_primary_helper_funcs' was not declared. Should it be static?
      	drivers/gpu/drm/drm_plane_helper.c:259:18: warning: symbol 'drm_primary_helper_create_plane' was not declared. Should it be static?
      
      Doing that makes gcc complain as follows:
      
      	  CC      drivers/gpu/drm/drm_plane_helper.o
      	drivers/gpu/drm/drm_plane_helper.c:260:19: error: conflicting types for 'drm_primary_helper_create_plane'
      	 struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev,
      	                   ^
      	In file included from drivers/gpu/drm/drm_plane_helper.c:29:0:
      	include/drm/drm_plane_helper.h:42:19: note: previous declaration of 'drm_primary_helper_create_plane' was here
      	 struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev,
      	                   ^
      	drivers/gpu/drm/drm_plane_helper.c: In function 'drm_primary_helper_create_plane':
      	drivers/gpu/drm/drm_plane_helper.c:274:11: warning: assignment discards 'const' qualifier from pointer target type
      	   formats = safe_modeset_formats;
      	           ^
      	In file included from include/linux/linkage.h:6:0,
      	                 from include/linux/kernel.h:6,
      	                 from include/drm/drmP.h:45,
      	                 from drivers/gpu/drm/drm_plane_helper.c:27:
      	drivers/gpu/drm/drm_plane_helper.c: At top level:
      	drivers/gpu/drm/drm_plane_helper.c:289:15: error: conflicting types for 'drm_primary_helper_create_plane'
      	 EXPORT_SYMBOL(drm_primary_helper_create_plane);
      	               ^
      	include/linux/export.h:57:21: note: in definition of macro '__EXPORT_SYMBOL'
      	  extern typeof(sym) sym;     \
      	                     ^
      	drivers/gpu/drm/drm_plane_helper.c:289:1: note: in expansion of macro 'EXPORT_SYMBOL'
      	 EXPORT_SYMBOL(drm_primary_helper_create_plane);
      	 ^
      	In file included from drivers/gpu/drm/drm_plane_helper.c:29:0:
      	include/drm/drm_plane_helper.h:42:19: note: previous declaration of 'drm_primary_helper_create_plane' was here
      	 struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev,
      	                   ^
      
      Which can easily be fixed by making the signatures of the implementation
      and the prototype match.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f220e626
    • J
      drm/exynos: dp: Use DPCD defines of drm_dp_helper.h · 073ea2ae
      Jingoo Han 提交于
      Use DPCD defines of drm_dp_helper.h; thus, duplicated DPCD defines
      of exynos_dp_core.h can be removed. Also, DP_TEST_EDID_CHECKSUM
      define is added to drm_dp_helper.h. There is no functional change.
      Signed-off-by: NJingoo Han <jg1.han@samsung.com>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NInki Dae <inki.dae@samsung.com>
      073ea2ae
  5. 30 5月, 2014 2 次提交
  6. 27 5月, 2014 1 次提交
  7. 26 5月, 2014 1 次提交
  8. 23 5月, 2014 1 次提交
  9. 21 5月, 2014 3 次提交
  10. 16 5月, 2014 1 次提交
  11. 13 5月, 2014 1 次提交
  12. 05 5月, 2014 1 次提交
  13. 01 5月, 2014 1 次提交
  14. 29 4月, 2014 1 次提交
  15. 23 4月, 2014 9 次提交
  16. 22 4月, 2014 5 次提交
  17. 18 4月, 2014 1 次提交
    • D
      drm: Split out drm_probe_helper.c from drm_crtc_helper.c · 8d754544
      Daniel Vetter 提交于
      This is leftover stuff from my previous doc round which I kinda wanted
      to do but didn't yet due to rebase hell.
      
      The modeset helpers and the probing helpers a independent and e.g.
      i915 uses the probing stuff but has its own modeset infrastructure. It
      hence makes to split this up. While at it add a DOC: comment for the
      probing libraray.
      
      It would be rather neat to pull some of the DocBook documenting these
      two helpers into in-line DOC: comments. But unfortunately kerneldoc
      doesn't support markdown or something similar to make nice-looking
      documentation, so the current state is better.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      8d754544
  18. 08 4月, 2014 1 次提交
  19. 04 4月, 2014 1 次提交