Skip to content

Commit 626426f

Browse files
anushasrmattrope
authored andcommitted
drm/i915/adl_p: Add cdclk support for ADL-P
ADL-P has 3 possible refclk frequencies: 19.2MHz, 24MHz and 38.4MHz While we're at it, remove the drm_WARNs. They've never actually helped us catch any problems, but it's very easy to forget to update them properly for new platforms. BSpec: 55409, 49208 Cc: Matt Roper <[email protected]> Cc: Clinton Taylor <[email protected]> Cc: José Roberto de Souza <[email protected]> Signed-off-by: Anusha Srivatsa <[email protected]> Signed-off-by: Clinton Taylor <[email protected]> Signed-off-by: Matt Roper <[email protected]> Reviewed-by: Mika Kahola <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 47d263a commit 626426f

File tree

1 file changed

+28
-13
lines changed

1 file changed

+28
-13
lines changed

drivers/gpu/drm/i915/display/intel_cdclk.c

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,27 @@ static const struct intel_cdclk_vals rkl_cdclk_table[] = {
12531253
{}
12541254
};
12551255

1256+
static const struct intel_cdclk_vals adlp_cdclk_table[] = {
1257+
{ .refclk = 19200, .cdclk = 172800, .divider = 3, .ratio = 27 },
1258+
{ .refclk = 19200, .cdclk = 192000, .divider = 2, .ratio = 20 },
1259+
{ .refclk = 19200, .cdclk = 307200, .divider = 2, .ratio = 32 },
1260+
{ .refclk = 19200, .cdclk = 556800, .divider = 2, .ratio = 58 },
1261+
{ .refclk = 19200, .cdclk = 652800, .divider = 2, .ratio = 68 },
1262+
1263+
{ .refclk = 24000, .cdclk = 176000, .divider = 3, .ratio = 22 },
1264+
{ .refclk = 24000, .cdclk = 192000, .divider = 2, .ratio = 16 },
1265+
{ .refclk = 24000, .cdclk = 312000, .divider = 2, .ratio = 26 },
1266+
{ .refclk = 24000, .cdclk = 552000, .divider = 2, .ratio = 46 },
1267+
{ .refclk = 24400, .cdclk = 648000, .divider = 2, .ratio = 54 },
1268+
1269+
{ .refclk = 38400, .cdclk = 179200, .divider = 3, .ratio = 14 },
1270+
{ .refclk = 38400, .cdclk = 192000, .divider = 2, .ratio = 10 },
1271+
{ .refclk = 38400, .cdclk = 307200, .divider = 2, .ratio = 16 },
1272+
{ .refclk = 38400, .cdclk = 556800, .divider = 2, .ratio = 29 },
1273+
{ .refclk = 38400, .cdclk = 652800, .divider = 2, .ratio = 34 },
1274+
{}
1275+
};
1276+
12561277
static int bxt_calc_cdclk(struct drm_i915_private *dev_priv, int min_cdclk)
12571278
{
12581279
const struct intel_cdclk_vals *table = dev_priv->cdclk.table;
@@ -1428,18 +1449,12 @@ static void bxt_get_cdclk(struct drm_i915_private *dev_priv,
14281449
div = 2;
14291450
break;
14301451
case BXT_CDCLK_CD2X_DIV_SEL_1_5:
1431-
drm_WARN(&dev_priv->drm,
1432-
DISPLAY_VER(dev_priv) >= 10,
1433-
"Unsupported divider\n");
14341452
div = 3;
14351453
break;
14361454
case BXT_CDCLK_CD2X_DIV_SEL_2:
14371455
div = 4;
14381456
break;
14391457
case BXT_CDCLK_CD2X_DIV_SEL_4:
1440-
drm_WARN(&dev_priv->drm,
1441-
DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv),
1442-
"Unsupported divider\n");
14431458
div = 8;
14441459
break;
14451460
default:
@@ -1550,16 +1565,10 @@ static u32 bxt_cdclk_cd2x_div_sel(struct drm_i915_private *dev_priv,
15501565
case 2:
15511566
return BXT_CDCLK_CD2X_DIV_SEL_1;
15521567
case 3:
1553-
drm_WARN(&dev_priv->drm,
1554-
DISPLAY_VER(dev_priv) >= 10,
1555-
"Unsupported divider\n");
15561568
return BXT_CDCLK_CD2X_DIV_SEL_1_5;
15571569
case 4:
15581570
return BXT_CDCLK_CD2X_DIV_SEL_2;
15591571
case 8:
1560-
drm_WARN(&dev_priv->drm,
1561-
DISPLAY_VER(dev_priv) >= 11 || IS_CANNONLAKE(dev_priv),
1562-
"Unsupported divider\n");
15631572
return BXT_CDCLK_CD2X_DIV_SEL_4;
15641573
}
15651574
}
@@ -2825,7 +2834,13 @@ u32 intel_read_rawclk(struct drm_i915_private *dev_priv)
28252834
*/
28262835
void intel_init_cdclk_hooks(struct drm_i915_private *dev_priv)
28272836
{
2828-
if (IS_ROCKETLAKE(dev_priv)) {
2837+
if (IS_ALDERLAKE_P(dev_priv)) {
2838+
dev_priv->display.set_cdclk = bxt_set_cdclk;
2839+
dev_priv->display.bw_calc_min_cdclk = skl_bw_calc_min_cdclk;
2840+
dev_priv->display.modeset_calc_cdclk = bxt_modeset_calc_cdclk;
2841+
dev_priv->display.calc_voltage_level = tgl_calc_voltage_level;
2842+
dev_priv->cdclk.table = adlp_cdclk_table;
2843+
} else if (IS_ROCKETLAKE(dev_priv)) {
28292844
dev_priv->display.set_cdclk = bxt_set_cdclk;
28302845
dev_priv->display.bw_calc_min_cdclk = skl_bw_calc_min_cdclk;
28312846
dev_priv->display.modeset_calc_cdclk = bxt_modeset_calc_cdclk;

0 commit comments

Comments
 (0)