[PATCH v5 4/4] drm: panel-backlight-quirks: Add Framework 13 glossy and 2.8k panels

2024-08-19 Thread Thomas Weißschuh
From: "Dustin L. Howett" I have tested these panels on the Framework Laptop 13 AMD with firmware revision 3.05 (latest at time of submission). Signed-off-by: Dustin L. Howett --- drivers/gpu/drm/drm_panel_backlight_quirks.c | 16 1 file changed, 16 insertions(+) diff --git a/

[PATCH 03/12] drm/edid: constify argument of drm_edid_is_valid()

2024-08-19 Thread Thomas Weißschuh
drm_edid_is_valid() does not modify its argument, so mark it as const. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/drm_edid.c | 2 +- include/drm/drm_edid.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c

[PATCH 00/12] drm/amd: Switch over to struct drm_edid

2024-08-19 Thread Thomas Weißschuh
around some code. The remaining patches perform the actual conversion in steps. [0] https://lore.kernel.org/lkml/20240818-amdgpu-min-backlight-quirk-v5-0-b6c0ead0c...@weissschuh.net/ Signed-off-by: Thomas Weißschuh --- Thomas Weißschuh (12): drm/amd/display: remove spurious definition for d

[PATCH 05/12] drm/amd/display: Constify raw_edid handling in dm_helpers_parse_edid_caps()

2024-08-19 Thread Thomas Weißschuh
The argument edid is passed in as const. Preserve this constness through the edid_buf variable and the used helper functions. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a

[PATCH v5 1/4] drm: Add panel backlight quirks

2024-08-19 Thread Thomas Weißschuh
panels. Add a quirk infrastructure with which the minimum valid backlight value can be maintained as part of the kernel. Signed-off-by: Thomas Weißschuh Tested-by: Dustin L. Howett --- Documentation/gpu/drm-kms-helpers.rst| 3 ++ drivers/gpu/drm/Kconfig | 4

[PATCH v5 3/4] drm: panel-backlight-quirks: Add Framework 13 matte panel

2024-08-19 Thread Thomas Weißschuh
isible. Tested on a Framework AMD 13 BIOS 3.05 with the matte panel. Link: https://community.frame.work/t/25711/9 Link: https://community.frame.work/t/47036 Signed-off-by: Thomas Weißschuh Tested-by: Dustin L. Howett --- drivers/gpu/drm/drm_panel_backlight_quirks.c | 8 1 file changed,

[PATCH v5 2/4] drm/amd/display: Add support for minimum backlight quirk

2024-08-19 Thread Thomas Weißschuh
Not all platforms provide correct PWM backlight capabilities through ATIF. Use the generic drm panel minimum backlight quirk infrastructure to override the capabilities where necessary. Signed-off-by: Thomas Weißschuh Tested-by: Dustin L. Howett --- drivers/gpu/drm/amd/amdgpu/Kconfig

[PATCH] drm/radeon: Switch radeon_connector to struct drm_edid

2024-08-19 Thread Thomas Weißschuh
"struct drm_edid" is the safe and recommended alternative to "struct edid". Rename the member to make sure that no usage sites are missed, as "struct drm_edid" has some restrictions, for example it can not be used with kfree(). Signed-off-by: Thomas Weißschuh -

[PATCH v5 0/4] drm: Minimum backlight overrides and implementation for amdgpu

2024-08-19 Thread Thomas Weißschuh
net --- Dustin L. Howett (1): drm: panel-backlight-quirks: Add Framework 13 glossy and 2.8k panels Thomas Weißschuh (3): drm: Add panel backlight quirks drm/amd/display: Add support for minimum backlight quirk drm: panel-backlight-quirks: Add Framework 13 matte panel

[PATCH 04/12] drm/amd/display: Simplify raw_edid handling in dm_helpers_parse_edid_caps()

2024-08-19 Thread Thomas Weißschuh
Reduce the number of casts needed by reusing the edid_buf variable. Also initialize edid_buf after the !edid case has been handled to avoid the ternary expression. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 8 +--- 1 file changed, 5

[PATCH 06/12] drm/amd/display: Constify 'struct edid' in parsing functions

2024-08-19 Thread Thomas Weißschuh
The parsing functions do not modify their edid argument. Mark the const to reflect this to the caller. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 +++--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 2 +- 2 files changed, 8

[PATCH 12/12] drm/amd/display: Switch dc_link_add_remote_sink() to struct drm_edid

2024-08-19 Thread Thomas Weißschuh
"struct drm_edid" is the safe and recommended alternative to "struct edid". Now that all callers of dc_link_add_remote_sink() have access to a validate struct drm_edid, pass it around directly. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgp

[PATCH 07/12] drm/amd/display: Use struct edid in dc_link_add_remote_sink()

