Skip to contentSkip to conversation

drm/i915: fix checksum write for automated test reply

PATCH In review Sivakumar Thulasimani 2 participants 3 messages Jul 22, 2015

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

PATCH 1/1 drm/i915: fix checksum write for automated test reply

From: "Thulasimani,Sivakumar" <[email protected]>

DP spec requires the checksum of the last block read to be written when replying to TEST_EDID_READ. This patch fixes the current code to do the same.

---
 drivers/gpu/drm/i915/intel_dp.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_dp.c +10 -1
index f1b9f93..9617d04 100644
@@ -4090,9 +4090,18 @@ static uint8_t intel_dp_autotest_edid(struct intel_dp *intel_dp)
 				      intel_dp->aux.i2c_defer_count);
 		intel_dp->compliance_test_data = INTEL_DP_RESOLUTION_FAILSAFE;
 	} else {
+		struct edid *block = intel_connector->detect_edid;
+		uint8_t temp = intel_connector->detect_edid->extensions;
+
+		/* We have to write the checksum
+		 * of the last block read
+		 */
+		while (temp--)
+			block++;
+
 		if (!drm_dp_dpcd_write(&intel_dp->aux,
 					DP_TEST_EDID_CHECKSUM,
-					&intel_connector->detect_edid->checksum,
+					&block->checksum,
 					1))
 			DRM_DEBUG_KMS("Failed to write EDID checksum\n");
 
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 17 lines · Sivakumar Thulasimani

From: "Thulasimani,Sivakumar" <[email protected]>

DP spec requires the checksum of the last block read to be written when replying to TEST_EDID_READ. This patch fixes the current code to do the same.

---
 drivers/gpu/drm/i915/intel_dp.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_dp.c +0 -0
index f1b9f93..9617d04 100644
@@ -4090,9 +4090,18 @@ static uint8_t intel_dp_autotest_edid(struct intel_dp *intel_dp)
 				      intel_dp->aux.i2c_defer_count);

drivers/gpu/drm/i915/intel_dp.c static uint8_t intel_dp_autotest_edid(struct intel_dp *intel_dp) · line 4100

Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +8 -0
 		intel_dp->compliance_test_data = INTEL_DP_RESOLUTION_FAILSAFE;
 	} else {
+		struct edid *block = intel_connector->detect_edid;
+		uint8_t temp = intel_connector->detect_edid->extensions;
+
+		/* We have to write the checksum
+		 * of the last block read
+		 */
+		while (temp--)
+			block++;
		block += block->extensions;

instead of implementing addition by adding lots of 1? Also if you want to simplify computation by extracting local variables, give them a better name than "temp". That's somewhat ok for a reused u32 tmp for register read-modify-writes over lots of registers, but not really for anything else.
-Daniel

Quoted 15 lines
drivers/gpu/drm/i915/intel_dp.c +2 -1
+
 		if (!drm_dp_dpcd_write(&intel_dp->aux,
 					DP_TEST_EDID_CHECKSUM,
-					&intel_connector->detect_edid->checksum,
+					&block->checksum,
 					1))
 			DRM_DEBUG_KMS("Failed to write EDID checksum\n");
 
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
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
#2 lore raw
Quoted 30 lines · Daniel Vetter
Quoted 17 lines · Sivakumar Thulasimani

From: "Thulasimani,Sivakumar" <[email protected]>

DP spec requires the checksum of the last block read to be written when replying to TEST_EDID_READ. This patch fixes the current code to do the same.

---
  drivers/gpu/drm/i915/intel_dp.c |   11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_dp.c +0 -0
index f1b9f93..9617d04 100644
@@ -4090,9 +4090,18 @@ static uint8_t intel_dp_autotest_edid(struct intel_dp *intel_dp)
  				      intel_dp->aux.i2c_defer_count);

drivers/gpu/drm/i915/intel_dp.c static uint8_t intel_dp_autotest_edid(struct intel_dp *intel_dp) · line 4100

Quoted 10 lines
drivers/gpu/drm/i915/intel_dp.c +8 -0
  		intel_dp->compliance_test_data = INTEL_DP_RESOLUTION_FAILSAFE;
  	} else {
+		struct edid *block = intel_connector->detect_edid;
+		uint8_t temp = intel_connector->detect_edid->extensions;
+
+		/* We have to write the checksum
+		 * of the last block read
+		 */
+		while (temp--)
+			block++;
		block += block->extensions;
Quoted 7 lines

instead of implementing addition by adding lots of 1? Also if you want to simplify computation by extracting local variables, give them a better name than "temp". That's somewhat ok for a reused u32 tmp for register read-modify-writes over lots of registers, but not really for anything else.
-Daniel

Done. uploaded v2 with this change.

Quoted 17 lines
Quoted 15 lines
drivers/gpu/drm/i915/intel_dp.c +2 -1
+
  		if (!drm_dp_dpcd_write(&intel_dp->aux,
  					DP_TEST_EDID_CHECKSUM,
-					&intel_connector->detect_edid->checksum,
+					&block->checksum,
  					1))
  			DRM_DEBUG_KMS("Failed to write EDID checksum\n");
 
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 8 lines
regards,
Sivakumar


_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx