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] [day] [month] [year] [list]
Message-ID: <CACO55tt0skPqe2YNrq3qnMvsUa1cT2db2zt718yF4S4hLnqC0Q@mail.gmail.com>
Date:   Wed, 9 Nov 2022 18:08:59 +0100
From:   Karol Herbst <kherbst@...hat.com>
To:     Antonio Gomes <antoniospg100@...il.com>
Cc:     linux-kernel@...r.kernel.org, Ben Skeggs <bskeggs@...hat.com>,
        Lyude Paul <lyude@...hat.com>, David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        dri-devel@...ts.freedesktop.org, nouveau@...ts.freedesktop.org
Subject: Re: [PATCH v3] drm/nouveau: Add support to control backlight using
 bl_power for nva3.

On Fri, Nov 4, 2022 at 11:04 PM Antonio Gomes <antoniospg100@...il.com> wrote:
>
> From: antoniospg <antoniospg100@...il.com>
>
> Summary:
>
> * Add support to turn on/off backlight when changing values in bl_power
>   file. This is achieved by using function backlight_get_brightness()
>   in nva3_set_intensity to get current brightness.
>
> Test plan:
>
> * Turn off:
> echo 1 > /sys/class/backlight/nv_backlight/bl_power
>
> * Turn on:
> echo 0 > /sys/class/backlight/nv_backlight/bl_power
>
> Signed-off-by: antoniospg <antoniospg100@...il.com>
> ---
>  drivers/gpu/drm/nouveau/nouveau_backlight.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
> index a2141d3d9b1d..5c82f5189b79 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
> @@ -263,7 +263,11 @@ nva3_set_intensity(struct backlight_device *bd)
>         u32 div, val;
>
>         div = nvif_rd32(device, NV50_PDISP_SOR_PWM_DIV(or));
> -       val = (bd->props.brightness * div) / 100;
> +
> +       val = backlight_get_brightness(bd);
> +       if (val)
> +               val = (val * div) / 100;
> +
>         if (div) {
>                 nvif_wr32(device, NV50_PDISP_SOR_PWM_CTL(or),
>                           val |
> --
> 2.25.1
>

Reviewed-by: Karol Herbst <kherbst@...hat.com>

btw, i'll fix up the name with the one from the Email From field, so
you won't have to send it out again.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