Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion drivers/gpu/drm/apple/iomfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2512,7 +2512,14 @@ int dcp_modes_replace(struct apple_dcp *dcp, struct dcp_parse_ctx *ctx,
ctx->pq_dsc = READ_ONCE(dcp->iomfb_template_pq) &&
!dcp_has_panel(dcp);
}
ctx->zero_vrr_range_fallback = dcp->fw_compat == DCP_FIRMWARE_V_26_6_DESKTOP;
/*
* A panel's timing lists its variable refresh range as zero placeholders
* on desktop 26.x and firmware 27 alike (the K114s's 120 Hz timing:
* MinimumVariableRefreshRate and MaximumVariableRefreshRate both 0), so
* zeros mean no range was given. Only an internal ProMotion timing then
* takes a range (dcp_refresh_range()); external timings stay fixed.
*/
ctx->zero_vrr_range_fallback = true;
ctx->internal_present_deadline = dcp->fw_compat == DCP_FIRMWARE_V_26_6_DESKTOP;
if (dcp->fixed_connector_type != DRM_MODE_CONNECTOR_eDP &&
smp_load_acquire(&dcp->dptxport[0].tile_hint)) {
Expand Down
11 changes: 7 additions & 4 deletions drivers/gpu/drm/apple/parser-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,10 @@ static void parser_vrr_empty_range(struct kunit *test)
KUNIT_EXPECT_EQ(test, modes[0].min_vrr, 0U);
KUNIT_EXPECT_EQ(test, modes[0].max_vrr, 0U);
kfree(modes);
/* The catalog owner enables this convention only for desktop firmware. */
/*
* The catalog owner takes zero placeholders as no range on every
* firmware, so an internal ProMotion timing gets its range either way.
*/
for (desktop = 0; desktop < 2; desktop++) {
struct apple_dcp *dcp = kunit_kzalloc(test, sizeof(*dcp), GFP_KERNEL);
u64 generation;
Expand All @@ -601,9 +604,9 @@ static void parser_vrr_empty_range(struct kunit *test)
generation = dcp_modes_transfer_begin(dcp);
KUNIT_ASSERT_EQ(test, dcp_modes_replace(dcp, &ctx, generation), 0);
KUNIT_ASSERT_EQ(test, dcp->nr_modes, 1U);
KUNIT_EXPECT_EQ(test, dcp->modes[0].vrr, !!desktop);
KUNIT_EXPECT_EQ(test, dcp->modes[0].min_vrr, desktop ? 24U << 16 : 0U);
KUNIT_EXPECT_EQ(test, dcp->modes[0].max_vrr, desktop ? 120U << 16 : 0U);
KUNIT_EXPECT_TRUE(test, dcp->modes[0].vrr);
KUNIT_EXPECT_EQ(test, dcp->modes[0].min_vrr, 24U << 16);
KUNIT_EXPECT_EQ(test, dcp->modes[0].max_vrr, 120U << 16);
kfree(dcp->modes);
}
}
Expand Down
Loading