public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Shih-Yuan Lee (FourDollars)" <sylee@canonical.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: A better maximum brightness for users.
Date: Mon, 09 Nov 2015 14:58:14 +0200	[thread overview]
Message-ID: <87bnb3jpnd.fsf@intel.com> (raw)
In-Reply-To: <CAApEhgjotNqqRqEMsGJ5ka0mmw0yFK6n8QfJQcD4i+JPo36ymw@mail.gmail.com>

On Mon, 09 Nov 2015, "Shih-Yuan Lee (FourDollars)" <sylee@canonical.com> wrote:
> On Mon, Nov 9, 2015 at 6:51 PM, Jani Nikula <jani.nikula@linux.intel.com>
> wrote:
>
>> On Mon, 09 Nov 2015, "Shih-Yuan Lee (FourDollars)" <sylee@canonical.com>
>> wrote:
>> > On Mon, Nov 9, 2015 at 6:17 PM, Jani Nikula <jani.nikula@linux.intel.com
>> >
>> > wrote:
>> >
>> >> On Mon, 09 Nov 2015, "Shih-Yuan Lee (FourDollars)" <sylee@canonical.com
>> >
>> >> wrote:
>> >> > The PWM brightness level of Dell XPS 13 (2015) is from 10 to 937
>> however
>> >> > the sysfs brightness level always starts from 0 so it is better to use
>> >> > 927 as the sysfs maximum brightness level and it becomes easier to map
>> >> > from the PWM brightness level to the sysfs brightness level.
>> >>
>> >> We've been thinking we should provide a fixed range to userspace
>> >> instead. Say, 0-100.
>> >>
>> >> BR,
>> >> Jani.
>> >>
>> >>
>> >>
>> > That might not be a good idea for the backward compatibility.
>>
>> Please explain how you think your change is good and a fixed range 0-100
>> is bad in terms of backward compatibility. Both just arbitrarily change
>> the max.
>>
> The original sysfs brightness range is from 0 to 937. Let's define it as A
> = {0, 1, 2, ..., 937}.
> The PWM brightness range is from 10 to 937. Let's define it as B = {10, 11,
> 12, ..., 937}.
> |A| = 938, |B| = 928
> |A| != |B|
> It implies A and B is not an 1-1 mapping.
>
> My patch is not a arbitrarily change.
> It makes A' = {0, 1, 2, ..., 927}. |A'| = 928
> You can see |A'| = |B| so it implies A' and B is an 1-1 mapping.
> It means any value in A' can be mapped to a different value in B and visa
> versa.
>
> C = {0, 100} has the same mapping problem.

Please tell me why you think this is a problem to begin with. What (user
perceptible) problem are you trying to solve?

I understand we could simplify (or remove) the scaling code with your
change, but I'm reluctant to go that way when, as I said, we've been
talking about fixing the range reported to userspace.

Part of the reason for going to 0-100 range would be that there are
barely that many user distinguishable steps in the backlight level. It
is silly to have brightness range of, say, 0-937, because you can't
distinguish them from each other. (Perhaps counter-intuitively, the
higher the PWM modulation frequency, the fewer user distinguishable
levels you can actually get.)

>> Besides, we've changed the max for some platforms before, and the ABI
>> for backlight sysfs is you can stick a value between 0 and
>> max_brightness to the brightness attribute. Any userspace that relies on
>> anything else is broken.
>>
>> > However I saw some message as the following.
>> > [    3.402233] [drm:parse_lfp_backlight] VBT backlight PWM modulation
>> > frequency 200 Hz, active high, min brightness 10, level 255
>> >
>> >
>> > Does it mean the brightness range is also defined in the BIOS?
>>
>> The minimum and the PWM modulation frequency are defined in BIOS. The
>> modulation frequency is an attribute for the hardware; I think that was
>> originally exposed as the max was just for implementation convenience.
>>
> I don't mean the minimum or the PWM modulation frequency.
> I mean "level 255".
> Does it mean the brightness range or something else?

It probably means the suggested initial level of the backlight in some
units, but AFAICT we don't use that for anything, and frankly I am not
sure why we log it.

BR,
Jani.


