]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/i915/cdclk: Add and use mdclk_source_is_cdclk_pll()
authorGustavo Sousa <gustavo.sousa@intel.com>
Tue, 12 Mar 2024 16:36:33 +0000 (13:36 -0300)
committerLucas De Marchi <lucas.demarchi@intel.com>
Wed, 13 Mar 2024 12:46:23 +0000 (05:46 -0700)
commit5372a54d7a3cf32c761d2896276b72b495bcb497
treea5d54c9382f368ef0636e2be0761cc71c9943783
parentdfdfc609bb71521ac22a2ff91f608644bf7e7b6d
drm/i915/cdclk: Add and use mdclk_source_is_cdclk_pll()

Currently, only Xe2LPD uses CDCLK PLL as the source of MDCLK and
previous display IPs use the CD2XCLK. There will be changes in code
paths common to those platforms that will rely on which source is being
used. As such, let's make that information explicit with the addition of
the predicate function mdclk_source_is_cdclk_pll().

Arguably, an enum could be created, but using a boolean should suffice
here, since we there are only two possible sources and the logic that
will rely on it will be very localized.

In order to get the code into a more consistent state, let's also take
this opportunity to hook the selection of CDCLK_CTL's "MDCLK Source
Select" to that new function. Even though currently only
MDCLK_SOURCE_SEL_CDCLK_PLL will be returned, having this extra logic is
arguably better than keeping stuff untied and prone to bugs.

v2:
  - Extract mdclk_source_is_cdclk_pll() out of xe2lpd_mdclk_source_sel()
    to make latter only about the register's field.

Bspec: 69090, 68861
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240312163639.172321-3-gustavo.sousa@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/i915/display/intel_cdclk.c
drivers/gpu/drm/i915/i915_reg.h