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: <e919ffdd-c94f-d808-5a89-afdcafd9a5d2@tronnes.org>
Date:   Tue, 16 Jan 2018 18:11:13 +0100
From:   Noralf Trønnes <noralf@...nnes.org>
To:     Meghana Madhyastha <meghana.madhyastha@...il.com>,
        Lee Jones <lee.jones@...aro.org>,
        Daniel Thompson <daniel.thompson@...aro.org>,
        Jingoo Han <jingoohan1@...il.com>,
        Thierry Reding <thierry.reding@...il.com>,
        Tomi Valkeinen <tomi.valkeinen@...com>,
        Daniel Vetter <daniel.vetter@...el.com>,
        Sean Paul <seanpaul@...omium.org>,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v16 07/10] drm/panel: Use backlight_enable/disable helpers


Den 16.01.2018 11.35, skrev Meghana Madhyastha:
> Use backlight_enable/disable helpers instead of changing
> the property and calling backlight_update_status for cleaner
> and simpler code and also to avoid repetitions.
>
> Signed-off-by: Meghana Madhyastha <meghana.madhyastha@...il.com>
> ---
>   drivers/gpu/drm/panel/panel-innolux-p079zca.c   |  6 ++----
>   drivers/gpu/drm/panel/panel-jdi-lt070me05000.c  |  6 ++----
>   drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c | 12 ++++--------
>   drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c | 12 ++++--------
>   4 files changed, 12 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-innolux-p079zca.c b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> index 6ba93449f..4c1b29eec 100644
> --- a/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> +++ b/drivers/gpu/drm/panel/panel-innolux-p079zca.c
> @@ -45,8 +45,7 @@ static int innolux_panel_disable(struct drm_panel *panel)
>   	if (!innolux->enabled)
>   		return 0;
>   
> -	innolux->backlight->props.power = FB_BLANK_POWERDOWN;
> -	backlight_update_status(innolux->backlight);
> +	backlight_disable(innolux->backlight);
>   
>   	err = mipi_dsi_dcs_set_display_off(innolux->link);
>   	if (err < 0)
> @@ -151,8 +150,7 @@ static int innolux_panel_enable(struct drm_panel *panel)
>   	if (innolux->enabled)
>   		return 0;
>   
> -	innolux->backlight->props.power = FB_BLANK_UNBLANK;
> -	ret = backlight_update_status(innolux->backlight);
> +	ret = backlight_enable(innolux->backlight);
>   	if (ret) {
>   		DRM_DEV_ERROR(panel->drm->dev,
>   			      "Failed to enable backlight %d\n", ret);
> diff --git a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
> index 5b2340ef7..0a94ab79a 100644
> --- a/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
> +++ b/drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
> @@ -192,8 +192,7 @@ static int jdi_panel_disable(struct drm_panel *panel)
>   	if (!jdi->enabled)
>   		return 0;
>   
> -	jdi->backlight->props.power = FB_BLANK_POWERDOWN;
> -	backlight_update_status(jdi->backlight);
> +	backlight_disable(jdi->backlight);
>   
>   	jdi->enabled = false;
>   
> @@ -289,8 +288,7 @@ static int jdi_panel_enable(struct drm_panel *panel)
>   	if (jdi->enabled)
>   		return 0;
>   
> -	jdi->backlight->props.power = FB_BLANK_UNBLANK;
> -	backlight_update_status(jdi->backlight);
> +	backlight_enable(jdi->backlight);
>   
>   	jdi->enabled = true;
>   
> diff --git a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c
> index 3cce3ca19..1512ec4f3 100644
> --- a/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c
> +++ b/drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c
> @@ -96,10 +96,8 @@ static int sharp_panel_disable(struct drm_panel *panel)
>   	if (!sharp->enabled)
>   		return 0;
>   
> -	if (sharp->backlight) {
> -		sharp->backlight->props.power = FB_BLANK_POWERDOWN;
> -		backlight_update_status(sharp->backlight);
> -	}
> +	if (sharp->backlight)

No need for a NULL check, backlight_enable/disable() already does that.
The same goes for the rest of the patch.

Noralf.

> +		backlight_disable(sharp->backlight);
>   
>   	sharp->enabled = false;
>   
> @@ -263,10 +261,8 @@ static int sharp_panel_enable(struct drm_panel *panel)
>   	if (sharp->enabled)
>   		return 0;
>   
> -	if (sharp->backlight) {
> -		sharp->backlight->props.power = FB_BLANK_UNBLANK;
> -		backlight_update_status(sharp->backlight);
> -	}
> +	if (sharp->backlight)
> +		backlight_enable(sharp->backlight);
>   
>   	sharp->enabled = true;
>   
> diff --git a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
> index 3aeb0bda4..a6af3257f 100644
> --- a/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
> +++ b/drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c
> @@ -117,10 +117,8 @@ static int sharp_nt_panel_disable(struct drm_panel *panel)
>   	if (!sharp_nt->enabled)
>   		return 0;
>   
> -	if (sharp_nt->backlight) {
> -		sharp_nt->backlight->props.power = FB_BLANK_POWERDOWN;
> -		backlight_update_status(sharp_nt->backlight);
> -	}
> +	if (sharp_nt->backlight)
> +		backlight_disable(sharp_nt->backlight);
>   
>   	sharp_nt->enabled = false;
>   
> @@ -203,10 +201,8 @@ static int sharp_nt_panel_enable(struct drm_panel *panel)
>   	if (sharp_nt->enabled)
>   		return 0;
>   
> -	if (sharp_nt->backlight) {
> -		sharp_nt->backlight->props.power = FB_BLANK_UNBLANK;
> -		backlight_update_status(sharp_nt->backlight);
> -	}
> +	if (sharp_nt->backlight)
> +		backlight_enable(sharp_nt->backlight);
>   
>   	sharp_nt->enabled = true;
>   

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