Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Animesh Manna <animesh.manna@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [Intel-gfx] [RFC PATCH 3/5] drm/i915/display: Use panel index to parse lfp backlight
Date: Thu,  2 Jun 2022 19:48:48 +0530	[thread overview]
Message-ID: <20220602141850.21301-4-animesh.manna@intel.com> (raw)
In-Reply-To: <20220602141850.21301-1-animesh.manna@intel.com>

There will be separate entry of backlight info for each
LFP in VBT. Panel index is used for deriving backlight info
of the respective panel.

Signed-off-by: Animesh Manna <animesh.manna@intel.com>
---
 drivers/gpu/drm/i915/display/intel_bios.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
index 943c5584f242..34160dc6b092 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -957,11 +957,11 @@ parse_generic_dtd(struct drm_i915_private *i915,
 
 static void
 parse_lfp_backlight(struct drm_i915_private *i915,
-		    struct intel_panel *panel)
+		    struct intel_panel *panel,
+		    int panel_index)
 {
 	const struct bdb_lfp_backlight_data *backlight_data;
 	const struct lfp_backlight_data_entry *entry;
-	int panel_type = panel->vbt.panel_type;
 	u16 level;
 
 	backlight_data = find_section(i915, BDB_LVDS_BACKLIGHT);
@@ -975,7 +975,7 @@ parse_lfp_backlight(struct drm_i915_private *i915,
 		return;
 	}
 
-	entry = &backlight_data->data[panel_type];
+	entry = &backlight_data->data[panel_index];
 
 	panel->vbt.backlight.present = entry->type == BDB_BACKLIGHT_TYPE_PWM;
 	if (!panel->vbt.backlight.present) {
@@ -999,7 +999,7 @@ parse_lfp_backlight(struct drm_i915_private *i915,
 		if (get_blocksize(backlight_data) >= exp_size) {
 			const struct lfp_backlight_control_method *method;
 
-			method = &backlight_data->backlight_control[panel_type];
+			method = &backlight_data->backlight_control[panel_index];
 			panel->vbt.backlight.type = method->type;
 			panel->vbt.backlight.controller = method->controller;
 		}
@@ -1012,11 +1012,11 @@ parse_lfp_backlight(struct drm_i915_private *i915,
 		u16 min_level;
 		bool scale;
 
-		level = backlight_data->brightness_level[panel_type].level;
-		min_level = backlight_data->brightness_min_level[panel_type].level;
+		level = backlight_data->brightness_level[panel_index].level;
+		min_level = backlight_data->brightness_min_level[panel_index].level;
 
 		if (i915->vbt.version >= 236)
-			scale = backlight_data->brightness_precision_bits[panel_type] == 16;
+			scale = backlight_data->brightness_precision_bits[panel_index] == 16;
 		else
 			scale = level > 255;
 
@@ -1028,11 +1028,8 @@ parse_lfp_backlight(struct drm_i915_private *i915,
 			level = 255;
 		}
 		panel->vbt.backlight.min_brightness = min_level;
-
-		panel->vbt.backlight.brightness_precision_bits =
-			backlight_data->brightness_precision_bits[panel_type];
 	} else {
-		level = backlight_data->level[panel_type];
+		level = backlight_data->level[panel_index];
 		panel->vbt.backlight.min_brightness = entry->min_brightness;
 	}
 
@@ -3117,7 +3114,7 @@ void intel_bios_init_panel(struct drm_i915_private *i915,
 	parse_panel_options(i915, panel, edid, panel_index);
 	parse_generic_dtd(i915, panel, panel_index);
 	parse_lfp_data(i915, panel, panel_index);
-	parse_lfp_backlight(i915, panel);
+	parse_lfp_backlight(i915, panel, panel_index);
 	parse_sdvo_panel_data(i915, panel);
 	parse_panel_driver_features(i915, panel);
 	parse_power_conservation_features(i915, panel);
-- 
2.29.0


  parent reply	other threads:[~2022-06-02 14:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02 14:18 [Intel-gfx] [RFC PATCH 0/5] Dual LFP/EDP enablement Animesh Manna
2022-06-02 14:18 ` [Intel-gfx] [RFC PATCH 1/5] drm/i915/bios: calculate drrs mode using panel index for dual LFP Animesh Manna
2022-06-02 15:07   ` Jani Nikula
2022-06-02 15:11     ` Jani Nikula
2022-06-03  9:43       ` Manna, Animesh
2022-06-02 14:18 ` [Intel-gfx] [RFC PATCH 2/5] drm/i915/display: Use panel index to parse panel timing for dual EDP Animesh Manna
2022-06-02 15:12   ` Jani Nikula
2022-06-02 14:18 ` Animesh Manna [this message]
2022-06-02 15:13   ` [Intel-gfx] [RFC PATCH 3/5] drm/i915/display: Use panel index to parse lfp backlight Jani Nikula
2022-06-02 14:18 ` [Intel-gfx] [RFC PATCH 4/5] drm/i915/display: prepend connector name to the backlight Animesh Manna
2022-06-02 15:16   ` Jani Nikula
2022-06-03  3:34     ` Murthy, Arun R
2022-06-03  7:02       ` Jani Nikula
2022-06-21  6:01         ` Murthy, Arun R
2022-06-21  7:17           ` Jani Nikula
2022-07-13  8:17   ` [Intel-gfx] [PATCHv2] drm/i915/display: add support for dual panel backlight Arun R Murthy
2022-08-02 15:00     ` Jani Nikula
2022-08-03  8:10       ` Murthy, Arun R
2022-08-03  8:08     ` [Intel-gfx] [PATCHv3] " Arun R Murthy
2022-08-03  8:19       ` Jani Nikula
2022-06-02 14:18 ` [Intel-gfx] [RFC PATCH 5/5] drm/i915/display/tgl+: Use PPS index from vbt Animesh Manna
2022-06-02 15:32   ` Jani Nikula
2022-06-03 10:29     ` Manna, Animesh
2022-06-02 16:08 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Dual LFP/EDP enablement Patchwork
2022-06-02 16:08 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-06-02 16:49 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-06-02 19:55 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-07-13  9:27 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for Dual LFP/EDP enablement (rev2) Patchwork
2022-08-03  8:42 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for Dual LFP/EDP enablement (rev3) Patchwork

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=20220602141850.21301-4-animesh.manna@intel.com \
    --to=animesh.manna@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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