diff --git a/drivers/gpu/drm/apple/iomfb_v14_7.c b/drivers/gpu/drm/apple/iomfb_v14_7.c index d55f96b2ba123f..58a127cb54f062 100644 --- a/drivers/gpu/drm/apple/iomfb_v14_7.c +++ b/drivers/gpu/drm/apple/iomfb_v14_7.c @@ -163,6 +163,12 @@ static const struct dcp_v14_board dcp_v14_board_j516c = { .log_bringup = true, .base_edid = true, .swap_timestamps = true, + /* + * The J516S panel and this image's swap carry the level block the + * T6030 record uses (present byte +0x354, binary64 nits +0x35c, 500 nits + * at most), as the e272b67 path on this J516C presented it. + */ + .panel_nits = true, }; /* @@ -292,7 +298,7 @@ struct apple_dcp_v14 { u64 swaps; u64 swap_ns_max; - /* Immutable probe admission: only the J514S/J516S internal panel. */ + /* Immutable probe admission: only the J514S/J516S/J516C internal panel. */ bool panel_nits; /* Copy of the last accepted surface; active_fb pins its DMA under lock. */ u8 shown_surface[DCP_V14_SURFACE_SIZE]; @@ -1690,7 +1696,8 @@ static bool dcp_v14_panel_nits_admit(const struct dcp_v14_board *board, dcp_v14_compat_fn machine_is, const void *ctx) { return board && board->panel_nits && - (machine_is(ctx, "apple,j514s") || machine_is(ctx, "apple,j516s")); + (machine_is(ctx, "apple,j514s") || machine_is(ctx, "apple,j516s") || + machine_is(ctx, "apple,j516c")); } 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 d2e56c427f3683..061af270a7f4ad 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 J613, J615 or J516C panel never initialises the backlight policy; + * RPC. A J613, 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. */ @@ -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 the T6030 record (J514S, J516S) carries levels. */ +/* Only the T6030 record (J514S, J516S) and the J516C record carry levels. */ static void v14_bl_boards(struct kunit *test) { static const char *const t6030_j516s[] = { "apple,t6030-dcp", "apple,j516s" }; @@ -156,7 +156,8 @@ static void v14_bl_boards(struct kunit *test) KUNIT_EXPECT_FALSE(test, board->panel_nits); 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_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, j516c)); } static void v14_bl_gate_transitions(struct kunit *test) @@ -342,14 +343,13 @@ static bool v14_bl_queued(struct apple_dcp_v14 *v14) } /* - * The production paths on J613, J615 and J516C: no policy is consulted, no + * The production paths on J613, J615 and 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_j613, &dcp_v14_board_j615, &dcp_v14_board_j516c, - &dcp_v14_board_j514c, + &dcp_v14_board_j613, &dcp_v14_board_j615, &dcp_v14_board_j514c, }; struct dcp_backlight_present present; unsigned int i;