diff --git a/drivers/gpu/drm/apple/dcp-internal.h b/drivers/gpu/drm/apple/dcp-internal.h index dc7e214be3b05..c53a0214d410b 100644 --- a/drivers/gpu/drm/apple/dcp-internal.h +++ b/drivers/gpu/drm/apple/dcp-internal.h @@ -370,6 +370,12 @@ struct apple_dcp_hw_data { * advertises (dcp_v27_dptx_layout()). */ u8 dptx_endpoint; + /* + * The endpoint the sink's DCPAV service (dcpav-service-epic) is + * announced on, where it is not the default: DPAVSERV_ENDPOINT_V2 on + * H17P external processors, otherwise DPAVSERV_ENDPOINT. + */ + u8 dpavserv_endpoint; /* * Open the DPTX controller endpoint before the ports, as for H17P * externals: the T8142 dcpext announces AppleDCPDPTXController there. diff --git a/drivers/gpu/drm/apple/dcp.c b/drivers/gpu/drm/apple/dcp.c index a5faae5bff404..0725d38586784 100644 --- a/drivers/gpu/drm/apple/dcp.c +++ b/drivers/gpu/drm/apple/dcp.c @@ -11823,6 +11823,8 @@ static const struct apple_dcp_hw_data apple_dcp_hw_t6050_dcpext = { .link_report = true, /* Its ports are announced on firmware 27's default endpoint. */ .dptx_endpoint = DPTX_ENDPOINT_V2, + /* The HDMI port's DCPAV service (AppleDCPPS190): see dcpavserv_identity(). */ + .dpavserv_endpoint = DPAVSERV_ENDPOINT_V2, }; /* diff --git a/drivers/gpu/drm/apple/epic/dpavservep-identity-test.c b/drivers/gpu/drm/apple/epic/dpavservep-identity-test.c index 584b37ccd4ff1..4846da3b90a6f 100644 --- a/drivers/gpu/drm/apple/epic/dpavservep-identity-test.c +++ b/drivers/gpu/drm/apple/epic/dpavservep-identity-test.c @@ -59,6 +59,17 @@ static const struct dpavid_case dpavid_cases[] = { NULL, 3, 3, false }, { "v2 ep 0x2a: DCPDPService class", DPAVID_V2, DPAVSERV_ENDPOINT_V2, DPAVID_NAME, "DCPDPService", 3, 3, false }, + /* T6050 dcpext0's HDMI converter: EPICUnit 0 on a dynamic interface. */ + { "v2 ep 0x2a: PS190 unit 0", DPAVID_V2, DPAVSERV_ENDPOINT_V2, DPAVID_NAME, + "AppleDCPPS190", 0, 1, true }, + { "v2 ep 0x2a: PS190 unit 0, other interface", DPAVID_V2, DPAVSERV_ENDPOINT_V2, + DPAVID_NAME, "AppleDCPPS190", 0, 5, true }, + { "v2 ep 0x2a: PS190 unit 1", DPAVID_V2, DPAVSERV_ENDPOINT_V2, DPAVID_NAME, + "AppleDCPPS190", 1, 1, false }, + { "v2 ep 0x2a: PS190 channel 0", DPAVID_V2, DPAVSERV_ENDPOINT_V2, DPAVID_NAME, + "AppleDCPPS190", 0, 0, false }, + { "v2 ep 0x28: PS190 unit 0", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, + "AppleDCPPS190", 0, 1, false }, /* * AFKV2 on the classic DPAV endpoint: the MCDP29xx converters and the diff --git a/drivers/gpu/drm/apple/epic/dpavservep.c b/drivers/gpu/drm/apple/epic/dpavservep.c index de678ef34b675..6b1131f2ca0c0 100644 --- a/drivers/gpu/drm/apple/epic/dpavservep.c +++ b/drivers/gpu/drm/apple/epic/dpavservep.c @@ -58,6 +58,15 @@ static bool dcpavserv_identity(struct apple_epic_service *service, const char *n return unit == 0; if (!class || !service->channel || service->channel > U16_MAX) return false; + /* + * Firmware 27 on the 14" and 16" MacBook Pro's external processor + * (T6050 dcpext0) names its HDMI port's DCPAV service after the PS190 + * DP-to-HDMI converter and announces it here with EPICUnit 0 on a + * dynamic interface-id, as macOS 27.2 binds it. + */ + if (service->ep->endpoint == DPAVSERV_ENDPOINT_V2 && + !strcmp(class, "AppleDCPPS190")) + return unit == 0; /* H17P's lower-case interface-id is dynamic, not a physical-port unit. */ if (service->ep->endpoint == DPAVSERV_ENDPOINT_V2) return (!strcmp(class, "AppleDCPDP2HDMI") || @@ -814,9 +823,10 @@ int dpavservep_init(struct apple_dcp *dcp) init_completion(&dcp->dcpavserv.enable_completion); - ep = afk_init(dcp, dcp->hw.iomfb_method_profile == - DCP_IOMFB_METHODS_H17P_EXTERNAL ? - DPAVSERV_ENDPOINT_V2 : DPAVSERV_ENDPOINT, dpavservep_ops); + ep = afk_init(dcp, dcp->hw.dpavserv_endpoint ?: + (dcp->hw.iomfb_method_profile == + DCP_IOMFB_METHODS_H17P_EXTERNAL ? + DPAVSERV_ENDPOINT_V2 : DPAVSERV_ENDPOINT), dpavservep_ops); if (IS_ERR(ep)) return PTR_ERR(ep); /* External H17P uses AFKV2 service calls with host-owned OOB buffers. */ diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/edid.py b/tools/testing/selftests/drivers/gpu/apple-dcp/edid.py index d2ca8a50eb36a..ed9e3eea076fe 100644 --- a/tools/testing/selftests/drivers/gpu/apple-dcp/edid.py +++ b/tools/testing/selftests/drivers/gpu/apple-dcp/edid.py @@ -710,7 +710,7 @@ def function(file, signature): struct { bool lock, enabled; u64 epoch; int enable_completion; struct apple_epic_service *service, *opened; u64 opened_epoch, close_gen, terminated_epoch; bool opening; } dcpavserv; struct apple_connector *connector; unsigned int nr_modes; - struct { int iomfb_method_profile; bool fw_14_7_endpoints; } hw; bool ext_dead,external_native; + struct { int iomfb_method_profile; bool fw_14_7_endpoints; unsigned dpavserv_endpoint; } hw; bool ext_dead,external_native; bool external_physically_absent,hpd_mutex, typec_cable_connected, quiescing; u64 typec_generation; int fw_compat; @@ -977,7 +977,7 @@ def function(text, signature): struct test_mode_ticket { u64 generation; bool associated; }; struct apple_dcp { bool quiescing; int fw_compat; void *dev; - struct { int iomfb_method_profile; bool fw_14_7_endpoints; } hw; bool ext_dead,external_native; + struct { int iomfb_method_profile; bool fw_14_7_endpoints; unsigned dpavserv_endpoint; } hw; bool ext_dead,external_native; struct { struct mutex lock; u64 epoch; bool enabled; void *service; } dcpavserv; struct test_mode_ticket dummy_ticket; struct { u64 connection_sequence; } rate_proof; @@ -1192,7 +1192,7 @@ def startup(root): }; struct apple_dcp { void *dev; - struct { int iomfb_method_profile; bool fw_14_7_endpoints; } hw; bool ext_dead,external_native; + struct { int iomfb_method_profile; bool fw_14_7_endpoints; unsigned dpavserv_endpoint; } hw; bool ext_dead,external_native; struct { unsigned enable_completion; bool enabled; } dcpavserv; struct apple_dcp_afkep *dcpavservep; int fw_compat; @@ -1262,7 +1262,14 @@ def startup(root): assert(starts==1&&!waits&&!warnings&&!shutdowns&&!detaches&&!debug); assert(v27.dcpavservep==&endpoint&&endpoint.wire_v2&&!endpoint.inline_v2); assert(endpoint.endpoint==DPAVSERV_ENDPOINT&&!v27.dcpavserv.enabled); - puts("PASS optional legacy discovery, AFKV2 early/absent service, firmware 27, endpoint failures"); + /* A processor whose match data names the endpoint (T6050 dcpext0: 0x2a) uses it. */ + struct apple_dcp t6050={.fw_compat=DCP_FIRMWARE_V_27_0,.hw={.dpavserv_endpoint=DPAVSERV_ENDPOINT_V2}}; + waits=warnings=starts=shutdowns=detaches=debug=0; + assert(dpavservep_init(&t6050)==0); + assert(starts==1&&!waits&&!warnings&&!shutdowns&&!detaches&&!debug); + assert(t6050.dcpavservep==&endpoint&&endpoint.wire_v2&&!endpoint.inline_v2); + assert(endpoint.endpoint==DPAVSERV_ENDPOINT_V2&&!t6050.dcpavserv.enabled); + puts("PASS optional legacy discovery, AFKV2 early/absent service, firmware 27, match-data endpoint, endpoint failures"); return 0; } '''