2024-08-19 Thread Thomas Weißschuh
The callers of dc_link_add_remote_sink() are using 'struct edid' which they all need to cast to uint8_t *. Allow the direct passing of 'struct edid' to avoid these cast and also move the length calculation so it does not need to be duplicated everywhere. Signed-off-

[PATCH 02/12] drm/amd/display: Remove EDID members of ddc_service

2024-08-19 Thread Thomas Weißschuh
All usages of these fields have been removed. Fixes: 7c7f5b15be65 ("drm/amd/display: Refactor edid read.") Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/display/dc/dc_ddc_types.h | 4 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dc_ddc_

[PATCH 08/12] drm/amdgpu: Switch amdgpu_connector to struct drm_edid

2024-08-19 Thread Thomas Weißschuh
"struct drm_edid" is the safe and recommended alternative to "struct edid". Rename the member to make sure that no usage sites are missed, as "struct drm_edid" has some restrictions, for example it can not be used with kfree(). Signed-off-by: Thomas Weißschuh -

[PATCH 09/12] drm/amd/display: Switch amdgpu_dm_connector to struct drm_edid

2024-08-19 Thread Thomas Weißschuh
"struct drm_edid" is the safe and recommended alternative to "struct edid". Rename the member to make sure that no usage sites are missed, as "struct drm_edid" has some restrictions, for example it can not be used with kfree(). Signed-off-by: Thomas Weißschuh --

[PATCH 10/12] drm/edid: add a helper to compare two EDIDs

2024-08-19 Thread Thomas Weißschuh
As struct drm_edid is opaque, drivers can't directly memcmp() the contained data. Add a helper to provide this functionality. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/drm_edid.c | 18 ++ include/drm/drm_edid.h | 1 + 2 files changed, 19 insertions(+) diff

[PATCH 11/12] drm/amd/display: Switch dc_sink to struct drm_edid

2024-08-19 Thread Thomas Weißschuh
The custom "struct dc_edid" can be replaced by the standard "struct drm_edid. Rename the member to make sure that no usage sites are missed, as "struct drm_edid" has some restrictions, for example it can not be used with kfree(). Signed-off-by: Thomas Weißschuh --- dr

[PATCH 01/12] drm/amd/display: remove spurious definition for dm_helpers_get_sbios_edid()

2024-08-19 Thread Thomas Weißschuh
The prototype is the whole content of commit 575d0df6dae4 ("drm/amd/display: refine the EDID override"). Apparently the definition was never added. Fixes: 575d0df6dae4 ("drm/amd/display: refine the EDID override") Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/dis

Re: [PATCH] drm/radeon: Switch radeon_connector to struct drm_edid

2024-08-19 Thread Thomas Weißschuh
On 2024-08-19 11:51:45+, Jani Nikula wrote: > On Sun, 18 Aug 2024, Thomas Weißschuh wrote: > > "struct drm_edid" is the safe and recommended alternative to "struct edid". > > > > Rename the member to make sure that no usage sites are missed, > >

Re: [PATCH 00/12] drm/amd: Switch over to struct drm_edid

2024-08-19 Thread Thomas Weißschuh
Hi Melissa, On 2024-08-19 11:31:44+, Melissa Wen wrote: > On 08/18, Thomas Weißschuh wrote: > > The AMD DRM drivers use 'struct edid', raw pointers and even custom > > structs to represent EDID data. > > Uniformly switch to the safe and recommended "str

Re: [PATCH 03/12] drm/edid: constify argument of drm_edid_is_valid()

2024-08-19 Thread Thomas Weißschuh
On 2024-08-19 11:21:21+, Jani Nikula wrote: > On Sun, 18 Aug 2024, Thomas Weißschuh wrote: > > drm_edid_is_valid() does not modify its argument, so mark it as const. > > That's not true. Indeed, thanks for noticing. It turns out this patch is not necessary anyways and

Re: [PATCH v5 2/4] drm/amd/display: Add support for minimum backlight quirk

2024-08-22 Thread Thomas Weißschuh
On 2024-08-21 15:54:14+, Mario Limonciello wrote: > On 8/18/2024 01:56, Thomas Weißschuh wrote: > > Not all platforms provide correct PWM backlight capabilities through ATIF. > > I don't think correct is an accurate term here. How about 'optimial'? Looks typ

Re: [PATCH v5 0/4] drm: Minimum backlight overrides and implementation for amdgpu

2024-08-22 Thread Thomas Weißschuh
Hi Mario, (+ a question for Dustin inside) On 2024-08-21 15:45:46+, Mario Limonciello wrote: > On 8/18/2024 01:56, Thomas Weißschuh wrote: > > The value of "min_input_signal" returned from ATIF on a Framework AMD 13 > > is "12". This leads to a fair

