All of lore.kernel.org
 help / color / mirror / Atom feed
From: Angelo Dureghello <angelo@kernel-space.org>
To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
	kherbst@redhat.com, lyude@redhat.com, dakr@redhat.com
Cc: Angelo Dureghello <angelo@kernel-space.org>
Subject: [PATCH v2 2/2] drm/dp: set pwm bit count when pwm hz is not set
Date: Fri, 12 Apr 2024 21:49:01 +0200	[thread overview]
Message-ID: <20240412194901.1596-2-angelo@kernel-space.org> (raw)
In-Reply-To: <20240412194901.1596-1-angelo@kernel-space.org>

Set pwmgen_bit_count to have proper brightness inc/dec steps
even when driver_pwm_freq_hz (optional) is zero.

cat /sys/class/backlight/nv_backlight/max_brightness
255

Can now tune properly backlight from 0 to 255.

---
Changes for v2:
none

Signed-off-by: Angelo Dureghello <angelo@kernel-space.org>
---
 drivers/gpu/drm/display/drm_dp_helper.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c
index f5d4be897866..30c4ed0f2ff1 100644
--- a/drivers/gpu/drm/display/drm_dp_helper.c
+++ b/drivers/gpu/drm/display/drm_dp_helper.c
@@ -3768,6 +3768,7 @@ drm_edp_backlight_probe_max(struct drm_dp_aux *aux, struct drm_edp_backlight_inf
 	}
 
 	pn &= DP_EDP_PWMGEN_BIT_COUNT_MASK;
+	bl->pwmgen_bit_count = pn;
 	bl->max = (1 << pn) - 1;
 	if (!driver_pwm_freq_hz)
 		return 0;
-- 
2.44.0


  reply	other threads:[~2024-04-12 19:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12 19:49 [PATCH v2 1/2] drm/nouveau/disp: add backlight for ada lovelace Angelo Dureghello
2024-04-12 19:49 ` Angelo Dureghello [this message]
2024-04-15 16:54 ` Lyude Paul
2024-04-16  7:11   ` Angelo Dureghello
2024-04-23 18:00 ` Add working backlight for "ada lovelace" missing case Moody Liu

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=20240412194901.1596-2-angelo@kernel-space.org \
    --to=angelo@kernel-space.org \
    --cc=dakr@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kherbst@redhat.com \
    --cc=lyude@redhat.com \
    --cc=nouveau@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.