1. 15 9月, 2018 1 次提交
    • C
      drm: Differentiate the lack of an interface from invalid parameter · 69fdf420
      Chris Wilson 提交于
      If the ioctl is not supported on a particular piece of HW/driver
      combination, report ENOTSUP (aka EOPNOTSUPP) so that it can be easily
      distinguished from both the lack of the ioctl and from a regular invalid
      parameter.
      
      v2: Across all the kms ioctls we had a mixture of reporting EINVAL,
      ENODEV and a few ENOTSUPP (most where EINVAL) for a failed
      drm_core_check_feature(). Update everybody to report ENOTSUPP.
      
      v3: ENOTSUPP is an internal errno! It's value (524) does not correspond
      to a POSIX errno, the one we want is ENOTSUP. However,
      uapi/asm-generic/errno.h doesn't include ENOTSUP but man errno says
      
      	"ENOTSUP and EOPNOTSUPP have the same value on Linux,
      	but according to POSIX.1 these error values should be
      	distinct."
      
      so use EOPNOTSUPP as its equivalent.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> #v2
      Link: https://patchwork.freedesktop.org/patch/msgid/20180913192050.24812-1-chris@chris-wilson.co.uk
      69fdf420
  2. 09 9月, 2018 1 次提交
  3. 17 7月, 2018 1 次提交
  4. 14 7月, 2018 3 次提交
  5. 05 7月, 2018 2 次提交
  6. 03 7月, 2018 1 次提交
  7. 20 6月, 2018 1 次提交
    • B
      drm: Add writeback connector type · 935774cd
      Brian Starkey 提交于
      Writeback connectors represent writeback engines which can write the
      CRTC output to a memory framebuffer. Add a writeback connector type and
      related support functions.
      
      Drivers should initialize a writeback connector with
      drm_writeback_connector_init() which takes care of setting up all the
      writeback-specific details on top of the normal functionality of
      drm_connector_init().
      
      Writeback connectors have a WRITEBACK_FB_ID property, used to set the
      output framebuffer, and a WRITEBACK_PIXEL_FORMATS blob used to expose the
      supported writeback formats to userspace.
      
      When a framebuffer is attached to a writeback connector with the
      WRITEBACK_FB_ID property, it is used only once (for the commit in which
      it was included), and userspace can never read back the value of
      WRITEBACK_FB_ID. WRITEBACK_FB_ID can only be set if the connector is
      attached to a CRTC.
      
      Changes since v1:
       - Added drm_writeback.c + documentation
       - Added helper to initialize writeback connector in one go
       - Added core checks
       - Squashed into a single commit
       - Dropped the client cap
       - Writeback framebuffers are no longer persistent
      
      Changes since v2:
       Daniel Vetter:
       - Subclass drm_connector to drm_writeback_connector
       - Relax check to allow CRTC to be set without an FB
       - Add some writeback_ prefixes
       - Drop PIXEL_FORMATS_SIZE property, as it was unnecessary
       Gustavo Padovan:
       - Add drm_writeback_job to handle writeback signalling centrally
      
      Changes since v3:
       - Rebased
       - Rename PIXEL_FORMATS -> WRITEBACK_PIXEL_FORMATS
      
      Chances since v4:
       - Embed a drm_encoder inside the drm_writeback_connector to
         reduce the amount of boilerplate code required from the drivers
         that are using it.
      
      Changes since v5:
       - Added Rob Clark's atomic_commit() vfunc to connector helper
         funcs, so that writeback jobs are committed from atomic helpers
       - Updated create_writeback_properties() signature to return an
         error code rather than a boolean false for failure.
       - Free writeback job with the connector state rather than when
         doing the cleanup_work()
      
      Changes since v7:
       - fix extraneous use of out_fence that is only introduced in a
         subsequent patch.
      
      Changes since v8:
       - whitespace changes pull from subsequent patch
      
      Changes since v9:
       - Revert the v6 changes that free the writeback job in the connector
         state cleanup and return to doing it in the cleanup_work() function
      Signed-off-by: NBrian Starkey <brian.starkey@arm.com>
      [rebased and fixed conflicts]
      Signed-off-by: NMihail Atanassov <mihail.atanassov@arm.com>
      [rebased and added atomic_commit() vfunc for writeback jobs]
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NLiviu Dudau <liviu.dudau@arm.com>
      Reviewed-by: NEric Anholt <eric@anholt.net>
      Link: https://patchwork.freedesktop.org/patch/229037/
      935774cd
  8. 18 6月, 2018 1 次提交
  9. 17 5月, 2018 1 次提交
    • S
      drm: content-type property for HDMI connector · 50525c33
      Stanislav Lisovskiy 提交于
      Added content_type property to drm_connector_state
      in order to properly handle external HDMI TV content-type setting.
      
      v2:
       * Moved helper function which attaches content type property
         to the drm core, as was suggested.
         Removed redundant connector state initialization.
      
      v3:
       * Removed caps in drm_content_type_enum_list.
         After some discussion it turned out that HDMI Spec 1.4
         was wrongly assuming that IT Content(itc) bit doesn't affect
         Content type states, however itc bit needs to be manupulated
         as well. In order to not expose additional property for itc,
         for sake of simplicity it was decided to bind those together
         in same "content type" property.
      
      v4:
       * Added it_content checking in intel_digital_connector_atomic_check.
         Fixed documentation for new content type enum.
      
      v5:
       * Moved patch revision's description to commit messages.
      
      v6:
       * Minor naming fix for the content type enumeration string.
      
      v7:
       * Fix parameter name for documentation and parameter alignment
         in order not to get warning. Added Content Type description to
         new HDMI connector properties section.
      
      v8:
       * Thrown away unneeded numbers from HDMI content-type property
         description. Switch to strings desription instead of plain
         definitions.
      
      v9:
       * Moved away hdmi specific content-type enum from
         drm_connector_state. Content type property should probably not
         be bound to any specific connector interface in
         drm_connector_state.
         Same probably should be done to hdmi_picture_aspect_ration enum
         which is also contained in drm_connector_state. Added special
         helper function to get derive hdmi specific relevant infoframe
         fields.
      
      v10:
       * Added usage description to HDMI properties kernel doc.
      
      v11:
       * Created centralized function for filling HDMI AVI infoframe, based
         on correspondent DRM property value.
      Acked-by: NHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NStanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20180515135928.31092-2-stanislav.lisovskiy@intel.com
      [vsyrjala: clean up checkpatch multiple blank lines warnings]
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      50525c33
  10. 11 5月, 2018 1 次提交
    • A
      drm: Expose modes with aspect ratio, only if requested · c3ff0cdb
      Ankit Nautiyal 提交于
      We parse the EDID and add all the modes in the connector's modelist.
      This adds CEA modes with aspect ratio information too, regardless of
      whether user space requested this information or not.
      
      This patch:
      -prunes the modes with aspect-ratio information, from the
       drm_mode_get_connector modelist supplied to the user, if the
       user-space has not set the aspect ratio DRM client cap. However if
       such a mode is unique in the list, it is kept in the list, with
       aspect-ratio flags reset.
      -prepares a list of exposed modes, which is used to find unique modes
       if aspect-ratio is not allowed.
      -adds a new list_head 'exposed_head' in drm_mode_display, to traverse
       the list of exposed modes.
      
      Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
      Cc: Shashank Sharma <shashank.sharma@intel.com>
      Cc: Jose Abreu <jose.abreu@synopsys.com>
      Signed-off-by: NAnkit Nautiyal <ankit.k.nautiyal@intel.com>
      
      V3: As suggested by Ville, modified the mechanism of pruning of modes
          with aspect-ratio, if the aspect-ratio is not supported. Instead
          of straight away pruning such a mode, the mode is retained with
          aspect ratio bits set to zero, provided it is unique.
      V4: rebase
      V5: Addressed review comments from Ville:
          -used a pointer to store last valid mode.
          -avoided, modifying of picture_aspect_ratio in kernel mode,
           instead only flags bits of user mode are reset (if aspect-ratio
           is not supported).
      V6: As suggested by Ville, corrected the mode pruning logic and
          elaborated the mode pruning logic and the assumptions taken.
      V7: rebase
      V8: rebase
      V9: rebase
      V10: rebase
      V11: Fixed the issue caused in kms_3d test, and enhanced the pruning
           logic to correctly identify and prune modes with aspect-ratio,
           if aspect-ratio cap is not set.
      V12: As suggested by Ville, added another list_head in
           drm_mode_display to traverse the list of exposed modes and
           avoided duplication of modes.
      V13: Minor modifications, as suggested by Ville.
      v14: As suggested by Daniel Vetter and Ville Syrjala, corrected the
           pruning logic to avoid any dependency in the order of mode with
           aspect-ratio.
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/1525777785-9740-9-git-send-email-ankit.k.nautiyal@intel.com
      c3ff0cdb
  11. 27 4月, 2018 1 次提交
  12. 20 2月, 2018 1 次提交
  13. 30 1月, 2018 1 次提交
  14. 09 1月, 2018 2 次提交
  15. 14 12月, 2017 1 次提交
    • D
      drm: rework delayed connector cleanup in connector_iter · ea497bb9
      Daniel Vetter 提交于
      PROBE_DEFER also uses system_wq to reprobe drivers, which means when
      that again fails, and we try to flush the overall system_wq (to get
      all the delayed connectore cleanup work_struct completed), we
      deadlock.
      
      Fix this by using just a single cleanup work, so that we can only
      flush that one and don't block on anything else. That means a free
      list plus locking, a standard pattern.
      
      v2:
      - Correctly free connectors only on last ref. Oops (Chris).
      - use llist_head/node (Chris).
      
      v3
      - Add init_llist_head (Chris).
      
      Fixes: a703c550 ("drm: safely free connectors from connector_iter")
      Fixes: 613051da ("drm: locking&new iterators for connector_list")
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Cc: Dave Airlie <airlied@gmail.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: <stable@vger.kernel.org> # v4.11+: 613051da ("drm: locking&new iterators for connector_list"
      Cc: <stable@vger.kernel.org> # v4.11+
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Gustavo Padovan <gustavo@padovan.org>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Javier Martinez Canillas <javier@dowhile0.org>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: Guillaume Tucker <guillaume.tucker@collabora.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: Matt Hart <matthew.hart@linaro.org>
      Cc: Thierry Escande <thierry.escande@collabora.co.uk>
      Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
      Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
      Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171213124936.17914-1-daniel.vetter@ffwll.ch
      ea497bb9
  16. 13 12月, 2017 2 次提交
    • K
      drm: Update edid-derived drm_display_info fields at edid property set [v2] · 4b4df570
      Keith Packard 提交于
      There are a set of values in the drm_display_info structure for each
      connector which hold information derived from EDID. These are computed
      in drm_add_display_info. Before this patch, that was only called in
      drm_add_edid_modes. This meant that they were only set when EDID was
      present and never reset when EDID was not, as happened when the
      display was disconnected.
      
      One of these fields, non_desktop, is used from
      drm_mode_connector_update_edid_property, the function responsible for
      assigning the new edid value to the application-visible property.
      
      Various drivers call these two functions (drm_add_edid_modes and
      drm_mode_connector_update_edid_property) in different orders. This
      means that even when EDID is present, the drm_display_info fields may
      not have been computed at the time that
      drm_mode_connector_update_edid_property used the non_desktop value to
      set the non_desktop property.
      
      I've added a public function (drm_reset_display_info) that resets the
      drm_display_info field values to default values and then made the
      drm_add_display_info function public. These two functions are now
      called directly from drm_mode_connector_update_edid_property so that
      the drm_display_info fields are always computed from the current EDID
      information before being used in that function.
      
      This means that the drm_display_info values are often computed twice,
      once when the EDID property it set and a second time when EDID is used
      to compute modes for the device. The alternative would be to uniformly
      ensure that the values were computed once before being used, which
      would require that all drivers reliably invoke the two paths in the
      same order. The computation is inexpensive enough that it seems more
      maintainable in the long term to simply compute them in both paths.
      
      The API to drm_add_display_info has been changed so that it no longer
      takes the set of edid-based quirks as a parameter. Rather, it now
      computes those quirks itself and returns them for further use by
      drm_add_edid_modes.
      
      This patch also includes a number of 'const' additions caused by
      drm_mode_connector_update_edid_property taking a 'const struct edid *'
      parameter and wanting to pass that along to drm_add_display_info.
      
      v2: after review by Daniel Vetter <daniel.vetter@ffwll.ch>
      
      	Removed EXPORT_SYMBOL_GPL for drm_reset_display_info and
      	drm_add_display_info.
      
      	Added FIXME in drm_mode_connector_update_edid_property about
      	potentially merging that with drm_add_edid_modes to avoid
      	the need for two driver calls.
      Signed-off-by: NKeith Packard <keithp@keithp.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171213084427.31199-1-keithp@keithp.com
      (danvet: cherry picked from commit 12a889bf4bca ("drm: rework delayed
      connector cleanup in connector_iter") from drm-misc-next since
      functional conflict with changes in -next and we need to make sure
      both have the right version and nothing gets lost.)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4b4df570
    • K
      drm: Update edid-derived drm_display_info fields at edid property set [v2] · 170178fe
      Keith Packard 提交于
      There are a set of values in the drm_display_info structure for each
      connector which hold information derived from EDID. These are computed
      in drm_add_display_info. Before this patch, that was only called in
      drm_add_edid_modes. This meant that they were only set when EDID was
      present and never reset when EDID was not, as happened when the
      display was disconnected.
      
      One of these fields, non_desktop, is used from
      drm_mode_connector_update_edid_property, the function responsible for
      assigning the new edid value to the application-visible property.
      
      Various drivers call these two functions (drm_add_edid_modes and
      drm_mode_connector_update_edid_property) in different orders. This
      means that even when EDID is present, the drm_display_info fields may
      not have been computed at the time that
      drm_mode_connector_update_edid_property used the non_desktop value to
      set the non_desktop property.
      
      I've added a public function (drm_reset_display_info) that resets the
      drm_display_info field values to default values and then made the
      drm_add_display_info function public. These two functions are now
      called directly from drm_mode_connector_update_edid_property so that
      the drm_display_info fields are always computed from the current EDID
      information before being used in that function.
      
      This means that the drm_display_info values are often computed twice,
      once when the EDID property it set and a second time when EDID is used
      to compute modes for the device. The alternative would be to uniformly
      ensure that the values were computed once before being used, which
      would require that all drivers reliably invoke the two paths in the
      same order. The computation is inexpensive enough that it seems more
      maintainable in the long term to simply compute them in both paths.
      
      The API to drm_add_display_info has been changed so that it no longer
      takes the set of edid-based quirks as a parameter. Rather, it now
      computes those quirks itself and returns them for further use by
      drm_add_edid_modes.
      
      This patch also includes a number of 'const' additions caused by
      drm_mode_connector_update_edid_property taking a 'const struct edid *'
      parameter and wanting to pass that along to drm_add_display_info.
      
      v2: after review by Daniel Vetter <daniel.vetter@ffwll.ch>
      
      	Removed EXPORT_SYMBOL_GPL for drm_reset_display_info and
      	drm_add_display_info.
      
      	Added FIXME in drm_mode_connector_update_edid_property about
      	potentially merging that with drm_add_edid_modes to avoid
      	the need for two driver calls.
      Signed-off-by: NKeith Packard <keithp@keithp.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171213084427.31199-1-keithp@keithp.com
      170178fe
  17. 06 12月, 2017 1 次提交
    • D
      drm: safely free connectors from connector_iter · a703c550
      Daniel Vetter 提交于
      In
      
      commit 613051da
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Wed Dec 14 00:08:06 2016 +0100
      
          drm: locking&new iterators for connector_list
      
      we've went to extreme lengths to make sure connector iterations works
      in any context, without introducing any additional locking context.
      This worked, except for a small fumble in the implementation:
      
      When we actually race with a concurrent connector unplug event, and
      our temporary connector reference turns out to be the final one, then
      everything breaks: We call the connector release function from
      whatever context we happen to be in, which can be an irq/atomic
      context. And connector freeing grabs all kinds of locks and stuff.
      
      Fix this by creating a specially safe put function for connetor_iter,
      which (in this rare case) punts the cleanup to a worker.
      Reported-by: NBen Widawsky <ben@bwidawsk.net>
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Fixes: 613051da ("drm: locking&new iterators for connector_list")
      Cc: Dave Airlie <airlied@gmail.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: <stable@vger.kernel.org> # v4.11+
      Reviewed-by: NDave Airlie <airlied@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171204204818.24745-1-daniel.vetter@ffwll.ch
      a703c550
  18. 05 12月, 2017 1 次提交
    • H
      drm: Add support for a panel-orientation connector property, v6 · 8d70f395
      Hans de Goede 提交于
      On some devices the LCD panel is mounted in the casing in such a way that
      the up/top side of the panel does not match with the top side of the
      device (e.g. it is mounted upside-down).
      
      This commit adds the necessary infra for lcd-panel drm_connector-s to
      have a "panel orientation" property to communicate how the panel is
      orientated vs the casing.
      
      Userspace can use this property to check for non-normal orientation and
      then adjust the displayed image accordingly by rotating it to compensate.
      
      Changes in v2:
      -Store panel_orientation in drm_display_info, so that drm_fb_helper.c can
       access it easily
      -Have a single drm_connector_init_panel_orientation_property rather then
       create and attach functions. The caller is expected to set
       drm_display_info.panel_orientation before calling this, then this will
       check for platform specific quirks overriding the panel_orientation and if
       the panel_orientation is set after this then it will attach the property.
      
      Changes in v6:
      -Use an enum (with kerneldoc) rather then #defines for
       DRM_MODE_PANEL_ORIENTATION_*
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171125193553.23986-4-hdegoede@redhat.com
      8d70f395
  19. 23 11月, 2017 1 次提交
  20. 12 10月, 2017 1 次提交
  21. 26 9月, 2017 1 次提交
  22. 11 9月, 2017 1 次提交
  23. 08 8月, 2017 2 次提交
    • D
      drm: Handle properties in the core for atomic drivers · 144a7999
      Daniel Vetter 提交于
      The reason behind the original indirection through the helper
      functions was to allow existing drivers to overwrite how they handle
      properties. For example when a vendor-specific userspace had
      expectations that didn't match atomic. That seemed likely, since
      atomic is standardizing a _lot_ more of the behaviour of a kms driver.
      
      But 20 drivers later there's no such need at all. Worse, this forces
      all drivers to hook up the default behaviour, breaking userspace if
      they forget to do that. And it forces us to export a bunch of core
      function just for those helpers.
      
      And finally, these helpers are the last places using
      drm_atomic_legacy_backoff() and the implicit acquire_ctx.
      
      This patch here just implements the new behaviour and updates the
      docs. Follow-up patches will garbage-collect all the dead code.
      
      v2: Fixup docs even better!
      
      v3: Make it actually work ...
      
      v4: Drop the uses_atomic_modeset() checks from the previous patch
      again, since they're now moved up in the callchain.
      
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: Archit Taneja <architt@codeaurora.org> (v3)
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170725120204.2107-1-daniel.vetter@ffwll.ch
      144a7999
    • D
      drm: Don't update property values for atomic drivers · 4a97a3da
      Daniel Vetter 提交于
      Atomic drivers only use the property value store for immutable (i.e.
      can't be set by userspace, but the kernel can still adjust it)
      properties. The only tricky part is the removal of the update in
      drm_atomic_helper_update_legacy_modeset_state().
      
      This was added in
      
      commit 8c10342c (tag: topic/drm-misc-2015-07-28)
      Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Date:   Mon Jul 27 13:24:29 2015 +0200
      
          drm/atomic: Update legacy DPMS state during modesets, v3.
      
      by copying it from the i915 code, where it was originally added in
      
      commit 68d34720
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Thu Sep 6 22:08:35 2012 +0200
      
          drm/i915: update dpms property in set_mode
      
      for the legacy modeset code. The reason we needed this hack was that
      i915 didn't yet set DRIVER_ATOMIC, and we checked for that instead of
      the newer-ish drm_drv_uses_atomic_modeset(), which avoids such
      troubles. With the correct feature checks this isn't needed anymore at
      all.
      
      Also make sure that drivers don't accidentally get this wrong by
      making the exported version of drm_object_property_get_value() only
      work for legacy drivers. Only gma500 uses it anyway.
      
      v2: Fixup the uses_atomic_modeset() checks (Maarten)
      
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170725120137.1903-1-daniel.vetter@ffwll.ch
      4a97a3da
  24. 21 6月, 2017 1 次提交
  25. 08 5月, 2017 1 次提交
  26. 28 2月, 2017 4 次提交
  27. 27 2月, 2017 1 次提交
    • M
      drm: Add a new connector atomic property for link status · 40ee6fbe
      Manasi Navare 提交于
      At the time userspace does setcrtc, we've already promised the mode
      would work. The promise is based on the theoretical capabilities of
      the link, but it's possible we can't reach this in practice. The DP
      spec describes how the link should be reduced, but we can't reduce
      the link below the requirements of the mode. Black screen follows.
      
      One idea would be to have setcrtc return a failure. However, it
      already should not fail as the atomic checks have passed. It would
      also conflict with the idea of making setcrtc asynchronous in the
      future, returning before the actual mode setting and link training.
      
      Another idea is to train the link "upfront" at hotplug time, before
      pruning the mode list, so that we can do the pruning based on
      practical not theoretical capabilities. However, the changes for link
      training are pretty drastic, all for the sake of error handling and
      DP compliance, when the most common happy day scenario is the current
      approach of link training at mode setting time, using the optimal
      parameters for the mode. It is also not certain all hardware could do
      this without the pipe on; not even all our hardware can do this. Some
      of this can be solved, but not trivially.
      
      Both of the above ideas also fail to address link degradation *during*
      operation.
      
      The solution is to add a new "link-status" connector property in order
      to address link training failure in a way that:
      a) changes the current happy day scenario as little as possible, to
      avoid regressions, b) can be implemented the same way by all drm
      drivers, c) is still opt-in for the drivers and userspace, and opting
      out doesn't regress the user experience, d) doesn't prevent drivers
      from implementing better or alternate approaches, possibly without
      userspace involvement. And, of course, handles all the issues presented.
      In the usual happy day scenario, this is always "good". If something
      fails during or after a mode set, the kernel driver can set the link
      status to "bad" and issue a hotplug uevent for userspace to have it
      re-check the valid modes through GET_CONNECTOR IOCTL, and try modeset
      again. If the theoretical capabilities of the link can't be reached,
      the mode list is trimmed based on that.
      
      v7 by Jani:
      * Rebase, simplify set property while at it, checkpatch fix
      v6:
      * Fix a typo in kernel doc (Sean Paul)
      v5:
      * Clarify doc for silent rejection of atomic properties by driver (Daniel Vetter)
      v4:
      * Add comments in kernel-doc format (Daniel Vetter)
      * Update the kernel-doc for link-status (Sean Paul)
      v3:
      * Fixed a build error (Jani Saarinen)
      v2:
      * Removed connector->link_status (Daniel Vetter)
      * Set connector->state->link_status in drm_mode_connector_set_link_status_property
      (Daniel Vetter)
      * Set the connector_changed flag to true if connector->state->link_status changed.
      * Reset link_status to GOOD in update_output_state (Daniel Vetter)
      * Never allow userspace to set link status from Good To Bad (Daniel Vetter)
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Acked-by: NTony Cheng <tony.cheng@amd.com>
      Acked-by: NHarry Wentland <harry.wentland@amd.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Sean Paul <seanpaul@chromium.org>
      Signed-off-by: NManasi Navare <manasi.d.navare@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Acked-by: Eric Anholt <eric@anholt.net> (for the -modesetting patch)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/0182487051aa9f1594820e35a4853de2f8747b4e.1481883920.git.jani.nikula@intel.com
      40ee6fbe
  28. 30 1月, 2017 2 次提交
  29. 26 1月, 2017 1 次提交
  30. 25 1月, 2017 1 次提交