diff mbox

drm/i915/bxt: set min brightness from VBT

Message ID 1505187390-7039-1-git-send-email-shawn.c.lee@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lee, Shawn C Sept. 12, 2017, 3:36 a.m. UTC
Min brightness value from vbt was missing for BXT platform.
This setting have to refer backlight ic spec to restrict
min backlight output. Without this restriction, driver would
allow to configure lower brightness value and violate
backlight ic requirement.

Fixes: 0fb890c01349 ("drm/i915/bxt: BLC implementation")
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Cooper Chiou <cooper.chiou@intel.com>
Cc: Gary C Wang <gary.c.wang@intel.com>
Signed-off-by: Shawn Lee <shawn.c.lee@intel.com>
---
 drivers/gpu/drm/i915/intel_panel.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jani Nikula Sept. 12, 2017, 9:36 a.m. UTC | #1
On Tue, 12 Sep 2017, "Lee, Shawn C" <shawn.c.lee@intel.com> wrote:
> Min brightness value from vbt was missing for BXT platform.
> This setting have to refer backlight ic spec to restrict
> min backlight output. Without this restriction, driver would
> allow to configure lower brightness value and violate
> backlight ic requirement.
>
> Fixes: 0fb890c01349 ("drm/i915/bxt: BLC implementation")
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Cooper Chiou <cooper.chiou@intel.com>
> Cc: Gary C Wang <gary.c.wang@intel.com>
> Signed-off-by: Shawn Lee <shawn.c.lee@intel.com>

Pushed to drm-intel-next-queued, thanks for the patch.

Care to send a similar patch for cnp_setup_backlight, please?

BR,
Jani.



> ---
>  drivers/gpu/drm/i915/intel_panel.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
> index a17b1de7d7e0..d4dd248ac9a8 100644
> --- a/drivers/gpu/drm/i915/intel_panel.c
> +++ b/drivers/gpu/drm/i915/intel_panel.c
> @@ -1699,6 +1699,8 @@ bxt_setup_backlight(struct intel_connector *connector, enum pipe unused)
>  	if (!panel->backlight.max)
>  		return -ENODEV;
>  
> +	panel->backlight.min = get_backlight_min_vbt(connector);
> +
>  	val = bxt_get_backlight(connector);
>  	val = intel_panel_compute_brightness(connector, val);
>  	panel->backlight.level = clamp(val, panel->backlight.min,
Lee, Shawn C Sept. 12, 2017, 9:42 a.m. UTC | #2
No problem! I will commit a patch for CNP later.

On Tue, 12 Sep 2017, "Lee, Shawn C" <shawn.c.lee@intel.com> wrote:
> Min brightness value from vbt was missing for BXT platform.
> This setting have to refer backlight ic spec to restrict min backlight 
> output. Without this restriction, driver would allow to configure 
> lower brightness value and violate backlight ic requirement.
>
> Fixes: 0fb890c01349 ("drm/i915/bxt: BLC implementation")
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Cooper Chiou <cooper.chiou@intel.com>
> Cc: Gary C Wang <gary.c.wang@intel.com>
> Signed-off-by: Shawn Lee <shawn.c.lee@intel.com>

Pushed to drm-intel-next-queued, thanks for the patch.

Care to send a similar patch for cnp_setup_backlight, please?

BR,
Jani.



> ---
>  drivers/gpu/drm/i915/intel_panel.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_panel.c 
> b/drivers/gpu/drm/i915/intel_panel.c
> index a17b1de7d7e0..d4dd248ac9a8 100644
> --- a/drivers/gpu/drm/i915/intel_panel.c
> +++ b/drivers/gpu/drm/i915/intel_panel.c
> @@ -1699,6 +1699,8 @@ bxt_setup_backlight(struct intel_connector *connector, enum pipe unused)
>  	if (!panel->backlight.max)
>  		return -ENODEV;
>  
> +	panel->backlight.min = get_backlight_min_vbt(connector);
> +
>  	val = bxt_get_backlight(connector);
>  	val = intel_panel_compute_brightness(connector, val);
>  	panel->backlight.level = clamp(val, panel->backlight.min,

--
Jani Nikula, Intel Open Source Technology Center
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index a17b1de7d7e0..d4dd248ac9a8 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -1699,6 +1699,8 @@  bxt_setup_backlight(struct intel_connector *connector, enum pipe unused)
 	if (!panel->backlight.max)
 		return -ENODEV;
 
+	panel->backlight.min = get_backlight_min_vbt(connector);
+
 	val = bxt_get_backlight(connector);
 	val = intel_panel_compute_brightness(connector, val);
 	panel->backlight.level = clamp(val, panel->backlight.min,