Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 3/9] drm/i915/mtl: Add Support for C10 PHY message bus and pll programming
Date: Thu, 13 Apr 2023 19:50:33 +0300	[thread overview]
Message-ID: <ZDgy2ZRi1bIKRWgc@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <20230412224925.1309815-4-radhakrishna.sripada@intel.com>

On Wed, Apr 12, 2023 at 03:49:19PM -0700, Radhakrishna Sripada wrote:
> [...]
> @@ -980,21 +981,38 @@ static int hsw_crtc_get_shared_dpll(struct intel_atomic_state *state,
>  static int dg2_crtc_compute_clock(struct intel_atomic_state *state,
>  				  struct intel_crtc *crtc)
>  {
> +	struct drm_i915_private *i915 = to_i915(state->base.dev);
>  	struct intel_crtc_state *crtc_state =
>  		intel_atomic_get_new_crtc_state(state, crtc);
>  	struct intel_encoder *encoder =
>  		intel_get_crtc_new_encoder(state, crtc_state);
> +	enum phy phy = intel_port_to_phy(i915, encoder->port);
>  	int ret;
>  
>  	ret = intel_mpllb_calc_state(crtc_state, encoder);
>  	if (ret)
>  		return ret;
>  
> +	/* TODO: Do the readback via intel_compute_shared_dplls() */
> +	if (intel_is_c10phy(i915, phy))
> +		crtc_state->port_clock = intel_c10pll_calc_port_clock(encoder, &crtc_state->cx0pll_state.c10);
> +

Added to the wrong function.

>  	crtc_state->hw.adjusted_mode.crtc_clock = intel_crtc_dotclock(crtc_state);

The above is also missing for mtl.

>  
>  	return 0;
>  }
>  
> +static int mtl_crtc_compute_clock(struct intel_atomic_state *state,
> +				  struct intel_crtc *crtc)
> +{
> +	struct intel_crtc_state *crtc_state =
> +		intel_atomic_get_new_crtc_state(state, crtc);
> +	struct intel_encoder *encoder =
> +		intel_get_crtc_new_encoder(state, crtc_state);
> +
> +	return intel_cx0pll_calc_state(crtc_state, encoder);
> +}
> +
>
> [...]
>
> +/**
> + * REG_FIELD_PREP8() - Prepare a u8 bitfield value
> + * @__mask: shifted mask defining the field's length and position
> + * @__val: value to put in the field
> + *
> + * Local copy of FIELD_PREP8() to generate an integer constant expression, force

Local copy of FIELD_PREP()

> + * u8 and for consistency with REG_FIELD_GET8(), REG_BIT8() and REG_GENMASK8().
> + *
> + * @return: @__val masked and shifted into the field defined by @__mask.
> + */
> +#define REG_FIELD_PREP8(__mask, __val)                                          \
> +	((u8)((((typeof(__mask))(__val) << __bf_shf(__mask)) & (__mask)) +      \
> +	       BUILD_BUG_ON_ZERO(!__is_constexpr(__mask)) +             \
> +	       BUILD_BUG_ON_ZERO((__mask) == 0 || (__mask) > U8_MAX) +          \
> +	       BUILD_BUG_ON_ZERO(!IS_POWER_OF_2((__mask) + (1ULL << __bf_shf(__mask)))) + \
> +	       BUILD_BUG_ON_ZERO(__builtin_choose_expr(__is_constexpr(__val), (~((__mask) >> __bf_shf(__mask)) & (__val)), 0))))
> +
>  /**
>   * REG_FIELD_GET() - Extract a u32 bitfield value
>   * @__mask: shifted mask defining the field's length and position
> @@ -155,6 +200,18 @@
>   */
>  #define _PICK(__index, ...) (((const u32 []){ __VA_ARGS__ })[__index])
>  

  reply	other threads:[~2023-04-13 16:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12 22:49 [Intel-gfx] [PATCH 0/9] drm/i915/mtl: Add Support for C10 phy Radhakrishna Sripada
2023-04-12 22:49 ` [Intel-gfx] [PATCH 1/9] drm/i915/mtl: Add DP rates Radhakrishna Sripada
2023-04-12 22:49 ` [Intel-gfx] [PATCH 2/9] drm/i915/mtl: Create separate reg file for PICA registers Radhakrishna Sripada
2023-04-12 22:49 ` [Intel-gfx] [PATCH 3/9] drm/i915/mtl: Add Support for C10 PHY message bus and pll programming Radhakrishna Sripada
2023-04-13 16:50   ` Imre Deak [this message]
2023-04-12 22:49 ` [Intel-gfx] [PATCH 4/9] drm/i915/mtl: Add vswing programming for C10 phys Radhakrishna Sripada
2023-04-13 15:57   ` Imre Deak
2023-04-12 22:49 ` [Intel-gfx] [PATCH 5/9] drm/i915/mtl: MTL PICA hotplug detection Radhakrishna Sripada
2023-04-12 22:49 ` [Intel-gfx] [PATCH 6/9] drm/i915/mtl/display: Implement DisplayPort sequences Radhakrishna Sripada
2023-04-13 16:17   ` Imre Deak
2023-04-12 22:49 ` [Intel-gfx] [PATCH 7/9] drm/i915/mtl: Initial DDI port setup Radhakrishna Sripada
2023-04-13 16:19   ` Imre Deak
2023-04-12 22:49 ` [Intel-gfx] [PATCH 8/9] drm/i915/mtl: Add C10 phy programming for HDMI Radhakrishna Sripada
2023-04-13 16:36   ` Imre Deak
2023-04-13 20:31     ` Sripada, Radhakrishna
2023-04-12 22:49 ` [Intel-gfx] [PATCH 9/9] drm/i915/display/mtl: Fill port width in DDI_BUF_/TRANS_DDI_FUNC_/PORT_BUF_CTL " Radhakrishna Sripada
2023-04-13 16:51   ` Imre Deak
2023-04-12 23:27 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/mtl: Add Support for C10 phy (rev2) Patchwork
2023-04-12 23:27 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-04-12 23:40 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-04-13 21:01 [Intel-gfx] [PATCH 0/9] drm/i915/mtl: Add Support for C10 phy Radhakrishna Sripada
2023-04-13 21:01 ` [Intel-gfx] [PATCH 3/9] drm/i915/mtl: Add Support for C10 PHY message bus and pll programming Radhakrishna Sripada
2023-04-13 21:24 [Intel-gfx] [PATCH 0/9] drm/i915/mtl: Add Support for C10 phy Radhakrishna Sripada
2023-04-13 21:24 ` [Intel-gfx] [PATCH 3/9] drm/i915/mtl: Add Support for C10 PHY message bus and pll programming Radhakrishna Sripada

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=ZDgy2ZRi1bIKRWgc@ideak-desk.fi.intel.com \
    --to=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=radhakrishna.sripada@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