Skip to contentSkip to conversation

drm/dp: Print the number of bytes processed for aux nacks

PATCH Applied [email protected] 4 participants 10 messages Mar 19, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 drm/dp: Print the number of bytes processed for aux nacks

From: Ville Syrjälä <[email protected]>

When doing a native or i2c aux write the sink will indicate the number of bytes written even if it the nacks the transfer. When we receive a nack we just return an error upwards, but it might still be interesting to see how many bytes made it before the nack. So include that information in the debug messages.

---
 drivers/gpu/drm/drm_dp_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_dp_helper.c +2 -2
index d5368ea..d7c73bd 100644
@@ -462,7 +462,7 @@ static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
 			break;
 
 		case DP_AUX_NATIVE_REPLY_NACK:
-			DRM_DEBUG_KMS("native nack\n");
+			DRM_DEBUG_KMS("native nack (%d)\n", ret);
 			return -EREMOTEIO;
 
 		case DP_AUX_NATIVE_REPLY_DEFER:
@@ -493,7 +493,7 @@ static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
 			return ret;
 
 		case DP_AUX_I2C_REPLY_NACK:
-			DRM_DEBUG_KMS("I2C nack\n");
+			DRM_DEBUG_KMS("I2C nack (%d)\n", ret);
 			aux->i2c_nack_count++;
 			return -EREMOTEIO;
 
Signature · 6 lines
2.0.5

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/3 drm/i915: Send out the full AUX address

From: Ville Syrjälä <[email protected]>

AUX addresses are 20 bits long. Send out the entire address instead of just the low 16 bits.

---
 drivers/gpu/drm/i915/intel_dp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +3 -2
index 3967af1..637dd53 100644
@@ -942,8 +942,9 @@ intel_dp_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
 	size_t txsize, rxsize;
 	int ret;
 
-	txbuf[0] = msg->request << 4;
-	txbuf[1] = msg->address >> 8;
+	txbuf[0] = (msg->request << 4) |
+		((msg->address >> 16) & 0xf);
+	txbuf[1] = (msg->address >> 8) & 0xff;
 	txbuf[2] = msg->address & 0xff;
 	txbuf[3] = msg->size - 1;
 
Signature · 6 lines
2.0.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer Reviewed-by on v1 2/3
#2 lore raw

Re: [PATCH 2/3] drm/i915: Send out the full AUX address

Quoted 6 lines · On Thu, 19 Mar 2015, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

AUX addresses are 20 bits long. Send out the entire address instead of just the low 16 bits.

Quoted 27 lines
---
 drivers/gpu/drm/i915/intel_dp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +3 -2
index 3967af1..637dd53 100644
@@ -942,8 +942,9 @@ intel_dp_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
 	size_t txsize, rxsize;
 	int ret;
 
-	txbuf[0] = msg->request << 4;
-	txbuf[1] = msg->address >> 8;
+	txbuf[0] = (msg->request << 4) |
+		((msg->address >> 16) & 0xf);
+	txbuf[1] = (msg->address >> 8) & 0xff;
 	txbuf[2] = msg->address & 0xff;
 	txbuf[3] = msg->size - 1;
 
Signature · 6 lines
2.0.5

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

Re: [Intel-gfx] [PATCH 2/3] drm/i915: Send out the full AUX address

Quoted 9 lines · Jani Nikula
Quoted 6 lines · On Thu, 19 Mar 2015, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

AUX addresses are 20 bits long. Send out the entire address instead of just the low 16 bits.

Queued for -next, thanks for the patch.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

PATCH 3/3 drm/radeon: Send out the full AUX address

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

AUX addresses are 20 bits long. Send out the entire address instead of just the low 16 bits.

Cc Alex Deucher <[email protected]>
Cc "Christian König" <[email protected]>
---
 drivers/gpu/drm/radeon/atombios_dp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/radeon/atombios_dp.c +3 -2
index 8d74de8..7a59a41 100644
@@ -171,8 +171,9 @@ radeon_dp_aux_transfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
 		return -E2BIG;
 
 	tx_buf[0] = msg->address & 0xff;
-	tx_buf[1] = msg->address >> 8;
-	tx_buf[2] = msg->request << 4;
+	tx_buf[1] = (msg->address >> 8) & 0xff;
+	tx_buf[2] = (msg->request << 4) |
+		((msg->address >> 16) & 0xf);
 	tx_buf[3] = msg->size ? (msg->size - 1) : 0;
 
 	switch (msg->request & ~DP_AUX_I2C_MOT) {
Signature · 6 lines
2.0.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by on v1 3/3
#5 lore raw

Re: [PATCH 3/3] drm/radeon: Send out the full AUX address

Task id: 6003 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied
PNV -2 272/272 270/272

ILK                                  301/301              301/301
SNB                                  303/303              303/303
IVB                                  342/342              342/342
BYT                                  287/287              287/287
HSW                                  362/362              362/362
BDW                                  308/308              308/308

-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
*PNV igt_gem_userptr_blits_minor-unsync-interruptible PASS(2) DMESG_WARN(1)PASS(1)
*PNV igt_gem_userptr_blits_minor-unsync-normal PASS(2) DMESG_WARN(1)PASS(1)
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer
#6 lore raw
In reply to [email protected]
Quoted 18 lines · On Thu, 19 Mar 2015, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

When doing a native or i2c aux write the sink will indicate the number of bytes written even if it the nacks the transfer. When we receive a nack we just return an error upwards, but it might still be interesting to see how many bytes made it before the nack. So include that information in the debug messages.

---
 drivers/gpu/drm/drm_dp_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_dp_helper.c +0 -0
index d5368ea..d7c73bd 100644

drivers/gpu/drm/drm_dp_helper.c static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg) · line 465