Re: [PATCH v5 1/4] drm: Add panel backlight quirks

2024-08-22 Thread Thomas Weißschuh
On 2024-08-21 15:51:17+, Mario Limonciello wrote: > On 8/18/2024 01:56, Thomas Weißschuh wrote: > > Panels using a PWM-controlled backlight source do not have a standard > > way to communicate their valid PWM ranges. > > On x86 the ranges are read from ACPI through d

[PATCH v2] drm/radeon: Switch radeon_connector to struct drm_edid

2024-08-23 Thread Thomas Weißschuh
"struct drm_edid" is the safe and recommended alternative to "struct edid". Rename the member to make sure that no usage sites are missed, as "struct drm_edid" has some restrictions, for example it can not be used with kfree(). Signed-off-by: Thomas Weißschuh ---

[PATCH v6 2/4] drm/amd/display: Add support for minimum backlight quirk

2024-08-26 Thread Thomas Weißschuh
uot; sysfs file has not shown any negative impact. One quirk seems to be that 0% at panel_power_savings=0 seems to be slightly darker than at panel_power_savings=4. Signed-off-by: Thomas Weißschuh Tested-by: Dustin L. Howett Reviewed-by: Mario Limonciello --- drivers/gpu/drm/amd/amdg

[PATCH v6 4/4] drm: panel-backlight-quirks: Add Framework 13 glossy and 2.8k panels

2024-08-26 Thread Thomas Weißschuh
From: "Dustin L. Howett" I have tested these panels on the Framework Laptop 13 AMD with firmware revision 3.05 (latest at time of submission). Signed-off-by: Dustin L. Howett Signed-off-by: Thomas Weißschuh Reviewed-by: Mario Limonciello --- drivers/gpu/drm/drm_panel_backlight_qui

[PATCH v6 0/4] drm: Minimum backlight overrides and implementation for amdgpu

2024-08-26 Thread Thomas Weißschuh
ucture - Quirk by EDID and DMI instead of only DMI - Limit quirk to only single Framework 13 matte panel - Link to v1: https://lore.kernel.org/r/20240610-amdgpu-min-backlight-quirk-v1-1-8459895a5...@weissschuh.net --- Dustin L. Howett (1): drm: panel-backlight-quirks: Add Framework 13 gloss

[PATCH v6 1/4] drm: Add panel backlight quirks

2024-08-26 Thread Thomas Weißschuh
panels. Add a quirk infrastructure with which the minimum valid backlight value can be maintained as part of the kernel. Signed-off-by: Thomas Weißschuh Tested-by: Dustin L. Howett Reviewed-by: Mario Limonciello --- Documentation/gpu/drm-kms-helpers.rst| 3 ++ drivers/gpu/drm/Kconfig

[PATCH v6 3/4] drm: panel-backlight-quirks: Add Framework 13 matte panel

2024-08-26 Thread Thomas Weißschuh
isible. Tested on a Framework AMD 13 BIOS 3.05 with the matte panel. Link: https://community.frame.work/t/25711/9 Link: https://community.frame.work/t/47036 Signed-off-by: Thomas Weißschuh Tested-by: Dustin L. Howett Reviewed-by: Mario Limonciello --- drivers/gpu/drm/drm_panel_backlight_quirks.

Re: [PATCH] drm/amd/display: Validate backlight caps are sane

2024-09-14 Thread Thomas Weißschuh
On 2024-09-13 15:48:55+, Mario Limonciello wrote: > On 9/13/2024 15:36, Alex Deucher wrote: > > On Fri, Sep 13, 2024 at 2:51 PM Mario Limonciello > > wrote: > > > > > > On 9/13/2024 13:47, Harry Wentland wrote: > > > > > > > > > > > > On 2024-09-13 14:00, Mario Limonciello wrote: > > > > >

Re: [PATCH] drm/amd: force min_input_signal to 0 on Framework AMD 13/16

2024-06-11 Thread Thomas Weißschuh
On 2024-06-10 14:58:02+, Mario Limonciello wrote: > +Kieran > > On 6/10/2024 14:26, Thomas Weißschuh wrote: > > The value of "min_input_signal" returned from ATIF on a Framework AMD 13 > > is "12". This leads to a fairly bright minimum display backligh

[PATCH] drm/amd: force min_input_signal to 0 on Framework AMD 13/16

2024-06-11 Thread Thomas Weißschuh
readable even in daylight. Tested on a Framework AMD 13 BIOS 3.05 and Framework AMD 16. Link: https://community.frame.work/t/25711/9 Link: https://community.frame.work/t/47036 Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 35

[PATCH] drm/amdgpu: convert bios_hardcoded_edid to drm_edid

2024-06-17 Thread Thomas Weißschuh
p;array[0]' to the equivalent 'array' and using 'max_t(int, ...)' instead of manual casts. Signed-off-by: Thomas Weißschuh --- While this patch introduces a new user for drm_edid_raw(), if amdgpu proper gets migrated to 'struct drm_edid', that usage will go away.

Re: [PATCH] drm/amdgpu: convert bios_hardcoded_edid to drm_edid

2024-06-17 Thread Thomas Weißschuh
On 2024-06-16 11:12:03+, Thomas Weißschuh wrote: > Instead of manually passing around 'struct edid *' and its size, > use 'struct drm_edid', which encapsulates a validated combination of > both. > > As the drm_edid_ can handle NULL gracefully, the explicit

[PATCH v2 0/3] drm: backlight quirk infrastructure and lower minimum for Framework AMD 13

2024-06-24 Thread Thomas Weißschuh
ework 13 matte panel - Link to v1: https://lore.kernel.org/r/20240610-amdgpu-min-backlight-quirk-v1-1-8459895a5...@weissschuh.net --- Thomas Weißschuh (3): drm: Add panel backlight quirks drm: panel-backlight-quirks: Add Framework 13 matte panel drm/amd/display: Add support ba

[PATCH v2 3/3] drm/amd/display: Add support backlight quirks

2024-06-24 Thread Thomas Weißschuh
Not all platforms provide correct PWM backlight capabilities through ATIF. Use the generic drm backlight quirk infrastructure to override the capabilities where necessary. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/amdgpu/Kconfig| 1 + drivers/gpu/drm/amd/display

[PATCH v2 2/3] drm: panel-backlight-quirks: Add Framework 13 matte panel

2024-06-24 Thread Thomas Weißschuh
isible. Tested on a Framework AMD 13 BIOS 3.05 with the matte panel. Link: https://community.frame.work/t/25711/9 Link: https://community.frame.work/t/47036 Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/drm_panel_backlight_quirks.c | 9 + 1 file changed, 9 insertions(+)

[PATCH v2 1/3] drm: Add panel backlight quirks

2024-06-24 Thread Thomas Weißschuh
with newer panels. Add a quirk infrastructure with which the valid backlight ranges can be maintained as part of the kernel. Signed-off-by: Thomas Weißschuh --- Documentation/gpu/drm-kms-helpers.rst| 3 ++ drivers/gpu/drm/Kconfig | 4 ++ drivers/gpu/drm/Makefile

Re: [PATCH v2 0/3] drm: backlight quirk infrastructure and lower minimum for Framework AMD 13

2024-06-25 Thread Thomas Weißschuh
Hi Hans! thanks for your feedback! On 2024-06-24 11:11:40+, Hans de Goede wrote: > On 6/23/24 10:51 AM, Thomas Weißschuh wrote: > > The value of "min_input_signal" returned from ATIF on a Framework AMD 13 > > is "12". This leads to a fairly bright minimu

Re: [PATCH v2 0/3] drm: backlight quirk infrastructure and lower minimum for Framework AMD 13

2024-07-20 Thread Thomas Weißschuh
Hi Hans, On 2024-07-18 10:25:18+, Hans de Goede wrote: > On 6/24/24 6:15 PM, Thomas Weißschuh wrote: > > On 2024-06-24 11:11:40+, Hans de Goede wrote: > >> On 6/23/24 10:51 AM, Thomas Weißschuh wrote: > >>> The value of "min_input_signal" returned

Re: [PATCH] drm/amdgpu: convert bios_hardcoded_edid to drm_edid

2024-07-20 Thread Thomas Weißschuh
Hi amdgpu maintainers, did you get a chance to look at the patch and the suspected bug? Thanks, Thomas On 2024-06-16 20:14:45+, Thomas Weißschuh wrote: > On 2024-06-16 11:12:03+0000, Thomas Weißschuh wrote: > > Instead of manually passing around 'struct edid *' and its si

Re: [PATCH 1/2] drm/amdgpu: properly handle vbios fake edid sizing

2024-07-23 Thread Thomas Weißschuh
there were actually any boards out there with a non-128 byte > EDID, but align the code with the comment. > > Reported-by: Thomas Weißschuh Afaik Reported-by: should also have a Link:. And IMO a Fixes: would also be fitting. > Signed-off-by: Alex Deucher > --- > .../gpu/d

Re: [PATCH 1/2] drm/amdgpu: properly handle vbios fake edid sizing

2024-07-24 Thread Thomas Weißschuh
On 2024-07-23 20:30:08+, Deucher, Alexander wrote: > > -Original Message- > > From: Thomas Weißschuh > > Sent: Tuesday, July 23, 2024 1:58 PM > > To: Deucher, Alexander > > Cc: amd-gfx@lists.freedesktop.org > > Subject: Re: [PATCH 1/2] drm/amd

