* [PATCH] drm: Call sysfs_notify after changing drm_connector::dpms
@ 2017-09-19 9:53 Karsten Wiese
2017-09-25 13:48 ` Jani Nikula
0 siblings, 1 reply; 11+ messages in thread
From: Karsten Wiese @ 2017-09-19 9:53 UTC (permalink / raw)
To: dri-devel; +Cc: Karsten Wiese
This makes poll work for the
/sys/class/drm/cardX/connectorY/dpms attributes.
Tested with i915 suspended by XScreenServer and
suspend to RAM.
Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>
---
drivers/gpu/drm/drm_atomic.c | 4 ++++
drivers/gpu/drm/drm_atomic_helper.c | 6 +++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 2fd383d..b6fa87b 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -1880,6 +1880,10 @@ int drm_atomic_connector_commit_dpms(struct drm_atomic_state *state,
out:
if (ret != 0)
connector->dpms = old_mode;
+ else
+ if (connector->dpms != old_mode)
+ sysfs_notify(&connector->kdev->kobj, NULL, "dpms");
+
return ret;
}
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 4e53aae..6198772 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -921,12 +921,16 @@ drm_atomic_helper_update_legacy_modeset_state(struct drm_device *dev,
crtc = new_conn_state->crtc;
if ((!crtc && old_conn_state->crtc) ||
(crtc && drm_atomic_crtc_needs_modeset(crtc->state))) {
- int mode = DRM_MODE_DPMS_OFF;
+ int old_mode, mode = DRM_MODE_DPMS_OFF;
if (crtc && crtc->state->active)
mode = DRM_MODE_DPMS_ON;
+ old_mode = connector->dpms;
connector->dpms = mode;
+ if (old_mode != mode)
+ sysfs_notify(&connector->kdev->kobj,
+ NULL, "dpms");
}
}
--
2.7.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] drm: Call sysfs_notify after changing drm_connector::dpms
2017-09-19 9:53 [PATCH] drm: Call sysfs_notify after changing drm_connector::dpms Karsten Wiese
@ 2017-09-25 13:48 ` Jani Nikula
2017-09-26 22:29 ` Karsten Wiese
0 siblings, 1 reply; 11+ messages in thread
From: Jani Nikula @ 2017-09-25 13:48 UTC (permalink / raw)
To: dri-devel; +Cc: Karsten Wiese
On Tue, 19 Sep 2017, Karsten Wiese <fzuuzf@googlemail.com> wrote:
> This makes poll work for the
> /sys/class/drm/cardX/connectorY/dpms attributes.
I guess the question is, what are you trying to achieve? What is the
problem that this solves?
We have zero sysfs_notify in all of drm AFAICT.
BR,
Jani.
>
> Tested with i915 suspended by XScreenServer and
> suspend to RAM.
>
> Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>
> ---
> drivers/gpu/drm/drm_atomic.c | 4 ++++
> drivers/gpu/drm/drm_atomic_helper.c | 6 +++++-
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 2fd383d..b6fa87b 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -1880,6 +1880,10 @@ int drm_atomic_connector_commit_dpms(struct drm_atomic_state *state,
> out:
> if (ret != 0)
> connector->dpms = old_mode;
> + else
> + if (connector->dpms != old_mode)
> + sysfs_notify(&connector->kdev->kobj, NULL, "dpms");
> +
> return ret;
> }
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 4e53aae..6198772 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -921,12 +921,16 @@ drm_atomic_helper_update_legacy_modeset_state(struct drm_device *dev,
> crtc = new_conn_state->crtc;
> if ((!crtc && old_conn_state->crtc) ||
> (crtc && drm_atomic_crtc_needs_modeset(crtc->state))) {
> - int mode = DRM_MODE_DPMS_OFF;
> + int old_mode, mode = DRM_MODE_DPMS_OFF;
>
> if (crtc && crtc->state->active)
> mode = DRM_MODE_DPMS_ON;
>
> + old_mode = connector->dpms;
> connector->dpms = mode;
> + if (old_mode != mode)
> + sysfs_notify(&connector->kdev->kobj,
> + NULL, "dpms");
> }
> }
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm: Call sysfs_notify after changing drm_connector::dpms
2017-09-25 13:48 ` Jani Nikula
@ 2017-09-26 22:29 ` Karsten Wiese
2017-09-27 7:18 ` Jani Nikula
2017-09-27 8:45 ` Daniel Vetter
0 siblings, 2 replies; 11+ messages in thread
From: Karsten Wiese @ 2017-09-26 22:29 UTC (permalink / raw)
To: Jani Nikula; +Cc: dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 2996 bytes --]
2017-09-25 15:48 GMT+02:00 Jani Nikula <jani.nikula@linux.intel.com>:
> On Tue, 19 Sep 2017, Karsten Wiese <fzuuzf@googlemail.com> wrote:
> > This makes poll work for the
> > /sys/class/drm/cardX/connectorY/dpms attributes.
>
> I guess the question is, what are you trying to achieve? What is the
> problem that this solves?
>
The patch enables cpu cycle less waiting for dpms flag changes.
Here it lets a screen brightness setting daemon know which monitor to
handle.
One of the attached screens gets confused if it is set just after being
switched on,
hence the daemon leaves it untouched until it has been active for some
seconds.
Without the patch the daemon would have to actively read the dpms flag
every once in a while.
>
> We have zero sysfs_notify in all of drm AFAICT.
Yes I noticed too and looked for some dbus signal to listen to but didn't
find any.
BR,
Karsten
>
> BR,
> Jani.
>
>
> >
> > Tested with i915 suspended by XScreenServer and
> > suspend to RAM.
> >
> > Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>
> > ---
> > drivers/gpu/drm/drm_atomic.c | 4 ++++
> > drivers/gpu/drm/drm_atomic_helper.c | 6 +++++-
> > 2 files changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> > index 2fd383d..b6fa87b 100644
> > --- a/drivers/gpu/drm/drm_atomic.c
> > +++ b/drivers/gpu/drm/drm_atomic.c
> > @@ -1880,6 +1880,10 @@ int drm_atomic_connector_commit_dpms(struct
> drm_atomic_state *state,
> > out:
> > if (ret != 0)
> > connector->dpms = old_mode;
> > + else
> > + if (connector->dpms != old_mode)
> > + sysfs_notify(&connector->kdev->kobj, NULL,
> "dpms");
> > +
> > return ret;
> > }
> >
> > diff --git a/drivers/gpu/drm/drm_atomic_helper.c
> b/drivers/gpu/drm/drm_atomic_helper.c
> > index 4e53aae..6198772 100644
> > --- a/drivers/gpu/drm/drm_atomic_helper.c
> > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> > @@ -921,12 +921,16 @@ drm_atomic_helper_update_legacy_modeset_state(struct
> drm_device *dev,
> > crtc = new_conn_state->crtc;
> > if ((!crtc && old_conn_state->crtc) ||
> > (crtc && drm_atomic_crtc_needs_modeset(crtc->state)))
> {
> > - int mode = DRM_MODE_DPMS_OFF;
> > + int old_mode, mode = DRM_MODE_DPMS_OFF;
> >
> > if (crtc && crtc->state->active)
> > mode = DRM_MODE_DPMS_ON;
> >
> > + old_mode = connector->dpms;
> > connector->dpms = mode;
> > + if (old_mode != mode)
> > + sysfs_notify(&connector->kdev->kobj,
> > + NULL, "dpms");
> > }
> > }
>
> --
> Jani Nikula, Intel Open Source Technology Center
>
[-- Attachment #1.2: Type: text/html, Size: 5208 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm: Call sysfs_notify after changing drm_connector::dpms
2017-09-26 22:29 ` Karsten Wiese
@ 2017-09-27 7:18 ` Jani Nikula
2017-09-27 10:20 ` Karsten Wiese
2017-09-27 8:45 ` Daniel Vetter
1 sibling, 1 reply; 11+ messages in thread
From: Jani Nikula @ 2017-09-27 7:18 UTC (permalink / raw)
To: Karsten Wiese; +Cc: dri-devel
On Wed, 27 Sep 2017, Karsten Wiese <fzuuzf@googlemail.com> wrote:
> 2017-09-25 15:48 GMT+02:00 Jani Nikula <jani.nikula@linux.intel.com>:
>
>> On Tue, 19 Sep 2017, Karsten Wiese <fzuuzf@googlemail.com> wrote:
>> > This makes poll work for the
>> > /sys/class/drm/cardX/connectorY/dpms attributes.
>>
>> I guess the question is, what are you trying to achieve? What is the
>> problem that this solves?
>>
>
> The patch enables cpu cycle less waiting for dpms flag changes.
>
> Here it lets a screen brightness setting daemon know which monitor to
> handle. One of the attached screens gets confused if it is set just
> after being switched on, hence the daemon leaves it untouched until it
> has been active for some seconds.
Screen brightness settings daemon? What exactly do you mean by "if it is
set"? What interface are you using to change brightness? What happens
when the display "gets confused"?
My first instinct is that you're proposing a new kernel ABI to solve an
issue you shouldn't be solving in userspace to begin with. Or that
perhaps the userspace should be doing this in cooperation with the drm
master, not standalone.
BR,
Jani.
>
> Without the patch the daemon would have to actively read the dpms flag
> every once in a while.
>
>
>>
>> We have zero sysfs_notify in all of drm AFAICT.
>
>
> Yes I noticed too and looked for some dbus signal to listen to but didn't
> find any.
>
> BR,
> Karsten
>
>>
>> BR,
>> Jani.
>>
>>
>> >
>> > Tested with i915 suspended by XScreenServer and
>> > suspend to RAM.
>> >
>> > Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>
>> > ---
>> > drivers/gpu/drm/drm_atomic.c | 4 ++++
>> > drivers/gpu/drm/drm_atomic_helper.c | 6 +++++-
>> > 2 files changed, 9 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
>> > index 2fd383d..b6fa87b 100644
>> > --- a/drivers/gpu/drm/drm_atomic.c
>> > +++ b/drivers/gpu/drm/drm_atomic.c
>> > @@ -1880,6 +1880,10 @@ int drm_atomic_connector_commit_dpms(struct
>> drm_atomic_state *state,
>> > out:
>> > if (ret != 0)
>> > connector->dpms = old_mode;
>> > + else
>> > + if (connector->dpms != old_mode)
>> > + sysfs_notify(&connector->kdev->kobj, NULL,
>> "dpms");
>> > +
>> > return ret;
>> > }
>> >
>> > diff --git a/drivers/gpu/drm/drm_atomic_helper.c
>> b/drivers/gpu/drm/drm_atomic_helper.c
>> > index 4e53aae..6198772 100644
>> > --- a/drivers/gpu/drm/drm_atomic_helper.c
>> > +++ b/drivers/gpu/drm/drm_atomic_helper.c
>> > @@ -921,12 +921,16 @@ drm_atomic_helper_update_legacy_modeset_state(struct
>> drm_device *dev,
>> > crtc = new_conn_state->crtc;
>> > if ((!crtc && old_conn_state->crtc) ||
>> > (crtc && drm_atomic_crtc_needs_modeset(crtc->state)))
>> {
>> > - int mode = DRM_MODE_DPMS_OFF;
>> > + int old_mode, mode = DRM_MODE_DPMS_OFF;
>> >
>> > if (crtc && crtc->state->active)
>> > mode = DRM_MODE_DPMS_ON;
>> >
>> > + old_mode = connector->dpms;
>> > connector->dpms = mode;
>> > + if (old_mode != mode)
>> > + sysfs_notify(&connector->kdev->kobj,
>> > + NULL, "dpms");
>> > }
>> > }
>>
>> --
>> Jani Nikula, Intel Open Source Technology Center
>>
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm: Call sysfs_notify after changing drm_connector::dpms
2017-09-26 22:29 ` Karsten Wiese
2017-09-27 7:18 ` Jani Nikula
@ 2017-09-27 8:45 ` Daniel Vetter
2017-09-27 10:38 ` Karsten Wiese
1 sibling, 1 reply; 11+ messages in thread
From: Daniel Vetter @ 2017-09-27 8:45 UTC (permalink / raw)
To: Karsten Wiese; +Cc: dri-devel
On Wed, Sep 27, 2017 at 12:29:46AM +0200, Karsten Wiese wrote:
> 2017-09-25 15:48 GMT+02:00 Jani Nikula <jani.nikula@linux.intel.com>:
>
> > On Tue, 19 Sep 2017, Karsten Wiese <fzuuzf@googlemail.com> wrote:
> > > This makes poll work for the
> > > /sys/class/drm/cardX/connectorY/dpms attributes.
> >
> > I guess the question is, what are you trying to achieve? What is the
> > problem that this solves?
> >
>
> The patch enables cpu cycle less waiting for dpms flag changes.
>
> Here it lets a screen brightness setting daemon know which monitor to
> handle.
> One of the attached screens gets confused if it is set just after being
> switched on,
> hence the daemon leaves it untouched until it has been active for some
> seconds.
Without knowing more details, but a brightness deamon in userspace sounds
rather wrong. The driver is supposed to take care of this and shut down
the backlight when we disable the output for a panel.
> Without the patch the daemon would have to actively read the dpms flag
> every once in a while.
On top of that, any uabi changes need open source userspace.
-Daniel
>
>
> >
> > We have zero sysfs_notify in all of drm AFAICT.
>
>
> Yes I noticed too and looked for some dbus signal to listen to but didn't
> find any.
>
> BR,
> Karsten
>
> >
> > BR,
> > Jani.
> >
> >
> > >
> > > Tested with i915 suspended by XScreenServer and
> > > suspend to RAM.
> > >
> > > Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>
> > > ---
> > > drivers/gpu/drm/drm_atomic.c | 4 ++++
> > > drivers/gpu/drm/drm_atomic_helper.c | 6 +++++-
> > > 2 files changed, 9 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> > > index 2fd383d..b6fa87b 100644
> > > --- a/drivers/gpu/drm/drm_atomic.c
> > > +++ b/drivers/gpu/drm/drm_atomic.c
> > > @@ -1880,6 +1880,10 @@ int drm_atomic_connector_commit_dpms(struct
> > drm_atomic_state *state,
> > > out:
> > > if (ret != 0)
> > > connector->dpms = old_mode;
> > > + else
> > > + if (connector->dpms != old_mode)
> > > + sysfs_notify(&connector->kdev->kobj, NULL,
> > "dpms");
> > > +
> > > return ret;
> > > }
> > >
> > > diff --git a/drivers/gpu/drm/drm_atomic_helper.c
> > b/drivers/gpu/drm/drm_atomic_helper.c
> > > index 4e53aae..6198772 100644
> > > --- a/drivers/gpu/drm/drm_atomic_helper.c
> > > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> > > @@ -921,12 +921,16 @@ drm_atomic_helper_update_legacy_modeset_state(struct
> > drm_device *dev,
> > > crtc = new_conn_state->crtc;
> > > if ((!crtc && old_conn_state->crtc) ||
> > > (crtc && drm_atomic_crtc_needs_modeset(crtc->state)))
> > {
> > > - int mode = DRM_MODE_DPMS_OFF;
> > > + int old_mode, mode = DRM_MODE_DPMS_OFF;
> > >
> > > if (crtc && crtc->state->active)
> > > mode = DRM_MODE_DPMS_ON;
> > >
> > > + old_mode = connector->dpms;
> > > connector->dpms = mode;
> > > + if (old_mode != mode)
> > > + sysfs_notify(&connector->kdev->kobj,
> > > + NULL, "dpms");
> > > }
> > > }
> >
> > --
> > Jani Nikula, Intel Open Source Technology Center
> >
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm: Call sysfs_notify after changing drm_connector::dpms
2017-09-27 7:18 ` Jani Nikula
@ 2017-09-27 10:20 ` Karsten Wiese
2017-09-27 11:47 ` Daniel Vetter
0 siblings, 1 reply; 11+ messages in thread
From: Karsten Wiese @ 2017-09-27 10:20 UTC (permalink / raw)
To: Jani Nikula; +Cc: dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 4784 bytes --]
2017-09-27 9:18 GMT+02:00 Jani Nikula <jani.nikula@linux.intel.com>:
> On Wed, 27 Sep 2017, Karsten Wiese <fzuuzf@googlemail.com> wrote:
> > 2017-09-25 15:48 GMT+02:00 Jani Nikula <jani.nikula@linux.intel.com>:
> >
> >> On Tue, 19 Sep 2017, Karsten Wiese <fzuuzf@googlemail.com> wrote:
> >> > This makes poll work for the
> >> > /sys/class/drm/cardX/connectorY/dpms attributes.
> >>
> >> I guess the question is, what are you trying to achieve? What is the
> >> problem that this solves?
> >>
> >
> > The patch enables cpu cycle less waiting for dpms flag changes.
> >
> > Here it lets a screen brightness setting daemon know which monitor to
> > handle. One of the attached screens gets confused if it is set just
> > after being switched on, hence the daemon leaves it untouched until it
> > has been active for some seconds.
>
> Screen brightness settings daemon?
>
Running on a laptop lacking an ambient light sensor employing it's webcam
instead to measure ambient light and adjust monitors' brightnesses
accordingly.
What exactly do you mean by "if it is
> set"? What interface are you using to change brightness?
The external monitor's brightness is adjusted by DDC/CI via the /dev/i2c-x
the monitor is attached to.
I there a saner interface to use?
What happens
> when the display "gets confused"?
>
The monitor wrongly toggles sharpness if it receives the brightness
adjusting
DDC/CI soon after resuming from power saving state.
>
> My first instinct is that you're proposing a new kernel ABI to solve an
> issue you shouldn't be solving in userspace to begin with.
Calculating ambient light from pictures acquired via
v4l2 in kernel seamed wrong to me.
Or that
> perhaps the userspace should be doing this in cooperation with the drm
> master, not standalone.
>
Is there a way to call into the drm-master (xscreensaver/xserver here
) with the call only returning if a monitor's power state changed?
There is DPMSInfo, but it returns immediately rendering the daemon less
efficient.
BR,
Karsten
>
> BR,
> Jani.
>
> >
> > Without the patch the daemon would have to actively read the dpms flag
> > every once in a while.
> >
> >
> >>
> >> We have zero sysfs_notify in all of drm AFAICT.
> >
> >
> > Yes I noticed too and looked for some dbus signal to listen to but
> didn't
> > find any.
> >
> > BR,
> > Karsten
> >
> >>
> >> BR,
> >> Jani.
> >>
> >>
> >> >
> >> > Tested with i915 suspended by XScreenServer and
> >> > suspend to RAM.
> >> >
> >> > Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>
> >> > ---
> >> > drivers/gpu/drm/drm_atomic.c | 4 ++++
> >> > drivers/gpu/drm/drm_atomic_helper.c | 6 +++++-
> >> > 2 files changed, 9 insertions(+), 1 deletion(-)
> >> >
> >> > diff --git a/drivers/gpu/drm/drm_atomic.c
> b/drivers/gpu/drm/drm_atomic.c
> >> > index 2fd383d..b6fa87b 100644
> >> > --- a/drivers/gpu/drm/drm_atomic.c
> >> > +++ b/drivers/gpu/drm/drm_atomic.c
> >> > @@ -1880,6 +1880,10 @@ int drm_atomic_connector_commit_dpms(struct
> >> drm_atomic_state *state,
> >> > out:
> >> > if (ret != 0)
> >> > connector->dpms = old_mode;
> >> > + else
> >> > + if (connector->dpms != old_mode)
> >> > + sysfs_notify(&connector->kdev->kobj, NULL,
> >> "dpms");
> >> > +
> >> > return ret;
> >> > }
> >> >
> >> > diff --git a/drivers/gpu/drm/drm_atomic_helper.c
> >> b/drivers/gpu/drm/drm_atomic_helper.c
> >> > index 4e53aae..6198772 100644
> >> > --- a/drivers/gpu/drm/drm_atomic_helper.c
> >> > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> >> > @@ -921,12 +921,16 @@ drm_atomic_helper_update_
> legacy_modeset_state(struct
> >> drm_device *dev,
> >> > crtc = new_conn_state->crtc;
> >> > if ((!crtc && old_conn_state->crtc) ||
> >> > (crtc && drm_atomic_crtc_needs_modeset(
> crtc->state)))
> >> {
> >> > - int mode = DRM_MODE_DPMS_OFF;
> >> > + int old_mode, mode = DRM_MODE_DPMS_OFF;
> >> >
> >> > if (crtc && crtc->state->active)
> >> > mode = DRM_MODE_DPMS_ON;
> >> >
> >> > + old_mode = connector->dpms;
> >> > connector->dpms = mode;
> >> > + if (old_mode != mode)
> >> > + sysfs_notify(&connector->kdev->kobj,
> >> > + NULL, "dpms");
> >> > }
> >> > }
> >>
> >> --
> >> Jani Nikula, Intel Open Source Technology Center
> >>
>
> --
> Jani Nikula, Intel Open Source Technology Center
>
[-- Attachment #1.2: Type: text/html, Size: 9250 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm: Call sysfs_notify after changing drm_connector::dpms
2017-09-27 8:45 ` Daniel Vetter
@ 2017-09-27 10:38 ` Karsten Wiese
0 siblings, 0 replies; 11+ messages in thread
From: Karsten Wiese @ 2017-09-27 10:38 UTC (permalink / raw)
To: Daniel Vetter; +Cc: dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 4350 bytes --]
2017-09-27 10:45 GMT+02:00 Daniel Vetter <daniel@ffwll.ch>:
> On Wed, Sep 27, 2017 at 12:29:46AM +0200, Karsten Wiese wrote:
> > 2017-09-25 15:48 GMT+02:00 Jani Nikula <jani.nikula@linux.intel.com>:
> >
> > > On Tue, 19 Sep 2017, Karsten Wiese <fzuuzf@googlemail.com> wrote:
> > > > This makes poll work for the
> > > > /sys/class/drm/cardX/connectorY/dpms attributes.
> > >
> > > I guess the question is, what are you trying to achieve? What is the
> > > problem that this solves?
> > >
> >
> > The patch enables cpu cycle less waiting for dpms flag changes.
> >
> > Here it lets a screen brightness setting daemon know which monitor to
> > handle.
> > One of the attached screens gets confused if it is set just after being
> > switched on,
> > hence the daemon leaves it untouched until it has been active for some
> > seconds.
>
> Without knowing more details, but a brightness deamon in userspace sounds
> rather wrong. The driver is supposed to take care of this and shut down
> the backlight when we disable the output for a panel.
>
> > Without the patch the daemon would have to actively read the dpms flag
> > every once in a while.
>
> On top of that, any uabi changes need open source userspace.
>
Will put publishing userspace on my list, if proposed uabi change is
agreed upon to be accepted once userspace is open sourced.
Or if I find another way of knowing monitors' power states using cpu cycles
only if said states have changed. Anybody?
BR,
Karsten
-Daniel
>
> >
> >
> > >
> > > We have zero sysfs_notify in all of drm AFAICT.
> >
> >
> > Yes I noticed too and looked for some dbus signal to listen to but
> didn't
> > find any.
> >
> > BR,
> > Karsten
> >
> > >
> > > BR,
> > > Jani.
> > >
> > >
> > > >
> > > > Tested with i915 suspended by XScreenServer and
> > > > suspend to RAM.
> > > >
> > > > Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>
> > > > ---
> > > > drivers/gpu/drm/drm_atomic.c | 4 ++++
> > > > drivers/gpu/drm/drm_atomic_helper.c | 6 +++++-
> > > > 2 files changed, 9 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/drm_atomic.c
> b/drivers/gpu/drm/drm_atomic.c
> > > > index 2fd383d..b6fa87b 100644
> > > > --- a/drivers/gpu/drm/drm_atomic.c
> > > > +++ b/drivers/gpu/drm/drm_atomic.c
> > > > @@ -1880,6 +1880,10 @@ int drm_atomic_connector_commit_dpms(struct
> > > drm_atomic_state *state,
> > > > out:
> > > > if (ret != 0)
> > > > connector->dpms = old_mode;
> > > > + else
> > > > + if (connector->dpms != old_mode)
> > > > + sysfs_notify(&connector->kdev->kobj, NULL,
> > > "dpms");
> > > > +
> > > > return ret;
> > > > }
> > > >
> > > > diff --git a/drivers/gpu/drm/drm_atomic_helper.c
> > > b/drivers/gpu/drm/drm_atomic_helper.c
> > > > index 4e53aae..6198772 100644
> > > > --- a/drivers/gpu/drm/drm_atomic_helper.c
> > > > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> > > > @@ -921,12 +921,16 @@ drm_atomic_helper_update_
> legacy_modeset_state(struct
> > > drm_device *dev,
> > > > crtc = new_conn_state->crtc;
> > > > if ((!crtc && old_conn_state->crtc) ||
> > > > (crtc && drm_atomic_crtc_needs_modeset(
> crtc->state)))
> > > {
> > > > - int mode = DRM_MODE_DPMS_OFF;
> > > > + int old_mode, mode = DRM_MODE_DPMS_OFF;
> > > >
> > > > if (crtc && crtc->state->active)
> > > > mode = DRM_MODE_DPMS_ON;
> > > >
> > > > + old_mode = connector->dpms;
> > > > connector->dpms = mode;
> > > > + if (old_mode != mode)
> > > > + sysfs_notify(&connector->kdev->kobj,
> > > > + NULL, "dpms");
> > > > }
> > > > }
> > >
> > > --
> > > Jani Nikula, Intel Open Source Technology Center
> > >
>
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
>
[-- Attachment #1.2: Type: text/html, Size: 6955 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm: Call sysfs_notify after changing drm_connector::dpms
2017-09-27 10:20 ` Karsten Wiese
@ 2017-09-27 11:47 ` Daniel Vetter
2017-09-27 12:58 ` Jani Nikula
0 siblings, 1 reply; 11+ messages in thread
From: Daniel Vetter @ 2017-09-27 11:47 UTC (permalink / raw)
To: Karsten Wiese; +Cc: dri-devel
On Wed, Sep 27, 2017 at 12:20:21PM +0200, Karsten Wiese wrote:
> 2017-09-27 9:18 GMT+02:00 Jani Nikula <jani.nikula@linux.intel.com>:
>
> > On Wed, 27 Sep 2017, Karsten Wiese <fzuuzf@googlemail.com> wrote:
> > > 2017-09-25 15:48 GMT+02:00 Jani Nikula <jani.nikula@linux.intel.com>:
> > >
> > >> On Tue, 19 Sep 2017, Karsten Wiese <fzuuzf@googlemail.com> wrote:
> > >> > This makes poll work for the
> > >> > /sys/class/drm/cardX/connectorY/dpms attributes.
> > >>
> > >> I guess the question is, what are you trying to achieve? What is the
> > >> problem that this solves?
> > >>
> > >
> > > The patch enables cpu cycle less waiting for dpms flag changes.
> > >
> > > Here it lets a screen brightness setting daemon know which monitor to
> > > handle. One of the attached screens gets confused if it is set just
> > > after being switched on, hence the daemon leaves it untouched until it
> > > has been active for some seconds.
> >
> > Screen brightness settings daemon?
> >
> Running on a laptop lacking an ambient light sensor employing it's webcam
> instead to measure ambient light and adjust monitors' brightnesses
> accordingly.
>
>
> What exactly do you mean by "if it is
> > set"? What interface are you using to change brightness?
>
> The external monitor's brightness is adjusted by DDC/CI via the /dev/i2c-x
> the monitor is attached to.
> I there a saner interface to use?
There's supposed to be a backlight property on the panel, exposed by the X
driver. If there's not, then that needs to be fixed/adjusted.
There's also plans to directly link that up on the kernel side, but that's
a bit more involved due to how screwed up the backlight driver design on
linux is right now.
-Daniel
>
> What happens
> > when the display "gets confused"?
> >
> The monitor wrongly toggles sharpness if it receives the brightness
> adjusting
> DDC/CI soon after resuming from power saving state.
>
> >
> > My first instinct is that you're proposing a new kernel ABI to solve an
> > issue you shouldn't be solving in userspace to begin with.
>
> Calculating ambient light from pictures acquired via
> v4l2 in kernel seamed wrong to me.
>
> Or that
> > perhaps the userspace should be doing this in cooperation with the drm
> > master, not standalone.
> >
> Is there a way to call into the drm-master (xscreensaver/xserver here
> ) with the call only returning if a monitor's power state changed?
>
> There is DPMSInfo, but it returns immediately rendering the daemon less
> efficient.
>
>
> BR,
>
> Karsten
>
> >
> > BR,
> > Jani.
> >
> > >
> > > Without the patch the daemon would have to actively read the dpms flag
> > > every once in a while.
> > >
> > >
> > >>
> > >> We have zero sysfs_notify in all of drm AFAICT.
> > >
> > >
> > > Yes I noticed too and looked for some dbus signal to listen to but
> > didn't
> > > find any.
> > >
> > > BR,
> > > Karsten
> > >
> > >>
> > >> BR,
> > >> Jani.
> > >>
> > >>
> > >> >
> > >> > Tested with i915 suspended by XScreenServer and
> > >> > suspend to RAM.
> > >> >
> > >> > Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>
> > >> > ---
> > >> > drivers/gpu/drm/drm_atomic.c | 4 ++++
> > >> > drivers/gpu/drm/drm_atomic_helper.c | 6 +++++-
> > >> > 2 files changed, 9 insertions(+), 1 deletion(-)
> > >> >
> > >> > diff --git a/drivers/gpu/drm/drm_atomic.c
> > b/drivers/gpu/drm/drm_atomic.c
> > >> > index 2fd383d..b6fa87b 100644
> > >> > --- a/drivers/gpu/drm/drm_atomic.c
> > >> > +++ b/drivers/gpu/drm/drm_atomic.c
> > >> > @@ -1880,6 +1880,10 @@ int drm_atomic_connector_commit_dpms(struct
> > >> drm_atomic_state *state,
> > >> > out:
> > >> > if (ret != 0)
> > >> > connector->dpms = old_mode;
> > >> > + else
> > >> > + if (connector->dpms != old_mode)
> > >> > + sysfs_notify(&connector->kdev->kobj, NULL,
> > >> "dpms");
> > >> > +
> > >> > return ret;
> > >> > }
> > >> >
> > >> > diff --git a/drivers/gpu/drm/drm_atomic_helper.c
> > >> b/drivers/gpu/drm/drm_atomic_helper.c
> > >> > index 4e53aae..6198772 100644
> > >> > --- a/drivers/gpu/drm/drm_atomic_helper.c
> > >> > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> > >> > @@ -921,12 +921,16 @@ drm_atomic_helper_update_
> > legacy_modeset_state(struct
> > >> drm_device *dev,
> > >> > crtc = new_conn_state->crtc;
> > >> > if ((!crtc && old_conn_state->crtc) ||
> > >> > (crtc && drm_atomic_crtc_needs_modeset(
> > crtc->state)))
> > >> {
> > >> > - int mode = DRM_MODE_DPMS_OFF;
> > >> > + int old_mode, mode = DRM_MODE_DPMS_OFF;
> > >> >
> > >> > if (crtc && crtc->state->active)
> > >> > mode = DRM_MODE_DPMS_ON;
> > >> >
> > >> > + old_mode = connector->dpms;
> > >> > connector->dpms = mode;
> > >> > + if (old_mode != mode)
> > >> > + sysfs_notify(&connector->kdev->kobj,
> > >> > + NULL, "dpms");
> > >> > }
> > >> > }
> > >>
> > >> --
> > >> Jani Nikula, Intel Open Source Technology Center
> > >>
> >
> > --
> > Jani Nikula, Intel Open Source Technology Center
> >
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm: Call sysfs_notify after changing drm_connector::dpms
2017-09-27 11:47 ` Daniel Vetter
@ 2017-09-27 12:58 ` Jani Nikula
2017-09-27 15:03 ` Karsten Wiese
0 siblings, 1 reply; 11+ messages in thread
From: Jani Nikula @ 2017-09-27 12:58 UTC (permalink / raw)
To: Daniel Vetter, Karsten Wiese; +Cc: dri-devel
On Wed, 27 Sep 2017, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Wed, Sep 27, 2017 at 12:20:21PM +0200, Karsten Wiese wrote:
>> 2017-09-27 9:18 GMT+02:00 Jani Nikula <jani.nikula@linux.intel.com>:
>>
>> > On Wed, 27 Sep 2017, Karsten Wiese <fzuuzf@googlemail.com> wrote:
>> > > 2017-09-25 15:48 GMT+02:00 Jani Nikula <jani.nikula@linux.intel.com>:
>> > >
>> > >> On Tue, 19 Sep 2017, Karsten Wiese <fzuuzf@googlemail.com> wrote:
>> > >> > This makes poll work for the
>> > >> > /sys/class/drm/cardX/connectorY/dpms attributes.
>> > >>
>> > >> I guess the question is, what are you trying to achieve? What is the
>> > >> problem that this solves?
>> > >>
>> > >
>> > > The patch enables cpu cycle less waiting for dpms flag changes.
>> > >
>> > > Here it lets a screen brightness setting daemon know which monitor to
>> > > handle. One of the attached screens gets confused if it is set just
>> > > after being switched on, hence the daemon leaves it untouched until it
>> > > has been active for some seconds.
>> >
>> > Screen brightness settings daemon?
>> >
>> Running on a laptop lacking an ambient light sensor employing it's webcam
>> instead to measure ambient light and adjust monitors' brightnesses
>> accordingly.
>>
>>
>> What exactly do you mean by "if it is
>> > set"? What interface are you using to change brightness?
>>
>> The external monitor's brightness is adjusted by DDC/CI via the /dev/i2c-x
>> the monitor is attached to.
>> I there a saner interface to use?
>
> There's supposed to be a backlight property on the panel, exposed by the X
> driver. If there's not, then that needs to be fixed/adjusted.
For eDP/LVDS in Intel driver yes, for external displays not. For
external displays DDC/CI is currently probably the best bet.
However, DDC/CI is overall not very robust. I think we have prior bug
reports about it, but it's never really been very high on our list of
priorities.
> There's also plans to directly link that up on the kernel side, but that's
> a bit more involved due to how screwed up the backlight driver design on
> linux is right now.
It's going to take forever and a half before DDC/CI for external
displays get that treatment, if ever.
It still feels wrong to add sysfs notify support for just one of our
properties, for just this one use case. In particular if the reason is
to workaround bugs in another interface.
BR,
Jani.
> -Daniel
>
>>
>> What happens
>> > when the display "gets confused"?
>> >
>> The monitor wrongly toggles sharpness if it receives the brightness
>> adjusting
>> DDC/CI soon after resuming from power saving state.
>>
>> >
>> > My first instinct is that you're proposing a new kernel ABI to solve an
>> > issue you shouldn't be solving in userspace to begin with.
>>
>> Calculating ambient light from pictures acquired via
>> v4l2 in kernel seamed wrong to me.
>>
>> Or that
>> > perhaps the userspace should be doing this in cooperation with the drm
>> > master, not standalone.
>> >
>> Is there a way to call into the drm-master (xscreensaver/xserver here
>> ) with the call only returning if a monitor's power state changed?
>>
>> There is DPMSInfo, but it returns immediately rendering the daemon less
>> efficient.
>>
>>
>> BR,
>>
>> Karsten
>>
>> >
>> > BR,
>> > Jani.
>> >
>> > >
>> > > Without the patch the daemon would have to actively read the dpms flag
>> > > every once in a while.
>> > >
>> > >
>> > >>
>> > >> We have zero sysfs_notify in all of drm AFAICT.
>> > >
>> > >
>> > > Yes I noticed too and looked for some dbus signal to listen to but
>> > didn't
>> > > find any.
>> > >
>> > > BR,
>> > > Karsten
>> > >
>> > >>
>> > >> BR,
>> > >> Jani.
>> > >>
>> > >>
>> > >> >
>> > >> > Tested with i915 suspended by XScreenServer and
>> > >> > suspend to RAM.
>> > >> >
>> > >> > Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>
>> > >> > ---
>> > >> > drivers/gpu/drm/drm_atomic.c | 4 ++++
>> > >> > drivers/gpu/drm/drm_atomic_helper.c | 6 +++++-
>> > >> > 2 files changed, 9 insertions(+), 1 deletion(-)
>> > >> >
>> > >> > diff --git a/drivers/gpu/drm/drm_atomic.c
>> > b/drivers/gpu/drm/drm_atomic.c
>> > >> > index 2fd383d..b6fa87b 100644
>> > >> > --- a/drivers/gpu/drm/drm_atomic.c
>> > >> > +++ b/drivers/gpu/drm/drm_atomic.c
>> > >> > @@ -1880,6 +1880,10 @@ int drm_atomic_connector_commit_dpms(struct
>> > >> drm_atomic_state *state,
>> > >> > out:
>> > >> > if (ret != 0)
>> > >> > connector->dpms = old_mode;
>> > >> > + else
>> > >> > + if (connector->dpms != old_mode)
>> > >> > + sysfs_notify(&connector->kdev->kobj, NULL,
>> > >> "dpms");
>> > >> > +
>> > >> > return ret;
>> > >> > }
>> > >> >
>> > >> > diff --git a/drivers/gpu/drm/drm_atomic_helper.c
>> > >> b/drivers/gpu/drm/drm_atomic_helper.c
>> > >> > index 4e53aae..6198772 100644
>> > >> > --- a/drivers/gpu/drm/drm_atomic_helper.c
>> > >> > +++ b/drivers/gpu/drm/drm_atomic_helper.c
>> > >> > @@ -921,12 +921,16 @@ drm_atomic_helper_update_
>> > legacy_modeset_state(struct
>> > >> drm_device *dev,
>> > >> > crtc = new_conn_state->crtc;
>> > >> > if ((!crtc && old_conn_state->crtc) ||
>> > >> > (crtc && drm_atomic_crtc_needs_modeset(
>> > crtc->state)))
>> > >> {
>> > >> > - int mode = DRM_MODE_DPMS_OFF;
>> > >> > + int old_mode, mode = DRM_MODE_DPMS_OFF;
>> > >> >
>> > >> > if (crtc && crtc->state->active)
>> > >> > mode = DRM_MODE_DPMS_ON;
>> > >> >
>> > >> > + old_mode = connector->dpms;
>> > >> > connector->dpms = mode;
>> > >> > + if (old_mode != mode)
>> > >> > + sysfs_notify(&connector->kdev->kobj,
>> > >> > + NULL, "dpms");
>> > >> > }
>> > >> > }
>> > >>
>> > >> --
>> > >> Jani Nikula, Intel Open Source Technology Center
>> > >>
>> >
>> > --
>> > Jani Nikula, Intel Open Source Technology Center
>> >
>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm: Call sysfs_notify after changing drm_connector::dpms
2017-09-27 12:58 ` Jani Nikula
@ 2017-09-27 15:03 ` Karsten Wiese
2017-09-27 15:16 ` Jani Nikula
0 siblings, 1 reply; 11+ messages in thread
From: Karsten Wiese @ 2017-09-27 15:03 UTC (permalink / raw)
To: Jani Nikula; +Cc: dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 7093 bytes --]
2017-09-27 14:58 GMT+02:00 Jani Nikula <jani.nikula@linux.intel.com>:
> On Wed, 27 Sep 2017, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Wed, Sep 27, 2017 at 12:20:21PM +0200, Karsten Wiese wrote:
> >> 2017-09-27 9:18 GMT+02:00 Jani Nikula <jani.nikula@linux.intel.com>:
> >>
> >> > On Wed, 27 Sep 2017, Karsten Wiese <fzuuzf@googlemail.com> wrote:
> >> > > 2017-09-25 15:48 GMT+02:00 Jani Nikula <jani.nikula@linux.intel.com
> >:
> >> > >
> >> > >> On Tue, 19 Sep 2017, Karsten Wiese <fzuuzf@googlemail.com> wrote:
> >> > >> > This makes poll work for the
> >> > >> > /sys/class/drm/cardX/connectorY/dpms attributes.
> >> > >>
> >> > >> I guess the question is, what are you trying to achieve? What is
> the
> >> > >> problem that this solves?
> >> > >>
> >> > >
> >> > > The patch enables cpu cycle less waiting for dpms flag changes.
> >> > >
> >> > > Here it lets a screen brightness setting daemon know which monitor
> to
> >> > > handle. One of the attached screens gets confused if it is set just
> >> > > after being switched on, hence the daemon leaves it untouched until
> it
> >> > > has been active for some seconds.
> >> >
> >> > Screen brightness settings daemon?
> >> >
> >> Running on a laptop lacking an ambient light sensor employing it's
> webcam
> >> instead to measure ambient light and adjust monitors' brightnesses
> >> accordingly.
> >>
> >>
> >> What exactly do you mean by "if it is
> >> > set"? What interface are you using to change brightness?
> >>
> >> The external monitor's brightness is adjusted by DDC/CI via the
> /dev/i2c-x
> >> the monitor is attached to.
> >> I there a saner interface to use?
> >
> > There's supposed to be a backlight property on the panel, exposed by the
> X
> > driver. If there's not, then that needs to be fixed/adjusted.
>
> For eDP/LVDS in Intel driver yes, for external displays not. For
> external displays DDC/CI is currently probably the best bet.
>
> However, DDC/CI is overall not very robust. I think we have prior bug
> reports about it, but it's never really been very high on our list of
> priorities.
>
> > There's also plans to directly link that up on the kernel side, but
> that's
> > a bit more involved due to how screwed up the backlight driver design on
> > linux is right now.
>
> It's going to take forever and a half before DDC/CI for external
> displays get that treatment, if ever.
>
> It still feels wrong to add sysfs notify support for just one of our
> properties, for just this one use case. In particular if the reason is
> to workaround bugs in another interface.
>
Would you accept a patch supporting all relevant attributes?
BR,
Karsten
>
> BR,
> Jani.
>
>
> > -Daniel
> >
> >>
> >> What happens
> >> > when the display "gets confused"?
> >> >
> >> The monitor wrongly toggles sharpness if it receives the brightness
> >> adjusting
> >> DDC/CI soon after resuming from power saving state.
> >>
> >> >
> >> > My first instinct is that you're proposing a new kernel ABI to solve
> an
> >> > issue you shouldn't be solving in userspace to begin with.
> >>
> >> Calculating ambient light from pictures acquired via
> >> v4l2 in kernel seamed wrong to me.
> >>
> >> Or that
> >> > perhaps the userspace should be doing this in cooperation with the drm
> >> > master, not standalone.
> >> >
> >> Is there a way to call into the drm-master (xscreensaver/xserver here
> >> ) with the call only returning if a monitor's power state changed?
> >>
> >> There is DPMSInfo, but it returns immediately rendering the daemon less
> >> efficient.
> >>
> >>
> >> BR,
> >>
> >> Karsten
> >>
> >> >
> >> > BR,
> >> > Jani.
> >> >
> >> > >
> >> > > Without the patch the daemon would have to actively read the dpms
> flag
> >> > > every once in a while.
> >> > >
> >> > >
> >> > >>
> >> > >> We have zero sysfs_notify in all of drm AFAICT.
> >> > >
> >> > >
> >> > > Yes I noticed too and looked for some dbus signal to listen to but
> >> > didn't
> >> > > find any.
> >> > >
> >> > > BR,
> >> > > Karsten
> >> > >
> >> > >>
> >> > >> BR,
> >> > >> Jani.
> >> > >>
> >> > >>
> >> > >> >
> >> > >> > Tested with i915 suspended by XScreenServer and
> >> > >> > suspend to RAM.
> >> > >> >
> >> > >> > Signed-off-by: Karsten Wiese <fzuuzf@googlemail.com>
> >> > >> > ---
> >> > >> > drivers/gpu/drm/drm_atomic.c | 4 ++++
> >> > >> > drivers/gpu/drm/drm_atomic_helper.c | 6 +++++-
> >> > >> > 2 files changed, 9 insertions(+), 1 deletion(-)
> >> > >> >
> >> > >> > diff --git a/drivers/gpu/drm/drm_atomic.c
> >> > b/drivers/gpu/drm/drm_atomic.c
> >> > >> > index 2fd383d..b6fa87b 100644
> >> > >> > --- a/drivers/gpu/drm/drm_atomic.c
> >> > >> > +++ b/drivers/gpu/drm/drm_atomic.c
> >> > >> > @@ -1880,6 +1880,10 @@ int drm_atomic_connector_commit_
> dpms(struct
> >> > >> drm_atomic_state *state,
> >> > >> > out:
> >> > >> > if (ret != 0)
> >> > >> > connector->dpms = old_mode;
> >> > >> > + else
> >> > >> > + if (connector->dpms != old_mode)
> >> > >> > + sysfs_notify(&connector->kdev->kobj, NULL,
> >> > >> "dpms");
> >> > >> > +
> >> > >> > return ret;
> >> > >> > }
> >> > >> >
> >> > >> > diff --git a/drivers/gpu/drm/drm_atomic_helper.c
> >> > >> b/drivers/gpu/drm/drm_atomic_helper.c
> >> > >> > index 4e53aae..6198772 100644
> >> > >> > --- a/drivers/gpu/drm/drm_atomic_helper.c
> >> > >> > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> >> > >> > @@ -921,12 +921,16 @@ drm_atomic_helper_update_
> >> > legacy_modeset_state(struct
> >> > >> drm_device *dev,
> >> > >> > crtc = new_conn_state->crtc;
> >> > >> > if ((!crtc && old_conn_state->crtc) ||
> >> > >> > (crtc && drm_atomic_crtc_needs_modeset(
> >> > crtc->state)))
> >> > >> {
> >> > >> > - int mode = DRM_MODE_DPMS_OFF;
> >> > >> > + int old_mode, mode = DRM_MODE_DPMS_OFF;
> >> > >> >
> >> > >> > if (crtc && crtc->state->active)
> >> > >> > mode = DRM_MODE_DPMS_ON;
> >> > >> >
> >> > >> > + old_mode = connector->dpms;
> >> > >> > connector->dpms = mode;
> >> > >> > + if (old_mode != mode)
> >> > >> > + sysfs_notify(&connector->kdev-
> >kobj,
> >> > >> > + NULL, "dpms");
> >> > >> > }
> >> > >> > }
> >> > >>
> >> > >> --
> >> > >> Jani Nikula, Intel Open Source Technology Center
> >> > >>
> >> >
> >> > --
> >> > Jani Nikula, Intel Open Source Technology Center
> >> >
> >
> >> _______________________________________________
> >> dri-devel mailing list
> >> dri-devel@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
> --
> Jani Nikula, Intel Open Source Technology Center
>
[-- Attachment #1.2: Type: text/html, Size: 11014 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm: Call sysfs_notify after changing drm_connector::dpms
2017-09-27 15:03 ` Karsten Wiese
@ 2017-09-27 15:16 ` Jani Nikula
0 siblings, 0 replies; 11+ messages in thread
From: Jani Nikula @ 2017-09-27 15:16 UTC (permalink / raw)
To: Karsten Wiese; +Cc: dri-devel
On Wed, 27 Sep 2017, Karsten Wiese <fzuuzf@googlemail.com> wrote:
> 2017-09-27 14:58 GMT+02:00 Jani Nikula <jani.nikula@linux.intel.com>:
>> It still feels wrong to add sysfs notify support for just one of our
>> properties, for just this one use case. In particular if the reason is
>> to workaround bugs in another interface.
>>
>
> Would you accept a patch supporting all relevant attributes?
It's not my call alone, but personally I'd be hesitant about taking on
the burden of maintaining that ABI.
BR,
Jani.
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2017-09-27 15:17 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-19 9:53 [PATCH] drm: Call sysfs_notify after changing drm_connector::dpms Karsten Wiese
2017-09-25 13:48 ` Jani Nikula
2017-09-26 22:29 ` Karsten Wiese
2017-09-27 7:18 ` Jani Nikula
2017-09-27 10:20 ` Karsten Wiese
2017-09-27 11:47 ` Daniel Vetter
2017-09-27 12:58 ` Jani Nikula
2017-09-27 15:03 ` Karsten Wiese
2017-09-27 15:16 ` Jani Nikula
2017-09-27 8:45 ` Daniel Vetter
2017-09-27 10:38 ` Karsten Wiese
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.