mbox series

[OEM-5.17/J,0/3] Fix oled brightness set above frame-average luminance

Message ID 20220823145022.1424144-1-aaron.ma@canonical.com
Headers show
Series Fix oled brightness set above frame-average luminance | expand

Message

Aaron Ma Aug. 23, 2022, 2:50 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1978986

[Impact]
The brightness is not changed obviously during 200 to 255 on AMD
or 400 to 512 on Intel.

[Fix]
Read HDR meta to detect the max and min luminance.
max_cll defines the content light luminance for individual pixel.
max_fall defines frame-average level luminance.
Use max_fall value instead of max_cll as a limit for brightness control.

[Test]
Verified on AMD Cezanne, Barcelo, Rembrandt and Intel ADL, also on LCD panel and
OLED panel. The brightness is changed more obivously on OLED panel, and
no affect on LCD panel.

[Where problems could occur]
Low risk, It may cause the max brightness can't be set.

All 3 patches are in drm-misc tree.

Jouni Högander (3):
  UBUNTU: SAUCE: drm: New function to get luminance range based on
    static hdr metadata
  UBUNTU: SAUCE: drm/amdgpu_dm: Rely on split out luminance calculation function
  UBUNTU: SAUCE: drm/i915: Use luminance range calculated during edid parsing

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 35 ++-----------
 drivers/gpu/drm/drm_edid.c                    | 52 ++++++++++++++++++-
 .../drm/i915/display/intel_dp_aux_backlight.c | 15 +++++-
 include/drm/drm_connector.h                   | 21 ++++++++
 4 files changed, 89 insertions(+), 34 deletions(-)

Comments

Stefan Bader Aug. 24, 2022, 8:03 a.m. UTC | #1
On 23.08.22 16:50, Aaron Ma wrote:
> BugLink: https://bugs.launchpad.net/bugs/1978986
> 
> [Impact]
> The brightness is not changed obviously during 200 to 255 on AMD
> or 400 to 512 on Intel.
> 
> [Fix]
> Read HDR meta to detect the max and min luminance.
> max_cll defines the content light luminance for individual pixel.
> max_fall defines frame-average level luminance.
> Use max_fall value instead of max_cll as a limit for brightness control.
> 
> [Test]
> Verified on AMD Cezanne, Barcelo, Rembrandt and Intel ADL, also on LCD panel and
> OLED panel. The brightness is changed more obivously on OLED panel, and
> no affect on LCD panel.
> 
> [Where problems could occur]
> Low risk, It may cause the max brightness can't be set.
> 
> All 3 patches are in drm-misc tree.
> 
> Jouni Högander (3):
>    UBUNTU: SAUCE: drm: New function to get luminance range based on
>      static hdr metadata
>    UBUNTU: SAUCE: drm/amdgpu_dm: Rely on split out luminance calculation function
>    UBUNTU: SAUCE: drm/i915: Use luminance range calculated during edid parsing
> 
>   .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 35 ++-----------
>   drivers/gpu/drm/drm_edid.c                    | 52 ++++++++++++++++++-
>   .../drm/i915/display/intel_dp_aux_backlight.c | 15 +++++-
>   include/drm/drm_connector.h                   | 21 ++++++++
>   4 files changed, 89 insertions(+), 34 deletions(-)
> 

Am I understanding right that this is something to allow oem-5.14 to roll 
forward? In which case I would like to see more info in future on
- how long has this been in oem-5.14 (regressions?)
- why is this not yet upstream?

