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
4 changes: 3 additions & 1 deletion drivers/gpu/drm/apple/iomfb_v14_7.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ static const struct dcp_v14_board dcp_v14_board_j615 = {
.panel_width = 2880,
.panel_height = 1864,
.promotion = false,
.panel_nits = true,
.ctm_set = A(421),
.ctm_get = A(420),
};
Expand Down Expand Up @@ -1762,7 +1763,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,j615"));
}

const char *iomfb_v14_7_board_name(const struct dcp_v14_board *board)
Expand Down
19 changes: 12 additions & 7 deletions drivers/gpu/drm/apple/iomfb_v14_7_backlight_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* a refused level never becomes the actual one).
*
* The objects are built here, with no DCP: nothing in a case may reach an
* RPC. A J615 or J514C panel never initialises the backlight policy;
* RPC. A J514C panel never initialises the backlight policy;
* its state is set to answer "yes" so that a case fails if anything on
* those boards looks at it.
*/
Expand Down 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, J615 and J504 internal panels carry levels. */
static void v14_bl_boards(struct kunit *test)
{
static const char *const t6030_j516s[] = { "apple,t6030-dcp", "apple,j516s" };
Expand Down Expand Up @@ -153,15 +153,14 @@ 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, j613));
KUNIT_EXPECT_FALSE(test, dcp_v14_panel_nits_admit(board, v14_bl_ctx_machine_is, j615));
board = dcp_v14_board_select(v14_bl_ctx_dcp_is, v14_bl_ctx_machine_is, j615, &known);
KUNIT_ASSERT_NOT_NULL(test, board);
KUNIT_EXPECT_FALSE(test, board->panel_nits);
KUNIT_EXPECT_TRUE(test, board->panel_nits);
KUNIT_EXPECT_TRUE(test, dcp_v14_panel_nits_admit(board, v14_bl_ctx_machine_is, j615));
board = dcp_v14_board_select(v14_bl_ctx_dcp_is, v14_bl_ctx_machine_is, j504, &known);
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, j504));
KUNIT_EXPECT_FALSE(test, dcp_v14_panel_nits_admit(board, v14_bl_ctx_machine_is, j615));
board = dcp_v14_board_select(v14_bl_ctx_dcp_is, v14_bl_ctx_machine_is, j516c, &known);
KUNIT_ASSERT_NOT_NULL(test, board);
KUNIT_EXPECT_TRUE(test, board->panel_nits);
Expand Down Expand Up @@ -354,13 +353,13 @@ static bool v14_bl_queued(struct apple_dcp_v14 *v14)
}

/*
* The production paths on J615 and J514C: no policy is consulted, no
* The production path on J514C: no policy is consulted, no
* level is encoded, the work does nothing, sleep leaves the gate alone.
*/
static void v14_bl_other_boards_untouched(struct kunit *test)
{
const struct dcp_v14_board *boards[] = {
&dcp_v14_board_j615, &dcp_v14_board_j514c,
&dcp_v14_board_j514c,
};
struct dcp_backlight_present present;
unsigned int i;
Expand Down Expand Up @@ -483,6 +482,11 @@ static void v14_bl_j613_swap_levels(struct kunit *test)
v14_bl_swap_levels(test, &dcp_v14_board_j613);
}

static void v14_bl_j615_swap_levels(struct kunit *test)
{
v14_bl_swap_levels(test, &dcp_v14_board_j615);
}

/*
* The gate, through the production queue path: open, a kick queues the work;
* suspended, nothing queues until resume; closed, nothing ever does. The
Expand Down Expand Up @@ -572,6 +576,7 @@ static struct kunit_case v14_backlight_cases[] = {
KUNIT_CASE(v14_bl_external_untouched),
KUNIT_CASE(v14_bl_t6030_swap_levels),
KUNIT_CASE(v14_bl_j613_swap_levels),
KUNIT_CASE(v14_bl_j615_swap_levels),
KUNIT_CASE(v14_bl_t6030_gate),
KUNIT_CASE(v14_bl_t6030_work),
{}
Expand Down
Loading