Re: [PATCH 2/2 V2] drm/radeon: properly handle vbios fake edid sizing

2024-07-24 Thread Thomas Weißschuh
there were actually any boards out there with a non-128 byte > EDID, but align the code with the comment. > > Reported-by: Thomas Weißschuh > Link: https://lists.freedesktop.org/archives/amd-gfx/2024-June/109964.html > Fixes: c324acd5032f ("drm/radeon/kms: parse the extended LCD

Re: [PATCH 1/2 V2] drm/amdgpu: properly handle vbios fake edid sizing

2024-07-24 Thread Thomas Weißschuh
there were actually any boards out there with a non-128 byte > EDID, but align the code with the comment. > > Reported-by: Thomas Weißschuh > Link: https://lists.freedesktop.org/archives/amd-gfx/2024-June/109964.html > Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)") >

[PATCH v2 1/2] drm/amdgpu: convert bios_hardcoded_edid to drm_edid

2024-07-27 Thread Thomas Weißschuh
p;array[0]' to the equivalent 'array' and using 'max_t(int, ...)' instead of manual casts. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 6 +- drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h | 4 ++-- drivers/gpu/drm/amd/amdgpu/a

[PATCH v2 0/2] drm/{amdgpu,radeon}: convert bios_hardcoded_edid to drm_edid

2024-07-27 Thread Thomas Weißschuh
x27; completely for which this series provides the foundation. Only compile-tested. Signed-off-by: Thomas Weißschuh --- Changes in v2: - Rebase onto current amdgpu/drm-next and recent changes to hardcoded bios handling - Add patch for drm/radeon - Link to v1: https://lore.kernel.org/r/

[PATCH v2 2/2] drm/radeon: convert bios_hardcoded_edid to drm_edid

2024-07-27 Thread Thomas Weißschuh
p;array[0]' to the equivalent 'array' and using 'max_t(int, ...)' instead of manual casts. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/radeon/radeon_atombios.c | 17 ++--- drivers/gpu/drm/radeon/radeon_combios.c| 26 +

[PATCH v3 0/2] drm: minimum backlight overrides and implementation for amdgpu

2024-08-02 Thread Thomas Weißschuh
I - Limit quirk to only single Framework 13 matte panel - Link to v1: https://lore.kernel.org/r/20240610-amdgpu-min-backlight-quirk-v1-1-8459895a5...@weissschuh.net --- Thomas Weißschuh (2): drm/connector: add drm_connector_get_cmdline_min_brightness_override() drm/amd/display: impleme

[PATCH v3 2/2] drm/amd/display: implement minimum brightness override

2024-08-02 Thread Thomas Weißschuh
This is useful if the minimum backlight as reported by machines VBT does not match the user expectations. As an example, the minimum backlight brightness on the Framework 13 matte panel is too high. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6

[PATCH v3 1/2] drm/connector: add drm_connector_get_cmdline_min_brightness_override()

2024-08-02 Thread Thomas Weißschuh
-off-by: Thomas Weißschuh --- drivers/gpu/drm/drm_connector.c | 34 ++ include/drm/drm_connector.h | 2 ++ 2 files changed, 36 insertions(+) diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index ab6ab7ff7ea8..d0b3d5d6c7c2 100644

Re: [PATCH v3 0/2] drm: minimum backlight overrides and implementation for amdgpu

2024-08-05 Thread Thomas Weißschuh
Hi, On 2024-08-01 10:52:55+, Hans de Goede wrote: > On 7/31/24 10:55 PM, Daniel Vetter wrote: > > On Wed, Jul 31, 2024 at 08:40:12PM +0300, Jani Nikula wrote: > >> On Wed, 31 Jul 2024, Thomas Weißschuh wrote: > >>> The value of "min_input_signal"

[PATCH v4 2/3] drm: panel-backlight-quirks: Add Framework 13 matte panel

2024-08-13 Thread Thomas Weißschuh
isible. Tested on a Framework AMD 13 BIOS 3.05 with the matte panel. Link: https://community.frame.work/t/25711/9 Link: https://community.frame.work/t/47036 Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/drm_panel_backlight_quirks.c | 8 1 file changed, 8 insertions(+)

[PATCH v4 0/3] drm: Minimum backlight overrides and implementation for amdgpu

2024-08-13 Thread Thomas Weißschuh
mdgpu-min-backlight-quirk-v1-1-8459895a5...@weissschuh.net --- Thomas Weißschuh (3): drm: Add panel backlight quirks drm: panel-backlight-quirks: Add Framework 13 matte panel drm/amd/display: Add support for minimum backlight quirk Documentation/gpu/drm-kms-helpers.rst

