From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Mahesh Kumar <mahesh1.kumar@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
Lucas De Marchi <lucas.demarchi@intel.com>
Subject: Re: [PATCH 4/8] drm/i915/icl: Use helper functions to classify the ports
Date: Wed, 3 Oct 2018 10:59:30 -0700 [thread overview]
Message-ID: <20181003175930.GG9811@intel.com> (raw)
In-Reply-To: <20181003072203.12848-5-mahesh1.kumar@intel.com>
On Wed, Oct 03, 2018 at 12:51:59PM +0530, Mahesh Kumar wrote:
> From: Vandita Kulkarni <vandita.kulkarni@intel.com>
>
> Use intel_port_is_tc and intel_port_is_combophy
> functions to replace the individual port checks
> from port C to F and port A to B respectively.
>
> Signed-off-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
> Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Madhav Chauhan <madhav.chauhan@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 15 ++++-----------
> drivers/gpu/drm/i915/intel_dpll_mgr.c | 14 ++++----------
> 2 files changed, 8 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 16d9a20a420a..e31d71526afd 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -9296,24 +9296,17 @@ static void icelake_get_ddi_pll(struct drm_i915_private *dev_priv,
> u32 temp;
>
> /* TODO: TBT pll not implemented. */
> - switch (port) {
> - case PORT_A:
> - case PORT_B:
> + if (intel_port_is_combophy(dev_priv, port)) {
> temp = I915_READ(DPCLKA_CFGCR0_ICL) &
> DPCLKA_CFGCR0_DDI_CLK_SEL_MASK(port);
> id = temp >> DPCLKA_CFGCR0_DDI_CLK_SEL_SHIFT(port);
>
> if (WARN_ON(id != DPLL_ID_ICL_DPLL0 && id != DPLL_ID_ICL_DPLL1))
> return;
> - break;
> - case PORT_C:
> - case PORT_D:
> - case PORT_E:
> - case PORT_F:
> + } else if (intel_port_is_tc(dev_priv, port)) {
> id = icl_port_to_mg_pll_id(port);
> - break;
> - default:
> - MISSING_CASE(port);
> + } else {
> + WARN(1, "Invalid port %x\n", port);
> return;
> }
>
> diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.c b/drivers/gpu/drm/i915/intel_dpll_mgr.c
> index 510ea90f6f5b..5b2ee49aee14 100644
> --- a/drivers/gpu/drm/i915/intel_dpll_mgr.c
> +++ b/drivers/gpu/drm/i915/intel_dpll_mgr.c
> @@ -2874,6 +2874,7 @@ static struct intel_shared_dpll *
> icl_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state,
> struct intel_encoder *encoder)
> {
> + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> struct intel_digital_port *intel_dig_port =
> enc_to_dig_port(&encoder->base);
> struct intel_shared_dpll *pll;
> @@ -2883,18 +2884,12 @@ icl_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state,
> int clock = crtc_state->port_clock;
> bool ret;
>
> - switch (port) {
> - case PORT_A:
> - case PORT_B:
> + if (intel_port_is_combophy(dev_priv, port)) {
> min = DPLL_ID_ICL_DPLL0;
> max = DPLL_ID_ICL_DPLL1;
> ret = icl_calc_dpll_state(crtc_state, encoder, clock,
> &pll_state);
> - break;
> - case PORT_C:
> - case PORT_D:
> - case PORT_E:
> - case PORT_F:
> + } else if (intel_port_is_tc(dev_priv, port)) {
> if (intel_dig_port->tc_type == TC_PORT_TBT) {
> min = DPLL_ID_ICL_TBTPLL;
> max = min;
> @@ -2906,8 +2901,7 @@ icl_get_dpll(struct intel_crtc *crtc, struct intel_crtc_state *crtc_state,
> ret = icl_calc_mg_pll_state(crtc_state, encoder, clock,
> &pll_state);
> }
> - break;
> - default:
> + } else {
> MISSING_CASE(port);
> return NULL;
> }
> --
> 2.16.2
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-10-03 17:59 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-03 7:21 [PATCH 0/8] Refactor and Add helper function for combophy/tc ports Mahesh Kumar
2018-10-03 7:21 ` [PATCH 1/8] drm/i915/icl: create function to identify combophy port Mahesh Kumar
2018-10-03 17:57 ` Rodrigo Vivi
2018-10-03 18:03 ` Lucas De Marchi
2018-10-04 8:50 ` [PATCH v2 " Mahesh Kumar
2018-10-04 20:00 ` Lucas De Marchi
2018-10-15 21:58 ` [PATCH " Manasi Navare
2018-10-03 7:21 ` [PATCH 2/8] drm/i915/icl: use combophy/TC helper functions during display detection Mahesh Kumar
2018-10-03 17:58 ` Rodrigo Vivi
2018-10-04 21:16 ` Lucas De Marchi
2018-10-03 7:21 ` [PATCH 3/8] drm/i915/icl: Refactor get_ddi_pll using helper func Mahesh Kumar
2018-10-04 21:18 ` Lucas De Marchi
2018-10-03 7:21 ` [PATCH 4/8] drm/i915/icl: Use helper functions to classify the ports Mahesh Kumar
2018-10-03 17:59 ` Rodrigo Vivi [this message]
2018-10-04 21:21 ` Lucas De Marchi
2018-10-03 7:22 ` [PATCH 5/8] drm/i915/icl: Refactor icl pll functions Mahesh Kumar
2018-10-04 21:24 ` Lucas De Marchi
2018-10-03 7:22 ` [PATCH 6/8] drm/i915/icl: Combine all port/combophy macros at one place Mahesh Kumar
2018-10-12 22:09 ` Rodrigo Vivi
2018-10-12 23:47 ` [PATCH v2] " Lucas De Marchi
2018-10-03 7:22 ` [PATCH 7/8] drm/i915/icl: Introduce new macros to get combophy registers Mahesh Kumar
2018-10-12 22:25 ` Rodrigo Vivi
2018-10-12 22:58 ` Lucas De Marchi
2018-10-15 16:29 ` Rodrigo Vivi
2018-10-16 2:35 ` [PATCH v2] " Lucas De Marchi
2018-10-16 16:04 ` Rodrigo Vivi
2018-10-03 7:22 ` [PATCH 8/8] drm/i915/icl: Fix DDI/TC port clk_off bits Mahesh Kumar
2018-10-04 21:26 ` Lucas De Marchi
2018-10-16 2:37 ` [PATCH v2] " Lucas De Marchi
2018-10-03 7:35 ` ✗ Fi.CI.CHECKPATCH: warning for Refactor and Add helper function for combophy/tc ports Patchwork
2018-10-03 7:57 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-10-03 13:51 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-03 23:15 ` ✓ Fi.CI.IGT: " Patchwork
2018-10-04 9:56 ` ✗ Fi.CI.CHECKPATCH: warning for Refactor and Add helper function for combophy/tc ports (rev2) Patchwork
2018-10-04 10:16 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-04 10:38 ` Patchwork
2018-10-04 16:36 ` ✓ Fi.CI.IGT: " Patchwork
2018-10-04 17:12 ` Patchwork
2018-10-12 23:57 ` ✗ Fi.CI.BAT: failure for Refactor and Add helper function for combophy/tc ports (rev3) Patchwork
2018-10-16 2:57 ` ✗ Fi.CI.CHECKPATCH: warning for Refactor and Add helper function for combophy/tc ports (rev5) Patchwork
2018-10-16 3:28 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-16 4:22 ` ✓ Fi.CI.IGT: " 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=20181003175930.GG9811@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=mahesh1.kumar@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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).