lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2975957e-51a9-fc44-9157-f3c4dba3cd0a@amd.com>
Date:   Mon, 27 Feb 2023 08:20:15 -0600
From:   Mario Limonciello <mario.limonciello@....com>
To:     Yuanzhi Wang <wangyuanzhi@...ontech.com>,
        alexander.deucher@....com, christian.koenig@....com,
        Xinhui.Pan@....com, airlied@...il.com, daniel@...ll.ch,
        Bokun.Zhang@....com, tzimmermann@...e.de, hdegoede@...hat.com,
        jingyuwang_vip@....com, rafael.j.wysocki@...el.com,
        amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] amdgpu: add a filter condition when set brightness

On 2/27/23 01:39, Yuanzhi Wang wrote:
> When the laptop is plugged into AC or DC power supply,
> the brightness obtained ACPI may be smaller than current
> brightness.As a result the screen becomes darkļ¼Œthis is
> not what people want.
> 

Do you have a matching bug report with more information included?

Some relevant details I think we need:
kernel version
laptop model
BIOS version
if it's the latest BIOS
some sample numbers that this new warning/behavior catches
acpidump

At least as described this sounds like a BIOS bug.

> Signed-off-by: Yuanzhi Wang <wangyuanzhi@...ontech.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> index d4196fcb85a0..93f1567028c5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> @@ -406,6 +406,7 @@ static int amdgpu_atif_handler(struct amdgpu_device *adev,
>   {
>   	struct amdgpu_atif *atif = &amdgpu_acpi_priv.atif;
>   	int count;
> +	int old_brightness;
>   
>   	DRM_DEBUG_DRIVER("event, device_class = %s, type = %#x\n",
>   			event->device_class, event->type);
> @@ -443,7 +444,13 @@ static int amdgpu_atif_handler(struct amdgpu_device *adev,
>   				 * hardwired to post BACKLIGHT_UPDATE_SYSFS.
>   				 * It probably should accept 'reason' parameter.
>   				 */
> -				backlight_device_set_brightness(atif->bd, req.backlight_level);
> +				old_brightness = backlight_get_brightness(atif->bd);
> +				if (old_brightness > req.backlight_level)
> +					DRM_WARN("old brightness %d is greater than ACPI brightness
> +						%d\n", old_brightness, req.backlight_level);
> +				else
> +					backlight_device_set_brightness(atif->bd,
> +						req.backlight_level);
>   			}
>   		}
>   

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