[PATCH v4 3/3] drm/amd/display: Add support for minimum backlight quirk

2024-08-13 Thread Thomas Weißschuh
Not all platforms provide correct PWM backlight capabilities through ATIF. Use the generic drm panel minimum backlight quirk infrastructure to override the capabilities where necessary. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/amdgpu/Kconfig| 1 + drivers/gpu/drm

[PATCH v4 1/3] drm: Add panel backlight quirks

2024-08-13 Thread Thomas Weißschuh
with newer panels. Add a quirk infrastructure with which the minimum valid backlight value can be maintained as part of the kernel. Signed-off-by: Thomas Weißschuh --- Documentation/gpu/drm-kms-helpers.rst| 3 ++ drivers/gpu/drm/Kconfig | 4 ++ drivers/gpu/drm

[PATCH] drm/amdkfd: Make kobj_type structures constant

2023-02-15 Thread Thomas Weißschuh
Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") the driver core allows the usage of const struct kobj_type. Take advantage of this to constify the structure definitions to prevent modification at runtime. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/

[PATCH] drm/amdgpu: make kobj_type structures constant

2023-02-15 Thread Thomas Weißschuh
Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") the driver core allows the usage of const struct kobj_type. Take advantage of this to constify the structure definitions to prevent modification at runtime. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/

Re: [PATCH v6 2/4] drm/amd/display: Add support for minimum backlight quirk

2024-10-10 Thread Thomas Weißschuh
On 2024-09-16 15:43:35-0400, Harry Wentland wrote: > On 2024-08-26 12:57, Mario Limonciello wrote: > > On 8/24/2024 13:33, Thomas Weißschuh wrote: > >> Not all platforms provide the full range of PWM backlight capabilities > >> supported by the hardware through ATIF. >

[PATCH v2 02/10] sysfs: introduce callback attribute_group::bin_size

2024-11-03 Thread Thomas Weißschuh
ize field. * It prevents the structure to be moved to read-only memory. Introduce a new dedicated callback to calculate the size of the attribute. Signed-off-by: Thomas Weißschuh --- fs/sysfs/group.c | 2 ++ include/linux/sysfs.h | 8 2 files changed, 10 insertions(+) diff --git a

[PATCH v2 01/10] sysfs: explicitly pass size to sysfs_add_bin_file_mode_ns()

2024-11-03 Thread Thomas Weißschuh
Upcoming changes to the sysfs core require the size of the created file to be overridable by the caller. Add a parameter to enable this. For now keep using attr->size in all cases. Signed-off-by: Thomas Weißschuh --- fs/sysfs/file.c | 8 fs/sysfs/group.c | 3 ++- fs/sysfs/sysfs.h

[PATCH v2 00/10] sysfs: constify struct bin_attribute (Part 1)

2024-11-03 Thread Thomas Weißschuh
ibutes. This series is intended to be merged through the driver core tree. Signed-off-by: Thomas Weißschuh --- Changes in v2: - Drop RFC state - Refuse registration of attributes with both read/read_new or write/write_new - Remove don't drop llseek() callback, as it is actually used. I

[PATCH v2 05/10] sysfs: treewide: constify attribute callback of bin_is_visible()

2024-11-03 Thread Thomas Weißschuh
The is_bin_visible() callbacks should not modify the struct bin_attribute passed as argument. Enforce this by marking the argument as const. As there are not many callback implementers perform this change throughout the tree at once. Signed-off-by: Thomas Weißschuh --- drivers/cxl/port.c

[PATCH v2 08/10] sysfs: implement all BIN_ATTR_* macros in terms of __BIN_ATTR()

2024-11-03 Thread Thomas Weißschuh
The preparations for the upcoming constification of struct bin_attribute requires some logic in the structure definition macros. To avoid duplication of that logic in multiple macros, reimplement all other macros in terms of __BIN_ATTR(). Signed-off-by: Thomas Weißschuh --- include/linux

[PATCH v2 06/10] sysfs: treewide: constify attribute callback of bin_attribute::mmap()

2024-11-03 Thread Thomas Weißschuh
The mmap() callbacks should not modify the struct bin_attribute passed as argument. Enforce this by marking the argument as const. As there are not many callback implementers perform this change throughout the tree at once. Signed-off-by: Thomas Weißschuh --- arch/alpha/kernel/pci-sysfs.c

[PATCH v2 10/10] driver core: Constify attribute arguments of binary attributes

2024-11-03 Thread Thomas Weißschuh
As preparation for the constification of struct bin_attribute, constify the arguments of the read and write callbacks. Signed-off-by: Thomas Weißschuh --- drivers/base/node.c | 4 ++-- drivers/base/topology.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH v2 03/10] PCI/sysfs: Calculate bin_attribute size through bin_size()

2024-11-03 Thread Thomas Weißschuh
Stop abusing the is_bin_visible() callback to calculate the attribute size. Instead use the new, dedicated bin_size() one. Signed-off-by: Thomas Weißschuh --- drivers/pci/pci-sysfs.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/pci

[PATCH v2 09/10] sysfs: bin_attribute: add const read/write callback variants

2024-11-03 Thread Thomas Weißschuh
churn during the transition. As soon as all handlers are switch to the const variant, the non-const one can be removed together with the transition machinery. Signed-off-by: Thomas Weißschuh --- fs/sysfs/file.c | 22 +- include/linux/sysfs.h | 25 +++-- 2

[PATCH v2 04/10] nvmem: core: calculate bin_attribute size through bin_size()

2024-11-03 Thread Thomas Weißschuh
Stop abusing the is_bin_visible() callback to calculate the attribute size. Instead use the new, dedicated bin_size() one. Signed-off-by: Thomas Weißschuh --- drivers/nvmem/core.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers

[PATCH v2 07/10] sysfs: treewide: constify attribute callback of bin_attribute::llseek()

2024-11-03 Thread Thomas Weißschuh
The llseek() callbacks should not modify the struct bin_attribute passed as argument. Enforce this by marking the argument as const. As there are not many callback implementers perform this change throughout the tree at once. Signed-off-by: Thomas Weißschuh --- drivers/pci/pci-sysfs.c | 2

[PATCH v7 1/4] drm: Add panel backlight quirks

2024-11-12 Thread Thomas Weißschuh
panels. Add a quirk infrastructure with which the minimum valid backlight value can be maintained as part of the kernel. Signed-off-by: Thomas Weißschuh Tested-by: Dustin L. Howett Reviewed-by: Mario Limonciello Reviewed-by: Harry Wentland --- Documentation/gpu/drm-kms-helpers.rst| 3

[PATCH v7 0/4] drm: Minimum backlight overrides and implementation for amdgpu

2024-11-12 Thread Thomas Weißschuh
tte panel - Link to v1: https://lore.kernel.org/r/20240610-amdgpu-min-backlight-quirk-v1-1-8459895a5...@weissschuh.net --- Dustin L. Howett (1): drm: panel-backlight-quirks: Add Framework 13 glossy and 2.8k panels Thomas Weißschuh (3): drm: Add panel backlight quirks drm/am

[PATCH v7 2/4] drm/amd/display: Add support for minimum backlight quirk

2024-11-12 Thread Thomas Weißschuh
uot; sysfs file has not shown any negative impact. One quirk seems to be that 0% at panel_power_savings=0 seems to be slightly darker than at panel_power_savings=4. Signed-off-by: Thomas Weißschuh Tested-by: Dustin L. Howett Reviewed-by: Mario Limonciello Reviewed-by: Harry Wentland --- drive

[PATCH v7 3/4] drm: panel-backlight-quirks: Add Framework 13 matte panel

2024-11-12 Thread Thomas Weißschuh
isible. Tested on a Framework AMD 13 BIOS 3.05 with the matte panel. Link: https://community.frame.work/t/25711/9 Link: https://community.frame.work/t/47036 Signed-off-by: Thomas Weißschuh Tested-by: Dustin L. Howett Reviewed-by: Mario Limonciello Reviewed-by: Harry Wentland --- drivers/gpu/dr

[PATCH v7 4/4] drm: panel-backlight-quirks: Add Framework 13 glossy and 2.8k panels

2024-11-12 Thread Thomas Weißschuh
From: "Dustin L. Howett" I have tested these panels on the Framework Laptop 13 AMD with firmware revision 3.05 (latest at time of submission). Signed-off-by: Dustin L. Howett Signed-off-by: Thomas Weißschuh Reviewed-by: Mario Limonciello Reviewed-by: Harry Wentland --- drive

[PATCH v2 2/7] drm/amd/display: Remove EDID members of ddc_service

2024-11-13 Thread Thomas Weißschuh
All usages of these fields have been removed. Fixes: 7c7f5b15be65 ("drm/amd/display: Refactor edid read.") Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/display/dc/dc_ddc_types.h | 4 1 file changed, 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dc_ddc_

[PATCH v2 5/7] drm/amd/display: Switch dc_sink to struct drm_edid

2024-11-13 Thread Thomas Weißschuh
The custom "struct dc_edid" can be replaced by the standard "struct drm_edid. Rename the member to make sure that no usage sites are missed, as "struct drm_edid" has some restrictions, for example it can not be used with kfree(). Signed-off-by: Thomas Weißschuh --- dr

[PATCH v2 3/7] drm/amd/display: Use struct edid in dc_link_add_remote_sink()