Acked-by: Stefan Bader <stefan.bader@canonical.com>
Aaron Ma Aug. 24, 2022, 8:45 a.m. UTC | #2
On 8/24/22 16:03, Stefan Bader wrote:
> On 23.08.22 16:50, Aaron Ma wrote:
>> BugLink: https://bugs.launchpad.net/bugs/1978986
>>
>> [Impact]
>> The brightness is not changed obviously during 200 to 255 on AMD
>> or 400 to 512 on Intel.
>>
>> [Fix]
>> Read HDR meta to detect the max and min luminance.
>> max_cll defines the content light luminance for individual pixel.
>> max_fall defines frame-average level luminance.
>> Use max_fall value instead of max_cll as a limit for brightness control.
>>
>> [Test]
>> Verified on AMD Cezanne, Barcelo, Rembrandt and Intel ADL, also on LCD panel and
>> OLED panel. The brightness is changed more obivously on OLED panel, and
>> no affect on LCD panel.
>>
>> [Where problems could occur]
>> Low risk, It may cause the max brightness can't be set.
>>
>> All 3 patches are in drm-misc tree.
>>
>> Jouni Högander (3):
>>    UBUNTU: SAUCE: drm: New function to get luminance range based on
>>      static hdr metadata
>>    UBUNTU: SAUCE: drm/amdgpu_dm: Rely on split out luminance calculation function
>>    UBUNTU: SAUCE: drm/i915: Use luminance range calculated during edid parsing
>>
>>   .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 35 ++-----------
>>   drivers/gpu/drm/drm_edid.c                    | 52 ++++++++++++++++++-
>>   .../drm/i915/display/intel_dp_aux_backlight.c | 15 +++++-
>>   include/drm/drm_connector.h                   | 21 ++++++++
>>   4 files changed, 89 insertions(+), 34 deletions(-)
>>
> 
> Am I understanding right that this is something to allow oem-5.14 to roll forward? In which case I would like to see more info in future on
> - how long has this been in oem-5.14 (regressions?)
> - why is this not yet upstream?
> 

The fix of AMD part is already landed in upstream and in oem-5.14 for 2 month.
This new version included Intel fix, it just landed in drm-misc and drm-tip.
It should be expected in 6.0.

Aaron

> Acked-by: Stefan Bader <stefan.bader@canonical.com>
>
Timo Aaltonen Aug. 24, 2022, 8:54 a.m. UTC | #3
Aaron Ma kirjoitti 24.8.2022 klo 11.45:
> 
> 
> On 8/24/22 16:03, Stefan Bader wrote:
>> On 23.08.22 16:50, Aaron Ma wrote:
>>> BugLink: https://bugs.launchpad.net/bugs/1978986
>>>
>>> [Impact]
>>> The brightness is not changed obviously during 200 to 255 on AMD
>>> or 400 to 512 on Intel.
>>>
>>> [Fix]
>>> Read HDR meta to detect the max and min luminance.
>>> max_cll defines the content light luminance for individual pixel.
>>> max_fall defines frame-average level luminance.
>>> Use max_fall value instead of max_cll as a limit for brightness control.
>>>
>>> [Test]
>>> Verified on AMD Cezanne, Barcelo, Rembrandt and Intel ADL, also on 
>>> LCD panel and
>>> OLED panel. The brightness is changed more obivously on OLED panel, and
>>> no affect on LCD panel.
>>>
>>> [Where problems could occur]
>>> Low risk, It may cause the max brightness can't be set.
>>>
>>> All 3 patches are in drm-misc tree.
>>>
>>> Jouni Högander (3):
>>>    UBUNTU: SAUCE: drm: New function to get luminance range based on
>>>      static hdr metadata
>>>    UBUNTU: SAUCE: drm/amdgpu_dm: Rely on split out luminance 
>>> calculation function
>>>    UBUNTU: SAUCE: drm/i915: Use luminance range calculated during 
>>> edid parsing
>>>
>>>   .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 35 ++-----------
>>>   drivers/gpu/drm/drm_edid.c                    | 52 ++++++++++++++++++-
>>>   .../drm/i915/display/intel_dp_aux_backlight.c | 15 +++++-
>>>   include/drm/drm_connector.h                   | 21 ++++++++
>>>   4 files changed, 89 insertions(+), 34 deletions(-)
>>>
>>
>> Am I understanding right that this is something to allow oem-5.14 to 
>> roll forward? In which case I would like to see more info in future on
>> - how long has this been in oem-5.14 (regressions?)
>> - why is this not yet upstream?
>>
> 
> The fix of AMD part is already landed in upstream and in oem-5.14 for 2 
> month.
> This new version included Intel fix, it just landed in drm-misc and 
> drm-tip.
> It should be expected in 6.0.

