Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/dp: Add counters in the drm_dp_aux struct for I2C NACKs and DEFERs

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: Todd 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: Daniel Vetter <daniel.vetter@ffwll.ch>

authored by

Todd Previte and committed by
Daniel Vetter
e9cf6194 b74c6c92

+3
+2
drivers/gpu/drm/drm_dp_helper.c
··· 462 462 463 463 case DP_AUX_I2C_REPLY_NACK: 464 464 DRM_DEBUG_KMS("I2C nack\n"); 465 + aux->i2c_nack_count++; 465 466 return -EREMOTEIO; 466 467 467 468 case DP_AUX_I2C_REPLY_DEFER: 468 469 DRM_DEBUG_KMS("I2C defer\n"); 470 + aux->i2c_defer_count++; 469 471 usleep_range(400, 500); 470 472 continue; 471 473
+1
include/drm/drm_dp_helper.h
··· 530 530 struct mutex hw_mutex; 531 531 ssize_t (*transfer)(struct drm_dp_aux *aux, 532 532 struct drm_dp_aux_msg *msg); 533 + unsigned i2c_nack_count, i2c_defer_count; 533 534 }; 534 535 535 536 ssize_t drm_dp_dpcd_read(struct drm_dp_aux *aux, unsigned int offset,