Skip to content

Commit 3e845c7

Browse files
committed
drm/i915: Replace the static panel_type variable with dev_priv->vbt.panel_type
Store the extracted panel_type under dev_priv.vbt instead of keeping around a static variable for it. Cc: Rob Kramer <rob@solution-space.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
1 parent eeeebea commit 3e845c7

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

drivers/gpu/drm/i915/i915_drv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,6 +1445,7 @@ struct intel_vbt_data {
14451445
unsigned int lvds_use_ssc:1;
14461446
unsigned int display_clock_mode:1;
14471447
unsigned int fdi_rx_polarity_inverted:1;
1448+
unsigned int panel_type:4;
14481449
int lvds_ssc_freq;
14491450
unsigned int bios_lvds_val; /* initial [PCH_]LVDS reg val in VBIOS */
14501451

drivers/gpu/drm/i915/intel_bios.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@
5858
#define SLAVE_ADDR1 0x70
5959
#define SLAVE_ADDR2 0x72
6060

61-
static int panel_type;
62-
6361
/* Get BDB block size given a pointer to Block ID. */
6462
static u32 _get_blocksize(const u8 *block_base)
6563
{
@@ -205,6 +203,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
205203
const struct lvds_dvo_timing *panel_dvo_timing;
206204
const struct lvds_fp_timing *fp_timing;
207205
struct drm_display_mode *panel_fixed_mode;
206+
int panel_type;
208207
int drrs_mode;
209208

210209
lvds_options = find_section(bdb, BDB_LVDS_OPTIONS);
@@ -219,6 +218,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
219218
}
220219

221220
panel_type = lvds_options->panel_type;
221+
dev_priv->vbt.panel_type = panel_type;
222222

223223
drrs_mode = (lvds_options->dps_panel_type_bits
224224
>> (panel_type * 2)) & MODE_MASK;
@@ -254,7 +254,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
254254

255255
panel_dvo_timing = get_lvds_dvo_timing(lvds_lfp_data,
256256
lvds_lfp_data_ptrs,
257-
lvds_options->panel_type);
257+
panel_type);
258258

259259
panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL);
260260
if (!panel_fixed_mode)
@@ -269,7 +269,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
269269

270270
fp_timing = get_lvds_fp_timing(bdb, lvds_lfp_data,
271271
lvds_lfp_data_ptrs,
272-
lvds_options->panel_type);
272+
panel_type);
273273
if (fp_timing) {
274274
/* check the resolution, just to be sure */
275275
if (fp_timing->x_res == panel_fixed_mode->hdisplay &&
@@ -287,6 +287,7 @@ parse_lfp_backlight(struct drm_i915_private *dev_priv,
287287
{
288288
const struct bdb_lfp_backlight_data *backlight_data;
289289
const struct bdb_lfp_backlight_data_entry *entry;
290+
int panel_type = dev_priv->vbt.panel_type;
290291

291292
backlight_data = find_section(bdb, BDB_LVDS_BACKLIGHT);
292293
if (!backlight_data)
@@ -549,6 +550,7 @@ parse_edp(struct drm_i915_private *dev_priv, const struct bdb_header *bdb)
549550
const struct bdb_edp *edp;
550551
const struct edp_power_seq *edp_pps;
551552
const struct edp_link_params *edp_link_params;
553+
int panel_type = dev_priv->vbt.panel_type;
552554

553555
edp = find_section(bdb, BDB_EDP);
554556
if (!edp) {
@@ -660,6 +662,7 @@ parse_psr(struct drm_i915_private *dev_priv, const struct bdb_header *bdb)
660662
{
661663
const struct bdb_psr *psr;
662664
const struct psr_table *psr_table;
665+
int panel_type = dev_priv->vbt.panel_type;
663666

664667
psr = find_section(bdb, BDB_PSR);
665668
if (!psr) {
@@ -706,6 +709,7 @@ parse_mipi_config(struct drm_i915_private *dev_priv,
706709
const struct bdb_mipi_config *start;
707710
const struct mipi_config *config;
708711
const struct mipi_pps_data *pps;
712+
int panel_type = dev_priv->vbt.panel_type;
709713

710714
/* parse MIPI blocks only if LFP type is MIPI */
711715
if (!intel_bios_is_dsi_present(dev_priv, NULL))
@@ -913,6 +917,7 @@ static void
913917
parse_mipi_sequence(struct drm_i915_private *dev_priv,
914918
const struct bdb_header *bdb)
915919
{
920+
int panel_type = dev_priv->vbt.panel_type;
916921
const struct bdb_mipi_sequence *sequence;
917922
const u8 *seq_data;
918923
u32 seq_size;

0 commit comments

Comments
 (0)