Nope, 6.1.

but yes, this is one of the two things still missing from jammy kernel 
to allow the roll-forward.
Kleber Souza Aug. 24, 2022, 3:43 p.m. UTC | #4
On 23.08.22 16:50, Aaron Ma wrote:
> BugLink: https://bugs.launchpad.net/bugs/1978986
> 
> [Impact]
> The brightness is not changed obviously during 200 to 255 on AMD
> or 400 to 512 on Intel.
> 
> [Fix]
> Read HDR meta to detect the max and min luminance.
> max_cll defines the content light luminance for individual pixel.
> max_fall defines frame-average level luminance.
> Use max_fall value instead of max_cll as a limit for brightness control.
> 
> [Test]
> Verified on AMD Cezanne, Barcelo, Rembrandt and Intel ADL, also on LCD panel and
> OLED panel. The brightness is changed more obivously on OLED panel, and
> no affect on LCD panel.
> 
> [Where problems could occur]
> Low risk, It may cause the max brightness can't be set.
> 
> All 3 patches are in drm-misc tree.
> 
> Jouni Högander (3):
>    UBUNTU: SAUCE: drm: New function to get luminance range based on
>      static hdr metadata
>    UBUNTU: SAUCE: drm/amdgpu_dm: Rely on split out luminance calculation function
>    UBUNTU: SAUCE: drm/i915: Use luminance range calculated during edid parsing
> 
>   .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 35 ++-----------
>   drivers/gpu/drm/drm_edid.c                    | 52 ++++++++++++++++++-
>   .../drm/i915/display/intel_dp_aux_backlight.c | 15 +++++-
>   include/drm/drm_connector.h                   | 21 ++++++++
>   4 files changed, 89 insertions(+), 34 deletions(-)
> 


Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

Thanks
Stefan Bader Aug. 25, 2022, 9:28 a.m. UTC | #5
On 23.08.22 16:50, Aaron Ma wrote:
> BugLink: https://bugs.launchpad.net/bugs/1978986
> 
> [Impact]
> The brightness is not changed obviously during 200 to 255 on AMD
> or 400 to 512 on Intel.
> 
> [Fix]
> Read HDR meta to detect the max and min luminance.
> max_cll defines the content light luminance for individual pixel.
> max_fall defines frame-average level luminance.
> Use max_fall value instead of max_cll as a limit for brightness control.
> 
> [Test]
> Verified on AMD Cezanne, Barcelo, Rembrandt and Intel ADL, also on LCD panel and
> OLED panel. The brightness is changed more obivously on OLED panel, and
> no affect on LCD panel.
> 
> [Where problems could occur]
> Low risk, It may cause the max brightness can't be set.
> 
> All 3 patches are in drm-misc tree.
> 
> Jouni Högander (3):
>    UBUNTU: SAUCE: drm: New function to get luminance range based on
>      static hdr metadata
>    UBUNTU: SAUCE: drm/amdgpu_dm: Rely on split out luminance calculation function
>    UBUNTU: SAUCE: drm/i915: Use luminance range calculated during edid parsing
> 
>   .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 35 ++-----------
>   drivers/gpu/drm/drm_edid.c                    | 52 ++++++++++++++++++-
>   .../drm/i915/display/intel_dp_aux_backlight.c | 15 +++++-
>   include/drm/drm_connector.h                   | 21 ++++++++
>   4 files changed, 89 insertions(+), 34 deletions(-)
> 

Applied to jammy:linux/master-next. Thanks.

-Stefan
Timo Aaltonen Aug. 30, 2022, 7:21 a.m. UTC | #6
Aaron Ma kirjoitti 23.8.2022 klo 17.50:
> BugLink: https://bugs.launchpad.net/bugs/1978986
> 
> [Impact]
> The brightness is not changed obviously during 200 to 255 on AMD
> or 400 to 512 on Intel.
> 
> [Fix]
> Read HDR meta to detect the max and min luminance.
> max_cll defines the content light luminance for individual pixel.
> max_fall defines frame-average level luminance.
> Use max_fall value instead of max_cll as a limit for brightness control.
> 
> [Test]
> Verified on AMD Cezanne, Barcelo, Rembrandt and Intel ADL, also on LCD panel and
> OLED panel. The brightness is changed more obivously on OLED panel, and
> no affect on LCD panel.
> 
> [Where problems could occur]
> Low risk, It may cause the max brightness can't be set.
> 
> All 3 patches are in drm-misc tree.
> 
> Jouni Högander (3):
>    UBUNTU: SAUCE: drm: New function to get luminance range based on
>      static hdr metadata
>    UBUNTU: SAUCE: drm/amdgpu_dm: Rely on split out luminance calculation function
>    UBUNTU: SAUCE: drm/i915: Use luminance range calculated during edid parsing
> 
>   .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 35 ++-----------
>   drivers/gpu/drm/drm_edid.c                    | 52 ++++++++++++++++++-
>   .../drm/i915/display/intel_dp_aux_backlight.c | 15 +++++-
>   include/drm/drm_connector.h                   | 21 ++++++++
>   4 files changed, 89 insertions(+), 34 deletions(-)
> 

What about kinetic/unstable?
Aaron Ma Sept. 15, 2022, 6:35 a.m. UTC | #7
On 8/30/22 15:21, Timo Aaltonen wrote:
>>
> 
> What about kinetic/unstable?

I will SRU it again on K/U when it's in upstream.

Regards,
Aaron
Timo Aaltonen Oct. 6, 2022, 9:24 a.m. UTC | #8
Aaron Ma kirjoitti 15.9.2022 klo 9.35:
> 
> 
> On 8/30/22 15:21, Timo Aaltonen wrote:
>>>
>>
>> What about kinetic/unstable?
> 
> I will SRU it again on K/U when it's in upstream.

this is in linux-next now
Timo Aaltonen Oct. 14, 2022, 7:47 a.m. UTC | #9
Aaron Ma kirjoitti 23.8.2022 klo 17.50:
> BugLink: https://bugs.launchpad.net/bugs/1978986
> 
> [Impact]
> The brightness is not changed obviously during 200 to 255 on AMD
> or 400 to 512 on Intel.
> 
> [Fix]
> Read HDR meta to detect the max and min luminance.
> max_cll defines the content light luminance for individual pixel.
> max_fall defines frame-average level luminance.
> Use max_fall value instead of max_cll as a limit for brightness control.
> 
> [Test]
> Verified on AMD Cezanne, Barcelo, Rembrandt and Intel ADL, also on LCD panel and
> OLED panel. The brightness is changed more obivously on OLED panel, and
> no affect on LCD panel.
> 
> [Where problems could occur]
> Low risk, It may cause the max brightness can't be set.
> 
> All 3 patches are in drm-misc tree.
> 
> Jouni Högander (3):
>    UBUNTU: SAUCE: drm: New function to get luminance range based on
>      static hdr metadata
>    UBUNTU: SAUCE: drm/amdgpu_dm: Rely on split out luminance calculation function
>    UBUNTU: SAUCE: drm/i915: Use luminance range calculated during edid parsing
> 
>   .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 35 ++-----------
>   drivers/gpu/drm/drm_edid.c                    | 52 ++++++++++++++++++-
>   .../drm/i915/display/intel_dp_aux_backlight.c | 15 +++++-
>   include/drm/drm_connector.h                   | 21 ++++++++
>   4 files changed, 89 insertions(+), 34 deletions(-)
> 

I've applied the newer version