[PATCH 12/13] drm/i915/backlight: Use drm helper to set edp backlight

2025-05-08 Thread Suraj Kandpal
Now that the drm helper sets the backlight using luminance too we can use that. Remove the obselete function. Signed-off-by: Suraj Kandpal --- .../drm/i915/display/intel_dp_aux_backlight.c | 34 ++- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/drivers/gpu/drm/i9

[PATCH 11/13] drm/i915/backlight: Use drm helper to initialize edp backlight

2025-05-08 Thread Suraj Kandpal
Now that drm_edp_backlight init has been to be able to setup brightness manipulation via luminance we can just use that. Signed-off-by: Suraj Kandpal --- .../drm/i915/display/intel_dp_aux_backlight.c | 100 +- 1 file changed, 49 insertions(+), 51 deletions(-) diff --git a/driver

[PATCH 13/13] drm/i915/backlight: Use drm_edp_backlight_enable

2025-05-08 Thread Suraj Kandpal
Use drm dp helper to enable backlight now that it has been modified to set PANEL_LUMINANCE_CONTROL_ENABLE bit based on if capability supports it and the driver wants it. Remove the dead code. Signed-off-by: Suraj Kandpal --- .../gpu/drm/i915/display/intel_dp_aux_backlight.c | 14 --

[PATCH 11/13] drm/i915/backlight: Use drm helper to initialize edp backlight

2025-04-13 Thread Suraj Kandpal
Now that drm_edp_backlight init has been to be able to setup brightness manipulation via luminance we can just use that. Signed-off-by: Suraj Kandpal --- .../drm/i915/display/intel_dp_aux_backlight.c | 100 +- 1 file changed, 49 insertions(+), 51 deletions(-) diff --git a/driver

[PATCH 12/13] drm/i915/backlight: Use drm helper to set edp backlight

2025-04-13 Thread Suraj Kandpal
Now that the drm helper sets the backlight using luminance too we can use that. Remove the obselete function. Signed-off-by: Suraj Kandpal --- .../drm/i915/display/intel_dp_aux_backlight.c | 34 ++- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/drivers/gpu/drm/i9

[PATCH 13/13] drm/i915/backlight: Use drm_edp_backlight_enable

2025-04-13 Thread Suraj Kandpal
Use drm dp helper to enable backlight now that it has been modified to set PANEL_LUMINANCE_CONTROL_ENABLE bit based on if capability supports it and the driver wants it. Remove the dead code. Signed-off-by: Suraj Kandpal --- .../gpu/drm/i915/display/intel_dp_aux_backlight.c | 14 --

[PATCH 2/2] drm/i915/backlight: Modify condition to use panel luminance

