diff --git a/drivers/gpu/drm/apple/dcp-syslog-test.c b/drivers/gpu/drm/apple/dcp-syslog-test.c index a4442810e88a8..256343fa38ccf 100644 --- a/drivers/gpu/drm/apple/dcp-syslog-test.c +++ b/drivers/gpu/drm/apple/dcp-syslog-test.c @@ -18,6 +18,8 @@ static void dcp_syslog_transition_test(struct kunit *test) "ready_for_run_mode_change: initiating deferred run mode change: 4 -> 1" }, { "UPPipeDCP_H17P.cpp:2014", "ready_for_run_mode_change: initiating deferred run mode change: 2 -> 4" }, + { "itorContext_v4.cpp:1324", + "SMC sensor TAOC is an invalid temp -127.0, using 2DVT fallback values" }, }; char message[128]; int i; @@ -46,6 +48,13 @@ static void dcp_syslog_unknown_test(struct kunit *test) { "UPPipeDCP_H17P.cpp:2014", "ready_for_run_mode_change: timeout" }, { "UPPipeDCP_H17P.cpp:2096", "set_run_mode_safe: error -110" }, { "UPPipeDCP_H17P.cpp:2097", "set_run_mode_safe: deferring: 4 -> 1" }, + /* A different sensor, value or verdict is news. */ + { "itorContext_v4.cpp:1324", + "SMC sensor TAOJ is an invalid temp -127.0, using 2DVT fallback values" }, + { "itorContext_v4.cpp:1324", + "SMC sensor TAOC is an invalid temp -40.0, using 2DVT fallback values" }, + { "itorContext_v4.cpp:1324", + "2DVT thermal sensors valid, using computed virtual temperatures" }, }; int i; diff --git a/drivers/gpu/drm/apple/dcp-syslog.h b/drivers/gpu/drm/apple/dcp-syslog.h index c1bf4f3616ea2..d54897f453185 100644 --- a/drivers/gpu/drm/apple/dcp-syslog.h +++ b/drivers/gpu/drm/apple/dcp-syslog.h @@ -24,6 +24,17 @@ static inline bool dcp_h17p_syslog_is_debug(const char *context, const char *mes !strcmp(message, "set_run_mode_safe: deferring: 2 -> 4"); if (!strcmp(context, "UPPipeDCP_H17P.cpp:2014")) return !strcmp(message, deferred_4_1) || !strcmp(message, deferred_2_4); + /* + * The 27.x panel temperature monitor (IOMFBTemperatureMonitorContext_v4) + * reads its sensor keys from the SMC once a second and falls back to the + * default 2D virtual temperature grid while TAOC holds the SMC's -127.0 + * "no sample" sentinel (the AOP feeds TAOC/TAOJ/TAOP in macOS; nothing + * does under Linux). Match the exact record so another sensor or value + * stays visible. + */ + if (!strcmp(context, "itorContext_v4.cpp:1324")) + return !strcmp(message, "SMC sensor TAOC is an invalid temp -127.0, " + "using 2DVT fallback values"); return false; } diff --git a/drivers/gpu/drm/apple/dcp.c b/drivers/gpu/drm/apple/dcp.c index 7fb810d0320d0..4ff52115cbf47 100644 --- a/drivers/gpu/drm/apple/dcp.c +++ b/drivers/gpu/drm/apple/dcp.c @@ -1705,18 +1705,19 @@ static void dcp_rtk_shmem_destroy(void *cookie, struct apple_rtkit_shmem *bfr) dma_free_coherent(dcp->dev, bfr->size, bfr->buffer, bfr->iova); } +static bool dcp_rtk_syslog_is_debug(void *cookie, const char *context, const char *message) +{ + return dcp_h17p_syslog_is_debug(context, message); +} + static struct apple_rtkit_ops rtkit_ops = { + .syslog_is_debug = dcp_rtk_syslog_is_debug, .crashed = dcp_rtk_crashed, .recv_message = dcp_recv_msg, .shmem_setup = dcp_rtk_shmem_setup, .shmem_destroy = dcp_rtk_shmem_destroy, }; -static bool dcp_rtk_syslog_is_debug(void *cookie, const char *context, const char *message) -{ - return dcp_h17p_syslog_is_debug(context, message); -} - static const struct apple_rtkit_ops external_h17p_rtkit_ops = { .flags = APPLE_RTKIT_COPROC_PLACES_BUFFERS, .syslog_is_debug = dcp_rtk_syslog_is_debug, diff --git a/drivers/gpu/drm/apple/iomfb_template.c b/drivers/gpu/drm/apple/iomfb_template.c index d070c3b5b9158..4fff1ea7b57db 100644 --- a/drivers/gpu/drm/apple/iomfb_template.c +++ b/drivers/gpu/drm/apple/iomfb_template.c @@ -1014,8 +1014,15 @@ dcpep_cb_get_uint_prop(struct apple_dcp *dcp, struct dcp_get_uint_prop_req *req) .value = 0 }; - if (dcp->panel.has_mini_led && - memcmp(req->obj, "SUMP", sizeof(req->obj)) == 0) { /* "PMUS */ + /* + * "PMUS"/"Temperature": the battery temperature in 0.1 K. Every + * firmware with a panel asks for it from TableCompensator:: + * set_PMU_service(), mini-LED or not: the OLED firmware (27.x on the + * K116s) uses it as the panel's initial temperature guess and logs + * "failed to read PMU temperature property!" when the reply is + * false. The H17P table already answers it unconditionally. + */ + if (memcmp(req->obj, "SUMP", sizeof(req->obj)) == 0) { /* "PMUS */ if (strncmp(req->key, "Temperature", sizeof(req->key)) == 0) { resp.value = dcp_pmu_temperature(dcp->dev); resp.ret = true; diff --git a/drivers/gpu/drm/apple/iomfb_v27.c b/drivers/gpu/drm/apple/iomfb_v27.c index 93d2fa72cc41b..57eba1fb0223a 100644 --- a/drivers/gpu/drm/apple/iomfb_v27.c +++ b/drivers/gpu/drm/apple/iomfb_v27.c @@ -474,6 +474,12 @@ static const iomfb_cb_handler cb_handlers[IOMFB_MAX_CB] = { [587] = trampoline_nop, [588] = trampoline_nop, [589] = trampoline_swap_info_h17p, + /* + * 27.2 sends this 20-byte notification with no reply after swaps (the + * macOS handler next to swap_info is the buffer-release notification); + * nothing here consumes it. + */ + [590] = trampoline_nop, [592] = trampoline_nop, [594] = trampoline_swap_complete, @@ -560,6 +566,7 @@ static const struct { [587] = { 0x0, 0x0 }, [588] = { 0x18, 0x0 }, [589] = { 0xe4, 0xe0 }, + [590] = { 0x14, 0x0 }, [592] = { 0x0, 0x0 }, [594] = { 0x730, 0x0 }, [596] = { 0x14, 0x0 }, diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/boot.py b/tools/testing/selftests/drivers/gpu/apple-dcp/boot.py index 95c02e87ddc02..a01a8dcb5f510 100644 --- a/tools/testing/selftests/drivers/gpu/apple-dcp/boot.py +++ b/tools/testing/selftests/drivers/gpu/apple-dcp/boot.py @@ -92,9 +92,10 @@ def syslog(root): dcp = (root / 'drivers/gpu/drm/apple/dcp.c').read_text() header = (root / 'drivers/gpu/drm/apple/dcp-syslog.h').read_text() helper = header[header.index('static inline bool'):header.index('\n#endif')] - # The policy belongs only to the external H17P transport. Other RTKit - # clients, including the panel and older DCP firmware, keep info logging. - assert '.syslog_is_debug' not in block(dcp, 'static struct apple_rtkit_ops rtkit_ops =') + # The policy covers both DCP transports, the internal panel's and the + # external H17P one. It demotes only the known records it matches, so other + # records, other firmware and other RTKit clients keep info logging. + assert '.syslog_is_debug = dcp_rtk_syslog_is_debug' in block(dcp, 'static struct apple_rtkit_ops rtkit_ops =') assert '.syslog_is_debug = dcp_rtk_syslog_is_debug' in block(dcp, 'static const struct apple_rtkit_ops external_h17p_rtkit_ops =') return r''' #include