All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>,
	Martin Peres <martin.peres@linux.intel.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Cc: "Daniel Thompson" <daniel.thompson@linaro.org>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Martin Gräßlin" <mgraesslin@kde.org>,
	plasma-devel@kde.org, "Lee Jones" <lee.jones@linaro.org>
Subject: Re: KMS backlight ABI proposition
Date: Wed, 22 Feb 2017 16:14:12 +0200	[thread overview]
Message-ID: <87poiaia8b.fsf@intel.com> (raw)
In-Reply-To: <53f44703-357d-7e31-d28b-cf86c32be853@redhat.com>

On Mon, 20 Feb 2017, Hans de Goede <hdegoede@redhat.com> wrote:
> On 17-02-17 13:58, Martin Peres wrote:
> So 1 and 2 are closely related the problem is that if we expose a
> fixed number of steps we need to convert in both directions, and if
> userspace tries to increment by doing read, add 1, write and we expose
> 1-100 but the hardware has only 4 levels then the read will keep
> returning the same value. Note I've fixed bugs like this already so
> this is a real problem. As already mentioned in the thread this can be
> fixed by caching the last written value on both sides and invalidating
> both caches on a new write to one side.

I don't think userspace should be doing read-modify-write like this,
*unless* the value read is guaranteed to be the same as the last value
written.

Contrast with the sysfs brightness class interface. RMW should only ever
have been done on the "brightness" attribute alone, never using read on
"actual_brightness" attribute and write on "brightness".

>> The display brightness MUST be a monotonically increasing function of
>> the brightness property.
>
> What does "monotonically increasing" actually mean ? I would prefer
> to clearly define that we are talking about perceived brightness here,
> for 2 reasons:

https://en.wikipedia.org/wiki/Monotonic_function

Increase in the property means the same or higher "perceived
brightness".

> 1) This is what the user actually wants
> 2) Some of the x86 firmware interfaces only give us perceived brightness
> and no way to get back to any other unit of measire.
>
>> Brightness property value 1 MUST mean the minimum supported visible
>> brightness.
>>
>> Brightness property value 100 MUST mean the maximum supported
>> brightness.
>>
>> Brightness property value 0 SHOULD mean backlight off or equivalent for
>> non-backlight brightness adjustment, typically completely
>> black. Brightness property value 0 MUST NOT switch the display or pipe
>> off [1].
>>
>> If the hardware is not capable of supporting zero brightness, and the
>> driver knows this, value 0 MUST be equal to value 1.
>
> Ok.
>
>> If the driver does not know whether the hardware is capable of
>> supporting zero brightness, the driver SHOULD err on the side of 0 not
>> being off rather than 1 meaning off. In this case, value 0 is likely
>> different from value 1, and the minimum brightness can only be reached
>> via property value 0 [2].
>
> I agree, but this needs rewording (I had to read it 3 times).
>
>> If the brightness gets changed outside of the property interface,
>> reading the property value MAY be out of sync with the actual brightness
>> [3].
>
> This is for when the panel is off ? Otherwise it seems like a bad idea
> to me.

It means we don't want to go dig through the sysfs class interface to
figure out what was written there, and do lossy conversions back to the
property (if there's scaling involved).


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

  reply	other threads:[~2017-02-22 14:14 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17 12:58 KMS backlight ABI proposition Martin Peres
2017-02-20 12:46 ` Martin Peres
2017-02-20 14:11   ` Daniel Thompson
2017-02-22 15:05     ` Jani Nikula
2017-02-22 15:18       ` Martin Peres
2017-02-22 16:20       ` Hans de Goede
2017-02-23  8:55         ` Jani Nikula
2017-02-23 13:44           ` Hans de Goede
2017-02-20 16:25   ` Thierry Reding
2017-02-22 15:38     ` Jani Nikula
2017-02-20 19:27 ` Dave Airlie
2017-02-20 19:57   ` Hans de Goede
2017-02-22 15:08     ` Martin Peres
2017-02-20 22:40   ` Alex Deucher
2017-02-20 23:01     ` Jasper St. Pierre
2017-02-22 14:00       ` Jani Nikula
2017-02-22 16:35         ` Jasper St. Pierre
2017-02-22 15:48   ` Jani Nikula
2017-02-20 20:09 ` Hans de Goede
2017-02-22 14:14   ` Jani Nikula [this message]
2017-02-22 19:07 ` Stéphane Marchesin
2017-02-23  8:40   ` Jani Nikula
2017-02-23 13:38     ` Hans de Goede
2017-02-23 17:31     ` Stéphane Marchesin
2017-02-24  8:43       ` Jani Nikula
2017-02-24  8:55         ` Hans de Goede
2017-02-24  9:34           ` Jani Nikula
2017-02-24  9:46             ` Hans de Goede
2017-02-24  9:48               ` Hans de Goede
2017-02-24  9:59                 ` Hans de Goede
2017-02-24 10:23                   ` Martin Peres
2017-02-24 10:44                     ` Hans de Goede
2017-02-24 12:56                       ` Martin Peres
2017-02-24 11:16         ` Daniel Thompson
2017-02-24 11:41           ` Jani Nikula
2017-02-23 17:41     ` Jasper St. Pierre

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=87poiaia8b.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=daniel.thompson@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=jingoohan1@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=martin.peres@linux.intel.com \
    --cc=mgraesslin@kde.org \
    --cc=plasma-devel@kde.org \
    /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.