1. 22 May, 2019 1 commit
    • Uma Shankar's avatar
      drm: Add HDR source metadata property · fbb5d035
      Uma Shankar authored
      
      This patch adds a blob property to get HDR metadata
      information from userspace. This will be send as part
      of AVI Infoframe to panel.
      
      It also implements get() and set() functions for HDR output
      metadata property.The blob data is received from userspace and
      saved in connector state, the same is returned as blob in get
      property call to userspace.
      
      v2: Rebase and modified the metadata structure elements
      as per Ville's POC changes.
      
      v3: No Change
      
      v4: Addressed Shashank's review comments
      
      v5: Rebase.
      
      v6: Addressed Brian Starkey's review comments, defined
      new structure with header for dynamic metadata scalability.
      Merge get/set property functions for metadata in this patch.
      
      v7: Addressed Jonas Karlman review comments and defined separate
      structure for infoframe to better align with CTA 861.G spec. Added
      Shashank's RB.
      
      v8: Addressed Ville's review comments. Moved sink metadata structure
      out of uapi headers as suggested by Jonas Karlman.
      
      v9: Rebase and addressed Jonas Karlman review comments.
      
      v10: Addressed Ville's review comments, dropped the metdata_changed
      state variable as its not needed anymore.
      Signed-off-by: default avatarUma Shankar <uma.shankar@intel.com>
      Reviewed-by: default avatarShashank Sharma <shashank.sharma@intel.com>
      Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/1558015817-12025-2-git-send-email-uma.shankar@intel.com
      fbb5d035
  2. 09 May, 2019 2 commits
  3. 07 May, 2019 1 commit
  4. 14 Mar, 2019 1 commit
  5. 19 Feb, 2019 1 commit
    • Uma Shankar's avatar
      drm: Add HDMI colorspace property · d2c6a405
      Uma Shankar authored
      
      Create a new connector property to program colorspace to sink
      devices. Modern sink devices support more than 1 type of
      colorspace like 601, 709, BT2020 etc. This helps to switch
      based on content type which is to be displayed. The decision
      lies with compositors as to in which scenarios, a particular
      colorspace will be picked.
      
      This will be helpful mostly to switch to higher gamut colorspaces
      like BT2020 when the media content is encoded as BT2020. Thereby
      giving a good visual experience to users.
      
      The expectation from userspace is that it should parse the EDID
      and get supported colorspaces. Use this property and switch to the
      one supported. Sink supported colorspaces should be retrieved by
      userspace from EDID and driver will not explicitly expose them.
      
      Basically the expectation from userspace is:
       - Set up CRTC DEGAMMA/CTM/GAMMA to convert to some sink
         colorspace
       - Set this new property to let the sink know what it
         converted the CRTC output to.
      
      v2: Addressed Maarten and Ville's review comments. Enhanced
      the colorspace enum to incorporate both HDMI and DP supported
      colorspaces. Also, added a default option for colorspace.
      
      v3: Removed Adobe references from enum definitions as per
      Ville, Hans Verkuil and Jonas Karlman suggestions. Changed
      Default to an unset state where driver will assign the colorspace
      is not chosen by user, suggested by Ville and Maarten. Addressed
      other misc review comments from Maarten. Split the changes to
      have separate colorspace property for DP and HDMI.
      
      v4: Addressed Chris and Ville's review comments, and created a
      common colorspace property for DP and HDMI, filtered the list
      based on the colorspaces supported by the respective protocol
      standard.
      
      v5: Made the property creation helper accept enum list based on
      platform capabilties as suggested by Shashank. Consolidated HDMI
      and DP property creation in the common helper.
      
      v6: Addressed Shashank's review comments.
      
      v7: Added defines instead of enum in uapi as per Brian Starkey's
      suggestion in order to go with string matching at userspace. Updated
      the commit message to add more details as well kernel docs.
      
      v8: Addressed Maarten's review comments.
      
      v9: Removed macro defines from uapi as per Brian Starkey and Daniel
      Stone's comments and moved to drm include file. Moved back to older
      design with exposing all HDMI colorspaces to userspace since infoframe
      capability is there even on legacy platforms, as per Ville's review
      comments.
      
      v10: Fixed sparse warnings, updated the RB from Maarten and Jani's ack.
      
      v11: Addressed Ville's review comments. Updated the Macro naming and
      added DCI-P3 colorspace as well, defined in CTA 861.G spec.
      
      v12: Appended BT709 and SMPTE 170M with YCC information as per Ville's
      review comment to be clear and not to be confused with RGB.
      
      v13: Reorder the colorspace macros.
      
      v14: Removed DP as of now, will be added later once full support is
      enabled, as per Ville's suggestion. Added Ville's RB.
      Signed-off-by: default avatarUma Shankar <uma.shankar@intel.com>
      Acked-by: default avatarJani Nikula <jani.nikula@intel.com>
      Reviewed-by: default avatarShashank Sharma <shashank.sharma@intel.com>
      Reviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/1550596381-993-2-git-send-email-uma.shankar@intel.com
      d2c6a405
  6. 04 Feb, 2019 1 commit
  7. 30 Jan, 2019 1 commit
  8. 19 Dec, 2018 2 commits
  9. 17 Dec, 2018 1 commit
  10. 28 Nov, 2018 2 commits
  11. 02 Nov, 2018 1 commit
    • Radhakrishna Sripada's avatar
      drm: Add connector property to limit max bpc · 47e22ff1
      Radhakrishna Sripada authored
      
      At times 12bpc HDMI cannot be driven due to faulty cables, dongles
      level shifters etc. To workaround them we may need to drive the output
      at a lower bpc. Currently the user space does not have a way to limit
      the bpc. The default bpc to be programmed is decided by the driver and
      is run against connector limitations.
      
      Creating a new connector property "max bpc" in order to limit the bpc.
      xrandr can make use of this connector property to make sure that bpc does
      not exceed the configured value. This property can be used by userspace to
      set the bpc.
      
      V2: Initialize max_bpc to satisfy kms_properties
      V3: Move the property to drm_connector
      V4: Split drm and i915 components(Ville)
      V5: Make the property per connector(Ville)
      V6: Compare the requested bpc to connector bpc(Daniel)
          Move the attach_property function to core(Ville)
      V7: Fix checkpatch warnings
      V8: Simplify the connector check code(Ville)
      V9: Const display_info(Ville)
      V10,V11: Fix CI issues.
      V12: Add the Kernel documentation(Daniel)
      V14: Crossreference the function name in the doc(Daniel)
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Kishore Kadiyala <kishore.kadiyala@intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Manasi Navare <manasi.d.navare@intel.com>
      Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
      Cc: Sunpeng Li <sunpeng.li@amd.com>
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarRadhakrishna Sripada <radhakrishna.sripada@intel.com>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181012184233.29250-1-radhakrishna.sripada@intel.com
      47e22ff1
  12. 24 Oct, 2018 1 commit
    • Sean Paul's avatar
      drm: Fix doc warning in drm_connector_attach_edid_property() · 9d32bdbb
      Sean Paul authored
      Fixes the following warnings:
      ../drivers/gpu/drm/drm_connector.c:305: warning: Excess function parameter 'dev' description in 'drm_connector_attach_edid_property'
      ../drivers/gpu/drm/drm_connector.c:306: warning: Excess function parameter 'dev' description in 'drm_connector_attach_edid_property'
      ../drivers/gpu/drm/drm_connector.c:305: warning: Excess function parameter 'dev' description in 'drm_connector_attach_edid_property'
      ../drivers/gpu/drm/drm_connector.c:305: warning: Excess function parameter 'dev' description in 'drm_connector_attach_edid_property'
      ../drivers/gpu/drm/drm_connector.c:305: warning: Excess function parameter 'dev' description in 'drm_connector_attach_edid_property'
      
      Fixes: 6b7e2d5c
      
       ("drm: add drm_connector_attach_edid_property()")
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: dri-devel@lists.freedesktop.org
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181024182442.206411-1-sean@poorly.run
      9d32bdbb
  13. 19 Oct, 2018 1 commit
    • Lyude Paul's avatar
      drm/atomic_helper: Stop modesets on unregistered connectors harder · de9f8eea
      Lyude Paul authored
      Unfortunately, it appears our fix in:
      commit b5d29843 ("drm/atomic_helper: Allow DPMS On<->Off changes
      for unregistered connectors")
      
      Which attempted to work around the problems introduced by:
      commit 4d802739 ("drm/atomic_helper: Disallow new modesets on
      unregistered connectors")
      
      Is still not the right solution, as modesets can still be triggered
      outside of drm_atomic_set_crtc_for_connector().
      
      So in order to fix this, while still being careful that we don't break
      modesets that a driver may perform before being registered with
      userspace, we replace connector->registered with a tristate member,
      connector->registration_state. This allows us to keep track of whether
      or not a connector is still initializing and hasn't been exposed to
      userspace, is currently registered and exposed to userspace, or has been
      legitimately removed from the system after having once been present.
      
      Using this info, we can prevent userspace from performing new modesets
      on unregistered connectors while still allowing the driver to perform
      modesets on unregistered connectors before the driver has finished being
      registered.
      
      Changes since v1:
      - Fix WARN_ON() in drm_connector_cleanup() that CI caught with this
        patchset in igt@drv_module_reload@basic-reload-inject and
        igt@drv_module_reload@basic-reload by checking if the connector is
        registered instead of unregistered, as calling drm_connector_cleanup()
        on a connector that hasn't been registered with userspace yet should
        stay valid.
      - Remove unregistered_connector_check(), and just go back to what we
        were doing before in commit 4d802739 ("drm/atomic_helper: Disallow
        new modesets on unregistered connectors") except replacing
        READ_ONCE(connector->registered) with drm_connector_is_unregistered().
        This gets rid of the behavior of allowing DPMS On<->Off, but that should
        be fine as it's more consistent with the UAPI we had before - danvet
      - s/drm_connector_unregistered/drm_connector_is_unregistered/ - danvet
      - Update documentation, fix some typos.
      
      Fixes: b5d29843
      
       ("drm/atomic_helper: Allow DPMS On<->Off changes for unregistered connectors")
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: stable@vger.kernel.org
      Cc: David Airlie <airlied@linux.ie>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181016203946.9601-1-lyude@redhat.com
      (cherry picked from commit 39b50c60)
      Fixes: e9655095 ("drm/atomic_helper: Disallow new modesets on unregistered connectors")
      Fixes: 34ca26a9
      
       ("drm/atomic_helper: Allow DPMS On<->Off changes for unregistered connectors")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      de9f8eea
  14. 17 Oct, 2018 1 commit
    • Lyude Paul's avatar
      drm/atomic_helper: Stop modesets on unregistered connectors harder · 39b50c60
      Lyude Paul authored
      Unfortunately, it appears our fix in:
      commit b5d29843 ("drm/atomic_helper: Allow DPMS On<->Off changes
      for unregistered connectors")
      
      Which attempted to work around the problems introduced by:
      commit 4d802739 ("drm/atomic_helper: Disallow new modesets on
      unregistered connectors")
      
      Is still not the right solution, as modesets can still be triggered
      outside of drm_atomic_set_crtc_for_connector().
      
      So in order to fix this, while still being careful that we don't break
      modesets that a driver may perform before being registered with
      userspace, we replace connector->registered with a tristate member,
      connector->registration_state. This allows us to keep track of whether
      or not a connector is still initializing and hasn't been exposed to
      userspace, is currently registered and exposed to userspace, or has been
      legitimately removed from the system after having once been present.
      
      Using this info, we can prevent userspace from performing new modesets
      on unregistered connectors while still allowing the driver to perform
      modesets on unregistered connectors before the driver has finished being
      registered.
      
      Changes since v1:
      - Fix WARN_ON() in drm_connector_cleanup() that CI caught with this
        patchset in igt@drv_module_reload@basic-reload-inject and
        igt@drv_module_reload@basic-reload by checking if the connector is
        registered instead of unregistered, as calling drm_connector_cleanup()
        on a connector that hasn't been registered with userspace yet should
        stay valid.
      - Remove unregistered_connector_check(), and just go back to what we
        were doing before in commit 4d802739 ("drm/atomic_helper: Disallow
        new modesets on unregistered connectors") except replacing
        READ_ONCE(connector->registered) with drm_connector_is_unregistered().
        This gets rid of the behavior of allowing DPMS On<->Off, but that should
        be fine as it's more consistent with the UAPI we had before - danvet
      - s/drm_connector_unregistered/drm_connector_is_unregistered/ - danvet
      - Update documentation, fix some typos.
      
      Fixes: b5d29843
      
       ("drm/atomic_helper: Allow DPMS On<->Off changes for unregistered connectors")
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: stable@vger.kernel.org
      Cc: David Airlie <airlied@linux.ie>
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20181016203946.9601-1-lyude@redhat.com
      39b50c60
  15. 05 Oct, 2018 1 commit
  16. 14 Sep, 2018 1 commit
    • Chris Wilson's avatar
      drm: Differentiate the lack of an interface from invalid parameter · 69fdf420
      Chris Wilson authored
      
      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: default avatarChris 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
  17. 09 Sep, 2018 1 commit
  18. 16 Jul, 2018 1 commit
  19. 13 Jul, 2018 3 commits
  20. 05 Jul, 2018 2 commits
  21. 03 Jul, 2018 1 commit
  22. 20 Jun, 2018 1 commit
    • Brian Starkey's avatar
      drm: Add writeback connector type · 935774cd
      Brian Starkey authored
      
      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: default avatarBrian Starkey <brian.starkey@arm.com>
      [rebased and fixed conflicts]
      Signed-off-by: default avatarMihail Atanassov <mihail.atanassov@arm.com>
      [rebased and added atomic_commit() vfunc for writeback jobs]
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      Signed-off-by: default avatarLiviu Dudau <liviu.dudau@arm.com>
      Reviewed-by: default avatarEric Anholt <eric@anholt.net>
      Link: https://patchwork.freedesktop.org/patch/229037/
      935774cd
  23. 18 Jun, 2018 1 commit
  24. 17 May, 2018 1 commit
    • Stanislav Lisovskiy's avatar
      drm: content-type property for HDMI connector · 50525c33
      Stanislav Lisovskiy authored
      
      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: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarStanislav 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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      50525c33
  25. 11 May, 2018 1 commit
    • Ankit Nautiyal's avatar
      drm: Expose modes with aspect ratio, only if requested · c3ff0cdb
      Ankit Nautiyal authored
      
      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: default avatarAnkit 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: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarMaarten 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
  26. 27 Apr, 2018 1 commit
  27. 20 Feb, 2018 1 commit
  28. 29 Jan, 2018 1 commit
  29. 08 Jan, 2018 2 commits
  30. 13 Dec, 2017 3 commits
    • Daniel Vetter's avatar
      drm: rework delayed connector cleanup in connector_iter · ea497bb9
      Daniel Vetter authored
      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: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171213124936.17914-1-daniel.vetter@ffwll.ch
      ea497bb9
    • Keith Packard's avatar
      drm: Update edid-derived drm_display_info fields at edid property set [v2] · 4b4df570
      Keith Packard authored
      
      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: default avatarKeith Packard <keithp@keithp.com>
      Reviewed-by: default avatarDaniel 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: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      4b4df570
    • Keith Packard's avatar
      drm: Update edid-derived drm_display_info fields at edid property set [v2] · 170178fe
      Keith Packard authored
      
      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: default avatarKeith Packard <keithp@keithp.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171213084427.31199-1-keithp@keithp.com
      170178fe
  31. 06 Dec, 2017 1 commit
    • Daniel Vetter's avatar
      drm: safely free connectors from connector_iter · a703c550
      Daniel Vetter authored
      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: default avatarBen 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: default avatarDave Airlie <airlied@gmail.com>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20171204204818.24745-1-daniel.vetter@ffwll.ch
      a703c550