Commit e8b2577c authored by Pandiyan, Dhinakaran's avatar Pandiyan, Dhinakaran Committed by Jani Nikula

drm/i915/dp: Fix buffer size for sink_irq_esi read

The buffer size defined is 16 bytes whereas only 14 bytes are read. Add a
macro to avoid this discrepancy.
Signed-off-by: default avatarDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: default avatarJames Ausmus <james.ausmus@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170918222141.4674-3-dhinakaran.pandiyan@intel.com
parent 9b1c5818
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include "i915_drv.h" #include "i915_drv.h"
#define DP_LINK_CHECK_TIMEOUT (10 * 1000) #define DP_LINK_CHECK_TIMEOUT (10 * 1000)
#define DP_DPRX_ESI_LEN 14
/* Compliance test status bits */ /* Compliance test status bits */
#define INTEL_DP_RESOLUTION_SHIFT_MASK 0 #define INTEL_DP_RESOLUTION_SHIFT_MASK 0
...@@ -4013,15 +4014,9 @@ intel_dp_get_sink_irq(struct intel_dp *intel_dp, u8 *sink_irq_vector) ...@@ -4013,15 +4014,9 @@ intel_dp_get_sink_irq(struct intel_dp *intel_dp, u8 *sink_irq_vector)
static bool static bool
intel_dp_get_sink_irq_esi(struct intel_dp *intel_dp, u8 *sink_irq_vector) intel_dp_get_sink_irq_esi(struct intel_dp *intel_dp, u8 *sink_irq_vector)
{ {
int ret; return drm_dp_dpcd_read(&intel_dp->aux, DP_SINK_COUNT_ESI,
sink_irq_vector, DP_DPRX_ESI_LEN) ==
ret = drm_dp_dpcd_read(&intel_dp->aux, DP_DPRX_ESI_LEN;
DP_SINK_COUNT_ESI,
sink_irq_vector, 14);
if (ret != 14)
return false;
return true;
} }
static uint8_t intel_dp_autotest_link_training(struct intel_dp *intel_dp) static uint8_t intel_dp_autotest_link_training(struct intel_dp *intel_dp)
...@@ -4221,7 +4216,7 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) ...@@ -4221,7 +4216,7 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
bool bret; bool bret;
if (intel_dp->is_mst) { if (intel_dp->is_mst) {
u8 esi[16] = { 0 }; u8 esi[DP_DPRX_ESI_LEN] = { 0 };
int ret = 0; int ret = 0;
int retry; int retry;
bool handled; bool handled;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment