mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
The Lenovo Legion 5 15ARH05 (Renoir) ships a BOE 0x08DF eDP panel that
advertises AUX/DPCD backlight control, so amdgpu's automatic detection
(amdgpu_backlight == -1) selects AUX. On this panel the AUX backlight
path has no effect: brightness writes are accepted but the panel level
never changes, the display is stuck at a fixed brightness and
max_brightness is reported as a bogus 511000. As a result neither the
desktop brightness slider nor the brightness hotkeys do anything.
Forcing PWM backlight (amdgpu.backlight=0) restores working control:
max_brightness becomes 65535 and the level tracks writes. This has long
been applied by users as a manual kernel-parameter workaround.
Extend the generic panel backlight quirk with a force_pwm flag, add an
entry for the Legion 5 15ARH05 / BOE 0x08DF panel, and have amdgpu
disable AUX backlight (use PWM) when the quirk matches and the user
lets the driver auto-select the backlight type.
Signed-off-by: Alessandro Rinaldi <ale@alerinaldi.it>
Tested-by: Alessandro Rinaldi <ale@alerinaldi.it>
Reviewed-by: George Zhang <george.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 81b39f43e7)
Cc: stable@vger.kernel.org
31 lines
723 B
C
31 lines
723 B
C
/* SPDX-License-Identifier: MIT */
|
|
/*
|
|
* Function prototypes for misc. drm utility functions.
|
|
* Specifically this file is for function prototypes for functions which
|
|
* may also be used outside of drm code (e.g. in fbdev drivers).
|
|
*
|
|
* Copyright (C) 2017 Hans de Goede <hdegoede@redhat.com>
|
|
*/
|
|
|
|
#ifndef __DRM_UTILS_H__
|
|
#define __DRM_UTILS_H__
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct drm_edid;
|
|
|
|
int drm_get_panel_orientation_quirk(int width, int height);
|
|
|
|
struct drm_panel_backlight_quirk {
|
|
u16 min_brightness;
|
|
u32 brightness_mask;
|
|
bool force_pwm;
|
|
};
|
|
|
|
const struct drm_panel_backlight_quirk *
|
|
drm_get_panel_backlight_quirk(const struct drm_edid *edid);
|
|
|
|
signed long drm_timeout_abs_to_jiffies(int64_t timeout_nsec);
|
|
|
|
#endif
|