All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Karsten Wiese <fzuuzf@googlemail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: Call sysfs_notify after changing drm_connector::dpms
Date: Wed, 27 Sep 2017 10:18:32 +0300	[thread overview]
Message-ID: <87a81g8v93.fsf@intel.com> (raw)
In-Reply-To: <CAM=nh0R73Z=k0kuegFJMHgJ5+pXUF9MAEjBMtCn7YFHvy-RTMg@mail.gmail.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? 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 p​atch 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

  reply	other threads:[~2017-09-27  7:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a81g8v93.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fzuuzf@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.