<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Aug 6, 2015 at 5:20 AM Daniel Vetter <<a href="mailto:daniel@ffwll.ch">daniel@ffwll.ch</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Aug 05, 2015 at 08:30:01PM +0000, Vivi, Rodrigo wrote:<br>
> On Wed, 2015-08-05 at 10:07 +0200, Daniel Vetter wrote:<br>
> > On Thu, Jul 30, 2015 at 04:26:39PM -0700, Rodrigo Vivi wrote:<br>
> > > This is just a preparation patch to make clear what operation we<br>
> > > are performing. There is no functional change on the sink crc<br>
> > > logic.<br>
> > ><br>
> > > hsw_disable_ips has been moved a bit further in the start function<br>
> > > to avoid disabling ips when sink crc is not going to be started.<br>
> > > and to avoid goto on this function.<br>
> > ><br>
> > > v2: explain why hsw_disable_ips() call place has changed.<br>
> > ><br>
> > > Cc: Daniel Vetter <<a href="mailto:daniel.vetter@ffwll.ch" target="_blank">daniel.vetter@ffwll.ch</a>><br>
> > > Reviewed-by: Rafael Antognolli <<a href="mailto:rafael.antognolli@intel.com" target="_blank">rafael.antognolli@intel.com</a>><br>
> > > Signed-off-by: Rodrigo Vivi <<a href="mailto:rodrigo.vivi@intel.com" target="_blank">rodrigo.vivi@intel.com</a>><br>
> ><br>
> > Thanks for the updated commit message. Queued for -next, thanks for the<br>
> > patch.<br>
><br>
> Thanks!<br>
><br>
> Do you intend to merge the other 3 remaining patches?<br>
> Or am I missing something there?<br>
<br>
Nah just oversight, merged 3 more patches. Do I have them all now?<br></blockquote><div><br></div><div>yes, thanks!</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Daniel<br>
<br>
><br>
> Thanks,<br>
> Rodrigo.<br>
><br>
> > -Daniel<br>
> > > ---<br>
> > > drivers/gpu/drm/i915/intel_dp.c | 89 +++++++++++++++++++++++------------------<br>
> > > 1 file changed, 50 insertions(+), 39 deletions(-)<br>
> > ><br>
> > > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c<br>
> > > index 44f8a32..10cbc98 100644<br>
> > > --- a/drivers/gpu/drm/i915/intel_dp.c<br>
> > > +++ b/drivers/gpu/drm/i915/intel_dp.c<br>
> > > @@ -3958,40 +3958,64 @@ intel_dp_probe_mst(struct intel_dp *intel_dp)<br>
> > > return intel_dp->is_mst;<br>
> > > }<br>
> > ><br>
> > > -int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)<br>
> > > +static void intel_dp_sink_crc_stop(struct intel_dp *intel_dp)<br>
> > > {<br>
> > > - struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);<br>
> > > - struct drm_device *dev = intel_dig_port->base.base.dev;<br>
> > > - struct intel_crtc *intel_crtc =<br>
> > > - to_intel_crtc(intel_dig_port->base.base.crtc);<br>
> > > + struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);<br>
> > > + struct intel_crtc *intel_crtc = to_intel_crtc(dig_port->base.base.crtc);<br>
> > > u8 buf;<br>
> > > - int test_crc_count;<br>
> > > - int attempts = 6;<br>
> > > - int ret = 0;<br>
> > > -<br>
> > > - hsw_disable_ips(intel_crtc);<br>
> > ><br>
> > > - if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK_MISC, &buf) < 0) {<br>
> > > - ret = -EIO;<br>
> > > - goto out;<br>
> > > + if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf) < 0) {<br>
> > > + DRM_DEBUG_KMS("Sink CRC couldn't be stopped properly\n");<br>
> > > + return;<br>
> > > }<br>
> > ><br>
> > > - if (!(buf & DP_TEST_CRC_SUPPORTED)) {<br>
> > > - ret = -ENOTTY;<br>
> > > - goto out;<br>
> > > - }<br>
> > > + if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK,<br>
> > > + buf & ~DP_TEST_SINK_START) < 0)<br>
> > > + DRM_DEBUG_KMS("Sink CRC couldn't be stopped properly\n");<br>
> > ><br>
> > > - if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf) < 0) {<br>
> > > - ret = -EIO;<br>
> > > - goto out;<br>
> > > - }<br>
> > > + hsw_enable_ips(intel_crtc);<br>
> > > +}<br>
> > > +<br>
> > > +static int intel_dp_sink_crc_start(struct intel_dp *intel_dp)<br>
> > > +{<br>
> > > + struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);<br>
> > > + struct intel_crtc *intel_crtc = to_intel_crtc(dig_port->base.base.crtc);<br>
> > > + u8 buf;<br>
> > > +<br>
> > > + if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK_MISC, &buf) < 0)<br>
> > > + return -EIO;<br>
> > > +<br>
> > > + if (!(buf & DP_TEST_CRC_SUPPORTED))<br>
> > > + return -ENOTTY;<br>
> > > +<br>
> > > + if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf) < 0)<br>
> > > + return -EIO;<br>
> > > +<br>
> > > + hsw_disable_ips(intel_crtc);<br>
> > ><br>
> > > if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK,<br>
> > > - buf | DP_TEST_SINK_START) < 0) {<br>
> > > - ret = -EIO;<br>
> > > - goto out;<br>
> > > + buf | DP_TEST_SINK_START) < 0) {<br>
> > > + hsw_enable_ips(intel_crtc);<br>
> > > + return -EIO;<br>
> > > }<br>
> > ><br>
> > > + return 0;<br>
> > > +}<br>
> > > +<br>
> > > +int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)<br>
> > > +{<br>
> > > + struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);<br>
> > > + struct drm_device *dev = dig_port->base.base.dev;<br>
> > > + struct intel_crtc *intel_crtc = to_intel_crtc(dig_port->base.base.crtc);<br>
> > > + u8 buf;<br>
> > > + int test_crc_count;<br>
> > > + int attempts = 6;<br>
> > > + int ret;<br>
> > > +<br>
> > > + ret = intel_dp_sink_crc_start(intel_dp);<br>
> > > + if (ret)<br>
> > > + return ret;<br>
> > > +<br>
> > > if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK_MISC, &buf) < 0) {<br>
> > > ret = -EIO;<br>
> > > goto stop;<br>
> > > @@ -4014,23 +4038,10 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc)<br>
> > > goto stop;<br>
> > > }<br>
> > ><br>
> > > - if (drm_dp_dpcd_read(&intel_dp->aux, DP_TEST_CRC_R_CR, crc, 6) < 0) {<br>
> > > + if (drm_dp_dpcd_read(&intel_dp->aux, DP_TEST_CRC_R_CR, crc, 6) < 0)<br>
> > > ret = -EIO;<br>
> > > - goto stop;<br>
> > > - }<br>
> > > -<br>
> > > stop:<br>
> > > - if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf) < 0) {<br>
> > > - DRM_DEBUG_KMS("Sink CRC couldn't be stopped properly\n");<br>
> > > - goto out;<br>
> > > - }<br>
> > > - if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK,<br>
> > > - buf & ~DP_TEST_SINK_START) < 0) {<br>
> > > - DRM_DEBUG_KMS("Sink CRC couldn't be stopped properly\n");<br>
> > > - goto out;<br>
> > > - }<br>
> > > -out:<br>
> > > - hsw_enable_ips(intel_crtc);<br>
> > > + intel_dp_sink_crc_stop(intel_dp);<br>
> > > return ret;<br>
> > > }<br>
> > ><br>
> > > --<br>
> > > 2.1.0<br>
> > ><br>
> ><br>
><br>
<br>
--<br>
Daniel Vetter<br>
Software Engineer, Intel Corporation<br>
<a href="http://blog.ffwll.ch" rel="noreferrer" target="_blank">http://blog.ffwll.ch</a><br>
_______________________________________________<br>
Intel-gfx mailing list<br>
<a href="mailto:Intel-gfx@lists.freedesktop.org" target="_blank">Intel-gfx@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/intel-gfx" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/intel-gfx</a><br>
</blockquote></div></div>