Skip to content
Open
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: 7 additions & 2 deletions drivers/gpu/drm/apple/iomfb_v14_7.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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[] = {
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion drivers/gpu/drm/apple/iomfb_v14_7_backlight_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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" };
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
14 changes: 10 additions & 4 deletions drivers/gpu/drm/apple/v14-board-test.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// SPDX-License-Identifier: GPL-2.0-only OR MIT
/*
* The 14.x IOMFB board records: which record a DCP gets on which machine,
* 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 <kunit/test.h>
#include <linux/string.h>
Expand Down Expand Up @@ -127,7 +128,9 @@
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));
Expand Down Expand Up @@ -243,7 +246,10 @@
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;
Expand Down
2 changes: 1 addition & 1 deletion tools/asahi/t6034-display-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
Loading