>
> Regards,
> $4
>
>>
>> BR,
>> Jani.
>>
>>
>> >
>> > Regards,
>> > $4
>> >
>> >>
>> >> >
>> >> > Signed-off-by: Shih-Yuan Lee (FourDollars) <sylee@canonical.com>
>> >> > ---
>> >> >  drivers/gpu/drm/i915/intel_panel.c | 2 +-
>> >> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >> >
>> >> > diff --git a/drivers/gpu/drm/i915/intel_panel.c
>> >> b/drivers/gpu/drm/i915/intel_panel.c
>> >> > index a24df35..697fd4d 100644
>> >> > --- a/drivers/gpu/drm/i915/intel_panel.c
>> >> > +++ b/drivers/gpu/drm/i915/intel_panel.c
>> >> > @@ -1211,7 +1211,7 @@ static int
>> intel_backlight_device_register(struct
>> >> intel_connector *connector)
>> >> >        * Note: Everything should work even if the backlight device max
>> >> >        * presented to the userspace is arbitrarily chosen.
>> >> >        */
>> >> > -     props.max_brightness = panel->backlight.max;
>> >> > +     props.max_brightness = panel->backlight.max -
>> panel->backlight.min;
>> >> >       props.brightness = scale_hw_to_user(connector,
>> >> >                                           panel->backlight.level,
>> >> >                                           props.max_brightness);
>> >>
>> >> --
>> >> Jani Nikula, Intel Open Source Technology Center
>> >>
>>
>> --
>> Jani Nikula, Intel Open Source Technology Center
>>

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-11-09 12:54 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-09  6:42 [PATCH] drm/i915: A better maximum brightness for users Shih-Yuan Lee (FourDollars)
2015-11-09 10:17 ` Jani Nikula
2015-11-09 10:30   ` Shih-Yuan Lee (FourDollars)
2015-11-09 10:51     ` Jani Nikula
2015-11-09 11:54       ` Shih-Yuan Lee (FourDollars)
2015-11-09 12:58         ` Jani Nikula [this message]
2015-11-09 14:02           ` Shih-Yuan Lee (FourDollars)
2015-11-09 15:25             ` Ville Syrjälä
2015-11-09 16:02   ` Paulo Zanoni
2015-11-09 16:57     ` Jani Nikula
2015-11-10  1:59       ` Shih-Yuan Lee (FourDollars)
2015-11-10  8:01 ` [PATCH v2] drm/i915: Respect the brightness range from VBT Shih-Yuan Lee (FourDollars)
2015-11-10 10:15   ` Jani Nikula
2015-11-10 11:26     ` Shih-Yuan Lee (FourDollars)
2015-11-10 12:57       ` Jani Nikula
2015-11-10 16:11         ` Shih-Yuan Lee (FourDollars)
2015-11-11  4:11   ` [PATCH v3] drm/i915: Set brightness maximum to a fixed value 100 Shih-Yuan Lee (FourDollars)
2015-11-11  4:57     ` kbuild test robot
2015-11-11  7:31 ` [PATCH v4] " Shih-Yuan Lee (FourDollars)
2015-11-11 12:05   ` Jani Nikula
2015-11-11 13:09     ` Shih-Yuan Lee (FourDollars)
2015-11-11 14:10 ` [PATCH v5] drm/i915: Set backlight class max to 100 and respect the VBT minimum again Shih-Yuan Lee (FourDollars)
2015-11-12  5:43 ` [PATCH v6] drm/i915: respect the VBT minimum backlight brightness again Shih-Yuan Lee (FourDollars)
2015-11-12  8:08   ` Stéphane ANCELOT
2015-11-12  8:28     ` Shih-Yuan Lee (FourDollars)
2015-11-12  8:40       ` Stéphane ANCELOT
2015-11-12  8:57         ` Shih-Yuan Lee (FourDollars)
2015-11-12  9:05           ` Stéphane ANCELOT
2015-11-12 10:01             ` Shih-Yuan Lee (FourDollars)
2015-11-18  9:06               ` Stéphane ANCELOT
2015-11-18  9:11                 ` Shih-Yuan Lee (FourDollars)
2015-11-12 13:44     ` Jani Nikula
2015-11-13  3:50 ` [PATCH v7] drm/i915: A better backlight class brightness range Shih-Yuan Lee (FourDollars)
2015-11-13  3:50   ` Shih-Yuan Lee (FourDollars)

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=87bnb3jpnd.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=sylee@canonical.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox