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: <160f5f63-6e80-a98c-c2c4-5e5e03e574da@connolly.tech>
Date:   Sat, 14 Jan 2023 01:30:33 +0000
From:   Caleb Connolly <caleb@...nolly.tech>
To:     Richard Acayan <mailingradian@...il.com>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Maxime Ripard <mripard@...nel.org>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        David Airlie <airlied@...il.com>,
        Daniel Vetter <daniel@...ll.ch>,
        Thierry Reding <thierry.reding@...il.com>,
        Sam Ravnborg <sam@...nborg.org>,
        Emil Velikov <emil.l.velikov@...il.com>,
        Vinay Simha BN <simhavcs@...il.com>,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Cc:     Daniel Mentz <danielmentz@...gle.com>
Subject: Re: [RFC PATCH v2 2/2] drm/panel: sofef00: Use 16-bit panel brightness



On 14/01/2023 01:00, Richard Acayan wrote:
> These panels communicate brightness in big endian. This is not a quirk
> of the panels themselves, but rather, a part of the MIPI standard. Use
> the new mipi_dsi_dcs_set_display_brightness_wide() function that
> properly handles 16-bit brightness instead of doing special processing
> of the brightness values.
>
> Signed-off-by: Richard Acayan <mailingradian@...il.com>

Awesome! Thanks for this series, glad to know this isn't a weird panel
quirk aha.

This works fine on the OnePlus 6 (the user of this panel), so for both
patches:

Tested-by: Caleb Connolly <caleb@...nolly.tech>
> ---
>  drivers/gpu/drm/panel/panel-samsung-sofef00.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-samsung-sofef00.c b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
> index 1a0d24595faa..014fe350bc59 100644
> --- a/drivers/gpu/drm/panel/panel-samsung-sofef00.c
> +++ b/drivers/gpu/drm/panel/panel-samsung-sofef00.c
> @@ -10,7 +10,6 @@
>  #include <linux/of.h>
>  #include <linux/of_device.h>
>  #include <linux/regulator/consumer.h>
> -#include <linux/swab.h>
>  #include <linux/backlight.h>
>
>  #include <video/mipi_display.h>
> @@ -221,13 +220,9 @@ static int sofef00_panel_bl_update_status(struct backlight_device *bl)
>  {
>  	struct mipi_dsi_device *dsi = bl_get_data(bl);
>  	int err;
> -	u16 brightness;
> +	u16 brightness = (u16)backlight_get_brightness(bl);
>
> -	brightness = (u16)backlight_get_brightness(bl);
> -	// This panel needs the high and low bytes swapped for the brightness value
> -	brightness = __swab16(brightness);
> -
> -	err = mipi_dsi_dcs_set_display_brightness(dsi, brightness);
> +	err = mipi_dsi_dcs_set_display_brightness_large(dsi, brightness);
>  	if (err < 0)
>  		return err;
>
> --
> 2.39.0
>

--
Kind Regards,
Caleb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