2025-04-10 Thread Suraj Kandpal
According to our internal spec we need to now check if both panel luminance and smooth brightness are available in panel for us to be able to change brightness using luminance value. --v2 -Add Fixes tag [Ankit] Fixes: 64481497924d ("drm/i915/backlight: Check Luminance based brightness co

[PATCH 12/13] drm/i915/backlight: Use drm helper to set edp backlight

2025-04-10 Thread Suraj Kandpal
Now that the drm helper sets the backlight using luminance too we can use that. Remove the obselete function. Signed-off-by: Suraj Kandpal --- .../drm/i915/display/intel_dp_aux_backlight.c | 34 ++- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/drivers/gpu/drm/i9

[PATCH 11/13] drm/i915/backlight: Use drm helper to initialize edp backlight

2025-04-10 Thread Suraj Kandpal
Now that drm_edp_backlight init has been to be able to setup brightness manipulation via luminance we can just use that. Signed-off-by: Suraj Kandpal --- .../drm/i915/display/intel_dp_aux_backlight.c | 100 +- 1 file changed, 49 insertions(+), 51 deletions(-) diff --git a/driver

[PATCH 13/13] drm/i915/backlight: Use drm_edp_backlight_enable

2025-04-10 Thread Suraj Kandpal
Use drm dp helper to enable backlight now that it has been modified to set PANEL_LUMINANCE_CONTROL_ENABLE bit based on if capability supports it and the driver wants it. Remove the dead code. Signed-off-by: Suraj Kandpal --- .../gpu/drm/i915/display/intel_dp_aux_backlight.c | 14 --

[PATCH 2/2] drm/i915/backlight: Modify condition to use panel luminance

2025-04-10 Thread Suraj Kandpal
According to our internal spec we need to now check if both panel luminance and smooth brightness are available in panel for us to be able to change brightness using luminance value. Signed-off-by: Suraj Kandpal --- drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 3 ++- 1 file changed, 2

Re: [PATCH 2/2] drm/i915/backlight: Modify condition to use panel luminance

2025-04-09 Thread Nautiyal, Ankit K
On 4/8/2025 10:31 AM, Suraj Kandpal wrote: According to our internal spec we need to now check if both panel luminance and smooth brightness are available in panel for us to be able to change brightness using luminance value. Since DP_EDP_SMOOTH_BRIGHTNESS_CAPABLE is introduced in eDP2.0 and

Re: [PATCH 2/2] drm/i915/backlight: Modify condition to use panel luminance

2025-04-09 Thread Nautiyal, Ankit K
On 4/10/2025 11:11 AM, Nautiyal, Ankit K wrote: On 4/8/2025 10:31 AM, Suraj Kandpal wrote: According to our internal spec we need to now check if both panel luminance and smooth brightness are available in panel for us to be able to change brightness using luminance value. Since DP_EDP_SMOO

Re: [PATCH 2/2] drm/i915/backlight: Modify condition to use panel luminance

2025-04-09 Thread Murthy, Arun R
On 08-04-2025 10:31, Suraj Kandpal wrote: According to our internal spec we need to now check if both panel luminance and smooth brightness are available in panel for us to be able to change brightness using luminance value. Signed-off-by: Suraj Kandpal --- Reviewed-by: Arun R Murthy Thanks

RE: [PATCH 4/8] drm/i915/backlight: Check Luminance based brightness control for VESA

2025-02-05 Thread Murthy, Arun R
> Check if we are capable of controlling brightness via luminance which is > dependent on PANEL_LUMINANCE_CONTROL_CAPABLE bit being set on > EDP_GENERAL_CAPABILITY_2 register. > > --v2 > -Prefer using luminance rather than nits [Jani] -Fix commit message > > --v3 > -Fix the bit name used in commi

RE: [PATCH 3/8] drm/i915/backlight: Use proper interface based on eDP version

2025-02-05 Thread Murthy, Arun R
> eDP is supposed to use VESA interface when using revision 1.5 and above, use > Intel interface for backlight control otherwise. Add check to use correct > interface. > > Signed-off-by: Suraj Kandpal > Tested-by: Ben Kao > --- Reviewed-by: Arun R Murthy Thanks and Regards, Arun R Murthy -

[PATCH 3/8] drm/i915/backlight: Use proper interface based on eDP version

2025-02-05 Thread Suraj Kandpal
eDP is supposed to use VESA interface when using revision 1.5 and above, use Intel interface for backlight control otherwise. Add check to use correct interface. Signed-off-by: Suraj Kandpal Tested-by: Ben Kao --- drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 8 +++- 1 file change

[PATCH 6/8] drm/i915/backlight: Add function to change brightness in nits for VESA

2025-02-05 Thread Suraj Kandpal
Create a function that fills in the value for PANEL_TARGET_LUMINANCE_VALUE which helps in changing the luminance in nits using VESA interface. --v2 -Prefer using luminance over nits [Jani] Signed-off-by: Suraj Kandpal Tested-by: Ben Kao Reviewed-by: Arun R Murthy --- .../drm/i915/display/inte

[PATCH 8/8] drm/i915/backlight: Enable nits based luminance

2025-02-05 Thread Suraj Kandpal
Enable nits based luminance by writing the PANEL_LUMINANCE_CONTROL bit and set the correct register to change brightness. Signed-off-by: Suraj Kandpal Tested-by: Ben Kao Reviewed-by: Arun R Murthy --- .../gpu/drm/i915/display/intel_dp_aux_backlight.c | 15 +++ 1 file changed, 15 in

[PATCH 4/8] drm/i915/backlight: Check Luminance based brightness control for VESA

2025-02-05 Thread Suraj Kandpal
Check if we are capable of controlling brightness via luminance which is dependent on PANEL_LUMINANCE_CONTROL_CAPABLE bit being set on EDP_GENERAL_CAPABILITY_2 register. --v2 -Prefer using luminance rather than nits [Jani] -Fix commit message --v3 -Fix the bit name used in commit message [Arun] -

[PATCH 5/8] drm/i915/backlight: Modify function to get VESA brightness in Nits

2025-02-05 Thread Suraj Kandpal
Modify vesa_get_brightness function to take into account luminance_control_support and based on that read the appropriate register and return the value. --v2 -Changes since we now use luminance instead of nits Signed-off-by: Suraj Kandpal Tested-by: Ben Kao Reviewed-by: Arun R Murthy --- .../

[PATCH 7/8] drm/i915/backlight: Setup nits based luminance via VESA

2025-02-05 Thread Suraj Kandpal
Modify backlight setup function for VESA interface to take into account the nits based luminance. --v2 -Prefer using luminance over nits [Jani] Signed-off-by: Suraj Kandpal Tested-by: Ben Kao Reviewed-by: Arun R Murthy --- .../drm/i915/display/intel_dp_aux_backlight.c | 99 +++

RE: [PATCH 7/7] drm/i915/backlight: Enable nits based luminance

2025-02-05 Thread Murthy, Arun R
> Enable nits based luminance by writing the PANEL_LUMINANCE_CONTROL bit > and set the correct register to change brightness. > > Signed-off-by: Suraj Kandpal > Tested-by: Ben Kao > --- Reviewed-by; Arun R Murthy Thanks and Regards, Arun R Murthy --- > .../gpu/drm/i915/display

RE: [PATCH 5/7] drm/i915/backlight: Add function to change brightness in nits for VESA

2025-02-05 Thread Murthy, Arun R
> > Create a function that fills in the value for > > PANEL_TARGET_LUMINANCE_VALUE which helps in changing the luminance > in nits using VESA interface. > > > > --v2 > > -Prefer using luminance over nits [Jani] > > > > Signed-off-by: Suraj Kandpal > > Tested-by: Ben Kao > > --- > Reviewed-by: Aru

RE: [PATCH 6/7] drm/i915/backlight: Setup nits based luminance via VESA

2025-02-05 Thread Murthy, Arun R
> Modify backlight setup function for VESA interface to take into account the > nits > based luminance. > > --v2 > -Prefer using luminance over nits [Jani] > > Signed-off-by: Suraj Kandpal > Tested-by: Ben Kao > --- Reviewed-by: Arun R Murthy Thanks and Regards, Arun R Murthy ---

RE: [PATCH 4/7] drm/i915/backlight: Modify function to get VESA brightness in Nits

2025-02-05 Thread Kandpal, Suraj
Subject: RE: [PATCH 4/7] drm/i915/backlight: Modify function to get VESA > brightness in Nits > > > Modify vesa_get_brightness function to take into account > > luminance_control_support and based on that read the appropriate > > register and return the value. > > >

RE: [PATCH 3/7] drm/i915/backlight: Check Luminance based brightness control for VESA

2025-02-05 Thread Kandpal, Suraj
Subject: RE: [PATCH 3/7] drm/i915/backlight: Check Luminance based > brightness control for VESA > > > Check if we are capable of controlling brightness via luminance which > > is dependent on PANEL_LUMINANCE_OVERRIDE being set. > > > Is PANEL_LUMINANCE_OVERRIDE a macro?

RE: [PATCH 4/7] drm/i915/backlight: Modify function to get VESA brightness in Nits

2025-02-05 Thread Murthy, Arun R
> Modify vesa_get_brightness function to take into account > luminance_control_support and based on that read the appropriate register > and return the value. > > --v2 > -Changes since we now use luminance instead of nits > > Signed-off-by: Suraj Kandpal > Tested-by: Ben Kao > --- > .../drm/i9

RE: [PATCH 5/7] drm/i915/backlight: Add function to change brightness in nits for VESA

2025-02-05 Thread Murthy, Arun R
> Create a function that fills in the value for PANEL_TARGET_LUMINANCE_VALUE > which helps in changing the luminance in nits using VESA interface. > > --v2 > -Prefer using luminance over nits [Jani] > > Signed-off-by: Suraj Kandpal > Tested-by: Ben Kao > --- Reviewed-by: Arun R Murthy Thanks

RE: [PATCH 3/7] drm/i915/backlight: Check Luminance based brightness control for VESA

2025-02-05 Thread Murthy, Arun R
> Check if we are capable of controlling brightness via luminance which is > dependent on PANEL_LUMINANCE_OVERRIDE being set. > Is PANEL_LUMINANCE_OVERRIDE a macro? I don't see this definition! > --v2 > -Prefer using luminance rather than nits [Jani] -Fix commit message > > Signed-off-by: Suraj

RE: [PATCH 2/7] drm/i915/backlight: Use proper interface based on eDP version

2025-02-05 Thread Murthy, Arun R
> eDP is supposed to use VESA interface when using revision 1.5 and above, use > Intel interface for backlight control otherwise. Add check to use correct > interface. > > Signed-off-by: Suraj Kandpal > Tested-by: Ben Kao > --- Reviewed-by: Arun R Murthy Thanks and Regards, Arun R Murthy -

[PATCH 5/7] drm/i915/backlight: Add function to change brightness in nits for VESA

2025-02-04 Thread Suraj Kandpal
Create a function that fills in the value for PANEL_TARGET_LUMINANCE_VALUE which helps in changing the luminance in nits using VESA interface. --v2 -Prefer using luminance over nits [Jani] Signed-off-by: Suraj Kandpal Tested-by: Ben Kao --- .../drm/i915/display/intel_dp_aux_backlight.c | 30 ++

[PATCH 4/7] drm/i915/backlight: Modify function to get VESA brightness in Nits

2025-02-04 Thread Suraj Kandpal
Modify vesa_get_brightness function to take into account luminance_control_support and based on that read the appropriate register and return the value. --v2 -Changes since we now use luminance instead of nits Signed-off-by: Suraj Kandpal Tested-by: Ben Kao --- .../drm/i915/display/intel_dp_au

[PATCH 7/7] drm/i915/backlight: Enable nits based luminance

2025-02-04 Thread Suraj Kandpal
Enable nits based luminance by writing the PANEL_LUMINANCE_CONTROL bit and set the correct register to change brightness. Signed-off-by: Suraj Kandpal Tested-by: Ben Kao --- .../gpu/drm/i915/display/intel_dp_aux_backlight.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/dr

[PATCH 6/7] drm/i915/backlight: Setup nits based luminance via VESA

2025-02-04 Thread Suraj Kandpal
Modify backlight setup function for VESA interface to take into account the nits based luminance. --v2 -Prefer using luminance over nits [Jani] Signed-off-by: Suraj Kandpal Tested-by: Ben Kao --- .../drm/i915/display/intel_dp_aux_backlight.c | 99 +++ 1 file changed, 59 inserti

[PATCH 3/7] drm/i915/backlight: Check Luminance based brightness control for VESA

2025-02-04 Thread Suraj Kandpal
Check if we are capable of controlling brightness via luminance which is dependent on PANEL_LUMINANCE_OVERRIDE being set. --v2 -Prefer using luminance rather than nits [Jani] -Fix commit message Signed-off-by: Suraj Kandpal Tested-by: Ben Kao --- drivers/gpu/drm/i915/display/intel_display_type

[PATCH 2/7] drm/i915/backlight: Use proper interface based on eDP version

2025-02-04 Thread Suraj Kandpal
eDP is supposed to use VESA interface when using revision 1.5 and above, use Intel interface for backlight control otherwise. Add check to use correct interface. Signed-off-by: Suraj Kandpal Tested-by: Ben Kao --- drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 8 +++- 1 file change

RE: [PATCH 3/7] drm/i915/backlight: Check Nits based brightness control for VESA

2025-02-04 Thread Kandpal, Suraj
l, Suraj > > Subject: Re: [PATCH 3/7] drm/i915/backlight: Check Nits based brightness > control for VESA > > On Fri, 24 Jan 2025, Suraj Kandpal wrote: > > Check if we are capable of controlling brightness via Nits which is > > dependant on PANEL_LUMINANCE_OVERRIDE

Re: [PATCH 5/7] drm/i915/backlight: Add function to change brightness in NITS for VESA

2025-02-04 Thread Jani Nikula
On Fri, 24 Jan 2025, Suraj Kandpal wrote: > Create a function that fills in the value for > PANEL_TARGET_LUMINANCE_VALUE which helps in changing the brightness in > NITS using VESA interface. > > Signed-off-by: Suraj Kandpal > --- > .../drm/i915/display/intel_dp_aux_backlight.c | 29

Re: [PATCH 3/7] drm/i915/backlight: Check Nits based brightness control for VESA

2025-02-04 Thread Jani Nikula
On Fri, 24 Jan 2025, Suraj Kandpal wrote: > Check if we are capable of controlling brightness via Nits which > is dependant on PANEL_LUMINANCE_OVERRIDE and SMOOTH_BRIGHTNESS > capablility being set. > > Signed-off-by: Suraj Kandpal > --- > drivers/gpu/drm/i915/display/intel_display_types.h|

Re: [PATCH v2] drm/i915/backlight: Return immediately when scale() finds invalid parameters

2025-02-03 Thread Rodrigo Vivi
On Sun, Feb 02, 2025 at 06:28:08AM -0800, Guenter Roeck wrote: > On 2/2/25 05:27, David Laight wrote: > > On Tue, 21 Jan 2025 15:15:09 -0800 > > Linus Torvalds wrote: > > > > > On Tue, 21 Jan 2025 at 14:59, Rodrigo Vivi wrote: > > > > > > > > I'm pushing this soon to drm-intel-next, unless Linu

RE: [PATCH 7/7] drm/i915/backlight: Enable Nits based brightness

2025-02-02 Thread Kao, Ben
This patch works as expected with 6.13.0-rc7 on Dell Bolan. Tested-by: Ben Kao

RE: [PATCH 6/7] drm/i915/backlight: Setup NITS based brightness via VESA

2025-02-02 Thread Kao, Ben
This patch works as expected with 6.13.0-rc7 on Dell Bolan. Tested-by: Ben Kao

RE: [PATCH 5/7] drm/i915/backlight: Add function to change brightness in NITS for VESA

2025-02-02 Thread Kao, Ben
This patch works as expected with 6.13.0-rc7 on Dell Bolan. Tested-by: Ben Kao

RE: [PATCH 4/7] drm/i915/backlight: Modify function to get VESA brightness in NITS

2025-02-02 Thread Kao, Ben
This patch works as expected with 6.13.0-rc7 on Dell Bolan. Tested-by: Ben Kao

RE: [PATCH 2/7] drm/i915/backlight: Use proper interface based on eDP version

2025-02-02 Thread Kao, Ben
This patch works as expected with 6.13.0-rc7 on Dell Bolan. Tested-by: Ben Kao

RE: [PATCH 3/7] drm/i915/backlight: Check Nits based brightness control for VESA

2025-02-02 Thread Kao, Ben
This patch works as expected with 6.13.0-rc7 on Dell Bolan. Tested-by: Ben Kao

Re: [PATCH v2] drm/i915/backlight: Return immediately when scale() finds invalid parameters

2025-02-02 Thread Guenter Roeck
On 2/2/25 05:27, David Laight wrote: On Tue, 21 Jan 2025 15:15:09 -0800 Linus Torvalds wrote: On Tue, 21 Jan 2025 at 14:59, Rodrigo Vivi wrote: I'm pushing this soon to drm-intel-next, unless Linus want to take this one directly to his tree Let's just go through the proper channels and go

Re: [PATCH v2] drm/i915/backlight: Return immediately when scale() finds invalid parameters

2025-02-02 Thread David Laight
On Tue, 21 Jan 2025 15:15:09 -0800 Linus Torvalds wrote: > On Tue, 21 Jan 2025 at 14:59, Rodrigo Vivi wrote: > > > > I'm pushing this soon to drm-intel-next, unless Linus want to take > > this one directly to his tree > > Let's just go through the proper channels and go through the drm tree.

[PATCH 2/7] drm/i915/backlight: Use proper interface based on eDP version

2025-01-23 Thread Suraj Kandpal
eDP is supposed to use VESA interface when using revision 1.5 and above, use Intel interface for backlight control otherwise. Add check to use correct interface. Signed-off-by: Suraj Kandpal --- drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 8 +++- 1 file changed, 7 insertions(+),

[PATCH 3/7] drm/i915/backlight: Check Nits based brightness control for VESA

2025-01-23 Thread Suraj Kandpal
Check if we are capable of controlling brightness via Nits which is dependant on PANEL_LUMINANCE_OVERRIDE and SMOOTH_BRIGHTNESS capablility being set. Signed-off-by: Suraj Kandpal --- drivers/gpu/drm/i915/display/intel_display_types.h| 1 + drivers/gpu/drm/i915/display/intel_dp_aux_backlight

[PATCH 6/7] drm/i915/backlight: Setup NITS based brightness via VESA

2025-01-23 Thread Suraj Kandpal
Modify backlight setup function for VESA interface to take into account the NITS based brightness. Signed-off-by: Suraj Kandpal --- .../drm/i915/display/intel_dp_aux_backlight.c | 97 +++ 1 file changed, 57 insertions(+), 40 deletions(-) diff --git a/drivers/gpu/drm/i915/display

[PATCH 7/7] drm/i915/backlight: Enable Nits based brightness

2025-01-23 Thread Suraj Kandpal
Enable Nits based brightness by writing the PANEL_LUMINANCE_CONTROL bit and set the correct register to change brightness. Signed-off-by: Suraj Kandpal --- .../gpu/drm/i915/display/intel_dp_aux_backlight.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/i915/

[PATCH 5/7] drm/i915/backlight: Add function to change brightness in NITS for VESA

2025-01-23 Thread Suraj Kandpal
Create a function that fills in the value for PANEL_TARGET_LUMINANCE_VALUE which helps in changing the brightness in NITS using VESA interface. Signed-off-by: Suraj Kandpal --- .../drm/i915/display/intel_dp_aux_backlight.c | 29 +++ 1 file changed, 29 insertions(+) diff --git a/

[PATCH 4/7] drm/i915/backlight: Modify function to get VESA brightness in NITS

2025-01-23 Thread Suraj Kandpal
Modify vesa_get_brightness function to take into account nits_support and based on that read the appropriate register and return the value. Signed-off-by: Suraj Kandpal --- .../drm/i915/display/intel_dp_aux_backlight.c | 20 +++ 1 file changed, 20 insertions(+) diff --git a/driv

Re: [PATCH v2] drm/i915/backlight: Return immediately when scale() finds invalid parameters

2025-01-21 Thread Linus Torvalds
On Tue, 21 Jan 2025 at 14:59, Rodrigo Vivi wrote: > > I'm pushing this soon to drm-intel-next, unless Linus want to take > this one directly to his tree Let's just go through the proper channels and go through the drm tree. Unless I've issed something, I think this is only an active issue on par

Re: [PATCH v2] drm/i915/backlight: Return immediately when scale() finds invalid parameters

2025-01-21 Thread Rodrigo Vivi
On Tue, Jan 21, 2025 at 06:52:03AM -0800, Guenter Roeck wrote: > The scale() functions detects invalid parameters, but continues > its calculations anyway. This causes bad results if negative values > are used for unsigned operations. Worst case, a division by 0 error > will be seen if source_min =

[PATCH v2] drm/i915/backlight: Return immediately when scale() finds invalid parameters

2025-01-21 Thread Guenter Roeck
The scale() functions detects invalid parameters, but continues its calculations anyway. This causes bad results if negative values are used for unsigned operations. Worst case, a division by 0 error will be seen if source_min == source_max. On top of that, after v6.13, the sequence of WARN_ON() f

Re: [PATCH] drm/i915/backlight: Return immediately when scale() finds invalid parameters

2025-01-21 Thread Jani Nikula
On Mon, 20 Jan 2025, Guenter Roeck wrote: > The scale() functions detects invalid parameters, but continues > its calculations anyway. This causes bad results if negative values > are used for unsigned operations. Worst case, a division by 0 error > will be seen if source_min == source_max. > > On

[PATCH] drm/i915/backlight: Return immediately when scale() finds invalid parameters

2025-01-20 Thread Guenter Roeck
The scale() functions detects invalid parameters, but continues its calculations anyway. This causes bad results if negative values are used for unsigned operations. Worst case, a division by 0 error will be seen if source_min == source_max. On top of that, after v6.13, the sequence of WARN_ON() f

Re: [PATCH] drm/i915/backlight: Remove a useless kstrdup_const()

2024-10-02 Thread Christophe JAILLET
Le 02/10/2024 à 13:51, Jani Nikula a écrit : On Tue, 01 Oct 2024, Christophe JAILLET wrote: Le 30/09/2024 à 09:48, Jani Nikula a écrit : On Sat, 28 Sep 2024, Christophe JAILLET wrote: "name" is allocated and freed in intel_backlight_device_register(). The initial allocation just duplicates "

Re: [PATCH] drm/i915/backlight: Remove a useless kstrdup_const()

2024-10-02 Thread Jani Nikula
On Tue, 01 Oct 2024, Christophe JAILLET wrote: > Le 30/09/2024 à 09:48, Jani Nikula a écrit : >> On Sat, 28 Sep 2024, Christophe JAILLET >> wrote: >>> "name" is allocated and freed in intel_backlight_device_register(). >>> The initial allocation just duplicates "intel_backlight". >>> >>> Later,

Re: [PATCH] drm/i915/backlight: Remove a useless kstrdup_const()

2024-10-01 Thread Christophe JAILLET
Le 30/09/2024 à 09:48, Jani Nikula a écrit : On Sat, 28 Sep 2024, Christophe JAILLET wrote: "name" is allocated and freed in intel_backlight_device_register(). The initial allocation just duplicates "intel_backlight". Later, if a device with this name has already been registered, another dynam

Re: [PATCH] drm/i915/backlight: Remove a useless kstrdup_const()

2024-09-30 Thread Jani Nikula
On Sat, 28 Sep 2024, Christophe JAILLET wrote: > "name" is allocated and freed in intel_backlight_device_register(). > The initial allocation just duplicates "intel_backlight". > > Later, if a device with this name has already been registered, another > dynamically generated one is allocated using

[PATCH] drm/i915/backlight: Remove a useless kstrdup_const()

2024-09-28 Thread Christophe JAILLET
"name" is allocated and freed in intel_backlight_device_register(). The initial allocation just duplicates "intel_backlight". Later, if a device with this name has already been registered, another dynamically generated one is allocated using kasprintf(). So at the end of the function, when "name"

Re: [PATCH 1/2] drm/i915/backlight: Drop duplicate intel_panel_actually_set_backlight()

2021-12-16 Thread Hans de Goede
Hi, On 11/21/21 12:00, Hans de Goede wrote: > After the recent refactoring of the backlight code the contents of > intel_panel_actually_set_backlight() is exactly the same (minus a > small wording difference in the drm_dbg_kms() as the contents if the > more widely used intel_backlight_set_pwm_lev

Re: [PATCH 2/2] drm/i915/backlight: Make ext_pwm_disable_backlight() call intel_backlight_set_pwm_level()

2021-11-22 Thread Lyude Paul
Reviewed-by: Lyude Paul On Sun, 2021-11-21 at 12:00 +0100, Hans de Goede wrote: > At least the Bay Trail LPSS PWM controller used with DSI panels on many > Bay Trail tablets seems to leave the PWM pin in whatever state it was > (high or low) ATM that the PWM gets disabled. Combined with some pane

Re: [PATCH 2/2] drm/i915/backlight: Make ext_pwm_disable_backlight() call intel_backlight_set_pwm_level()

2021-11-22 Thread Jani Nikula
On Sun, 21 Nov 2021, Hans de Goede wrote: > At least the Bay Trail LPSS PWM controller used with DSI panels on many > Bay Trail tablets seems to leave the PWM pin in whatever state it was > (high or low) ATM that the PWM gets disabled. Combined with some panels > not having a separate backlight-en

Re: [PATCH 1/2] drm/i915/backlight: Drop duplicate intel_panel_actually_set_backlight()

2021-11-22 Thread Jani Nikula
On Sun, 21 Nov 2021, Hans de Goede wrote: > After the recent refactoring of the backlight code the contents of > intel_panel_actually_set_backlight() is exactly the same (minus a > small wording difference in the drm_dbg_kms() as the contents if the > more widely used intel_backlight_set_pwm_level

[PATCH 2/2] drm/i915/backlight: Make ext_pwm_disable_backlight() call intel_backlight_set_pwm_level()

2021-11-21 Thread Hans de Goede
At least the Bay Trail LPSS PWM controller used with DSI panels on many Bay Trail tablets seems to leave the PWM pin in whatever state it was (high or low) ATM that the PWM gets disabled. Combined with some panels not having a separate backlight-enable pin this leads to the backlight sometimes stay

[PATCH 1/2] drm/i915/backlight: Drop duplicate intel_panel_actually_set_backlight()

2021-11-21 Thread Hans de Goede
After the recent refactoring of the backlight code the contents of intel_panel_actually_set_backlight() is exactly the same (minus a small wording difference in the drm_dbg_kms() as the contents if the more widely used intel_backlight_set_pwm_level() function. Drop the duplicate intel_panel_actual

Re: [PATCH v2 22/24] drm/i915: Backlight update

2020-09-02 Thread Jani Nikula
On Sun, 23 Aug 2020, Sam Ravnborg wrote: > Update backlight implementation to utilize newly added backlight > functionality. > > - Use macros for initialization > - Replace direct access to backlight_properties with get and set > operations > - Moved enable/disable after registering backlight de

[PATCH v2 22/24] drm/i915: Backlight update

2020-08-23 Thread Sam Ravnborg
Update backlight implementation to utilize newly added backlight functionality. - Use macros for initialization - Replace direct access to backlight_properties with get and set operations - Moved enable/disable after registering backlight device One side-effect of these changes is that the conf

[PATCH v1 20/22] drm/i915: Backlight update

2020-08-02 Thread Sam Ravnborg
Update backlight implementation to utilize newly added backlight functionality. - Use macros for initialization - Replace direct access to backlight_properties with get and set operations - Dropped extra checks as some methods accepts a NULL backlight device. One side-effect of these changes is

[v3 7/7] drm/i915: Backlight control using CRC PMIC based PWM driver

2015-06-26 Thread Shobhit Kumar
Use the CRC PWM device in intel_panel.c and add new MIPI backlight specififc callbacks v2: Modify to use pwm_config callback v3: Addressed Jani's comments - Renamed all function as pwm_* instead of vlv_* - Call intel_panel_actually_set_backlight in enable function - Return -ENODEV in c

[Intel-gfx] [v2 7/7] drm/i915: Backlight control using CRC PMIC based PWM driver

2015-06-26 Thread Jani Nikula
On Thu, 25 Jun 2015, Shobhit Kumar wrote: > On Thu, Jun 25, 2015 at 2:18 PM, Ville Syrjälä > wrote: >> On Mon, Jun 22, 2015 at 04:24:25PM +0530, Shobhit Kumar wrote: >>> Use the CRC PWM device in intel_panel.c and add new MIPI backlight >>> specififc callbacks >>> >>> v2: Modify to use pwm_conf

[Intel-gfx] [v2 7/7] drm/i915: Backlight control using CRC PMIC based PWM driver

2015-06-25 Thread Shobhit Kumar
On Thu, Jun 25, 2015 at 6:17 PM, Ville Syrjälä wrote: > On Thu, Jun 25, 2015 at 05:38:50PM +0530, Shobhit Kumar wrote: >> On Thu, Jun 25, 2015 at 2:18 PM, Ville Syrjälä >> wrote: >> > On Mon, Jun 22, 2015 at 04:24:25PM +0530, Shobhit Kumar wrote: >> >> Use the CRC PWM device in intel_panel.c

[Intel-gfx] [v2 7/7] drm/i915: Backlight control using CRC PMIC based PWM driver

2015-06-25 Thread Shobhit Kumar
On Thu, Jun 25, 2015 at 2:18 PM, Ville Syrjälä wrote: > On Mon, Jun 22, 2015 at 04:24:25PM +0530, Shobhit Kumar wrote: >> Use the CRC PWM device in intel_panel.c and add new MIPI backlight >> specififc callbacks >> >> v2: Modify to use pwm_config callback >> v3: Addressed Jani's comments >>

[Intel-gfx] [v2 7/7] drm/i915: Backlight control using CRC PMIC based PWM driver

2015-06-25 Thread Ville Syrjälä
On Thu, Jun 25, 2015 at 05:38:50PM +0530, Shobhit Kumar wrote: > On Thu, Jun 25, 2015 at 2:18 PM, Ville Syrjälä > wrote: > > On Mon, Jun 22, 2015 at 04:24:25PM +0530, Shobhit Kumar wrote: > >> Use the CRC PWM device in intel_panel.c and add new MIPI backlight > >> specififc callbacks > >> > >> v

[Intel-gfx] [v2 7/7] drm/i915: Backlight control using CRC PMIC based PWM driver

2015-06-25 Thread Ville Syrjälä
On Mon, Jun 22, 2015 at 04:24:25PM +0530, Shobhit Kumar wrote: > Use the CRC PWM device in intel_panel.c and add new MIPI backlight > specififc callbacks > > v2: Modify to use pwm_config callback > v3: Addressed Jani's comments > - Renamed all function as pwm_* instead of vlv_* > - Call in

[v2 7/7] drm/i915: Backlight control using CRC PMIC based PWM driver

2015-06-22 Thread Shobhit Kumar
Use the CRC PWM device in intel_panel.c and add new MIPI backlight specififc callbacks v2: Modify to use pwm_config callback v3: Addressed Jani's comments - Renamed all function as pwm_* instead of vlv_* - Call intel_panel_actually_set_backlight in enable function - Return -ENODEV in c

[PATCH 8/8] drm/i915: Backlight control using CRC PMIC based PWM driver

2015-05-06 Thread Jani Nikula
On Wed, 29 Apr 2015, Shobhit Kumar wrote: > Use the CRC PWM device in intel_panel.c and add new MIPI backlight > specififc callbacks > > v2: Modify to use pwm_config callback > > CC: Samuel Ortiz > Cc: Linus Walleij > Cc: Alexandre Courbot > Cc: Thierry Reding > Signed-off-by: Shobhit Kumar >

[PATCH 8/8] drm/i915: Backlight control using CRC PMIC based PWM driver

2015-04-29 Thread Shobhit Kumar
Use the CRC PWM device in intel_panel.c and add new MIPI backlight specififc callbacks v2: Modify to use pwm_config callback CC: Samuel Ortiz Cc: Linus Walleij Cc: Alexandre Courbot Cc: Thierry Reding Signed-off-by: Shobhit Kumar --- drivers/gpu/drm/i915/intel_drv.h | 5 +++ drivers/gpu/

[BUG] drm/i915: backlight off after resume

2015-01-09 Thread Jani Nikula
On Fri, 09 Jan 2015, Jeremiah Mahler wrote: > Jani, all, > > On a Lenovo X1 Carbon if the display is off when suspend is entered > it will be off when it is resumed. A key must be pressed to restore > normal brightness. Please file a bug on [1] and attach dmesg with drm.debug=14 set, from boot t

[BUG] drm/i915: backlight off after resume

2015-01-08 Thread Jeremiah Mahler
Jani, all, On a Lenovo X1 Carbon if the display is off when suspend is entered it will be off when it is resumed. A key must be pressed to restore normal brightness. xset dpms force off sleep 1 sudo systemctl suspend (resume) (screen off, press any key) The behavior I am accustomed to

i915 backlight

2013-08-05 Thread Daniel Vetter
On Fri, Aug 02, 2013 at 09:16:03AM +0800, Aaron Lu wrote: > Hi Jani & Daniel, > > It turned out there is an integer overflow problem, and the below patch > fixed this problem on Acer Aspire 4732Z and thinkpad R61i. > > From: Aaron Lu > Subject: [PATCH] drm/i915: avoid brightness overflow when do

Re: i915 backlight

2013-08-05 Thread Daniel Vetter
On Fri, Aug 02, 2013 at 09:16:03AM +0800, Aaron Lu wrote: > Hi Jani & Daniel, > > It turned out there is an integer overflow problem, and the below patch > fixed this problem on Acer Aspire 4732Z and thinkpad R61i. > > From: Aaron Lu > Subject: [PATCH] drm/i915: avoid brightness overflow when do

Re: i915 backlight

2013-08-03 Thread Josep Lladonosa
On 2 August 2013 23:25, Felipe Contreras wrote: > On Fri, Aug 2, 2013 at 3:11 PM, Josep Lladonosa wrote: >> "Before" means with previous kernels that worked with >> >> GRUB_CMDLINE_LINUX="acpi_osi=Linux acpi_backlight=vendor" > > That's probably a different issue. You would need to bisect the pro

Re: i915 backlight

2013-08-03 Thread Josep Lladonosa
"Before" means with previous kernels that worked with GRUB_CMDLINE_LINUX="acpi_osi=Linux acpi_backlight=vendor" I have not checked this issue with acpi_osi="!Windows 2012". Josep On 2 August 2013 22:08, Felipe Contreras wrote: > On Fri, Aug 2, 2013 at 3:03 PM, Josep Lladonosa wrote: >> With t

Re: i915 backlight

2013-08-03 Thread Josep Lladonosa
Hi, With this setup, something has happened: in xorg, when screen goes to screensaver and after, enters into Standby mode, when I press a key, it keeps black and, to recover screen, I have to adjust brightness manually (by increasing), as if it didn't remember previous value to standby mode. This

i915 backlight

2013-08-03 Thread Rafael J. Wysocki
On Friday, August 02, 2013 01:58:55 PM Felipe Contreras wrote: > On Fri, Aug 2, 2013 at 9:03 AM, Rafael J. Wysocki wrote: > > On Friday, August 02, 2013 01:48:37 AM Felipe Contreras wrote: > >> On Fri, Aug 2, 2013 at 1:25 AM, Josep Lladonosa > >> wrote: > >> > Hello, > >> > > >> > I am using a L

i915 backlight

2013-08-03 Thread Josep Lladonosa
On 2 August 2013 23:25, Felipe Contreras wrote: > On Fri, Aug 2, 2013 at 3:11 PM, Josep Lladonosa wrote: >> "Before" means with previous kernels that worked with >> >> GRUB_CMDLINE_LINUX="acpi_osi=Linux acpi_backlight=vendor" > > That's probably a different issue. You would need to bisect the pro

i915 backlight

2013-08-02 Thread Borislav Petkov
On Fri, Aug 02, 2013 at 10:11:27PM +0200, Josep Lladonosa wrote: > "Before" means with previous kernels that worked with > > GRUB_CMDLINE_LINUX="acpi_osi=Linux acpi_backlight=vendor" > > I have not checked this issue with acpi_osi="!Windows 2012". Hey Josep, would you please not top-post when y

i915 backlight

2013-08-02 Thread Josep Lladonosa
"Before" means with previous kernels that worked with GRUB_CMDLINE_LINUX="acpi_osi=Linux acpi_backlight=vendor" I have not checked this issue with acpi_osi="!Windows 2012". Josep On 2 August 2013 22:08, Felipe Contreras wrote: > On Fri, Aug 2, 2013 at 3:03 PM, Josep Lladonosa wrote: >> With t

i915 backlight

2013-08-02 Thread Josep Lladonosa
Hi, With this setup, something has happened: in xorg, when screen goes to screensaver and after, enters into Standby mode, when I press a key, it keeps black and, to recover screen, I have to adjust brightness manually (by increasing), as if it didn't remember previous value to standby mode. This

i915 backlight

2013-08-02 Thread Felipe Contreras
On Fri, Aug 2, 2013 at 6:35 PM, Rafael J. Wysocki wrote: > On Friday, August 02, 2013 01:58:55 PM Felipe Contreras wrote: >> On Fri, Aug 2, 2013 at 9:03 AM, Rafael J. Wysocki wrote: >> > On Friday, August 02, 2013 01:48:37 AM Felipe Contreras wrote: >> >> I think it's pretty obvious that for the

Re: i915 backlight

2013-08-02 Thread Felipe Contreras
On Fri, Aug 2, 2013 at 6:35 PM, Rafael J. Wysocki wrote: > On Friday, August 02, 2013 01:58:55 PM Felipe Contreras wrote: >> On Fri, Aug 2, 2013 at 9:03 AM, Rafael J. Wysocki wrote: >> > On Friday, August 02, 2013 01:48:37 AM Felipe Contreras wrote: >> >> I think it's pretty obvious that for the

Re: i915 backlight

2013-08-02 Thread Rafael J. Wysocki
On Friday, August 02, 2013 01:58:55 PM Felipe Contreras wrote: > On Fri, Aug 2, 2013 at 9:03 AM, Rafael J. Wysocki wrote: > > On Friday, August 02, 2013 01:48:37 AM Felipe Contreras wrote: > >> On Fri, Aug 2, 2013 at 1:25 AM, Josep Lladonosa wrote: > >> > Hello, > >> > > >> > I am using a Lenovo

i915 backlight

2013-08-02 Thread Felipe Contreras
On Fri, Aug 2, 2013 at 3:11 PM, Josep Lladonosa wrote: > "Before" means with previous kernels that worked with > > GRUB_CMDLINE_LINUX="acpi_osi=Linux acpi_backlight=vendor" That's probably a different issue. You would need to bisect the problem. > I have not checked this issue with acpi_osi="!Wi

i915 backlight

2013-08-02 Thread Rafael J. Wysocki
On Friday, August 02, 2013 01:48:37 AM Felipe Contreras wrote: > On Fri, Aug 2, 2013 at 1:25 AM, Josep Lladonosa wrote: > > Hello, > > > > I am using a Lenovo Edge E530 and, with kernel 3.11.0-rc3, I had to > > change to this parameter to the kernel boot: > > > > > > GRUB_CMDLINE_LINUX="acpi_osi=\

  1   2   >