2024-11-13 Thread Thomas Weißschuh
The callers of dc_link_add_remote_sink() are using 'struct edid' which they all need to cast to uint8_t *. Allow the direct passing of 'struct edid' to avoid these cast and also move the length calculation so it does not need to be duplicated everywhere. Signed-off-

[PATCH v2 7/7] drm/amd/display: Switch dc_link_add_remote_sink() to struct drm_edid

2024-11-13 Thread Thomas Weißschuh
"struct drm_edid" is the safe and recommended alternative to "struct edid". Now that all callers of dc_link_add_remote_sink() have access to a validate struct drm_edid, pass it around directly. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgp

[PATCH v2 4/7] drm/amdgpu: Switch amdgpu_connector to struct drm_edid

2024-11-13 Thread Thomas Weißschuh
"struct drm_edid" is the safe and recommended alternative to "struct edid". Rename the member to make sure that no usage sites are missed, as "struct drm_edid" has some restrictions, for example it can not be used with kfree(). Signed-off-by: Thomas Weißschuh -

[PATCH v3] drm/radeon: Switch radeon_connector to struct drm_edid

2024-11-13 Thread Thomas Weißschuh
"struct drm_edid" is the safe and recommended alternative to "struct edid". Rename the member to make sure that no usage sites are missed, as "struct drm_edid" has some restrictions, for example it can not be used with kfree(). Signed-off-by: Thomas Weißschuh --

[PATCH v2 1/7] drm/amd/display: Remove spurious declaration of dm_helpers_get_sbios_edid()

2024-11-13 Thread Thomas Weißschuh
The prototype is the whole content of commit 575d0df6dae4 ("drm/amd/display: refine the EDID override"). Apparently the definition was never added. Fixes: 575d0df6dae4 ("drm/amd/display: refine the EDID override") Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/dis

[PATCH v2 6/7] drm/amd/display: Drop opencoded edid panel id extraction

2024-11-13 Thread Thomas Weißschuh
Now that a struct drm_edid is available make use of the standard drm_edid_get_panel_id(). Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/amd/display

[PATCH v2 0/7] drm/amd: Switch over to struct drm_edid

2024-11-13 Thread Thomas Weißschuh
. Patches 1 and 2 delete some dead code. The remaining patches perform the actual conversion in steps. If some patches are already acceptable as they are, I'd be happy for those to be picked up from the series. Signed-off-by: Thomas Weißschuh --- Changes in v2: - Remove a wrong kfree(struc

Re: [PATCH v6 0/4] drm: Minimum backlight overrides and implementation for amdgpu

2024-09-17 Thread Thomas Weißschuh
Hi Harry, Leo and other amdgpu maintainers, On 2024-08-24 20:33:53+, Thomas Weißschuh wrote: > The value of "min_input_signal" returned from ATIF on a Framework AMD 13 > is "12". This leads to a fairly bright minimum display backlight. > > Introduce a quirk t

Re: [PATCH 0/5] drm: Constify 'struct bin_attribute'

2025-02-10 Thread Thomas Weißschuh
Hi, On 2024-12-16 12:34:46+0100, Thomas Weißschuh wrote: > The sysfs core now allows instances of 'struct bin_attribute' to be > moved into read-only memory. Make use of that to protect them against > accidental or malicious modifications. Can anybody pick up these patches? E

[PATCH 5/5] drm/amd/display: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 8 --

[PATCH 3/5] drm/i915: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/i915/i915_gpu_error.c | 8 drivers/gp

[PATCH 1/5] drm/sysfs: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/drm_sysfs.c | 10 +- 1 file changed, 5 insert

[PATCH 2/5] drm/lima: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/lima/lima_drv.c | 8 1 file changed, 4 insert

[PATCH 4/5] drm/amdgpu: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 +++--- drivers/gpu/drm/

[PATCH 0/5] drm: Constify 'struct bin_attribute'

2024-12-16 Thread Thomas Weißschuh
The sysfs core now allows instances of 'struct bin_attribute' to be moved into read-only memory. Make use of that to protect them against accidental or malicious modifications. Signed-off-by: Thomas Weißschuh --- Thomas Weißschuh (5): drm/sysfs: Constify 'struct bin_attri

Re: [PATCH v2 09/10] sysfs: bin_attribute: add const read/write callback variants

2024-12-03 Thread Thomas Weißschuh
On 2024-12-03 11:06:16-0500, James Bottomley wrote: > > diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h > > index > > d17c473c1ef292875475bf3bdf62d07241c13882..d713a6445a6267145a7014f308d > > f3bb25b8c3287 100644 > > --- a/include/linux/sysfs.h > > +++ b/include/linux/sysfs.h > > @@ -305