<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 11:01 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 16:45, Piotr Redlewski wrote:<br>
><br>
> 2015-06-23 8:28 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 23.06.2015 04:19, Piotr Redlewski wrote:<br>
> ><br>
> > 2015-06-22 12:01 GMT+02:00 Piotr Redlewski <<a href="mailto:predlewski@gmail.com">predlewski@gmail.com</a> <mailto:<a href="mailto:predlewski@gmail.com">predlewski@gmail.com</a>><br>
</span>> > <mailto:<a href="mailto:predlewski@gmail.com">predlewski@gmail.com</a> <mailto:<a href="mailto:predlewski@gmail.com">predlewski@gmail.com</a>>>>:<br>
<span class="">> ><br>
> > 2015-06-22 9:49 GMT+02:00 Michel Dänzer <<a href="mailto:michel@daenzer.net">michel@daenzer.net</a> <mailto:<a href="mailto:michel@daenzer.net">michel@daenzer.net</a>><br>
</span>> > <mailto:<a href="mailto:michel@daenzer.net">michel@daenzer.net</a> <mailto:<a href="mailto:michel@daenzer.net">michel@daenzer.net</a>>>>:<br>
> ><br>
> > On <a href="tel:21.06.2015%2023" value="+12106201523">21.06.2015 23</a> <tel:21.06.2015%2023> <tel:21.06.2015%2023>:30, Piotr<br>
<div><div class="h5">> Redlewski wrote:<br>
> > <br>
> > drmmode_crtc_dpms(xf86CrtcPtr crtc, int mode)<br>
> > > {<br>
> > > - /* Nothing to do. drmmode_do_crtc_dpms() is called<br>
> as appropriate */<br>
> > > + drmmode_crtc_private_ptr drmmode_crtc =<br>
> 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<br>
> 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<br>
> 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>
> Isn't crtc->mode valid at that point?<br>
><br>
> I don't think so, but I'll double check it<br>
<br>
</div></div>If it's not valid, I'd expect drmmode_set_mode_major() to get called by<br>
the X server.<br>
<span class=""><br>
<br>
> If it's not, maybe we can store the mode in<br>
> <br>
> drmmode_crtc and use that<br>
> instead.<br>
><br>
> crtc mode is one thing, but we need other parameters as well: x/y crtc<br>
> offsets,<br>
> buffer id, connectors list - do you think that these also can be stored in<br>
> <br>
> drmmode_crtc<br>
> ?<br>
<br>
</span>Again I'm not sure how those can not be valid in the xf86CrtcRec when<br>
the X server calls drmmode_crtc_dpms() but not drmmode_set_mode_major().<br>
<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>
> It would be nice to get the same effect for DPMS off though,<br>
> wouldn't it?<br>
><br>
> Of course, if I find a way to implement it I'll do it.<br>
<br>
</span>Thanks. If you want to tackle that in a followup patch, we can probably<br>
just use if (!crtc->enabled) in this patch?<br>
<div class=""><div class="h5"><br></div></div></blockquote><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Sounds good. I'll send v2 in the evening and then (having in mind</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">your suggestions) I'll start to figuring out how to make it work for</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">DPMS off .</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 class=""><div class="h5">
<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>
</div></div></blockquote></div><br></div></div>