[Intel-gfx] [RFC PATCH 2/5] drm/i915/display: Use panel index to parse panel timing for dual EDP

Jani Nikula jani.nikula at intel.com
Thu Jun 2 15:12:03 UTC 2022


On Thu, 02 Jun 2022, Animesh Manna <animesh.manna at intel.com> wrote:
> There will be separate entry for eack LFP in VBT. Panel index is
> used for deriving panel timing info of the respective panel.

This is completely unnecessary once you handle panel_type properly as
explained in reply to the previous patch.

BR,
Jani.


>
> Signed-off-by: Animesh Manna <animesh.manna at intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_bios.c | 26 ++++++++++++-----------
>  1 file changed, 14 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index 78eaf6255599..943c5584f242 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -793,16 +793,16 @@ static void
>  parse_lfp_panel_dtd(struct drm_i915_private *i915,
>  		    struct intel_panel *panel,
>  		    const struct bdb_lvds_lfp_data *lvds_lfp_data,
> -		    const struct bdb_lvds_lfp_data_ptrs *lvds_lfp_data_ptrs)
> +		    const struct bdb_lvds_lfp_data_ptrs *lvds_lfp_data_ptrs,
> +		    int panel_index)
>  {
>  	const struct lvds_dvo_timing *panel_dvo_timing;
>  	const struct lvds_fp_timing *fp_timing;
>  	struct drm_display_mode *panel_fixed_mode;
> -	int panel_type = panel->vbt.panel_type;
>  
>  	panel_dvo_timing = get_lvds_dvo_timing(lvds_lfp_data,
>  					       lvds_lfp_data_ptrs,
> -					       panel_type);
> +					       panel_index);
>  
>  	panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL);
>  	if (!panel_fixed_mode)
> @@ -818,7 +818,7 @@ parse_lfp_panel_dtd(struct drm_i915_private *i915,
>  
>  	fp_timing = get_lvds_fp_timing(lvds_lfp_data,
>  				       lvds_lfp_data_ptrs,
> -				       panel_type);
> +				       panel_index);
>  
>  	/* check the resolution, just to be sure */
>  	if (fp_timing->x_res == panel_fixed_mode->hdisplay &&
> @@ -832,7 +832,8 @@ parse_lfp_panel_dtd(struct drm_i915_private *i915,
>  
>  static void
>  parse_lfp_data(struct drm_i915_private *i915,
> -	       struct intel_panel *panel)
> +	       struct intel_panel *panel,
> +	       int panel_index)
>  {
>  	const struct bdb_lvds_lfp_data *data;
>  	const struct bdb_lvds_lfp_data_tail *tail;
> @@ -848,7 +849,7 @@ parse_lfp_data(struct drm_i915_private *i915,
>  		return;
>  
>  	if (!panel->vbt.lfp_lvds_vbt_mode)
> -		parse_lfp_panel_dtd(i915, panel, data, ptrs);
> +		parse_lfp_panel_dtd(i915, panel, data, ptrs, panel_index);
>  
>  	tail = get_lfp_data_tail(data, ptrs);
>  	if (!tail)
> @@ -865,7 +866,8 @@ parse_lfp_data(struct drm_i915_private *i915,
>  
>  static void
>  parse_generic_dtd(struct drm_i915_private *i915,
> -		  struct intel_panel *panel)
> +		  struct intel_panel *panel,
> +		  int panel_index)
>  {
>  	const struct bdb_generic_dtd *generic_dtd;
>  	const struct generic_dtd_entry *dtd;
> @@ -900,14 +902,14 @@ parse_generic_dtd(struct drm_i915_private *i915,
>  
>  	num_dtd = (get_blocksize(generic_dtd) -
>  		   sizeof(struct bdb_generic_dtd)) / generic_dtd->gdtd_size;
> -	if (panel->vbt.panel_type >= num_dtd) {
> +	if (panel_index >= num_dtd) {
>  		drm_err(&i915->drm,
>  			"Panel type %d not found in table of %d DTD's\n",
> -			panel->vbt.panel_type, num_dtd);
> +			panel_index, num_dtd);
>  		return;
>  	}
>  
> -	dtd = &generic_dtd->dtd[panel->vbt.panel_type];
> +	dtd = &generic_dtd->dtd[panel_index];
>  
>  	panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL);
>  	if (!panel_fixed_mode)
> @@ -3113,8 +3115,8 @@ void intel_bios_init_panel(struct drm_i915_private *i915,
>  	panel_index = get_lfp_panel_index(i915, lfp_inst);
>  
>  	parse_panel_options(i915, panel, edid, panel_index);
> -	parse_generic_dtd(i915, panel);
> -	parse_lfp_data(i915, panel);
> +	parse_generic_dtd(i915, panel, panel_index);
> +	parse_lfp_data(i915, panel, panel_index);
>  	parse_lfp_backlight(i915, panel);
>  	parse_sdvo_panel_data(i915, panel);
>  	parse_panel_driver_features(i915, panel);

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list