Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Suraj Kandpal <suraj.kandpal@intel.com>
To: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Cc: ankit.k.nautiyal@intel.com, arun.r.murthy@intel.com,
	Suraj Kandpal <suraj.kandpal@intel.com>
Subject: [PATCH 03/13] drm/dp: Add argument for luminance range info in drm_edp_backlight_init
Date: Fri, 11 Apr 2025 09:58:59 +0530	[thread overview]
Message-ID: <20250411042909.2626807-4-suraj.kandpal@intel.com> (raw)
In-Reply-To: <20250411042909.2626807-1-suraj.kandpal@intel.com>

Add new argument to drm_edp_backlight_init which gives the
drm_luminance_range_info struct which will be needed to set the min
and max values for backlight.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
 drivers/gpu/drm/display/drm_dp_helper.c               | 5 ++++-
 drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 5 +++--
 drivers/gpu/drm/nouveau/nouveau_backlight.c           | 5 ++++-
 include/drm/display/drm_dp_helper.h                   | 1 +
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c
index 99b27e5e3365..3b309ac5190b 100644
--- a/drivers/gpu/drm/display/drm_dp_helper.c
+++ b/drivers/gpu/drm/display/drm_dp_helper.c
@@ -4227,6 +4227,8 @@ drm_edp_backlight_probe_state(struct drm_dp_aux *aux, struct drm_edp_backlight_i
  * interface.
  * @aux: The DP aux device to use for probing
  * @bl: The &drm_edp_backlight_info struct to fill out with information on the backlight
+ * @lr: The &drm_luminance_range_info struct which is used to get the min max when using
+ *luminance override
  * @driver_pwm_freq_hz: Optional PWM frequency from the driver in hz
  * @edp_dpcd: A cached copy of the eDP DPCD
  * @current_level: Where to store the probed brightness level, if any
@@ -4243,6 +4245,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,
+		       struct drm_luminance_range_info *lr,
 		       u16 driver_pwm_freq_hz, const u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE],
 		       u16 *current_level, u8 *current_mode, bool need_luminance)
 {
@@ -4372,7 +4375,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,
+	ret = drm_edp_backlight_init(aux, &bl->info, NULL, 0, edp_dpcd,
 				     &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 6dab8a0c0d74..22af5cf83b1e 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
@@ -600,8 +600,9 @@ static int intel_dp_aux_vesa_setup_backlight(struct intel_connector *connector,
 			    connector->base.base.id, connector->base.name);
 	} 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, false);
+					     luminance_range, panel->vbt.backlight.pwm_freq_hz,
+					     intel_dp->edp_dpcd, &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 b938684a9422..a3681e101d56 100644
--- a/drivers/gpu/drm/nouveau/nouveau_backlight.c
+++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c
@@ -234,6 +234,8 @@ nv50_backlight_init(struct nouveau_backlight *bl,
 		    const struct backlight_ops **ops)
 {
 	struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev);
+	struct drm_luminance_range_info *luminance_range =
+		&nv_conn->base.display_info.luminance_range;
 
 	/*
 	 * Note when this runs the connectors have not been probed yet,
@@ -261,7 +263,8 @@ nv50_backlight_init(struct nouveau_backlight *bl,
 			NV_DEBUG(drm, "DPCD backlight controls supported on %s\n",
 				 nv_conn->base.name);
 
-			ret = drm_edp_backlight_init(&nv_conn->aux, &bl->edp_info, 0, edp_dpcd,
+			ret = drm_edp_backlight_init(&nv_conn->aux, &bl->edp_info,
+						     luminance_range, 0, edp_dpcd,
 						     &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 ef0786a0af4a..6f53921f5dce 100644
--- a/include/drm/display/drm_dp_helper.h
+++ b/include/drm/display/drm_dp_helper.h
@@ -849,6 +849,7 @@ struct drm_edp_backlight_info {
 
 int
 drm_edp_backlight_init(struct drm_dp_aux *aux, struct drm_edp_backlight_info *bl,
+		       struct drm_luminance_range_info *lr,
 		       u16 driver_pwm_freq_hz, const u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE],
 		       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,
-- 
2.34.1


  parent reply	other threads:[~2025-04-11  4:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-11  4:28 [PATCH 00/13] Modify drm helpers to use luminance Suraj Kandpal
2025-04-11  4:28 ` [PATCH 01/13] drm/dp: Introduce new member in drm_backlight_info Suraj Kandpal
2025-04-11  4:28 ` [PATCH 02/13] drm/dp: Add argument in drm_edp_backlight_init Suraj Kandpal
2025-04-11  4:28 ` Suraj Kandpal [this message]
2025-04-11  4:29 ` [PATCH 04/13] drm/dp: Move from u16 to u32 for max in drm_edp_backlight_info Suraj Kandpal
2025-04-11  4:29 ` [PATCH 05/13] drm/dp: Change current_level argument type to u32 Suraj Kandpal
2025-04-11  4:29 ` [PATCH 06/13] drm/dp: Modify drm_edp_probe_state Suraj Kandpal
2025-04-11  4:29 ` [PATCH 07/13] drm/dp: Change argument type for drm_edp_backlight_set_level Suraj Kandpal
2025-04-11 10:39   ` Jani Nikula
2025-04-14  4:16     ` Kandpal, Suraj
2025-04-11  4:29 ` [PATCH 08/13] drm/dp: Modify drm_edp_backlight_set_level Suraj Kandpal
2025-04-11  4:29 ` [PATCH 09/13] drm/dp: Change argument type of drm_edp_backlight_enable Suraj Kandpal
2025-04-11  4:29 ` [PATCH 10/13] drm/dp: Enable backlight control using luminance Suraj Kandpal
2025-04-11  4:29 ` [PATCH 11/13] drm/i915/backlight: Use drm helper to initialize edp backlight Suraj Kandpal
2025-04-11  4:29 ` [PATCH 12/13] drm/i915/backlight: Use drm helper to set " Suraj Kandpal
2025-04-11  4:29 ` [PATCH 13/13] drm/i915/backlight: Use drm_edp_backlight_enable Suraj Kandpal
2025-04-11  5:00 ` ✗ Fi.CI.SPARSE: warning for Modify drm helpers to use luminance Patchwork
2025-04-11  5:27 ` ✓ i915.CI.BAT: success " Patchwork
2025-04-11  7:08 ` ✗ i915.CI.Full: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2025-04-14  4:16 [PATCH 00/13] " Suraj Kandpal
2025-04-14  4:16 ` [PATCH 03/13] drm/dp: Add argument for luminance range info in drm_edp_backlight_init Suraj Kandpal
2025-06-12  6:14   ` Murthy, Arun R
2025-06-12 10:31     ` Kandpal, Suraj
2025-06-12 11:13       ` Murthy, Arun R
2025-06-12 11:40         ` Kandpal, Suraj
2025-06-19  5:17           ` Murthy, Arun R
2025-06-19  5:56             ` Kandpal, Suraj
2025-05-09  5:18 [PATCH 00/13] Modify drm helpers to use luminance Suraj Kandpal
2025-05-09  5:18 ` [PATCH 03/13] drm/dp: Add argument for luminance range info in drm_edp_backlight_init Suraj Kandpal

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=20250411042909.2626807-4-suraj.kandpal@intel.com \
    --to=suraj.kandpal@intel.com \
    --cc=ankit.k.nautiyal@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