diff options
author | Animesh Manna <animesh.manna@intel.com> | 2022-06-20 12:21:38 +0530 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2022-06-20 19:56:06 +0300 |
commit | 6434cf630086eea2d091f122f5802582a05d9d1c (patch) | |
tree | 5b1e670a991e0b2372244afed786d91984acf06e /drivers/gpu/drm/i915/display/intel_bios.c | |
parent | 47fa33cc54615161ec5192389e55f3b95274f56f (diff) | |
download | linux-6434cf630086eea2d091f122f5802582a05d9d1c.tar.gz |
drm/i915/bios: calculate panel type as per child device index in VBT
Each LFP may have different panel type which is stored in LFP data
data block. Based on the child device index respective panel-type/
panel-type2 field will be used.
v1: Initial rfc verion.
v2: Based on review comments from Jani,
- Used panel-type instead addition panel-index variable.
- DEVICE_HANDLE_* name changed and placed before DEVICE_TYPE_*
macro.
v3:
- passing intel_bios_encoder_data as argument of
intel_bios_init_panel(). Passing NULL to indicate encoder is not
initialized yet for dsi as current focus is to enable dual EDP. [Jani]
v4:
- encoder->devdata used which is initialized before from vbt
structure. [Jani]
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220620065138.5126-1-animesh.manna@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/display/intel_bios.c')
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_bios.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index 82eef3b1ca87..e89bc1d665f4 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -603,12 +603,14 @@ get_lfp_data_tail(const struct bdb_lvds_lfp_data *data, } static int opregion_get_panel_type(struct drm_i915_private *i915, + const struct intel_bios_encoder_data *devdata, const struct edid *edid) { return intel_opregion_get_panel_type(i915); } static int vbt_get_panel_type(struct drm_i915_private *i915, + const struct intel_bios_encoder_data *devdata, const struct edid *edid) { const struct bdb_lvds_options *lvds_options; @@ -624,10 +626,16 @@ static int vbt_get_panel_type(struct drm_i915_private *i915, return -1; } + if (devdata && devdata->child.handle == DEVICE_HANDLE_LFP2) + return lvds_options->panel_type2; + + drm_WARN_ON(&i915->drm, devdata && devdata->child.handle != DEVICE_HANDLE_LFP1); + return lvds_options->panel_type; } static int pnpid_get_panel_type(struct drm_i915_private *i915, + const struct intel_bios_encoder_data *devdata, const struct edid *edid) { const struct bdb_lvds_lfp_data *data; @@ -674,6 +682,7 @@ static int pnpid_get_panel_type(struct drm_i915_private *i915, } static int fallback_get_panel_type(struct drm_i915_private *i915, + const struct intel_bios_encoder_data *devdata, const struct edid *edid) { return 0; @@ -687,11 +696,13 @@ enum panel_type { }; static int get_panel_type(struct drm_i915_private *i915, + const struct intel_bios_encoder_data *devdata, const struct edid *edid) { struct { const char *name; int (*get_panel_type)(struct drm_i915_private *i915, + const struct intel_bios_encoder_data *devdata, const struct edid *edid); int panel_type; } panel_types[] = { @@ -715,7 +726,7 @@ static int get_panel_type(struct drm_i915_private *i915, int i; for (i = 0; i < ARRAY_SIZE(panel_types); i++) { - panel_types[i].panel_type = panel_types[i].get_panel_type(i915, edid); + panel_types[i].panel_type = panel_types[i].get_panel_type(i915, devdata, edid); drm_WARN_ON(&i915->drm, panel_types[i].panel_type > 0xf && panel_types[i].panel_type != 0xff); @@ -3126,11 +3137,12 @@ out: void intel_bios_init_panel(struct drm_i915_private *i915, struct intel_panel *panel, + const struct intel_bios_encoder_data *devdata, const struct edid *edid) { init_vbt_panel_defaults(panel); - panel->vbt.panel_type = get_panel_type(i915, edid); + panel->vbt.panel_type = get_panel_type(i915, devdata, edid); parse_panel_options(i915, panel); parse_generic_dtd(i915, panel); |