Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Hans de Goede" <hdegoede@redhat.com>,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>,
	dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH resend 1/2] drm/i915: panel: Use intel_panel_compute_brightness() from pwm_setup_backlight()
Date: Wed, 04 Mar 2020 17:15:13 +0200	[thread overview]
Message-ID: <874kv4p2wu.fsf@intel.com> (raw)
In-Reply-To: <895e4a40-2c3f-b964-102d-13eff5b3c268@redhat.com>

On Tue, 03 Mar 2020, Hans de Goede <hdegoede@redhat.com> wrote:
> Hi All,
>
> On 2/21/20 6:29 PM, Hans de Goede wrote:
>> Use intel_panel_compute_brightness() from pwm_setup_backlight() so that
>> we correctly take i915_modparams.invert_brightness and/or
>> QUIRK_INVERT_BRIGHTNESS into account when setting + getting the initial
>> brightness value.
>> 
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>
> ping? Any chance I can get a review from someone on this series?
>
> Both patches are pretty trivial really...

For both,

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

And sad trombone, I was hoping I could nuke the whole module parameter
one of these days. It used to be something associated with gen4 only.

BR,
Jani.


>
> Regards,
>
> Hans
>
>
>
>> ---
>>   drivers/gpu/drm/i915/display/intel_panel.c | 18 +++++++++++-------
>>   1 file changed, 11 insertions(+), 7 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c
>> index 7b3ec6eb3382..9ebee7d93414 100644
>> --- a/drivers/gpu/drm/i915/display/intel_panel.c
>> +++ b/drivers/gpu/drm/i915/display/intel_panel.c
>> @@ -1843,6 +1843,7 @@ static int pwm_setup_backlight(struct intel_connector *connector,
>>   	struct drm_i915_private *dev_priv = to_i915(dev);
>>   	struct intel_panel *panel = &connector->panel;
>>   	const char *desc;
>> +	u32 level, ns;
>>   	int retval;
>>   
>>   	/* Get the right PWM chip for DSI backlight according to VBT */
>> @@ -1866,8 +1867,12 @@ static int pwm_setup_backlight(struct intel_connector *connector,
>>   	 */
>>   	pwm_apply_args(panel->backlight.pwm);
>>   
>> -	retval = pwm_config(panel->backlight.pwm, CRC_PMIC_PWM_PERIOD_NS,
>> -			    CRC_PMIC_PWM_PERIOD_NS);
>> +	panel->backlight.min = 0; /* 0% */
>> +	panel->backlight.max = 100; /* 100% */
>> +	level = intel_panel_compute_brightness(connector, 100);
>> +	ns = DIV_ROUND_UP(level * CRC_PMIC_PWM_PERIOD_NS, 100);
>> +
>> +	retval = pwm_config(panel->backlight.pwm, ns, CRC_PMIC_PWM_PERIOD_NS);
>>   	if (retval < 0) {
>>   		DRM_ERROR("Failed to configure the pwm chip\n");
>>   		pwm_put(panel->backlight.pwm);
>> @@ -1875,11 +1880,10 @@ static int pwm_setup_backlight(struct intel_connector *connector,
>>   		return retval;
>>   	}
>>   
>> -	panel->backlight.min = 0; /* 0% */
>> -	panel->backlight.max = 100; /* 100% */
>> -	panel->backlight.level = DIV_ROUND_UP(
>> -				 pwm_get_duty_cycle(panel->backlight.pwm) * 100,
>> -				 CRC_PMIC_PWM_PERIOD_NS);
>> +	level = DIV_ROUND_UP(pwm_get_duty_cycle(panel->backlight.pwm) * 100,
>> +			     CRC_PMIC_PWM_PERIOD_NS);
>> +	panel->backlight.level =
>> +		intel_panel_compute_brightness(connector, level);
>>   	panel->backlight.enabled = panel->backlight.level != 0;
>>   
>>   	DRM_INFO("Using %s PWM for LCD backlight control\n", desc);
>> 
>

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2020-03-04 15:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21 17:29 [Intel-gfx] [PATCH resend 1/2] drm/i915: panel: Use intel_panel_compute_brightness() from pwm_setup_backlight() Hans de Goede
2020-02-21 17:29 ` [Intel-gfx] [PATCH resend 2/2] drm/i915: Add invert-brightness quirk for Thundersoft TST178 tablet Hans de Goede
2020-02-22  1:08 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [resend,1/2] drm/i915: panel: Use intel_panel_compute_brightness() from pwm_setup_backlight() Patchwork
2020-02-22  1:32 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-02-24 14:19 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2020-03-03 10:29 ` [Intel-gfx] [PATCH resend 1/2] " Hans de Goede
2020-03-04 15:15   ` Jani Nikula [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874kv4p2wu.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox