Skip to content

Commit 43b26bd

Browse files
Karthikeyan Ramasubramanianrodrigovivi
authored andcommitted
drm/i915/bios: Fix parsing backlight BDB data
Starting BDB version 239, hdr_dpcd_refresh_timeout is introduced to backlight BDB data. Commit 7000345 ("drm/i915/bios: Define more BDB contents") updated the backlight BDB data accordingly. This broke the parsing of backlight BDB data in VBT for versions 236 - 238 (both inclusive) and hence the backlight controls are not responding on units with the concerned BDB version. backlight_control information has been present in backlight BDB data from at least BDB version 191 onwards, if not before. Hence this patch extracts the backlight_control information for BDB version 191 or newer. Tested on Chromebooks using Jasperlake SoC (reports bdb->version = 236). Tested on Chromebooks using Raptorlake SoC (reports bdb->version = 251). v2: removed checking the block size of the backlight BDB data [vsyrjala: this is completely safe thanks to commit e163cfb ("drm/i915/bios: Make copies of VBT data blocks")] Fixes: 7000345 ("drm/i915/bios: Define more BDB contents") Cc: stable@vger.kernel.org Cc: Jani Nikula <jani.nikula@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240221180622.v2.1.I0690aa3e96a83a43b3fc33f50395d334b2981826@changeid Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (cherry picked from commit c286f6a) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent c66b835 commit 43b26bd

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

drivers/gpu/drm/i915/display/intel_bios.c

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,22 +1042,11 @@ parse_lfp_backlight(struct drm_i915_private *i915,
10421042
panel->vbt.backlight.type = INTEL_BACKLIGHT_DISPLAY_DDI;
10431043
panel->vbt.backlight.controller = 0;
10441044
if (i915->display.vbt.version >= 191) {
1045-
size_t exp_size;
1045+
const struct lfp_backlight_control_method *method;
10461046

1047-
if (i915->display.vbt.version >= 236)
1048-
exp_size = sizeof(struct bdb_lfp_backlight_data);
1049-
else if (i915->display.vbt.version >= 234)
1050-
exp_size = EXP_BDB_LFP_BL_DATA_SIZE_REV_234;
1051-
else
1052-
exp_size = EXP_BDB_LFP_BL_DATA_SIZE_REV_191;
1053-
1054-
if (get_blocksize(backlight_data) >= exp_size) {
1055-
const struct lfp_backlight_control_method *method;
1056-
1057-
method = &backlight_data->backlight_control[panel_type];
1058-
panel->vbt.backlight.type = method->type;
1059-
panel->vbt.backlight.controller = method->controller;
1060-
}
1047+
method = &backlight_data->backlight_control[panel_type];
1048+
panel->vbt.backlight.type = method->type;
1049+
panel->vbt.backlight.controller = method->controller;
10611050
}
10621051

10631052
panel->vbt.backlight.pwm_freq_hz = entry->pwm_freq_hz;

drivers/gpu/drm/i915/display/intel_vbt_defs.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -897,11 +897,6 @@ struct lfp_brightness_level {
897897
u16 reserved;
898898
} __packed;
899899

900-
#define EXP_BDB_LFP_BL_DATA_SIZE_REV_191 \
901-
offsetof(struct bdb_lfp_backlight_data, brightness_level)
902-
#define EXP_BDB_LFP_BL_DATA_SIZE_REV_234 \
903-
offsetof(struct bdb_lfp_backlight_data, brightness_precision_bits)
904-
905900
struct bdb_lfp_backlight_data {
906901
u8 entry_size;
907902
struct lfp_backlight_data_entry data[16];

0 commit comments

Comments
 (0)