Quoted 5 lines
drivers/gpu/drm/drm_dp_helper.c +1 -1
@@ -462,7 +462,7 @@ static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
 			break;
 
 		case DP_AUX_NATIVE_REPLY_NACK:
-			DRM_DEBUG_KMS("native nack\n");
+			DRM_DEBUG_KMS("native nack (%d)\n", ret);

I guess it would be useful to print the full length too, so you know if it was a short write or not.

BR,
Jani.

Quoted 19 lines
drivers/gpu/drm/drm_dp_helper.c +1 -1
 			return -EREMOTEIO;
 
 		case DP_AUX_NATIVE_REPLY_DEFER:
@@ -493,7 +493,7 @@ static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
 			return ret;
 
 		case DP_AUX_I2C_REPLY_NACK:
-			DRM_DEBUG_KMS("I2C nack\n");
+			DRM_DEBUG_KMS("I2C nack (%d)\n", ret);
 			aux->i2c_nack_count++;
 			return -EREMOTEIO;
 
Signature · 6 lines
2.0.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

PATCH v2 1/3 drm/dp: Print the number of bytes processed for aux nacks

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

When doing a native or i2c aux write the sink will indicate the number of bytes written even if it the nacks the transfer. When we receive a nack we just return an error upwards, but it might still be interesting to see how many bytes made it before the nack. So include that information in the debug messages.

v2: Also print the message size (Jani)

---
 drivers/gpu/drm/drm_dp_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_dp_helper.c +2 -2
index d5368ea..71dcbc6 100644
@@ -462,7 +462,7 @@ static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
 			break;
 
 		case DP_AUX_NATIVE_REPLY_NACK:
-			DRM_DEBUG_KMS("native nack\n");
+			DRM_DEBUG_KMS("native nack (result=%d, size=%zu)\n", ret, msg->size);
 			return -EREMOTEIO;
 
 		case DP_AUX_NATIVE_REPLY_DEFER:
@@ -493,7 +493,7 @@ static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
 			return ret;
 
 		case DP_AUX_I2C_REPLY_NACK:
-			DRM_DEBUG_KMS("I2C nack\n");
+			DRM_DEBUG_KMS("I2C nack (result=%d, size=%zu\n", ret, msg->size);
 			aux->i2c_nack_count++;
 			return -EREMOTEIO;
 
Signature · 6 lines
2.0.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer Reviewed-by on v2 1/3
#8 lore raw
Quoted 11 lines · On Thu, 19 Mar 2015, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

When doing a native or i2c aux write the sink will indicate the number of bytes written even if it the nacks the transfer. When we receive a nack we just return an error upwards, but it might still be interesting to see how many bytes made it before the nack. So include that information in the debug messages.

v2: Also print the message size (Jani)

Quoted 29 lines
---
 drivers/gpu/drm/drm_dp_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_dp_helper.c +2 -2
index d5368ea..71dcbc6 100644
@@ -462,7 +462,7 @@ static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
 			break;
 
 		case DP_AUX_NATIVE_REPLY_NACK:
-			DRM_DEBUG_KMS("native nack\n");
+			DRM_DEBUG_KMS("native nack (result=%d, size=%zu)\n", ret, msg->size);
 			return -EREMOTEIO;
 
 		case DP_AUX_NATIVE_REPLY_DEFER:
@@ -493,7 +493,7 @@ static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
 			return ret;
 
 		case DP_AUX_I2C_REPLY_NACK:
-			DRM_DEBUG_KMS("I2C nack\n");
+			DRM_DEBUG_KMS("I2C nack (result=%d, size=%zu\n", ret, msg->size);
 			aux->i2c_nack_count++;
 			return -EREMOTEIO;
 
Signature · 1 line
2.0.5
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw
Quoted 9 lines · Jani Nikula
Quoted 8 lines · On Thu, 19 Mar 2015, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

When doing a native or i2c aux write the sink will indicate the number of bytes written even if it the nacks the transfer. When we receive a nack we just return an error upwards, but it might still be interesting to see how many bytes made it before the nack. So include that information in the debug messages.

Quoted 5 lines
Quoted 3 lines

v2: Also print the message size (Jani)

Merged to drm-misc, thanks.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx