1. 07 3月, 2017 1 次提交
  2. 25 1月, 2017 1 次提交
  3. 19 9月, 2016 1 次提交
  4. 16 9月, 2016 1 次提交
  5. 15 9月, 2016 4 次提交
  6. 31 8月, 2016 1 次提交
  7. 17 8月, 2016 1 次提交
  8. 10 8月, 2016 2 次提交
  9. 03 8月, 2016 1 次提交
  10. 29 7月, 2016 1 次提交
    • V
      drm: aux ->transfer() can return 0, deal with it · a1f5524a
      Ville Syrjälä 提交于
      Restore the correct behaviour (as in check msg.reply) when aux
      ->transfer() returns 0. It got removed in
      commit 82922da3 ("drm/dp_helper: Retry aux transactions on all errors")
      
      Now I can actually dump the "entire" DPCD on a Dell UP2314Q with
      ddrescue. It has some offsets in the DPCD that can't be read
      for some resaon, all you get is defers. Previously ddrescue would
      just give up at the first unredable offset on account of
      read() returning 0 means EOF. Here's the ddrescue log
      for the interested:
      0x00000000  0x00001400  +
      0x00001400  0x00000030  -
      0x00001430  0x000001D0  +
      0x00001600  0x00000030  -
      0x00001630  0x0001F9D0  +
      0x00021000  0x00000001  -
      0x00021001  0x000DEFFF  +
      
      Cc: Lyude <cpaul@redhat.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch
      Cc: stable@vger.kernel.org
      Fixes: 82922da3 ("drm/dp_helper: Retry aux transactions on all errors")
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      a1f5524a
  11. 17 6月, 2016 2 次提交
  12. 23 4月, 2016 3 次提交
    • L
      drm/dp_helper: Perform throw-away read before actual read in drm_dp_dpcd_read() · f808f633
      Lyude 提交于
      This is part of a patch series to migrate all of the workarounds for
      commonly seen behavior from bad sinks in intel_dp_dpcd_read_wake() to drm's
      DP helper.
      
      Some sinks will just return garbage for the first aux tranaction they
      receive when coming out of sleep mode, so we need to perform an additional
      read before the actual read to workaround this.
      
      			    Changes since v5
      - If the throwaway read in drm_dp_dpcd_read() fails, return the error
        from that instead of continuing. This follows the same logic we do in
        drm_dp_dpcd_access() (e.g. the error from the first transaction may
        differ from the errors that proceeding attempts might return).
      Signed-off-by: NLyude <cpaul@redhat.com>
      Tested-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1460730335-5012-1-git-send-email-cpaul@redhat.com
      f808f633
    • L
      drm/dp_helper: Retry aux transactions on all errors · 82922da3
      Lyude 提交于
      This is part of a patch series to migrate all of the workarounds for
      commonly seen behavior from bad sinks in intel_dp_dpcd_read_wake() to
      drm's DP helper.
      
      We cannot rely on sinks NACKing or deferring when they can't receive
      transactions, nor can we rely on any other sort of consistent error to
      know when we should stop retrying. As such, we need to just retry
      unconditionally on errors. We also make sure here to return the error we
      encountered during the first transaction, since it's possible that
      retrying the transaction might return a different error then we had
      originally.
      
      This, along with the previous patch, work around a weird bug with the
      ThinkPad T560's and it's dock. When resuming the laptop, it appears that
      there's a short period of time where we're unable to complete any aux
      transactions, as they all immediately timeout. The only machine I'm able
      to reproduce this on is the T560 as other production Skylake models seem
      to be fine. The period during which AUX transactions fail appears to be
      around 22ms long. AFAIK, the dock for the T560 never actually turns off,
      the only difference is that it's in SST mode at the start of the resume
      process, so it's unclear as to why it would need so much time to come
      back up.
      
      There's been a discussion on this issue going on for a while on the
      intel-gfx mailing list about this that has, in addition to including
      developers from Intel, also had the correspondence of one of the
      hardware engineers for Intel:
      
      http://www.spinics.net/lists/intel-gfx/msg88831.html
      http://www.spinics.net/lists/intel-gfx/msg88410.html
      
      We've already looked into a couple of possible explanations for the
      problem:
      
      - Calling intel_dp_mst_resume() before right fix.
        intel_runtime_pm_enable_interrupts(). This was the first fix I tried,
        and while it worked it definitely wasn't the right fix. This worked
        because DP aux transactions don't actually require interrupts to work:
      
      	static uint32_t
      	intel_dp_aux_wait_done(struct intel_dp *intel_dp, bool has_aux_irq)
      	{
      		struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
      		struct drm_device *dev = intel_dig_port->base.base.dev;
      		struct drm_i915_private *dev_priv = dev->dev_private;
      		i915_reg_t ch_ctl = intel_dp->aux_ch_ctl_reg;
      		uint32_t status;
      		bool done;
      
      	#define C (((status = I915_READ_NOTRACE(ch_ctl)) & DP_AUX_CH_CTL_SEND_BUSY) == 0)
      		if (has_aux_irq)
      			done = wait_event_timeout(dev_priv->gmbus_wait_queue, C,
      						  msecs_to_jiffies_timeout(10));
      		else
      			done = wait_for_atomic(C, 10) == 0;
      		if (!done)
      			DRM_ERROR("dp aux hw did not signal timeout (has irq: %i)!\n",
      				  has_aux_irq);
      	#undef C
      
      		return status;
      	}
      
        When there's no interrupts enabled, we end up timing out on the
        wait_event_timeout() call, which causes us to check the DP status
        register once to see if the transaction was successful or not. Since
        this adds a 10ms delay to each aux transaction, it ends up adding a
        long enough delay to the resume process for aux transactions to become
        functional again. This gave us the illusion that enabling interrupts
        had something to do with making things work again, and put me on the
        wrong track for a while.
      
      - Interrupts occurring when we try to perform the aux transactions
        required to put the dock back into MST mode. This isn't the problem,
        as the only interrupts I've observed that come during this timeout
        period are from the snd_hda_intel driver, and disabling that driver
        doesn't appear to change the behavior at all.
      
      - Skylake's PSR block causing issues by performing aux transactions
        while we try to bring the dock out of MST mode. Disabling PSR through
        i915's command line options doesn't seem to change the behavior
        either, nor does preventing the DMC firmware from being loaded.
      
      Since this investigation went on for about 2 weeks, we decided it would
      be better for the time being to just workaround this issue by making
      sure AUX transactions wait a short period of time before retrying.
      Signed-off-by: NLyude <cpaul@redhat.com>
      Tested-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1460559513-32280-3-git-send-email-cpaul@redhat.com
      82922da3
    • L
      drm/dp_helper: Always wait before retrying native aux transactions · e1083ff3
      Lyude 提交于
      This is part of a patch series to migrate all of the workarounds for
      commonly seen behavior from bad sinks in intel_dp_dpcd_read_wake() to
      drm's DP helper.
      
      Some sinks need some time during the process of resuming the system from
      sleep before they're ready to handle transactions. While it would be
      nice if they responded with NACKs in these scenarios, this isn't always
      the case as a few sinks will just timeout on all of the transactions
      they receive until they're ready.
      Signed-off-by: NLyude <cpaul@redhat.com>
      Tested-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1460559513-32280-2-git-send-email-cpaul@redhat.com
      e1083ff3
  13. 01 4月, 2016 1 次提交
  14. 12 2月, 2016 1 次提交
    • R
      drm/dp: Add a drm_aux-dev module for reading/writing dpcd registers. · e94cb37b
      Rafael Antognolli 提交于
      This module is heavily based on i2c-dev. Once loaded, it provides one
      dev node per DP AUX channel, named drm_dp_auxN, where N is an integer.
      
      It's possible to know which connector owns this aux channel by looking
      at the respective sysfs /sys/class/drm_aux_dev/drm_dp_auxN/connector, if
      the connector device pointer was correctly set in the aux helper struct.
      
      Two main operations are provided on the registers read and write. The
      address of the register to be read or written is given using lseek. The
      seek position is updated upon read or write.
      
      v2:
       - lseek is used to select the register to read/write
       - read/write are used instead of ioctl
       - no blocking_notifier is used, just a direct callback
      
      v3:
       - use drm_dp_aux_dev prefix for public functions
       - chardev is named drm_dp_auxN
       - read/write don't allocate a buffer anymore, and transfer up to 16 bytes a
         time
       - remove notifier list from the implementation
       - option on menuconfig is now a boolean
       - add inline stub functions to avoid breakage when this option is disabled
      
      v4:
       - fix build system changes - actually disable this module when not selected.
      
      v5:
       - Use kref to avoid device closing while still in use
       - Don't use list, use an idr for storing aux_dev
       - Remove "connector" attribute
       - set aux.dev to the connector drm_connector device, instead of
         drm_device
      
      v6:
       - Use atomic_t for usage count
       - Use a mutex instead of spinlock for idr lock
       - Destroy chardev immediately on unregister
       - other minor suggestions from Ville
      
      v7:
       - style fixes
       - error handling fixes
      
      v8:
       - more error handling fixes
      
      v9:
       - remove module_init and module_exit, and add drm_dp_aux_dev_init/exit
       to drm_kms_helper_init/exit.
      Signed-off-by: NRafael Antognolli <rafael.antognolli@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1453417821-2811-3-git-send-email-rafael.antognolli@intel.com
      e94cb37b
  15. 09 9月, 2015 1 次提交
  16. 02 9月, 2015 3 次提交
    • V
      drm/dp: Add dp_aux_i2c_speed_khz module param to set the assume i2c bus speed · f36203be
      Ville Syrjälä 提交于
      To help with debugging i2c-over-aux issues, add a module parameter than
      can be used to tweak the assumed i2c bus speed, and thus the maximum
      number of retries we will do for each aux message.
      
      Cc: Simon Farnsworth <simon.farnsworth@onelan.com>
      Cc: moosotc@gmail.com
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NSimon Farnsworth <simon.farnsworth@onelan.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      f36203be
    • V
      drm/dp: Adjust i2c-over-aux retry count based on message size and i2c bus speed · 4efa83c8
      Ville Syrjälä 提交于
      Calculate the number of retries we should do for each i2c-over-aux
      message based on the time it takes to perform the i2c transfer vs. the
      aux transfer. We assume the shortest possible length for the aux
      transfer, and the longest possible (exluding clock stretching) for the
      i2c transfer.
      
      The DP spec has some examples on how to calculate this, but we don't
      calculate things quite the same way. The spec doesn't account for the
      retry interval (assumes immediate retry on defer), and doesn't assume
      the best/worst case behaviour as we do.
      
      Note that currently we assume 10 kHz speed for the i2c bus. Some real
      world devices (eg. some Apple DP->VGA dongle) fails with less than 16
      retries. and that would correspond to something close to 15 kHz (with
      our method of calculating things) But let's just go for 10 kHz to be
      on the safe side. Ideally we should query/set the i2c bus speed via
      DPCD but for now this should at leaast remove the regression from the
      1->16 byte trasnfer size change. And of course if the sink completes
      the transfer quicker this shouldn't slow things down since we don't
      change the interval between retries.
      
      I did a few experiments with a DP->DVI dongle I have that allows you
      to change the i2c bus speed. Here are the results of me changing the
      actual bus speed and the assumed bus speed and seeing when we start
      to fail the operation:
      
      actual i2c khz          assumed i2c khz         max retries
      1                       1 ok -> 2 fail          211 ok -> 106 fail
      5                       8 ok -> 9 fail          27 ok -> 24 fail
      10                      17 ok -> 18 fail        13 ok -> 12 fail
      100                     210 ok -> 211 fail      2 ok -> 1 fail
      
      So based on that we have a fairly decent safety margin baked into
      the formula to calculate the max number of retries.
      
      Fixes a regression with some DP dongles from:
      commit 1d002fa7
      Author: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
      Date:   Tue Feb 10 18:38:08 2015 +0000
      
          drm/dp: Use large transactions for I2C over AUX
      
      v2: Use best case for AUX and worst case for i2c (Simon Farnsworth)
          Add a define our AUX retry interval and account for it
      v3: Make everything usecs to avoid confusion about units (Daniel)
          Add a comment reminding people about the AUX bitrate (Daniel)
          Use DIV_ROUND_UP() since we're after the "worst" case for i2c
      
      Cc: Simon Farnsworth <simon.farnsworth@onelan.com>
      Cc: moosotc@gmail.com
      Tested-by: moosotc@gmail.com
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91451Reviewed-by: NSimon Farnsworth <simon.farnsworth@onelan.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      4efa83c8
    • V
      drm/dp: Define AUX_RETRY_INTERVAL as 500 us · 79a2b161
      Ville Syrjälä 提交于
      Currently we react to native and i2c defers by waiting either 400-500 us
      or 500-600 us, depending on which code path we take. Consolidate them
      all to one define AUX_RETRY_INTERVAL which defines the minimum interval.
      Since we've been using two different intervals pick the longer of them
      and define AUX_RETRY_INTERVAL as 500 us. For the maximum just use
      AUX_RETRY_INTERVAL+100 us.
      
      I want to have a define for this so that I can use it when calculating
      the estimated duration of i2c-over-aux transfers. Without a define it
      would be very easy to change the sleep duration and neglect to update
      the i2c-over-aux estimates.
      
      Cc: Simon Farnsworth <simon.farnsworth@onelan.com>
      Cc: moosotc@gmail.com
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NSimon Farnsworth <simon.farnsworth@onelan.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      79a2b161
  17. 21 4月, 2015 1 次提交
    • T
      drm: Fix for DP CTS test 4.2.2.5 - I2C DEFER handling · 396aa445
      Todd Previte 提交于
      For test 4.2.2.5 to pass per the Link CTS Core 1.2 rev1.1 spec, the source
      device must attempt at least 7 times to read the EDID when it receives an
      I2C defer. The normal DRM code makes only 7 retries, regardless of whether
      or not the response is a native defer or an I2C defer. Test 4.2.2.5 fails
      since there are native defers interspersed with the I2C defers which
      results in less than 7 EDID read attempts.
      
      The solution is to add the numer of defers to the retry counter when an I2C
      DEFER is returned such that another read attempt will be made. This situation
      should normally only occur in compliance testing, however, as a worse case
      real-world scenario, it would result in 13 attempts ( 6 native defers, 7 I2C
      defers) for a single transaction to complete. The net result is a slightly
      slower response to an EDID read that shouldn't significantly impact overall
      performance.
      
      V2:
      - Added a check on the number of I2C Defers to limit the number
        of times that the retries variable will be decremented. This
        is to address review feedback regarding possible infinite loops
        from misbehaving sink devices.
      V3:
      - Fixed the limit value to 7 instead of 8 to get the correct retry
        count.
      - Combined the increment of the defer count into the if-statement
      V4:
      - Removed i915 tag from subject as the patch is not i915-specific
      V5:
      - Updated the for-loop to add the number of i2c defers to the retry
        counter such that the correct number of retry attempts will be
        made
      Signed-off-by: NTodd Previte <tprevite@gmail.com>
      Cc: dri-devel@lists.freedesktop.org
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      396aa445
  18. 16 4月, 2015 1 次提交
  19. 23 3月, 2015 1 次提交
  20. 12 3月, 2015 1 次提交
    • S
      drm/dp: Use large transactions for I2C over AUX · 1d002fa7
      Simon Farnsworth 提交于
      Older DisplayPort to DVI-D Dual Link adapters designed by Bizlink have bugs
      in their I2C over AUX implementation (fixed in newer revisions). They work
      fine with Windows, but fail with Linux.
      
      It turns out that they cannot keep an I2C transaction open unless the
      previous read was 16 bytes; shorter reads can only be followed by a zero
      byte transfer ending the I2C transaction.
      
      Copy Windows's behaviour, and read 16 bytes at a time. If we get a short
      reply, assume that there's a hardware bottleneck, and shrink our read size
      to match. For this purpose, use the algorithm in the DisplayPort 1.2 spec,
      in the hopes that it'll be closest to what Windows does.
      
      Also provide an unsafe module parameter for testing smaller transfer sizes,
      in case there are sinks out there that cannot work with Windows.
      
      Note also that despite the previous comment in drm_dp_i2c_xfer, this speeds
      up native DP EDID reads; Ville Syrjälä <ville.syrjala@linux.intel.com> found
      the following changes in his testing:
      
      Device under test:     old  -> with this patch
      DP->DVI (OUI 001cf8):  40ms -> 35ms
      DP->VGA (OUI 0022b9):  45ms -> 38ms
      Zotac DP->2xHDMI:      25ms ->  4ms
      Asus PB278 monitor:    22ms ->  3ms
      
      A back of the envelope calculation shows that peak theoretical transfer rate
      for 1 byte reads is around 60 kbit/s; with 16 byte reads, this increases to
      around 500 kbit/s, which explains the increase in speed.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55228
      Tested-by: Aidan Marks <aidanamarks@gmail.com> (v3)
      Signed-off-by: NSimon Farnsworth <simon.farnsworth@onelan.co.uk>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1d002fa7
  21. 02 2月, 2015 1 次提交
  22. 09 12月, 2014 1 次提交
  23. 05 11月, 2014 1 次提交
    • T
      drm/dp: Add counters in the drm_dp_aux struct for I2C NACKs and DEFERs · e9cf6194
      Todd Previte 提交于
      These counters are used for Displayort compliance testing to detect error
      conditions when executing tests 4.2.2.4 and 4.2.2.5 in the Displayport Link
      CTS specificaiton. They determine whether to use the preferred/requested
      mode or the failsafe mode during these tests.
      
      V2:
      - Addressed previous review feedback
      - Updated commit message
      - Changed from uint8_t to uint32_t
      
      Cc: dri-devel@lists.freedesktop.org
      Signed-off-by: NTodd Previte <tprevite@gmail.com>
      [danvet: s/uint32_t/unsigned/ for clearer intent. Also drop the i915
      from the subject, it's all core stuff.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e9cf6194
  24. 23 10月, 2014 1 次提交
  25. 05 6月, 2014 1 次提交
  26. 02 6月, 2014 1 次提交
    • D
      drm/dp-helper: Deprecate old i2c-over-dp_aux heleprs · 2a8dc638
      Daniel Vetter 提交于
      Only gma500 is still using this, once that's converted we can kill all
      this code. If that conversion doesn't happen soonish I think we should
      just move this helper code into the gma500 driver itself to avoid
      abuse from new drivers.
      
      Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
      Cc: Alan Cox <alan@linux.intel.com>
      Cc: Thierry Reding <treding@nvidia.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2a8dc638
  27. 29 4月, 2014 1 次提交
  28. 08 4月, 2014 2 次提交
  29. 05 4月, 2014 1 次提交
  30. 25 3月, 2014 1 次提交