<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-23 8:28 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 class="">On 23.06.2015 04:19, Piotr Redlewski wrote:<br>
><br>
><br>
> 2015-06-22 12:01 GMT+02:00 Piotr Redlewski <<a href="mailto:predlewski@gmail.com">predlewski@gmail.com</a><br>
</span>> <mailto:<a href="mailto:predlewski@gmail.com">predlewski@gmail.com</a>>>:<br>
<span class="">><br>
><br>
><br>
> 2015-06-22 9:49 GMT+02:00 Michel Dänzer <<a href="mailto:michel@daenzer.net">michel@daenzer.net</a><br>
</span>> <mailto:<a href="mailto:michel@daenzer.net">michel@daenzer.net</a>>>:<br>
<span class="">><br>
> On <a href="tel:21.06.2015%2023" value="+12106201523">21.06.2015 23</a> <tel:21.06.2015%2023>: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>
</span>> > Signed-off-by: Piotr Redlewski <<a href="mailto:predlewski@gmail.com">predlewski@gmail.com</a> <mailto:<a href="mailto:predlewski@gmail.com">predlewski@gmail.com</a>>><br>
<div><div class="h5">> > ---<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>
> ><br>
> <br>
> 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>
> Maybe this should be<br>
><br>
> if (!crtc->enabled || mode != DPMSModeOn) {<br>
><br>
> or can it actually happen that<br>
> <br>
> !crtc->enabled and mode == DPMSModeOn?<br>
><br>
> Just wanted to be safe here, but I think you are right. I'll send<br>
> v2 later today.<br>
><br>
> I wanted to test changes before sending v2 and I stumbled on one issue.<br>
> Everything works as expected when xrandr is used, but problem starts<br>
> when screensaver<br>
> comes into play. X calls<br>
> drmmode_crtc_dpms() to on/off screensaver, so when it is supposed to be<br>
> enabled, function is called with mode=DPMSModeOff and we<br>
> call drmModeSetCrtc() to set crtc's mode to NULL. Problem is when X<br>
> wants to disable screensaver: drmmode_crtc_dpms() is called with<br>
> mode=DPMSModeOn and... nothing happens as there is no logic for this<br>
> scenario - we should call drmModeSetCrtc() to set valid mode, but we<br>
> don't know what this mode should be.<br>
<br>
</div></div>Isn't crtc->mode valid at that point?<br></blockquote><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">I don't think so, but I'll double check it</div> </div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"></div><br></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">
<br>
If it's not, maybe we can store the mode in <div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline"></div>drmmode_crtc and use that<br>
instead.<br></blockquote><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">crtc mode is one thing, but we need other parameters as well: x/y crtc offsets,</div></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">buffer id, connectors list - do you think that these also can be stored in </div></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline"></div>drmmode_crtc<div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">?</div> </div><div><br></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 class=""><br>
<br>
> Because of the situation with the screensaver I think that original<br>
> version of the patch is ok (it solves the problem with CRTC staying<br>
> enabled when using xrandr to disable the output).<br>
<br>
</span>It would be nice to get the same effect for DPMS off though, wouldn't it?<br></blockquote><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">Of course, if I find a way to implement it I'll do it.</div></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline"></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 class=""><div class="h5"><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>
</div></div></blockquote></div><br></div></div>