From: Jani Nikula <jani.nikula@intel.com> To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@intel.com, dri-devel@lists.freedesktop.org, rodrigo.vivi@intel.com Subject: [PATCH v4 2/2] drm/i915/bios: convert intel_bios_init_panel() to drm_edid Date: Fri, 1 Jul 2022 11:55:39 +0300 [thread overview] Message-ID: <125183e0b6917bf246d02e63b96b9f31f5ecb358.1656665533.git.jani.nikula@intel.com> (raw) In-Reply-To: <cover.1656665533.git.jani.nikula@intel.com> Try to use struct drm_edid where possible, even if having to fall back to looking into struct edid down low via drm_edid_raw(). v2: Rebase Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/i915/display/intel_bios.c | 19 ++++++++++--------- drivers/gpu/drm/i915/display/intel_bios.h | 4 ++-- drivers/gpu/drm/i915/display/intel_dp.c | 2 +- drivers/gpu/drm/i915/display/intel_lvds.c | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index 51dde5bfd956..2fa296d8e69d 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -606,14 +606,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) + const struct drm_edid *drm_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 drm_edid *drm_edid) { const struct bdb_lvds_options *lvds_options; @@ -638,12 +638,13 @@ static int vbt_get_panel_type(struct drm_i915_private *i915, static int pnpid_get_panel_type(struct drm_i915_private *i915, const struct intel_bios_encoder_data *devdata, - const struct edid *edid) + const struct drm_edid *drm_edid) { const struct bdb_lvds_lfp_data *data; const struct bdb_lvds_lfp_data_ptrs *ptrs; const struct lvds_pnp_id *edid_id; struct lvds_pnp_id edid_id_nodate; + const struct edid *edid = drm_edid_raw(drm_edid); /* FIXME */ int i, best = -1; if (!edid) @@ -685,7 +686,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) + const struct drm_edid *drm_edid) { return 0; } @@ -699,13 +700,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) + const struct drm_edid *drm_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); + const struct drm_edid *drm_edid); int panel_type; } panel_types[] = { [PANEL_TYPE_OPREGION] = { @@ -728,7 +729,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, devdata, edid); + panel_types[i].panel_type = panel_types[i].get_panel_type(i915, devdata, drm_edid); drm_WARN_ON(&i915->drm, panel_types[i].panel_type > 0xf && panel_types[i].panel_type != 0xff); @@ -3144,11 +3145,11 @@ void intel_bios_init(struct drm_i915_private *i915) 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) + const struct drm_edid *drm_edid) { init_vbt_panel_defaults(panel); - panel->vbt.panel_type = get_panel_type(i915, devdata, edid); + panel->vbt.panel_type = get_panel_type(i915, devdata, drm_edid); parse_panel_options(i915, panel); parse_generic_dtd(i915, panel); diff --git a/drivers/gpu/drm/i915/display/intel_bios.h b/drivers/gpu/drm/i915/display/intel_bios.h index e47582b0de0a..defea578a768 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.h +++ b/drivers/gpu/drm/i915/display/intel_bios.h @@ -32,8 +32,8 @@ #include <linux/types.h> +struct drm_edid; struct drm_i915_private; -struct edid; struct intel_bios_encoder_data; struct intel_crtc_state; struct intel_encoder; @@ -235,7 +235,7 @@ void intel_bios_init(struct drm_i915_private *dev_priv); void intel_bios_init_panel(struct drm_i915_private *dev_priv, struct intel_panel *panel, const struct intel_bios_encoder_data *devdata, - const struct edid *edid); + const struct drm_edid *drm_edid); void intel_bios_fini_panel(struct intel_panel *panel); void intel_bios_driver_remove(struct drm_i915_private *dev_priv); bool intel_bios_is_valid_vbt(const void *buf, size_t size); diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 8a3b2dbebe04..f9633fc90e10 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -5265,7 +5265,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, intel_connector->edid = drm_edid; intel_bios_init_panel(dev_priv, &intel_connector->panel, encoder->devdata, - IS_ERR_OR_NULL(drm_edid) ? NULL : drm_edid_raw(drm_edid)); + IS_ERR(drm_edid) ? NULL : drm_edid); intel_panel_add_edid_fixed_modes(intel_connector, intel_connector->panel.vbt.drrs_type != DRRS_TYPE_NONE, diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c index 98c07fd3bd3e..1f578a8ea919 100644 --- a/drivers/gpu/drm/i915/display/intel_lvds.c +++ b/drivers/gpu/drm/i915/display/intel_lvds.c @@ -973,7 +973,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) intel_connector->edid = drm_edid; intel_bios_init_panel(dev_priv, &intel_connector->panel, NULL, - IS_ERR_OR_NULL(drm_edid) ? NULL : drm_edid_raw(drm_edid)); + IS_ERR(drm_edid) ? NULL : drm_edid); /* Try EDID first */ intel_panel_add_edid_fixed_modes(intel_connector, -- 2.30.2
WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@intel.com> To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@intel.com, dri-devel@lists.freedesktop.org, rodrigo.vivi@intel.com Subject: [Intel-gfx] [PATCH v4 2/2] drm/i915/bios: convert intel_bios_init_panel() to drm_edid Date: Fri, 1 Jul 2022 11:55:39 +0300 [thread overview] Message-ID: <125183e0b6917bf246d02e63b96b9f31f5ecb358.1656665533.git.jani.nikula@intel.com> (raw) In-Reply-To: <cover.1656665533.git.jani.nikula@intel.com> Try to use struct drm_edid where possible, even if having to fall back to looking into struct edid down low via drm_edid_raw(). v2: Rebase Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> --- drivers/gpu/drm/i915/display/intel_bios.c | 19 ++++++++++--------- drivers/gpu/drm/i915/display/intel_bios.h | 4 ++-- drivers/gpu/drm/i915/display/intel_dp.c | 2 +- drivers/gpu/drm/i915/display/intel_lvds.c | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c index 51dde5bfd956..2fa296d8e69d 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.c +++ b/drivers/gpu/drm/i915/display/intel_bios.c @@ -606,14 +606,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) + const struct drm_edid *drm_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 drm_edid *drm_edid) { const struct bdb_lvds_options *lvds_options; @@ -638,12 +638,13 @@ static int vbt_get_panel_type(struct drm_i915_private *i915, static int pnpid_get_panel_type(struct drm_i915_private *i915, const struct intel_bios_encoder_data *devdata, - const struct edid *edid) + const struct drm_edid *drm_edid) { const struct bdb_lvds_lfp_data *data; const struct bdb_lvds_lfp_data_ptrs *ptrs; const struct lvds_pnp_id *edid_id; struct lvds_pnp_id edid_id_nodate; + const struct edid *edid = drm_edid_raw(drm_edid); /* FIXME */ int i, best = -1; if (!edid) @@ -685,7 +686,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) + const struct drm_edid *drm_edid) { return 0; } @@ -699,13 +700,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) + const struct drm_edid *drm_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); + const struct drm_edid *drm_edid); int panel_type; } panel_types[] = { [PANEL_TYPE_OPREGION] = { @@ -728,7 +729,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, devdata, edid); + panel_types[i].panel_type = panel_types[i].get_panel_type(i915, devdata, drm_edid); drm_WARN_ON(&i915->drm, panel_types[i].panel_type > 0xf && panel_types[i].panel_type != 0xff); @@ -3144,11 +3145,11 @@ void intel_bios_init(struct drm_i915_private *i915) 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) + const struct drm_edid *drm_edid) { init_vbt_panel_defaults(panel); - panel->vbt.panel_type = get_panel_type(i915, devdata, edid); + panel->vbt.panel_type = get_panel_type(i915, devdata, drm_edid); parse_panel_options(i915, panel); parse_generic_dtd(i915, panel); diff --git a/drivers/gpu/drm/i915/display/intel_bios.h b/drivers/gpu/drm/i915/display/intel_bios.h index e47582b0de0a..defea578a768 100644 --- a/drivers/gpu/drm/i915/display/intel_bios.h +++ b/drivers/gpu/drm/i915/display/intel_bios.h @@ -32,8 +32,8 @@ #include <linux/types.h> +struct drm_edid; struct drm_i915_private; -struct edid; struct intel_bios_encoder_data; struct intel_crtc_state; struct intel_encoder; @@ -235,7 +235,7 @@ void intel_bios_init(struct drm_i915_private *dev_priv); void intel_bios_init_panel(struct drm_i915_private *dev_priv, struct intel_panel *panel, const struct intel_bios_encoder_data *devdata, - const struct edid *edid); + const struct drm_edid *drm_edid); void intel_bios_fini_panel(struct intel_panel *panel); void intel_bios_driver_remove(struct drm_i915_private *dev_priv); bool intel_bios_is_valid_vbt(const void *buf, size_t size); diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 8a3b2dbebe04..f9633fc90e10 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -5265,7 +5265,7 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp, intel_connector->edid = drm_edid; intel_bios_init_panel(dev_priv, &intel_connector->panel, encoder->devdata, - IS_ERR_OR_NULL(drm_edid) ? NULL : drm_edid_raw(drm_edid)); + IS_ERR(drm_edid) ? NULL : drm_edid); intel_panel_add_edid_fixed_modes(intel_connector, intel_connector->panel.vbt.drrs_type != DRRS_TYPE_NONE, diff --git a/drivers/gpu/drm/i915/display/intel_lvds.c b/drivers/gpu/drm/i915/display/intel_lvds.c index 98c07fd3bd3e..1f578a8ea919 100644 --- a/drivers/gpu/drm/i915/display/intel_lvds.c +++ b/drivers/gpu/drm/i915/display/intel_lvds.c @@ -973,7 +973,7 @@ void intel_lvds_init(struct drm_i915_private *dev_priv) intel_connector->edid = drm_edid; intel_bios_init_panel(dev_priv, &intel_connector->panel, NULL, - IS_ERR_OR_NULL(drm_edid) ? NULL : drm_edid_raw(drm_edid)); + IS_ERR(drm_edid) ? NULL : drm_edid); /* Try EDID first */ intel_panel_add_edid_fixed_modes(intel_connector, -- 2.30.2
next prev parent reply other threads:[~2022-07-01 8:56 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-07-01 8:55 [PATCH v4 0/2] drm/i915: switch DP, HDMI and LVDS to drm_edid Jani Nikula 2022-07-01 8:55 ` [Intel-gfx] " Jani Nikula 2022-07-01 8:55 ` [PATCH v4 1/2] drm/i915/edid: convert " Jani Nikula 2022-07-01 8:55 ` [Intel-gfx] " Jani Nikula 2022-07-01 9:01 ` Jani Nikula 2022-07-01 9:01 ` [Intel-gfx] " Jani Nikula 2022-07-01 12:57 ` Ville Syrjälä 2022-07-01 12:57 ` [Intel-gfx] " Ville Syrjälä 2022-07-01 8:55 ` Jani Nikula [this message] 2022-07-01 8:55 ` [Intel-gfx] [PATCH v4 2/2] drm/i915/bios: convert intel_bios_init_panel() " Jani Nikula 2022-07-01 9:38 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: switch DP, HDMI and LVDS " Patchwork 2022-07-01 9:59 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork 2022-07-02 2:04 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=125183e0b6917bf246d02e63b96b9f31f5ecb358.1656665533.git.jani.nikula@intel.com \ --to=jani.nikula@intel.com \ --cc=dri-devel@lists.freedesktop.org \ --cc=intel-gfx@lists.freedesktop.org \ --cc=rodrigo.vivi@intel.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.