Skip to content
Merged
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
3 changes: 2 additions & 1 deletion drivers/gpu/drm/apple/iomfb_v14_7.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,13 @@ static const struct dcp_v14_board dcp_v14_board_j615 = {
.name = "J615",
.debugfs = "dcp-j615",
.dcp_compatible = "apple,t8122-dcp",
.machine = "apple,j615",
.panel = "apple,panel-j615",
.firmware_uuid = DCP_V14_J613_FIRMWARE_UUID,
.handoff = "apple,t8122-handoff",
.panel_width = 2880,
.panel_height = 1864,
.promotion = false,
.panel_nits = true,
.ctm_set = A(421),
.ctm_get = A(420),
};
Expand Down
22 changes: 16 additions & 6 deletions drivers/gpu/drm/apple/iomfb_v14_7_backlight_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ static void v14_bl_boards(struct kunit *test)
static const char *const t6030_j516s[] = { "apple,t6030-dcp", "apple,j516s", NULL };
static const char *const t6030_j514s[] = { "apple,t6030-dcp", "apple,j514s", NULL };
static const char *const j613[] = { "apple,t8122-dcp", "apple,j613", NULL };
static const char *const j615[] = { "apple,t8122-dcp", "apple,j615", NULL };
static const char *const j615[] = { "apple,t8122-dcp", "apple,j615", "apple,panel-j615" };
static const char *const j615_no_panel[] = { "apple,t8122-dcp", "apple,j615", NULL };
static const char *const j504[] = { "apple,t8122-dcp", "apple,j504", "apple,panel-j504" };
static const char *const j504_no_panel[] = { "apple,t8122-dcp", "apple,j504", NULL };
static const char *const j516c[] = { "apple,t6031-dcp", "apple,j516c", NULL };
Expand Down Expand Up @@ -166,11 +167,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, v14_bl_ctx_panel_is,
j615, &known);
KUNIT_ASSERT_NOT_NULL(test, board);
KUNIT_EXPECT_FALSE(test, board->panel_nits);
KUNIT_ASSERT_PTR_EQ(test, board, &dcp_v14_board_j615);
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, v14_bl_ctx_panel_is,
j615_no_panel, &known);
KUNIT_EXPECT_NULL(test, board);
KUNIT_EXPECT_TRUE(test, known);
board = dcp_v14_board_select(v14_bl_ctx_dcp_is, v14_bl_ctx_machine_is, v14_bl_ctx_panel_is,
j504, &known);
KUNIT_ASSERT_NOT_NULL(test, board);
Expand Down Expand Up @@ -374,13 +378,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 paths 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 @@ -498,6 +502,11 @@ static void v14_bl_t6030_swap_levels(struct kunit *test)
v14_bl_swap_levels(test, &dcp_v14_board_t6030);
}

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

static void v14_bl_j613_swap_levels(struct kunit *test)
{
v14_bl_swap_levels(test, &dcp_v14_board_j613);
Expand Down Expand Up @@ -612,6 +621,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
9 changes: 7 additions & 2 deletions tools/asahi/dcp14-panel-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@
#ifdef OLD
assert(IS_ERR(b));puts("old J615 board selection rejects: PASS");return 0;
#else
assert(!IS_ERR(b) && b && b->panel_width==2880 && b->panel_height==1864);
assert(IS_ERR(b));
panel.compatible="apple,panel-j615";
b=iomfb_v14_7_board(&dev);
assert(!IS_ERR(b) && b && b->panel_width==2880 && b->panel_height==1864 && b->panel_nits);
machine="apple,other";assert(iomfb_v14_7_board(&dev)==b);
panel.compatible=NULL;
assert(!strcmp(b->firmware_uuid,"90F849E1-B422-367E-B389-50246F8DEC47"));
assert(!strcmp(b->handoff,"apple,t8122-handoff") && !b->promotion);
image_uuid=b->firmware_uuid;assert(probe_gate(&dev,b)==0);
Expand Down Expand Up @@ -110,7 +115,7 @@
assert(dcp_v14_geometry(&q)==0&&q.panel_height==1964&&q.notch_rows==74);
height=1964;notch=0;assert(dcp_v14_geometry(&q)==0&&q.panel_height==1964);
width=2560;height=1600;stride=width*4;notch=64;assert(dcp_v14_geometry(&q)==-EINVAL);}
/* The Airs keep their machine records whatever the panel node says. */
/* J613 keeps its machine record; J615 and J504 match the panel. */
machine="apple,j613";assert(iomfb_v14_7_board(&dev)==j);
/* Other T8122 Macs (J433/J434 iMacs, no J504 panel) have no record. */
panel.compatible=NULL;
Expand Down
Loading