<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-09-27 10:45 GMT+02:00 Daniel Vetter <span dir="ltr"><<a href="mailto:daniel@ffwll.ch" target="_blank">daniel@ffwll.ch</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Sep 27, 2017 at 12:29:46AM +0200, Karsten Wiese wrote:<br>
> 2017-09-25 15:48 GMT+02:00 Jani Nikula <<a href="mailto:jani.nikula@linux.intel.com">jani.nikula@linux.intel.com</a>>:<br>
><br>
> > On Tue, 19 Sep 2017, Karsten Wiese <<a href="mailto:fzuuzf@googlemail.com">fzuuzf@googlemail.com</a>> wrote:<br>
> > > This makes poll work for the<br>
> > > /sys/class/drm/cardX/<wbr>connectorY/dpms attributes.<br>
> ><br>
> > I guess the question is, what are you trying to achieve? What is the<br>
> > problem that this solves?<br>
> ><br>
> <br>
> The patch enables cpu cycle less waiting for dpms flag changes.<br>
><br>
> Here it lets a screen brightness setting daemon know which monitor to<br>
> handle.<br>
> One of the attached screens gets confused if it is set just after being<br>
> switched on,<br>
> hence the daemon leaves it untouched until it has been active for some<br>
> seconds.<br>
<br>
</span>Without knowing more details, but a brightness deamon in userspace sounds<br>
rather wrong. The driver is supposed to take care of this and shut down<br>
the backlight when we disable the output for a panel.<br>
<span class=""><br>
> Without the patch the daemon would have to actively read the dpms flag<br>
> every once in a while.<br>
<br>
</span>On top of that, any uabi changes need open source userspace.<br></blockquote><div> </div><div style="font-family:courier new,monospace" class="gmail_default">Will put publishing userspace on my list, if proposed uabi change is agreed upon to be accepted once userspace is open sourced.</div><div style="font-family:courier new,monospace" class="gmail_default">Or if I find another way of knowing monitors' power states using cpu cycles only if said states have changed. Anybody?<br></div><div style="font-family:courier new,monospace" class="gmail_default"><br></div><div style="font-family:courier new,monospace" class="gmail_default">BR,</div><div style="font-family:courier new,monospace" class="gmail_default">Karsten<br></div><div style="font-family:courier new,monospace" class="gmail_default"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Daniel<br>
<div><div class="h5"><br>
><br>
><br>
> ><br>
> > We have zero sysfs_notify in all of drm AFAICT.<br>
><br>
><br>
> Yes I noticed too and looked for some dbus signal to listen to but didn't<br>
> find any.<br>
><br>
> BR,<br>
> Karsten<br>
><br>
> ><br>
> > BR,<br>
> > Jani.<br>
> ><br>
> ><br>
> > ><br>
> > > Tested with i915 suspended by XScreenServer and<br>
> > > suspend to RAM.<br>
> > ><br>
> > > Signed-off-by: Karsten Wiese <<a href="mailto:fzuuzf@googlemail.com">fzuuzf@googlemail.com</a>><br>
> > > ---<br>
> > > drivers/gpu/drm/drm_atomic.c | 4 ++++<br>
> > > drivers/gpu/drm/drm_atomic_<wbr>helper.c | 6 +++++-<br>
> > > 2 files changed, 9 insertions(+), 1 deletion(-)<br>
> > ><br>
> > > diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c<br>
> > > index 2fd383d..b6fa87b 100644<br>
> > > --- a/drivers/gpu/drm/drm_atomic.c<br>
> > > +++ b/drivers/gpu/drm/drm_atomic.c<br>
> > > @@ -1880,6 +1880,10 @@ int drm_atomic_connector_commit_<wbr>dpms(struct<br>
> > drm_atomic_state *state,<br>
> > > out:<br>
> > > if (ret != 0)<br>
> > > connector->dpms = old_mode;<br>
> > > + else<br>
> > > + if (connector->dpms != old_mode)<br>
> > > + sysfs_notify(&connector->kdev-<wbr>>kobj, NULL,<br>
> > "dpms");<br>
> > > +<br>
> > > return ret;<br>
> > > }<br>
> > ><br>
> > > diff --git a/drivers/gpu/drm/drm_atomic_<wbr>helper.c<br>
> > b/drivers/gpu/drm/drm_atomic_<wbr>helper.c<br>
> > > index 4e53aae..6198772 100644<br>
> > > --- a/drivers/gpu/drm/drm_atomic_<wbr>helper.c<br>
> > > +++ b/drivers/gpu/drm/drm_atomic_<wbr>helper.c<br>
> > > @@ -921,12 +921,16 @@ drm_atomic_helper_update_<wbr>legacy_modeset_state(struct<br>
> > drm_device *dev,<br>
> > > crtc = new_conn_state->crtc;<br>
> > > if ((!crtc && old_conn_state->crtc) ||<br>
> > > (crtc && drm_atomic_crtc_needs_modeset(<wbr>crtc->state)))<br>
> > {<br>
> > > - int mode = DRM_MODE_DPMS_OFF;<br>
> > > + int old_mode, mode = DRM_MODE_DPMS_OFF;<br>
> > ><br>
> > > if (crtc && crtc->state->active)<br>
> > > mode = DRM_MODE_DPMS_ON;<br>
> > ><br>
> > > + old_mode = connector->dpms;<br>
> > > connector->dpms = mode;<br>
> > > + if (old_mode != mode)<br>
> > > + sysfs_notify(&connector->kdev-<wbr>>kobj,<br>
> > > + NULL, "dpms");<br>
> > > }<br>
> > > }<br>
> ><br>
> > --<br>
> > Jani Nikula, Intel Open Source Technology Center<br>
> ><br>
<br>
</div></div>> ______________________________<wbr>_________________<br>
> dri-devel mailing list<br>
> <a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.<wbr>org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/dri-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/dri-devel</a><br>
<span class="HOEnZb"><font color="#888888"><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>
</font></span></blockquote></div><br></div></div>