Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -136,6 +136,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 @@ -1694,7 +1695,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,j516c") || machine_is(ctx, "apple,j613") ||
machine_is(ctx, "apple,j615"));
}

const char *iomfb_v14_7_board_name(const struct dcp_v14_board *board)
Expand Down
24 changes: 15 additions & 9 deletions drivers/gpu/drm/apple/iomfb_v14_7_backlight_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* 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;
* its state is set to answer "yes" so that a case fails if anything on
* those boards looks at it.
* RPC. A J514C panel never initialises the backlight policy; its state is
* set to answer "yes" so that a case fails if anything on that board
* looks at it.
*/
#include <kunit/device.h>
#include <kunit/test.h>
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 and J613 internal panels carry levels. */
/* Only admitted T6030, J516C, J613 and J615 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 @@ -152,10 +152,10 @@ 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, j516c, &known);
KUNIT_ASSERT_NOT_NULL(test, board);
KUNIT_EXPECT_TRUE(test, board->panel_nits);
Expand Down Expand Up @@ -348,13 +348,13 @@ static bool v14_bl_queued(struct apple_dcp_v14 *v14)
}

/*
* The production paths on J615 and J514C: no policy is consulted, no
* level is encoded, the work does nothing, sleep leaves the gate alone.
* 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 @@ -477,6 +477,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 @@ -586,6 +591,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