diff --git a/drivers/gpu/drm/apple/iomfb_v14_7.c b/drivers/gpu/drm/apple/iomfb_v14_7.c index bb6df87824fdc..2300e697a2fc6 100644 --- a/drivers/gpu/drm/apple/iomfb_v14_7.c +++ b/drivers/gpu/drm/apple/iomfb_v14_7.c @@ -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), }; 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 fe7f7cb6ab859..3eea1558792fe 100644 --- a/drivers/gpu/drm/apple/iomfb_v14_7_backlight_test.c +++ b/drivers/gpu/drm/apple/iomfb_v14_7_backlight_test.c @@ -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 }; @@ -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); @@ -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; @@ -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); @@ -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), {} diff --git a/tools/asahi/dcp14-panel-tests.py b/tools/asahi/dcp14-panel-tests.py index 353996cca3404..8238ce559ebe6 100755 --- a/tools/asahi/dcp14-panel-tests.py +++ b/tools/asahi/dcp14-panel-tests.py @@ -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); @@ -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;