drm/i915/bios: Move panel_type stuff out of parse_panel_options()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 15 Jun 2022 15:14:43 +0000 (18:14 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 16 Jun 2022 14:13:29 +0000 (17:13 +0300)
Parsing the panel_type is a bit special and should be done
before we parse anything else potentially panel-specific from
the VBT. So move it out from parse_panel_options(). It doesn't
neet to be there anyway since it'll do its own LVDS options
block lookup.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220615151445.8531-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_bios.c

index 64ee418c0c5d5bae9877625fe33d61e4630be9d0..5ed8cebdd41f8f19835736f2b34d4d59e003a5e3 100644 (file)
@@ -745,11 +745,10 @@ static int get_panel_type(struct drm_i915_private *i915,
 /* Parse general panel options */
 static void
 parse_panel_options(struct drm_i915_private *i915,
-                   struct intel_panel *panel,
-                   const struct edid *edid)
+                   struct intel_panel *panel)
 {
        const struct bdb_lvds_options *lvds_options;
-       int panel_type;
+       int panel_type = panel->vbt.panel_type;
        int drrs_mode;
 
        lvds_options = find_section(i915, BDB_LVDS_OPTIONS);
@@ -758,10 +757,6 @@ parse_panel_options(struct drm_i915_private *i915,
 
        panel->vbt.lvds_dither = lvds_options->pixel_dither;
 
-       panel_type = get_panel_type(i915, edid);
-
-       panel->vbt.panel_type = panel_type;
-
        drrs_mode = (lvds_options->dps_panel_type_bits
                                >> (panel_type * 2)) & MODE_MASK;
        /*
@@ -3116,7 +3111,9 @@ void intel_bios_init_panel(struct drm_i915_private *i915,
 {
        init_vbt_panel_defaults(panel);
 
-       parse_panel_options(i915, panel, edid);
+       panel->vbt.panel_type = get_panel_type(i915, edid);
+
+       parse_panel_options(i915, panel);
        parse_generic_dtd(i915, panel);
        parse_lfp_data(i915, panel);
        parse_lfp_backlight(i915, panel);