drm/i915/bios: Fix parsing backlight BDB data
authorjsg <jsg@openbsd.org>
Mon, 20 May 2024 05:22:41 +0000 (05:22 +0000)
committerjsg <jsg@openbsd.org>
Mon, 20 May 2024 05:22:41 +0000 (05:22 +0000)
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
sys/dev/pci/drm/i915/display/intel_vbt_defs.h

index 5694147..e7dcbcd 100644 (file)
@@ -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;
index a9f44ab..b50cd0d 100644 (file)
@@ -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];