Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Suraj Kandpal <suraj.kandpal@intel.com>
To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org
Cc: arun.r.murthy@intel.com, Suraj Kandpal <suraj.kandpal@intel.com>
Subject: [PATCH v3 02/13] drm/dp: Add argument in drm_edp_backlight_init
Date: Fri, 20 Jun 2025 12:04:34 +0530	[thread overview]
Message-ID: <20250620063445.3603086-3-suraj.kandpal@intel.com> (raw)
In-Reply-To: <20250620063445.3603086-1-suraj.kandpal@intel.com>

Add bool argument in drm_edp_backlight init to provide the drivers
option to choose if they want to use luminance values to
manipulate brightness.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com>
---
 drivers/gpu/drm/display/drm_dp_helper.c               | 7 ++++---
 drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 2 +-
 drivers/gpu/drm/nouveau/nouveau_backlight.c           | 2 +-
 include/drm/display/drm_dp_helper.h                   | 2 +-
 4 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c
index e817bed9ffc6..2a662951f7a8 100644
--- a/drivers/gpu/drm/display/drm_dp_helper.c
+++ b/drivers/gpu/drm/display/drm_dp_helper.c
@@ -4255,6 +4255,7 @@ drm_edp_backlight_probe_state(struct drm_dp_aux *aux, struct drm_edp_backlight_i
  * @edp_dpcd: A cached copy of the eDP DPCD
  * @current_level: Where to store the probed brightness level, if any
  * @current_mode: Where to store the currently set backlight control mode
+ * @need_luminance: Tells us if a we want to manipulate backlight using luminance values
  *
  * Initializes a &drm_edp_backlight_info struct by probing @aux for it's backlight capabilities,
  * along with also probing the current and maximum supported brightness levels.
@@ -4267,7 +4268,7 @@ drm_edp_backlight_probe_state(struct drm_dp_aux *aux, struct drm_edp_backlight_i
 int
 drm_edp_backlight_init(struct drm_dp_aux *aux, struct drm_edp_backlight_info *bl,
 		       u16 driver_pwm_freq_hz, const u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE],
-		       u16 *current_level, u8 *current_mode)
+		       u16 *current_level, u8 *current_mode, bool need_luminance)
 {
 	int ret;
 
@@ -4278,7 +4279,7 @@ drm_edp_backlight_init(struct drm_dp_aux *aux, struct drm_edp_backlight_info *bl
 	if (edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_BYTE_COUNT)
 		bl->lsb_reg_used = true;
 	if ((edp_dpcd[0] & DP_EDP_15) && edp_dpcd[3] &
-	    (DP_EDP_PANEL_LUMINANCE_CONTROL_CAPABLE))
+	    (DP_EDP_PANEL_LUMINANCE_CONTROL_CAPABLE) && need_luminance)
 		bl->luminance_set = true;
 
 	/* Sanity check caps */
@@ -4396,7 +4397,7 @@ int drm_panel_dp_aux_backlight(struct drm_panel *panel, struct drm_dp_aux *aux)
 	bl->aux = aux;
 
 	ret = drm_edp_backlight_init(aux, &bl->info, 0, edp_dpcd,
-				     &current_level, &current_mode);
+				     &current_level, &current_mode, false);
 	if (ret < 0)
 		return ret;
 
diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
index 271b27c9de51..dc6f6680774f 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
@@ -600,7 +600,7 @@ static int intel_dp_aux_vesa_setup_backlight(struct intel_connector *connector,
 	} else {
 		ret = drm_edp_backlight_init(&intel_dp->aux, &panel->backlight.edp.vesa.info,
 					     panel->vbt.backlight.pwm_freq_hz, intel_dp->edp_dpcd,
-					     &current_level, &current_mode);
+					     &current_level, &current_mode, false);
 		if (ret < 0)
 			return ret;
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c
index 9aae26eb7d8f..7d93266bf26a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
+++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
@@ -262,7 +262,7 @@ nv50_backlight_init(struct nouveau_backlight *bl,
 				 nv_conn->base.name);
 
 			ret = drm_edp_backlight_init(&nv_conn->aux, &bl->edp_info, 0, edp_dpcd,
-						     &current_level, &current_mode);
+						     &current_level, &current_mode, false);
 			if (ret < 0)
 				return ret;
 
diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h
index e3b13858c8a9..fcbf447206cf 100644
--- a/include/drm/display/drm_dp_helper.h
+++ b/include/drm/display/drm_dp_helper.h
@@ -861,7 +861,7 @@ struct drm_edp_backlight_info {
 int
 drm_edp_backlight_init(struct drm_dp_aux *aux, struct drm_edp_backlight_info *bl,
 		       u16 driver_pwm_freq_hz, const u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE],
-		       u16 *current_level, u8 *current_mode);
+		       u16 *current_level, u8 *current_mode, bool need_luminance);
 int drm_edp_backlight_set_level(struct drm_dp_aux *aux, const struct drm_edp_backlight_info *bl,
 				u16 level);
 int drm_edp_backlight_enable(struct drm_dp_aux *aux, const struct drm_edp_backlight_info *bl,
-- 
2.34.1


  parent reply	other threads:[~2025-06-20  6:35 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-20  6:34 [PATCH 00/13] Modify drm helpers to use luminance Suraj Kandpal
2025-06-20  6:34 ` [PATCH v3 01/13] drm/dp: Introduce new member in drm_backlight_info Suraj Kandpal
2025-06-20  6:34 ` Suraj Kandpal [this message]
2025-06-20  6:34 ` [PATCH v3 03/13] drm/dp: Add argument for max luminance in drm_edp_backlight_init Suraj Kandpal
2025-06-24  4:42   ` Murthy, Arun R
2025-06-20  6:34 ` [PATCH v3 04/13] drm/dp: Move from u16 to u32 for max in drm_edp_backlight_info Suraj Kandpal
2025-06-24  4:44   ` Murthy, Arun R
2025-06-20  6:34 ` [PATCH v3 05/13] drm/dp: Change current_level argument type to u32 Suraj Kandpal
2025-06-20  6:34 ` [PATCH v3 06/13] drm/dp: Modify drm_edp_probe_state Suraj Kandpal
2025-06-20  6:34 ` [PATCH v3 07/13] drm/dp: Change argument type for drm_edp_backlight_set_level Suraj Kandpal
2025-06-20  6:34 ` [PATCH v3 08/13] drm/dp: Modify drm_edp_backlight_set_level Suraj Kandpal
2025-06-20  6:34 ` [PATCH v3 09/13] drm/dp: Change argument type of drm_edp_backlight_enable Suraj Kandpal
2025-06-20  6:34 ` [PATCH v3 10/13] drm/dp: Enable backlight control using luminance Suraj Kandpal
2025-06-20  6:34 ` [PATCH v3 11/13] drm/i915/backlight: Use drm helper to initialize edp backlight Suraj Kandpal
2025-06-24  4:47   ` Murthy, Arun R
2025-06-24  4:52     ` Kandpal, Suraj
2025-06-24  5:01       ` Murthy, Arun R
2025-06-24  5:13         ` Kandpal, Suraj
2025-06-24  5:20         ` Kandpal, Suraj
2025-06-20  6:34 ` [PATCH v3 12/13] drm/i915/backlight: Use drm helper to set " Suraj Kandpal
2025-06-20  6:34 ` [PATCH v3 13/13] drm/i915/backlight: Use drm_edp_backlight_enable Suraj Kandpal
2025-06-20  7:25 ` ✓ i915.CI.BAT: success for Modify drm helpers to use luminance (rev4) Patchwork
2025-06-20 10:59 ` ✓ i915.CI.Full: " Patchwork
2025-06-25  9:03 ` [PATCH 00/13] Modify drm helpers to use luminance Jani Nikula
2025-06-25 11:20   ` Kandpal, Suraj
2025-06-30  6:58     ` Kandpal, Suraj

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=20250620063445.3603086-3-suraj.kandpal@intel.com \
    --to=suraj.kandpal@intel.com \
    --cc=arun.r.murthy@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox