<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-06-22 12:01 GMT+02:00 Piotr Redlewski <span dir="ltr"><<a href="mailto:predlewski@gmail.com" target="_blank">predlewski@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">2015-06-22 9:49 GMT+02:00 Michel Dänzer <span dir="ltr"><<a href="mailto:michel@daenzer.net" target="_blank">michel@daenzer.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>On <a href="tel:21.06.2015%2023" value="+12106201523" target="_blank">21.06.2015 23</a>:30, Piotr Redlewski wrote:<br>
> When turning the outputs off (DPMSModeOff), CRTCs stayed enabled. This led<br>
> to higher card temperatures than with fglrx driver.<br>
><br>
> Signed-off-by: Piotr Redlewski <<a href="mailto:predlewski@gmail.com" target="_blank">predlewski@gmail.com</a>><br>
> ---<br>
>  src/drmmode_display.c | 9 ++++++++-<br>
>  1 file changed, 8 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c<br>
> index 3564853..04b4341 100644<br>
> --- a/src/drmmode_display.c<br>
> +++ b/src/drmmode_display.c<br>
> @@ -342,7 +342,14 @@ drmmode_do_crtc_dpms(xf86CrtcPtr crtc, int mode)<br>
>  static void<br>
>  <div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">​​</div>drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)<br>
>  {<br>
> -     /* Nothing to do. drmmode_do_crtc_dpms() is called as appropriate */<br>
> +     drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;<br>
> +     drmmode_ptr drmmode = drmmode_crtc->drmmode;<br>
> +<br>
> +     /* Disable unused CRTCs */<br>
> +     if (!crtc->enabled && mode != DPMSModeOn) {<br>
<br>
</span>Maybe this should be<br>
<br>
        if (!crtc->enabled || mode != DPMSModeOn) {<br>
<br>
or can it actually happen that <div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">​​</div>!crtc->enabled and mode == DPMSModeOn?<br>
<span><br></span></blockquote></span><div style="font-family:arial,helvetica,sans-serif">​Just wanted to be safe here, but I think you are right. I'll send v2 later today.</div><span class=""><div><br></div></span></div></div></div></blockquote><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​I wanted to test changes before sending v2 and I stumbled on one issue. Everything works as expected when xrandr is used, but problem starts when screensaver <div class="gmail_default" style="display:inline">​comes into play. X calls </div><span style="font-family:arial,sans-serif">drmmode_crtc_dpms() to on/off screensaver, so when it is supposed to be enabled, function is called with mode=DPMSModeOff and we call </span><span style="font-size:12.8000001907349px;font-family:arial,sans-serif">drmModeSetCrtc() to set crtc's mode to NULL. Problem is when X wants to disable screensaver: </span><span style="font-family:arial,sans-serif">drmmode_crtc_dpms() is called </span><span style="font-family:arial,sans-serif">with mode=DPMSModeOn</span><span style="font-family:arial,sans-serif"> and... nothing happens as there is no logic for this scenario - we should call </span><span style="font-size:12.8000001907349px;font-family:arial,sans-serif">drmModeSetCrtc() to set valid mode, but we don't know what this mode should be. Effect is that we are stuck with blanked output.</span></div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​Because of the situation with the screensaver I think that original version of the patch is ok (it solves the problem with CRTC staying enabled when using xrandr to disable the output)<span style="font-family:arial,sans-serif">.</span></div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span>
<br>
> +             drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,<br>
> +                            0, 0, 0, NULL, 0, NULL);<br>
> +     }<br>
>  }<br>
><br>
>  static PixmapPtr<br>
><br>
<br>
</span>Other than that, looks good to me.<br>
<span><font color="#888888"><br>
<br>
--<br>
Earthling Michel Dänzer               |               <a href="http://www.amd.com" rel="noreferrer" target="_blank">http://www.amd.com</a><br>
Libre software enthusiast             |             Mesa and X developer<br>
<br>
</font></span></blockquote></span></div><br></div></div>
</blockquote></div><br></div></div>