mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
eeeebea6cb
commit
3e845c7a40
|
@ -1445,6 +1445,7 @@ struct intel_vbt_data {
|
||||||
unsigned int lvds_use_ssc:1;
|
unsigned int lvds_use_ssc:1;
|
||||||
unsigned int display_clock_mode:1;
|
unsigned int display_clock_mode:1;
|
||||||
unsigned int fdi_rx_polarity_inverted:1;
|
unsigned int fdi_rx_polarity_inverted:1;
|
||||||
|
unsigned int panel_type:4;
|
||||||
int lvds_ssc_freq;
|
int lvds_ssc_freq;
|
||||||
unsigned int bios_lvds_val; /* initial [PCH_]LVDS reg val in VBIOS */
|
unsigned int bios_lvds_val; /* initial [PCH_]LVDS reg val in VBIOS */
|
||||||
|
|
||||||
|
|
|
@ -58,8 +58,6 @@
|
||||||
#define SLAVE_ADDR1 0x70
|
#define SLAVE_ADDR1 0x70
|
||||||
#define SLAVE_ADDR2 0x72
|
#define SLAVE_ADDR2 0x72
|
||||||
|
|
||||||
static int panel_type;
|
|
||||||
|
|
||||||
/* Get BDB block size given a pointer to Block ID. */
|
/* Get BDB block size given a pointer to Block ID. */
|
||||||
static u32 _get_blocksize(const u8 *block_base)
|
static u32 _get_blocksize(const u8 *block_base)
|
||||||
{
|
{
|
||||||
|
@ -205,6 +203,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
|
||||||
const struct lvds_dvo_timing *panel_dvo_timing;
|
const struct lvds_dvo_timing *panel_dvo_timing;
|
||||||
const struct lvds_fp_timing *fp_timing;
|
const struct lvds_fp_timing *fp_timing;
|
||||||
struct drm_display_mode *panel_fixed_mode;
|
struct drm_display_mode *panel_fixed_mode;
|
||||||
|
int panel_type;
|
||||||
int drrs_mode;
|
int drrs_mode;
|
||||||
|
|
||||||
lvds_options = find_section(bdb, BDB_LVDS_OPTIONS);
|
lvds_options = find_section(bdb, BDB_LVDS_OPTIONS);
|
||||||
|
@ -219,6 +218,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
|
||||||
}
|
}
|
||||||
|
|
||||||
panel_type = lvds_options->panel_type;
|
panel_type = lvds_options->panel_type;
|
||||||
|
dev_priv->vbt.panel_type = panel_type;
|
||||||
|
|
||||||
drrs_mode = (lvds_options->dps_panel_type_bits
|
drrs_mode = (lvds_options->dps_panel_type_bits
|
||||||
>> (panel_type * 2)) & MODE_MASK;
|
>> (panel_type * 2)) & MODE_MASK;
|
||||||
|
@ -254,7 +254,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
|
||||||
|
|
||||||
panel_dvo_timing = get_lvds_dvo_timing(lvds_lfp_data,
|
panel_dvo_timing = get_lvds_dvo_timing(lvds_lfp_data,
|
||||||
lvds_lfp_data_ptrs,
|
lvds_lfp_data_ptrs,
|
||||||
lvds_options->panel_type);
|
panel_type);
|
||||||
|
|
||||||
panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL);
|
panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL);
|
||||||
if (!panel_fixed_mode)
|
if (!panel_fixed_mode)
|
||||||
|
@ -269,7 +269,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
|
||||||
|
|
||||||
fp_timing = get_lvds_fp_timing(bdb, lvds_lfp_data,
|
fp_timing = get_lvds_fp_timing(bdb, lvds_lfp_data,
|
||||||
lvds_lfp_data_ptrs,
|
lvds_lfp_data_ptrs,
|
||||||
lvds_options->panel_type);
|
panel_type);
|
||||||
if (fp_timing) {
|
if (fp_timing) {
|
||||||
/* check the resolution, just to be sure */
|
/* check the resolution, just to be sure */
|
||||||
if (fp_timing->x_res == panel_fixed_mode->hdisplay &&
|
if (fp_timing->x_res == panel_fixed_mode->hdisplay &&
|
||||||
|
@ -287,6 +287,7 @@ parse_lfp_backlight(struct drm_i915_private *dev_priv,
|
||||||
{
|
{
|
||||||
const struct bdb_lfp_backlight_data *backlight_data;
|
const struct bdb_lfp_backlight_data *backlight_data;
|
||||||
const struct bdb_lfp_backlight_data_entry *entry;
|
const struct bdb_lfp_backlight_data_entry *entry;
|
||||||
|
int panel_type = dev_priv->vbt.panel_type;
|
||||||
|
|
||||||
backlight_data = find_section(bdb, BDB_LVDS_BACKLIGHT);
|
backlight_data = find_section(bdb, BDB_LVDS_BACKLIGHT);
|
||||||
if (!backlight_data)
|
if (!backlight_data)
|
||||||
|
@ -549,6 +550,7 @@ parse_edp(struct drm_i915_private *dev_priv, const struct bdb_header *bdb)
|
||||||
const struct bdb_edp *edp;
|
const struct bdb_edp *edp;
|
||||||
const struct edp_power_seq *edp_pps;
|
const struct edp_power_seq *edp_pps;
|
||||||
const struct edp_link_params *edp_link_params;
|
const struct edp_link_params *edp_link_params;
|
||||||
|
int panel_type = dev_priv->vbt.panel_type;
|
||||||
|
|
||||||
edp = find_section(bdb, BDB_EDP);
|
edp = find_section(bdb, BDB_EDP);
|
||||||
if (!edp) {
|
if (!edp) {
|
||||||
|
@ -660,6 +662,7 @@ parse_psr(struct drm_i915_private *dev_priv, const struct bdb_header *bdb)
|
||||||
{
|
{
|
||||||
const struct bdb_psr *psr;
|
const struct bdb_psr *psr;
|
||||||
const struct psr_table *psr_table;
|
const struct psr_table *psr_table;
|
||||||
|
int panel_type = dev_priv->vbt.panel_type;
|
||||||
|
|
||||||
psr = find_section(bdb, BDB_PSR);
|
psr = find_section(bdb, BDB_PSR);
|
||||||
if (!psr) {
|
if (!psr) {
|
||||||
|
@ -706,6 +709,7 @@ parse_mipi_config(struct drm_i915_private *dev_priv,
|
||||||
const struct bdb_mipi_config *start;
|
const struct bdb_mipi_config *start;
|
||||||
const struct mipi_config *config;
|
const struct mipi_config *config;
|
||||||
const struct mipi_pps_data *pps;
|
const struct mipi_pps_data *pps;
|
||||||
|
int panel_type = dev_priv->vbt.panel_type;
|
||||||
|
|
||||||
/* parse MIPI blocks only if LFP type is MIPI */
|
/* parse MIPI blocks only if LFP type is MIPI */
|
||||||
if (!intel_bios_is_dsi_present(dev_priv, NULL))
|
if (!intel_bios_is_dsi_present(dev_priv, NULL))
|
||||||
|
@ -913,6 +917,7 @@ static void
|
||||||
parse_mipi_sequence(struct drm_i915_private *dev_priv,
|
parse_mipi_sequence(struct drm_i915_private *dev_priv,
|
||||||
const struct bdb_header *bdb)
|
const struct bdb_header *bdb)
|
||||||
{
|
{
|
||||||
|
int panel_type = dev_priv->vbt.panel_type;
|
||||||
const struct bdb_mipi_sequence *sequence;
|
const struct bdb_mipi_sequence *sequence;
|
||||||
const u8 *seq_data;
|
const u8 *seq_data;
|
||||||
u32 seq_size;
|
u32 seq_size;
|
||||||
|
|
Loading…
Reference in New Issue