diff --git a/drivers/gpu/drm/apple/iomfb_v14_7.c b/drivers/gpu/drm/apple/iomfb_v14_7.c index 7a6c96dfa1f74f..4126fffdddd95e 100644 --- a/drivers/gpu/drm/apple/iomfb_v14_7.c +++ b/drivers/gpu/drm/apple/iomfb_v14_7.c @@ -236,7 +236,7 @@ static const struct dcp_v14_board dcp_v14_board_j514c = { .log_bringup = true, }; -/* J514M's 14.7 DCP image and panel geometry; the root SoC is required too. */ +/* J514M's 14.7 DCP image; the root SoC is required too. */ static const struct dcp_v14_board dcp_v14_board_j514m = { .name = "J514M", .debugfs = "dcp-j514m", @@ -247,6 +247,10 @@ static const struct dcp_v14_board dcp_v14_board_j514m = { .handoff = "apple,t6034-handoff", .promotion = true, .log_bringup = true, + /* Same pinned DCP image as J516C: zero stamps cap this panel at 60 fps. */ + .swap_timestamps = true, + /* J516C's 14.7 image uses the bounded nits block for the J514 panel too. */ + .panel_nits = true, }; static const struct dcp_v14_board *const dcp_v14_boards[] = { @@ -1762,7 +1766,8 @@ static bool dcp_v14_panel_nits_admit(const struct dcp_v14_board *board, return board && board->panel_nits && (machine_is(ctx, "apple,j514s") || machine_is(ctx, "apple,j516s") || machine_is(ctx, "apple,j516c") || machine_is(ctx, "apple,j613") || - machine_is(ctx, "apple,j504") || machine_is(ctx, "apple,j516m")); + machine_is(ctx, "apple,j504") || machine_is(ctx, "apple,j516m") || + machine_is(ctx, "apple,j514m")); } const char *iomfb_v14_7_board_name(const struct dcp_v14_board *board) diff --git a/drivers/gpu/drm/apple/iomfb_v14_7_backlight_test.c b/drivers/gpu/drm/apple/iomfb_v14_7_backlight_test.c index 6f1b6ad2bfe967..3edce23c643b6f 100644 --- a/drivers/gpu/drm/apple/iomfb_v14_7_backlight_test.c +++ b/drivers/gpu/drm/apple/iomfb_v14_7_backlight_test.c @@ -122,7 +122,7 @@ static bool v14_bl_ctx_machine_is(const void *ctx, const char *compat) return !strcmp(((const char *const *)ctx)[1], compat); } -/* Only admitted T6030, J516C, J613 and J504 internal panels carry levels. */ +/* Only admitted T6030, J516C, J613, J504 and J514M internal panels carry levels. */ static void v14_bl_boards(struct kunit *test) { static const char *const t6030_j516s[] = { "apple,t6030-dcp", "apple,j516s" }; @@ -131,6 +131,7 @@ static void v14_bl_boards(struct kunit *test) static const char *const j615[] = { "apple,t8122-dcp", "apple,j615" }; static const char *const j504[] = { "apple,t8122-dcp", "apple,j504" }; static const char *const j516c[] = { "apple,t6031-dcp", "apple,j516c" }; + static const char *const j514m[] = { "apple,t6034-dcp", "apple,j514m" }; static const char *const other_t6030[] = { "apple,t6030-dcp", "apple,other" }; const struct dcp_v14_board *board; bool known; @@ -166,6 +167,8 @@ static void v14_bl_boards(struct kunit *test) KUNIT_ASSERT_NOT_NULL(test, board); KUNIT_EXPECT_TRUE(test, board->panel_nits); KUNIT_EXPECT_TRUE(test, dcp_v14_panel_nits_admit(board, v14_bl_ctx_machine_is, j516c)); + /* The J514M root is admitted too; its record's flag is in v14-board-test. */ + KUNIT_EXPECT_TRUE(test, dcp_v14_panel_nits_admit(board, v14_bl_ctx_machine_is, j514m)); } static void v14_bl_gate_transitions(struct kunit *test) diff --git a/drivers/gpu/drm/apple/v14-board-test.c b/drivers/gpu/drm/apple/v14-board-test.c index 858b5db4e2835d..87e209246ee6b8 100644 --- a/drivers/gpu/drm/apple/v14-board-test.c +++ b/drivers/gpu/drm/apple/v14-board-test.c @@ -4,8 +4,9 @@ * and which DCP firmware image a record admits. The J516C (T6031) record * admits only the T6030 image, whose IOMFB layouts were validated, and * refuses every other; the existing records are unchanged. Which DCPs stamp - * their swaps: the internal panel of a T6031 record; the T6030 and T8122 - * panels and external processors keep zero timestamps, byte for byte. + * their swaps: the internal panel of a record with swap_timestamps set + * (J516C, J516M, J514M); the J514C, T6030 and T8122 panels and external + * processors keep zero timestamps, byte for byte. */ #include #include @@ -127,7 +128,9 @@ static void v14_board_j514m(struct kunit *test) KUNIT_EXPECT_STREQ(test, b->handoff, "apple,t6034-handoff"); KUNIT_EXPECT_TRUE(test, dcp_v14_board_admits(b, J516C_DCP_IMAGE)); KUNIT_EXPECT_FALSE(test, dcp_v14_board_admits(b, T6030_DCP_IMAGE)); - KUNIT_EXPECT_FALSE(test, b->panel_nits); + KUNIT_EXPECT_TRUE(test, b->panel_nits); + KUNIT_EXPECT_TRUE(test, dcp_v14_board_stamps_swaps(b, false)); + KUNIT_EXPECT_FALSE(test, dcp_v14_board_stamps_swaps(b, true)); KUNIT_EXPECT_NULL(test, board_for("apple,t6034-dcp", j514m_wrong_soc, &known)); KUNIT_EXPECT_NULL(test, board_for("apple,t6034-dcp", j516m, &known)); KUNIT_EXPECT_NULL(test, board_for("apple,t6031-dcp", j514m, &known)); @@ -243,7 +246,10 @@ static void v14_board_unchanged(struct kunit *test) KUNIT_EXPECT_TRUE(test, known); } -/* Only the internal panel of the J516C record stamps its swaps. */ +/* + * Only the internal panel of a record with swap_timestamps set (J516C, J516M, + * J514M) stamps its swaps; J516M and J514M are checked in their own cases. + */ static void v14_board_swap_timestamps(struct kunit *test) { const struct dcp_v14_board *j516c_b, *j514c_b, *t6030_b, *j613_b; diff --git a/tools/asahi/t6034-display-tests.py b/tools/asahi/t6034-display-tests.py index 7647e4bcfebb0f..ebcbf138f5c96c 100644 --- a/tools/asahi/t6034-display-tests.py +++ b/tools/asahi/t6034-display-tests.py @@ -51,7 +51,7 @@ def item(s, marker): assert(known && (!!b)==expected); if(!b)continue; assert(!strcmp(b->handoff,"apple,t6034-handoff")); - assert(b->promotion && b->log_bringup && !b->ctm_set && !b->ctm_get && !b->panel_nits); + assert(b->promotion && b->log_bringup && !b->ctm_set && !b->ctm_get && b->panel_nits && b->swap_timestamps); assert(dcp_v14_board_admits(b,"F493F03E-CC40-3D89-9A08-5F259BA2B246")); assert(!dcp_v14_board_admits(b,"F493F03E-CC40-3D89-9A08-5F259BA2B247")); assert(!dcp_v14_board_admits(b,"f493f03e-cc40-3d89-9a08-5f259ba2b246"));