Re: [PATCH v2] drm/panic: Add a u64 divide by 10 for arm32

2025-08-01 Thread Thomas Weißschuh
On Fri, Jun 27, 2025 at 02:38:19PM +0200, Jocelyn Falempe wrote: > On 32bits ARM, u64 divided by a constant is not optimized to a > multiply by inverse by the compiler [1]. > So do the multiply by inverse explicitly for this architecture. > > Link: https://github.com/llvm/llvm-project/issues/37280

[PATCH v2] drm/msm: Don't use %pK through printk

2025-07-18 Thread Thomas Weißschuh
t to be used through printk(). They can still unintentionally leak raw pointers or acquire sleeping locks in atomic contexts. Switch to the regular pointer formatting which is safer and easier to reason about. Signed-off-by: Thomas Weißschuh --- Changes in v2: - Drop already applied patches

[PATCH 3/3] drm/msm: Don't use %pK through printk

2025-06-18 Thread Thomas Weißschuh
t to be used through printk(). They can still unintentionally leak raw pointers or acquire sleeping locks in atomic contexts. Switch to the regular pointer formatting which is safer and easier to reason about. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c| 2 +-

[PATCH 0/3] drm: Don't use %pK through printk

2025-06-18 Thread Thomas Weißschuh
is safe. Signed-off-by: Thomas Weißschuh --- Thomas Weißschuh (3): drm/bridge: samsung-dsim: Don't use %pK through printk drm/exynos: Don't use %pK through printk drm/msm: Don't use %pK through printk drivers/gpu/drm/bridge/samsung-dsim.c | 4 ++-- driv

[PATCH 1/3] drm/bridge: samsung-dsim: Don't use %pK through printk

2025-06-18 Thread Thomas Weißschuh
t to be used through printk(). They can still unintentionally leak raw pointers or acquire sleeping locks in atomic contexts. Switch to the regular pointer formatting which is safer and easier to reason about. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/bridge/samsung-dsim.c | 4 ++-

[PATCH 2/3] drm/exynos: Don't use %pK through printk

2025-06-18 Thread Thomas Weißschuh
t to be used through printk(). They can still unintentionally leak raw pointers or acquire sleeping locks in atomic contexts. Switch to the regular pointer formatting which is safer and easier to reason about. Signed-off-by: Thomas Weißschuh --- drivers/gpu/drm/exynos/exynos_drm_gem.c | 2 +- dr

Re: [PATCH 1/2] fbcon: Register sysfs groups through device_add_group

2025-03-12 Thread Thomas Weißschuh
Hi, On Tue, Mar 11, 2025 at 07:28:55PM +0800, oushixiong1...@163.com wrote: > From: Shixiong Ou > > Use device_add_group() to simplify creation and removal. > > Signed-off-by: Shixiong Ou > --- > drivers/video/fbdev/core/fbcon.c | 48 +++- > 1 file changed, 22 inse

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

Re: [PATCH AUTOSEL 6.12 02/31] drm: Add panel backlight quirks

2025-01-26 Thread Thomas Weißschuh
Hi Sasha, On 2025-01-26 09:54:18-0500, Sasha Levin wrote: > From: Thomas Weißschuh > > [ Upstream commit 22e5c7ae12145af13785e3ff138395d5b1a22116 ] > > Panels using a PWM-controlled backlight source do not have a standard > way to communicate their valid PWM ranges. >

[PATCH] accel/habanalabs: 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/accel/habanalabs/common/sysfs.c | 10 +- 1 file

[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

[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 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 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] fbdev/udlfb: Remove world-writability from EDID attribute

2024-12-15 Thread Thomas Weißschuh
It should not be possible for every user to override the EDID. Limit it to the system administrator. Fixes: 8ef8cc4fca4a ("staging: udlfb: support for writing backup EDID to sysfs file") Cc: sta...@vger.kernel.org Signed-off-by: Thomas Weißschuh --- The EDID passed through sysfs is on

[PATCH] fbdev/radeon: Use const 'struct bin_attribute' callbacks

2024-12-15 Thread Thomas Weißschuh
The sysfs core now provides callback variants that explicitly take a const pointer. Make use of it to match the attribute definitions. Signed-off-by: Thomas Weißschuh --- drivers/video/fbdev/aty/radeon_base.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH] fbdev/udlfb: Use const 'struct bin_attribute' callback

2024-12-15 Thread Thomas Weißschuh
The sysfs core now provides callback variants that explicitly take a const pointer. Make use of it to match the attribute definition. Signed-off-by: Thomas Weißschuh --- drivers/video/fbdev/udlfb.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev

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

Re: [PATCH v2 00/32] driver core: Constify API device_find_child() and adapt for various existing usages

2024-12-03 Thread Thomas Weißschuh
On 2024-12-03 08:58:26-0500, James Bottomley wrote: > On Tue, 2024-12-03 at 21:02 +0800, Zijun Hu wrote: > > On 2024/12/3 20:41, Greg Kroah-Hartman wrote: > > > On Tue, Dec 03, 2024 at 08:23:45PM +0800, Zijun Hu wrote: > [...] > > > > or squash such patch series into a single patch ? > > > > > > >

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

2024-11-12 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 6/7] drm/amd/display: Drop opencoded edid panel id extraction

2024-11-12 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 3/7] drm/amd/display: Use struct edid in dc_link_add_remote_sink()

2024-11-12 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 v3] drm/radeon: Switch radeon_connector to struct drm_edid

2024-11-12 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 0/7] drm/amd: Switch over to struct drm_edid

2024-11-12 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

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

2024-11-12 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 7/7] drm/amd/display: Switch dc_link_add_remote_sink() to struct drm_edid

2024-11-12 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 2/7] drm/amd/display: Remove EDID members of ddc_service

2024-11-12 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 1/7] drm/amd/display: Remove spurious declaration of dm_helpers_get_sbios_edid()

2024-11-12 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 v7 2/4] drm/amd/display: Add support for minimum backlight quirk

2024-11-11 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 4/4] drm: panel-backlight-quirks: Add Framework 13 glossy and 2.8k panels

2024-11-11 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 v7 1/4] drm: Add panel backlight quirks

2024-11-11 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 3/4] drm: panel-backlight-quirks: Add Framework 13 matte panel

2024-11-11 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 0/4] drm: Minimum backlight overrides and implementation for amdgpu

2024-11-11 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 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 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 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 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 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 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 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 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 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 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 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

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

2024-10-09 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. >

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

2024-09-16 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] fbdev: Introduce devm_register_framebuffer()

2024-08-30 Thread Thomas Weißschuh
On 2024-08-30 12:16:46+, Helge Deller wrote: > On 8/30/24 11:45, Thomas Weißschuh wrote: > > Introduce a device-managed variant of register_framebuffer() which > > automatically unregisters the framebuffer on device destruction. > > This can simplify the error handling an

[PATCH] fbdev: Introduce devm_register_framebuffer()

2024-08-30 Thread Thomas Weißschuh
Introduce a device-managed variant of register_framebuffer() which automatically unregisters the framebuffer on device destruction. This can simplify the error handling and resource management in drivers. Signed-off-by: Thomas Weißschuh --- This is a fixed resend of [0], which was broken. Thanks

Re: [PATCH 3/5] fbdev: Introduce devm_register_framebuffer()

2024-08-30 Thread Thomas Weißschuh
Hi everybody, On 2024-08-27 17:25:14+, Thomas Weißschuh wrote: > Introduce a device-managed variant of register_framebuffer() which > automatically unregisters the framebuffer on device destruction. > This can simplify the error handling and resource management in drivers. Bert repo

Re: [PATCH 1/5] fbdev/efifb: Use stack memory for screeninfo structs

2024-08-29 Thread Thomas Weißschuh
On 2024-08-28 19:42:51+, Helge Deller wrote: > On 8/27/24 17:25, Thomas Weißschuh wrote: > > These variables are only used inside efifb_probe(). > > Afterwards they are using memory unnecessarily. > > Did you check if this change really saves some memory? Nope... &g

[PATCH 2/5] fbdev/efifb: Register sysfs groups through driver core

2024-08-27 Thread Thomas Weißschuh
The driver core can register and cleanup sysfs groups already. Make use of that functionality to simplify the error handling and cleanup. Also avoid a UAF race during unregistering where the sysctl attributes were usable after the info struct was freed. Signed-off-by: Thomas Weißschuh

[PATCH 5/5] fbdev/efifb: Use driver-private screen_info for sysfs

2024-08-27 Thread Thomas Weißschuh
Since commit b9cfd1d271ab ("fbdev/efifb: Use screen_info pointer from device") efifb uses a local copy of screen_info and applies its modifications there. Adapt the sysfs attributes to also work with the custom copy instead of the unmodified platform data. Signed-off-by: Thomas

[PATCH 1/5] fbdev/efifb: Use stack memory for screeninfo structs

2024-08-27 Thread Thomas Weißschuh
These variables are only used inside efifb_probe(). Afterwards they are using memory unnecessarily. Signed-off-by: Thomas Weißschuh --- drivers/video/fbdev/efifb.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/video/fbdev

[PATCH 3/5] fbdev: Introduce devm_register_framebuffer()

2024-08-27 Thread Thomas Weißschuh
Introduce a device-managed variant of register_framebuffer() which automatically unregisters the framebuffer on device destruction. This can simplify the error handling and resource management in drivers. Signed-off-by: Thomas Weißschuh --- drivers/video/fbdev/core/fbmem.c | 24

[PATCH 4/5] fbdev/efifb: Use devm_register_framebuffer()

2024-08-27 Thread Thomas Weißschuh
This simplifies the error handling. Also the drvdata slot is now unused and can be used for other usecases. Signed-off-by: Thomas Weißschuh --- drivers/video/fbdev/efifb.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/video/fbdev/efifb.c b/drivers

[PATCH 0/5] fbdev: devm_register_framebuffer() and some fixes for efifb

2024-08-27 Thread Thomas Weißschuh
Some random optimization and fixes I came up with while looking at efifb.c. I can't get the efifb driver to probe on my hardware, so this is only compile-tested. If somebody could actually test it, that would be great. Signed-off-by: Thomas Weißschuh --- Thomas Weißschuh (5): fbdev/

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

2024-08-24 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 3/4] drm: panel-backlight-quirks: Add Framework 13 matte panel

2024-08-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 Tested-by: Dustin L. Howett Reviewed-by: Mario Limonciello --- drivers/gpu/drm/drm_panel_backlight_quirks.

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

2024-08-24 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 4/4] drm: panel-backlight-quirks: Add Framework 13 glossy and 2.8k panels

2024-08-24 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 1/4] drm: Add panel backlight quirks

2024-08-24 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 v2] drm/radeon: Switch radeon_connector to struct drm_edid

2024-08-22 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 ---

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

2024-08-21 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 1/4] drm: Add panel backlight quirks

2024-08-21 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

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

2024-08-21 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 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] 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 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

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

2024-08-18 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 07/12] drm/amd/display: Use struct edid in dc_link_add_remote_sink()

2024-08-18 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 05/12] drm/amd/display: Constify raw_edid handling in dm_helpers_parse_edid_caps()

2024-08-18 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 11/12] drm/amd/display: Switch dc_sink to struct drm_edid

2024-08-18 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 04/12] drm/amd/display: Simplify raw_edid handling in dm_helpers_parse_edid_caps()

2024-08-18 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 08/12] drm/amdgpu: Switch amdgpu_connector to struct drm_edid

2024-08-18 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 03/12] drm/edid: constify argument of drm_edid_is_valid()

2024-08-18 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 06/12] drm/amd/display: Constify 'struct edid' in parsing functions

2024-08-18 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-18 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 09/12] drm/amd/display: Switch amdgpu_dm_connector to struct drm_edid

2024-08-18 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-18 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 01/12] drm/amd/display: remove spurious definition for dm_helpers_get_sbios_edid()

2024-08-18 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 02/12] drm/amd/display: Remove EDID members of ddc_service

2024-08-18 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 00/12] drm/amd: Switch over to struct drm_edid

2024-08-18 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 v5 1/4] drm: Add panel backlight quirks

2024-08-17 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 2/4] drm/amd/display: Add support for minimum backlight quirk

2024-08-17 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 v5 3/4] drm: panel-backlight-quirks: Add Framework 13 matte panel

2024-08-17 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 4/4] drm: panel-backlight-quirks: Add Framework 13 glossy and 2.8k panels

2024-08-17 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 v5 0/4] drm: Minimum backlight overrides and implementation for amdgpu

2024-08-17 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

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

2024-08-17 Thread Thomas Weißschuh
Hi Dustin, On 2024-08-17 14:23:42+, Dustin Howett wrote: > On Sat, Aug 17, 2024 at 1:59 PM Dustin L. Howett wrote: > > > > This patch depends on > > 20240812-amdgpu-min-backlight-quirk-v4-0-56a63ff89...@weissschuh.net > > > > I have tested these panels on the Framework Laptop 13 AMD with firm

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

2024-08-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 --- drivers/gpu/drm/drm_panel_backlight_quirks.c | 8 1 file changed, 8 insertions(+)

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

2024-08-12 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 v4 3/3] drm/amd/display: Add support for minimum backlight quirk

2024-08-12 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 0/3] drm: Minimum backlight overrides and implementation for amdgpu

2024-08-12 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

Re: [PATCH v3 1/9] HID: hid-appletb-bl: add driver for the backlight of Apple Touch Bars

2024-08-10 Thread Thomas Weißschuh
On 2024-08-10 15:30:58+, Aditya Garg wrote: > > > > > Also include linux/device.h as you are using functions from there. > > Like devm_kcalloc(). > > Alright, I’ll add that > > > >>> > +#include > +#include > + > +#include "hid-ids.h" > + > +#define APPLETB_

Re: [PATCH v3 1/9] HID: hid-appletb-bl: add driver for the backlight of Apple Touch Bars

2024-08-10 Thread Thomas Weißschuh
On 2024-08-10 13:23:30+, Aditya Garg wrote: > Hi Thomas > > >> diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile > >> index e40f1ddeb..1d825a474 100644 > >> --- a/drivers/hid/Makefile > >> +++ b/drivers/hid/Makefile > >> @@ -29,6 +29,7 @@ obj-$(CONFIG_HID_ALPS) += hid-alps.o > >> obj-$(

Re: [PATCH v3 1/9] HID: hid-appletb-bl: add driver for the backlight of Apple Touch Bars

2024-08-10 Thread Thomas Weißschuh
On 2024-08-08 13:50:33+, Aditya Garg wrote: > From: Kerem Karabay > > This commit adds a driver for the backlight of Apple Touch Bars on x86 > Macs. Note that currently only T2 Macs are supported. > > This driver is based on previous work done by Ronald Tschalär > . > > Signed-off-by: Kerem

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

2024-08-02 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 v3 0/2] drm: minimum backlight overrides and implementation for amdgpu

2024-07-31 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-07-31 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

  1   2   >