All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/i915: Start using comparative INTEL_PCH_TYPE
Date: Wed, 13 Mar 2019 10:30:52 -0700	[thread overview]
Message-ID: <20190313173052.dxsiublarhoyxyyf@ldmartin-desk.amr.corp.intel.com> (raw)
In-Reply-To: <20190308214300.25057-3-rodrigo.vivi@intel.com>

On Fri, Mar 08, 2019 at 01:43:00PM -0800, Rodrigo Vivi wrote:
>In order to make it easier to bring up new platforms
>without having to take care about all corner cases
>that was previously taken care for previous platforms
>we already use comparative INTEL_GEN statements.
>
>Let's start doing the same with PCH.
>
>The only caveats are:
> - less-than comparisons need to be avoided or done with
>   attention and check > PCH_NONE as well.
> - It is not necessarily a chronological order, but a matter
>   of south display compatibility/inheritance.
>
>v2: Rebased on top of Jani's clean-up which removed the
>    need for less-than comparison
>
>Cc: Jani Nikula <jani.nikula@intel.com>
>Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>


Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

thanks
Lucas De Marchi


>---
> drivers/gpu/drm/i915/i915_drv.h    | 6 ++++++
> drivers/gpu/drm/i915/i915_irq.c    | 7 ++-----
> drivers/gpu/drm/i915/intel_cdclk.c | 2 +-
> drivers/gpu/drm/i915/intel_dp.c    | 3 +--
> drivers/gpu/drm/i915/intel_panel.c | 5 ++---
> 5 files changed, 12 insertions(+), 11 deletions(-)
>
>diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>index 8a57cdde5385..9a93accbb2e1 100644
>--- a/drivers/gpu/drm/i915/i915_drv.h
>+++ b/drivers/gpu/drm/i915/i915_drv.h
>@@ -523,6 +523,12 @@ struct i915_psr {
> 	u16 su_x_granularity;
> };
>
>+/*
>+ * Sorted by south display engine compatibility.
>+ * If the new PCH comes with a south display engine that is not
>+ * inherited from the latest item, please do not add it to the
>+ * end. Instead, add it right after its "parent" PCH.
>+ */
> enum intel_pch {
> 	PCH_NOP = -1,	/* PCH without south display */
> 	PCH_NONE = 0,	/* No PCH present */
>diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
>index 1f4e984ce42f..c823d2e76852 100644
>--- a/drivers/gpu/drm/i915/i915_irq.c
>+++ b/drivers/gpu/drm/i915/i915_irq.c
>@@ -2831,9 +2831,7 @@ gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 master_ctl)
>
> 			if (HAS_PCH_ICP(dev_priv))
> 				icp_irq_handler(dev_priv, iir);
>-			else if (HAS_PCH_SPT(dev_priv) ||
>-				 HAS_PCH_KBP(dev_priv) ||
>-				 HAS_PCH_CNP(dev_priv))
>+			else if (INTEL_PCH_TYPE(dev_priv) >= PCH_SPT)
> 				spt_irq_handler(dev_priv, iir);
> 			else
> 				cpt_irq_handler(dev_priv, iir);
>@@ -4621,8 +4619,7 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
> 		dev->driver->disable_vblank = gen8_disable_vblank;
> 		if (IS_GEN9_LP(dev_priv))
> 			dev_priv->display.hpd_irq_setup = bxt_hpd_irq_setup;
>-		else if (HAS_PCH_SPT(dev_priv) || HAS_PCH_KBP(dev_priv) ||
>-			 HAS_PCH_CNP(dev_priv))
>+		else if (INTEL_PCH_TYPE(dev_priv) >= PCH_SPT)
> 			dev_priv->display.hpd_irq_setup = spt_hpd_irq_setup;
> 		else
> 			dev_priv->display.hpd_irq_setup = ilk_hpd_irq_setup;
>diff --git a/drivers/gpu/drm/i915/intel_cdclk.c b/drivers/gpu/drm/i915/intel_cdclk.c
>index 7e5132772477..9d236e4ed26a 100644
>--- a/drivers/gpu/drm/i915/intel_cdclk.c
>+++ b/drivers/gpu/drm/i915/intel_cdclk.c
>@@ -2723,7 +2723,7 @@ static int g4x_hrawclk(struct drm_i915_private *dev_priv)
>  */
> void intel_update_rawclk(struct drm_i915_private *dev_priv)
> {
>-	if (HAS_PCH_CNP(dev_priv) || HAS_PCH_ICP(dev_priv))
>+	if (INTEL_PCH_TYPE(dev_priv) >= PCH_CNP)
> 		dev_priv->rawclk_freq = cnp_rawclk(dev_priv);
> 	else if (HAS_PCH_SPLIT(dev_priv))
> 		dev_priv->rawclk_freq = pch_rawclk(dev_priv);
>diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
>index f40b3342d82a..47857f96c3b1 100644
>--- a/drivers/gpu/drm/i915/intel_dp.c
>+++ b/drivers/gpu/drm/i915/intel_dp.c
>@@ -951,8 +951,7 @@ static void intel_pps_get_registers(struct intel_dp *intel_dp,
> 	regs->pp_off = PP_OFF_DELAYS(pps_idx);
>
> 	/* Cycle delay moved from PP_DIVISOR to PP_CONTROL */
>-	if (IS_GEN9_LP(dev_priv) || HAS_PCH_CNP(dev_priv) ||
>-	    HAS_PCH_ICP(dev_priv))
>+	if (IS_GEN9_LP(dev_priv) || INTEL_PCH_TYPE(dev_priv) >= PCH_CNP)
> 		regs->pp_div = INVALID_MMIO_REG;
> 	else
> 		regs->pp_div = PP_DIVISOR(pps_idx);
>diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
>index beca98d2b035..edd5540639b0 100644
>--- a/drivers/gpu/drm/i915/intel_panel.c
>+++ b/drivers/gpu/drm/i915/intel_panel.c
>@@ -1894,15 +1894,14 @@ intel_panel_init_backlight_funcs(struct intel_panel *panel)
> 		panel->backlight.set = bxt_set_backlight;
> 		panel->backlight.get = bxt_get_backlight;
> 		panel->backlight.hz_to_pwm = bxt_hz_to_pwm;
>-	} else if (HAS_PCH_CNP(dev_priv) || HAS_PCH_ICP(dev_priv)) {
>+	} else if (INTEL_PCH_TYPE(dev_priv) >= PCH_CNP) {
> 		panel->backlight.setup = cnp_setup_backlight;
> 		panel->backlight.enable = cnp_enable_backlight;
> 		panel->backlight.disable = cnp_disable_backlight;
> 		panel->backlight.set = bxt_set_backlight;
> 		panel->backlight.get = bxt_get_backlight;
> 		panel->backlight.hz_to_pwm = cnp_hz_to_pwm;
>-	} else if (HAS_PCH_LPT(dev_priv) || HAS_PCH_SPT(dev_priv) ||
>-		   HAS_PCH_KBP(dev_priv)) {
>+	} else if (INTEL_PCH_TYPE(dev_priv) >= PCH_LPT) {
> 		panel->backlight.setup = lpt_setup_backlight;
> 		panel->backlight.enable = lpt_enable_backlight;
> 		panel->backlight.disable = lpt_disable_backlight;
>-- 
>2.20.1
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-03-13 17:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-08 21:42 [PATCH 1/3] drm/i915/gen11+: First assume next platforms will inherit stuff Rodrigo Vivi
2019-03-08 21:42 ` [PATCH 2/3] drm/i915: Move PCH_NOP to -1 Rodrigo Vivi
2019-03-08 21:43 ` [PATCH 3/3] drm/i915: Start using comparative INTEL_PCH_TYPE Rodrigo Vivi
2019-03-13 17:30   ` Lucas De Marchi [this message]
2019-03-13 20:02     ` Rodrigo Vivi
2019-03-08 21:58 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/3] drm/i915/gen11+: First assume next platforms will inherit stuff Patchwork
2019-03-08 22:23 ` [PATCH 1/3] " Chris Wilson
2019-03-08 22:39   ` Rodrigo Vivi
2019-03-09  7:43     ` Lucas De Marchi
2019-03-11  9:12       ` Jani Nikula
2019-03-11 19:13         ` Rodrigo Vivi
2019-03-12 10:27           ` Jani Nikula
2019-03-08 22:41 ` ✓ Fi.CI.BAT: success for series starting with [1/3] " Patchwork
2019-03-09  4:53 ` ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2019-03-04 22:48 [PATCH 1/3] " Rodrigo Vivi
2019-03-04 22:48 ` [PATCH 3/3] drm/i915: Start using comparative INTEL_PCH_TYPE Rodrigo Vivi
2019-03-05 14:10   ` Jani Nikula
2019-03-05 17:08     ` Lucas De Marchi
2019-03-05 17:16       ` Jani Nikula
2019-03-05 17:42         ` Lucas De Marchi
2019-03-05 18:38           ` Rodrigo Vivi
2019-03-05 18:48             ` Lucas De Marchi
2019-03-05 19:46               ` Jani Nikula
2019-03-05 20:24                 ` Rodrigo Vivi

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=20190313173052.dxsiublarhoyxyyf@ldmartin-desk.amr.corp.intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --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: link
Be 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.