From 0591302998999d77145a4fe04980e035d15b71a6 Mon Sep 17 00:00:00 2001 From: Eric Juta Date: Fri, 13 Nov 2026 22:48:37 +0000 Subject: [PATCH] drm/apple: enable the J615 panel brightness path The J615 board record does not admit panel nits, so the working 14.7 display session never registers a backlight device: /sys/class/backlight is empty on the 15-inch M3 MacBook Air and brightness keys do nothing. The J615 runs the J613 DCP image (DCP_V14_J613_FIRMWARE_UUID) on the same T8122 DCP, and its device tree carries apple,max-brightness like the J613. Admit the J615 to the nits path the same way eec6458360 admitted the J613, keeping the firmware UUID and display handoff checks. J514C remains excluded. Run the existing swap-level KUnit case for J615 as well, and move it out of the boards whose production path must stay untouched. Assisted-by: Claude (claude-opus-5-5) Signed-off-by: Eric Juta --- drivers/gpu/drm/apple/iomfb_v14_7.c | 4 +++- .../drm/apple/iomfb_v14_7_backlight_test.c | 19 ++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/apple/iomfb_v14_7.c b/drivers/gpu/drm/apple/iomfb_v14_7.c index 7a6c96dfa1f74f..dcd3389aff8cf7 100644 --- a/drivers/gpu/drm/apple/iomfb_v14_7.c +++ b/drivers/gpu/drm/apple/iomfb_v14_7.c @@ -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), }; @@ -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) 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 6f1b6ad2bfe967..0c8fca3b3c370e 100644 --- a/drivers/gpu/drm/apple/iomfb_v14_7_backlight_test.c +++ b/drivers/gpu/drm/apple/iomfb_v14_7_backlight_test.c @@ -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. */ @@ -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" }; @@ -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); @@ -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; @@ -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 @@ -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), {}