Intel-XE 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 01/13] drm/dp: Introduce new member in drm_backlight_info
Date: Mon, 14 Apr 2025 09:46:25 +0530	[thread overview]
Message-ID: <20250414041637.128039-2-suraj.kandpal@intel.com> (raw)
In-Reply-To: <20250414041637.128039-1-suraj.kandpal@intel.com>

Introduce luminance_set flag which indicates if we can manipulate
backlight using luminance value or not which is only possible
after eDP v1.5.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
 drivers/gpu/drm/display/drm_dp_helper.c | 8 ++++++--
 include/drm/display/drm_dp_helper.h     | 1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c
index 57828f2b7b5a..41de7a92d76d 100644
--- a/drivers/gpu/drm/display/drm_dp_helper.c
+++ b/drivers/gpu/drm/display/drm_dp_helper.c
@@ -4253,11 +4253,15 @@ drm_edp_backlight_init(struct drm_dp_aux *aux, struct drm_edp_backlight_info *bl
 		bl->aux_set = true;
 	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))
+		bl->luminance_set = true;
 
 	/* Sanity check caps */
-	if (!bl->aux_set && !(edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP)) {
+	if (!bl->aux_set && !(edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP) &&
+	    !bl->luminance_set) {
 		drm_dbg_kms(aux->drm_dev,
-			    "%s: Panel supports neither AUX or PWM brightness control? Aborting\n",
+			    "%s: Panel does not support AUX, PWM or luminance-based brightness control. Aborting\n",
 			    aux->name);
 		return -EINVAL;
 	}
diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h
index d9614e2c8939..b8fdc09737fc 100644
--- a/include/drm/display/drm_dp_helper.h
+++ b/include/drm/display/drm_dp_helper.h
@@ -844,6 +844,7 @@ struct drm_edp_backlight_info {
 	bool lsb_reg_used : 1;
 	bool aux_enable : 1;
 	bool aux_set : 1;
+	bool luminance_set : 1;
 };
 
 int
-- 
2.34.1


  reply	other threads:[~2025-04-14  4:17 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14  4:16 [PATCH 00/13] Modify drm helpers to use luminance Suraj Kandpal
2025-04-14  4:16 ` Suraj Kandpal [this message]
2025-06-12  5:20   ` [PATCH 01/13] drm/dp: Introduce new member in drm_backlight_info Murthy, Arun R
2025-04-14  4:16 ` [PATCH 02/13] drm/dp: Add argument in drm_edp_backlight_init Suraj Kandpal
2025-06-12  5:27   ` Murthy, Arun R
2025-04-14  4:16 ` [PATCH 03/13] drm/dp: Add argument for luminance range info " 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-04-14  4:16 ` [PATCH 04/13] drm/dp: Move from u16 to u32 for max in drm_edp_backlight_info Suraj Kandpal
2025-06-19  5:21   ` Murthy, Arun R
2025-04-14  4:16 ` [PATCH 05/13] drm/dp: Change current_level argument type to u32 Suraj Kandpal
2025-06-19  5:23   ` Murthy, Arun R
2025-04-14  4:16 ` [PATCH 06/13] drm/dp: Modify drm_edp_probe_state Suraj Kandpal
2025-05-07 12:08   ` kernel test robot
2025-06-20  4:34   ` Murthy, Arun R
2025-04-14  4:16 ` [PATCH 07/13] drm/dp: Change argument type for drm_edp_backlight_set_level Suraj Kandpal
2025-06-20  5:42   ` Murthy, Arun R
2025-04-14  4:16 ` [PATCH 08/13] drm/dp: Modify drm_edp_backlight_set_level Suraj Kandpal
2025-04-14  4:16 ` [PATCH 09/13] drm/dp: Change argument type of drm_edp_backlight_enable Suraj Kandpal
2025-06-20  4:38   ` Murthy, Arun R
2025-04-14  4:16 ` [PATCH 10/13] drm/dp: Enable backlight control using luminance Suraj Kandpal
2025-06-20  4:46   ` Murthy, Arun R
2025-06-20  4:53     ` Kandpal, Suraj
2025-06-20  4:55       ` Murthy, Arun R
2025-04-14  4:16 ` [PATCH 11/13] drm/i915/backlight: Use drm helper to initialize edp backlight Suraj Kandpal
2025-06-20  5:29   ` Murthy, Arun R
2025-06-20  5:53     ` Kandpal, Suraj
2025-04-14  4:16 ` [PATCH 12/13] drm/i915/backlight: Use drm helper to set " Suraj Kandpal
2025-06-20  5:30   ` Murthy, Arun R
2025-04-14  4:16 ` [PATCH 13/13] drm/i915/backlight: Use drm_edp_backlight_enable Suraj Kandpal
2025-06-20  5:31   ` Murthy, Arun R
2025-04-14  4:53 ` ✓ CI.Patch_applied: success for Modify drm helpers to use luminance (rev2) Patchwork
2025-04-14  4:53 ` ✓ CI.checkpatch: " Patchwork
2025-04-14  4:54 ` ✓ CI.KUnit: " Patchwork
2025-04-14  5:03 ` ✓ CI.Build: " Patchwork
2025-04-14  5:05 ` ✓ CI.Hooks: " Patchwork
2025-04-14  5:07 ` ✗ CI.checksparse: warning " Patchwork
2025-04-14  5:52 ` ✓ Xe.CI.BAT: success " Patchwork
2025-04-14  7:06 ` ✗ Xe.CI.Full: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2025-05-09  5:18 [PATCH 00/13] Modify drm helpers to use luminance Suraj Kandpal
2025-05-09  5:18 ` [PATCH 01/13] drm/dp: Introduce new member in drm_backlight_info Suraj Kandpal
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

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=20250414041637.128039-2-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