drm/i915: preserve other DP_TEST_SINK bits.
Subsystems (2)
Rodrigo Vivi
maintainerPATCH 1/1 drm/i915: preserve other DP_TEST_SINK bits.
Sink crc was implemented based on dp 1.1 spec that had all TEST_SINK bits reserved reading all 0s. But when reviewing my latest changes on sink crc Todd warned me that on new specs we have other valid bits on this reg that we might want to preserve.
--- drivers/gpu/drm/i915/intel_dp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +6 -2
@@ -3821,8 +3821,9 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)if (!(buf &DP_TEST_CRC_SUPPORTED ))return -ENOTTY ; +drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf);if (drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK , -DP_TEST_SINK_START ) <0 ) + buf |DP_TEST_SINK_START ) <0 )return -EIO ;drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK_MISC , &buf);
@@ -3841,7 +3842,10 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)if (drm_dp_dpcd_read (&intel_dp->aux,DP_TEST_CRC_R_CR , crc,6 ) <0 )return -EIO ; -drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK ,0 ); +drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf); +drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK , + buf & ~DP_TEST_SINK_START ); +return 0 ; }
Signature · 1 line
1.9.3
Hi Rodrigo,
Looks good. Only thing that needs to be removed is that extra blank line between the last part of the function and the return statement. Otherwise...
-----Original Message-----
From: Rodrigo Vivi [mailto:[email protected]]
Sent: Monday, September 29, 2014 3:30 PM
To: [email protected]
Cc: Rodrigo Vivi; Todd Previte
Subject: [PATCH] drm/i915: preserve other DP_TEST_SINK bits.
Sink crc was implemented based on dp 1.1 spec that had all TEST_SINK bits reserved reading all 0s. But when reviewing my latest changes on sink crc Todd warned me that on new specs we have other valid bits on this reg that we might want to preserve.
--- drivers/gpu/drm/i915/intel_dp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
(quoted diff) +0 -0
b/drivers/gpu/drm/i915/intel_dp.c index b8699b0..7d5fa2f 100644
drivers/gpu/drm/i915/intel_dp.c +0 -0
@@ -3821,8 +3821,9 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8
*crc)
if (!(buf & DP_TEST_CRC_SUPPORTED))
return -ENOTTY;
+ drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf);
if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK,
- DP_TEST_SINK_START) < 0)
+ buf | DP_TEST_SINK_START) < 0)
return -EIO;
drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK_MISC, &buf); @@
-3841,7 +3842,10 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)
if (drm_dp_dpcd_read(&intel_dp->aux, DP_TEST_CRC_R_CR, crc, 6) < 0)
return -EIO;
- drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK, 0);
+ drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf);
+ drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK,
+ buf & ~DP_TEST_SINK_START);
+
return 0;
}
--
1.9.3
Daniel Vetter
AppliedQuoted 4 lines · Todd Previte
Hi Rodrigo,
Looks good. Only thing that needs to be removed is that extra blank line between the last part of the function and the return statement. Otherwise...
Looking around in our driver the return statement at the end of the function is often on a separate line.
Quoted 2 lines
Reviewed-by Todd Previte <[email protected]>
Queued for -next, thanks for the patch.
Quoted 8 lines
-----Original Message-----
From: Rodrigo Vivi [mailto:[email protected]]
Sent: Monday, September 29, 2014 3:30 PM
To: [email protected]
Cc: Rodrigo Vivi; Todd Previte
Subject: [PATCH] drm/i915: preserve otherDP_TEST_SINKbits.
Quoted 4 lines
Sink crc was implemented based on dp 1.1 spec that had all
TEST_SINKbits reserved reading all 0s. But when reviewing my latest changes on sink crc Todd warned me that on new specs we have other valid bits on this reg that we might want to preserve.
Why was this not mentioned in the review to that patch? I've double-checked Todd's reply and I've only found a "lgtm, r-b".
If you spot something odd, or something that should be addressed in a follow-up patch, that should be part of your review reply - review is much more than rubber-stamping with r-b tags.
And if that review happened offline or in Portland, pls always try to summarize the main points discussed in the patch or reply for the benefit of everyone else. We're a globally distributed team, so active and inclusive communication is absolutely key.
Thanks, Daniel
Quoted 44 lines
Cc Todd Previte <[email protected]>Signed-off-by Rodrigo Vivi <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/i915/intel_dp.cindex b8699b0..7d5fa2f 100644drivers/gpu/drm/i915/intel_dp.c +2
-1@@ -3821,8 +3821,9 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)if (!(buf &DP_TEST_CRC_SUPPORTED ))return -ENOTTY ; +drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf);if (drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK , -DP_TEST_SINK_START ) <0 ) + buf |DP_TEST_SINK_START ) <0 )return -EIO ;
drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK_MISC, &buf); @@
-3841,7 +3842,10 @@ intintel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)drivers/gpu/drm/i915/intel_dp.c +4
-2if (drm_dp_dpcd_read (&intel_dp->aux,DP_TEST_CRC_R_CR , crc,6 ) <0 )return -EIO ; -drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK ,0 ); +drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf); +drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK , + buf & ~DP_TEST_SINK_START ); +return 0 ; } --1.9.3
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Quoted 16 lines · Rodrigo Vivi
Sink crc was implemented based on dp 1.1 spec that had all
TEST_SINKbits reserved reading all 0s. But when reviewing my latest changes on sink crc Todd warned me that on new specs we have other valid bits on this reg that we might want to preserve.Cc Todd Previte <[email protected]>Signed-off-by Rodrigo Vivi <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/intel_dp.c +0
-0
drivers/gpu/drm/i915/intel_dp.c int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc) · line 3825
Quoted 5 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0@@ -3821,8 +3821,9 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)if (!(buf &DP_TEST_CRC_SUPPORTED ))return -ENOTTY ; +drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf); if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK,
With this we no longer check the first aux transaction for errors, and maybe we should even check them all?
-Daniel
Quoted 24 lines
drivers/gpu/drm/i915/intel_dp.c +5
-2- DP_TEST_SINK_START) < 0) + buf | DP_TEST_SINK_START) < 0)return -EIO ;drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK_MISC , &buf);@@ -3841,7 +3842,10 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)if (drm_dp_dpcd_read (&intel_dp->aux,DP_TEST_CRC_R_CR , crc,6 ) <0 )return -EIO ; -drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK ,0 ); +drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf); +drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK , + buf & ~DP_TEST_SINK_START ); +return 0 ; }Signature · 6 lines
1.9.3 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Please don't forget the drm/i915: Fix Sink CRC
That is the important one that fix crc calculation and will allow me to remove the extra wait for vblanks on tests besides making tests more stable.
Quoted 20 lines · Daniel Vetter
Quoted 19 lines · Rodrigo Vivi
Sink crc was implemented based on dp 1.1 spec that had all
TEST_SINKbits reserved reading all 0s. But when reviewing my latest changes on sink crc Todd warned me that on new specs we have other valid bits on this reg that we might want to preserve.Cc Todd Previte <[email protected]>Signed-off-by Rodrigo Vivi <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/intel_dp.c +0
-0@@ -3821,8 +3821,9 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)if (!(buf &DP_TEST_CRC_SUPPORTED ))return -ENOTTY ;
Quoted 5 lines
drivers/gpu/drm/i915/intel_dp.c int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc) · line 3825
Quoted 2 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0+drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf); if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK,With this we no longer check the first aux transaction for errors, and maybe we should even check them all?
That is true. Do you prefer a v2 or top fix?
And what do you prefer? avoid the check at all or check on the first aux transaction?
Quoted 35 lines
-Daniel
Quoted 20 lines
drivers/gpu/drm/i915/intel_dp.c +5
-3- DP_TEST_SINK_START) < 0) + buf | DP_TEST_SINK_START) < 0)return -EIO ;drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK_MISC , &buf);@@ -3841,7 +3842,10 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)if (drm_dp_dpcd_read (&intel_dp->aux,DP_TEST_CRC_R_CR , crc,6 ) <0 )return -EIO ; -drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK ,0 ); +drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf); +drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK , + buf & ~DP_TEST_SINK_START ); +return 0 ; } --1.9.3
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Rodrigo Vivi Blog: http://blog.vivi.eng.br
Quoted 34 lines · Rodrigo Vivi
Please don't forget the drm/i915: Fix Sink CRC
That is the important one that fix crc calculation and will allow me to remove the extra wait for vblanks on tests besides making tests more stable.
Quoted 20 lines · Daniel Vetter
Quoted 19 lines · Rodrigo Vivi
Sink crc was implemented based on dp 1.1 spec that had all
TEST_SINKbits reserved reading all 0s. But when reviewing my latest changes on sink crc Todd warned me that on new specs we have other valid bits on this reg that we might want to preserve.Cc Todd Previte <[email protected]>Signed-off-by Rodrigo Vivi <[email protected]>--- drivers/gpu/drm/i915/intel_dp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/intel_dp.c +0
-0@@ -3821,8 +3821,9 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)if (!(buf &DP_TEST_CRC_SUPPORTED ))return -ENOTTY ;Quoted 5 lines
drivers/gpu/drm/i915/intel_dp.c int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc) · line 3825
Quoted 2 lines
drivers/gpu/drm/i915/intel_dp.c +1
-0+drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf); if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK,With this we no longer check the first aux transaction for errors, and maybe we should even check them all?
Quoted 3 lines
That is true. Do you prefer a v2 or top fix?
And what do you prefer? avoid the check at all or check on the first aux transaction?
Fixup patch is ok, I've kept your patch here. And I guess if you bother you should add checks with return -EIO to all of them, since they could all fail. Even if it's just for consistency.
-Daniel
Quoted 43 lines
Quoted 37 lines
-Daniel
Quoted 20 lines
drivers/gpu/drm/i915/intel_dp.c +5
-3- DP_TEST_SINK_START) < 0) + buf | DP_TEST_SINK_START) < 0)return -EIO ;drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK_MISC , &buf);@@ -3841,7 +3842,10 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)if (drm_dp_dpcd_read (&intel_dp->aux,DP_TEST_CRC_R_CR , crc,6 ) <0 )return -EIO ; -drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK ,0 ); +drm_dp_dpcd_readb (&intel_dp->aux,DP_TEST_SINK , &buf); +drm_dp_dpcd_writeb (&intel_dp->aux,DP_TEST_SINK , + buf & ~DP_TEST_SINK_START ); +return 0 ; } --1.9.3
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Rodrigo Vivi Blog: http://blog.vivi.eng.br
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch