From 93221aa7cbbb9bfa051346ca37c76132f0ece43a Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 20 May 2024 05:22:41 +0000 Subject: [PATCH] drm/i915/bios: Fix parsing backlight BDB data From Karthikeyan Ramasubramanian ca82830e453364d192e3c0c92a0f8823f621879c in linux-6.6.y/6.6.3 43b26bdd2ee5cfca80939be910d5b23a50cd7f9d in mainline linux --- sys/dev/pci/drm/i915/display/intel_bios.c | 19 ++++--------------- sys/dev/pci/drm/i915/display/intel_vbt_defs.h | 5 ----- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/sys/dev/pci/drm/i915/display/intel_bios.c b/sys/dev/pci/drm/i915/display/intel_bios.c index 5694147a63a..e7dcbcdb388 100644 --- a/sys/dev/pci/drm/i915/display/intel_bios.c +++ b/sys/dev/pci/drm/i915/display/intel_bios.c @@ -1035,22 +1035,11 @@ parse_lfp_backlight(struct drm_i915_private *i915, panel->vbt.backlight.type = INTEL_BACKLIGHT_DISPLAY_DDI; panel->vbt.backlight.controller = 0; if (i915->display.vbt.version >= 191) { - size_t exp_size; + const struct lfp_backlight_control_method *method; - if (i915->display.vbt.version >= 236) - exp_size = sizeof(struct bdb_lfp_backlight_data); - else if (i915->display.vbt.version >= 234) - exp_size = EXP_BDB_LFP_BL_DATA_SIZE_REV_234; - else - exp_size = EXP_BDB_LFP_BL_DATA_SIZE_REV_191; - - if (get_blocksize(backlight_data) >= exp_size) { - const struct lfp_backlight_control_method *method; - - method = &backlight_data->backlight_control[panel_type]; - panel->vbt.backlight.type = method->type; - panel->vbt.backlight.controller = method->controller; - } + method = &backlight_data->backlight_control[panel_type]; + panel->vbt.backlight.type = method->type; + panel->vbt.backlight.controller = method->controller; } panel->vbt.backlight.pwm_freq_hz = entry->pwm_freq_hz; diff --git a/sys/dev/pci/drm/i915/display/intel_vbt_defs.h b/sys/dev/pci/drm/i915/display/intel_vbt_defs.h index a9f44abfc9f..b50cd0dcabd 100644 --- a/sys/dev/pci/drm/i915/display/intel_vbt_defs.h +++ b/sys/dev/pci/drm/i915/display/intel_vbt_defs.h @@ -897,11 +897,6 @@ struct lfp_brightness_level { u16 reserved; } __packed; -#define EXP_BDB_LFP_BL_DATA_SIZE_REV_191 \ - offsetof(struct bdb_lfp_backlight_data, brightness_level) -#define EXP_BDB_LFP_BL_DATA_SIZE_REV_234 \ - offsetof(struct bdb_lfp_backlight_data, brightness_precision_bits) - struct bdb_lfp_backlight_data { u8 entry_size; struct lfp_backlight_data_entry data[16]; -- 2.20.1