From b0f1acfc21d1501ce144ba252c7a26abebb819be Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Sat, 28 Nov 2026 22:58:23 +0100 Subject: [PATCH 1/3] drm/apple: dpavservep: admit DCPDPService on DPAVSERV_ENDPOINT On T8103 external DisplayPort over USB-C (dcpext) with firmware 27.2, DPAVSERV_ENDPOINT (0x28) announces the sink EDID service as class DCPDPService with EPICUnit 0. Admit DCPDPService on DPAVSERV_ENDPOINT alongside DCPDP13Service (still requiring unit 0 and a bounded dynamic interface ID) so external DP Alt Mode displays expose their full sink EDID instead of dropping the service as unsupported. Update the dpavservep identity KUnit test cases accordingly. Signed-off-by: Thomas Glanzmann --- .../drm/apple/epic/dpavservep-identity-test.c | 17 +++++++++++++---- drivers/gpu/drm/apple/epic/dpavservep.c | 9 +++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/apple/epic/dpavservep-identity-test.c b/drivers/gpu/drm/apple/epic/dpavservep-identity-test.c index 584b37ccd4ff1..c8f4ce8d339dd 100644 --- a/drivers/gpu/drm/apple/epic/dpavservep-identity-test.c +++ b/drivers/gpu/drm/apple/epic/dpavservep-identity-test.c @@ -62,8 +62,9 @@ static const struct dpavid_case dpavid_cases[] = { /* * AFKV2 on the classic DPAV endpoint: the MCDP29xx converters and the - * M3/M4 Airs' generic DCPDP13Service, with EPICUnit 0 and a bounded - * dynamic interface-id. AppleDCPDP2HDMI and the other classes stay refused. + * generic external DP classes (DCPDP13Service, DCPDPService), with + * EPICUnit 0 and a bounded dynamic interface-id. AppleDCPDP2HDMI and + * other classes stay refused. */ { "v2 ep 0x28: DP13 unit 0", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, "DCPDP13Service", 0, 7, true }, @@ -87,8 +88,16 @@ static const struct dpavid_case dpavid_cases[] = { "DCPDP13Service", 0, 0x10000, false }, { "v2 ep 0x28: no class", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, NULL, 0, 7, false }, - { "v2 ep 0x28: DCPDPService class", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, - "DCPDPService", 0, 7, false }, + { "v2 ep 0x28: DCPDPService unit 0", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, + "DCPDPService", 0, 7, true }, + { "v2 ep 0x28: DCPDPService unit 1", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, + "DCPDPService", 1, 7, false }, + { "v2 ep 0x28: DCPDPService channel 0", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, + "DCPDPService", 0, 0, false }, + { "v2 ep 0x28: DCPDPService channel over u16", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, + "DCPDPService", 0, 0x10000, false }, + { "v2 ep 0x28: unknown class", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, + "DCPUnknownService", 0, 7, false }, /* AFKV2 on any other endpoint. */ { "v2 other endpoint", DPAVID_V2, 0x29, DPAVID_NAME, "DCPDP13Service", 0, 7, false }, diff --git a/drivers/gpu/drm/apple/epic/dpavservep.c b/drivers/gpu/drm/apple/epic/dpavservep.c index de678ef34b675..d6d7395a96b66 100644 --- a/drivers/gpu/drm/apple/epic/dpavservep.c +++ b/drivers/gpu/drm/apple/epic/dpavservep.c @@ -66,14 +66,15 @@ static bool dcpavserv_identity(struct apple_epic_service *service, const char *n * Firmware 27 names an MCDP29xx DP-to-HDMI converter's AV service after * its part (the M2 Mac mini's HDMI port, USB-C to HDMI adapters) and * announces it on the classic DPAV endpoint with EPICUnit 0; its - * interface-id (the channel) is dynamic across reconnects. The M3 and - * M4 Airs' external processors announce the generic DCPDP13Service - * there the same way. + * interface-id (the channel) is dynamic across reconnects. External + * display processors announce the generic DCPDP13Service (M3/M4 Air) + * and DCPDPService (M1 dcpext) there the same way. */ return service->ep->endpoint == DPAVSERV_ENDPOINT && unit == 0 && (!strcmp(class, "AppleDCPMCDP29XX") || !strcmp(class, "AppleDCPMCDP2900") || - !strcmp(class, "DCPDP13Service")); + !strcmp(class, "DCPDP13Service") || + !strcmp(class, "DCPDPService")); } static bool dcpavserv_admission_current(struct apple_dcp *dcp, u64 generation) From d00e528aa06b917687f3f0068079eda3476d98c6 Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Sat, 28 Nov 2026 22:58:23 +0100 Subject: [PATCH 2/3] drm/apple: dcp: release adopted DPTX display after starting IOMFB When a boot stage hands an active DPTX DCP (such as T8103 dcpext over USB-C DP Alt Mode) over live via dcp-live-v1, releasing the adopted display before iomfb_start_rtkit() prevents firmware from observing the disconnect over IOMFB. On the subsequent Type-C connect, firmware trains the link and enumerates sink modes but never delivers the connect hotplug, leaving the connector stuck disconnected. Move the adopted DPTX HPD-low and release_display sequence to right after iomfb_start_rtkit(). Guard dcp_connector_update_dict() against a NULL connector (freeing the incoming chunk buffer cleanly) because IOMFB can deliver boot-display property updates during iomfb_start_rtkit() before a Type-C route binds a connector to dcpext. Signed-off-by: Thomas Glanzmann --- drivers/gpu/drm/apple/connector.c | 7 ++++++ drivers/gpu/drm/apple/dcp.c | 40 ++++++++++++++++--------------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/drivers/gpu/drm/apple/connector.c b/drivers/gpu/drm/apple/connector.c index e3c8c876a215a..550f396bb4ec3 100644 --- a/drivers/gpu/drm/apple/connector.c +++ b/drivers/gpu/drm/apple/connector.c @@ -333,6 +333,13 @@ static void dcp_connector_set_dict(struct apple_connector *connector, void dcp_connector_update_dict(struct apple_connector *connector, const char *key, struct dcp_chunks *chunks) { + if (!connector) { + kvfree(chunks->data); + chunks->data = NULL; + chunks->length = 0; + return; + } + mutex_lock(&connector->chunk_lock); if (!strcmp(key, "ColorElements")) dcp_connector_set_dict(connector, &connector->color_elements, chunks); diff --git a/drivers/gpu/drm/apple/dcp.c b/drivers/gpu/drm/apple/dcp.c index d2a97ff93f641..509d4297367da 100644 --- a/drivers/gpu/drm/apple/dcp.c +++ b/drivers/gpu/drm/apple/dcp.c @@ -5173,24 +5173,6 @@ int dcp_start(struct platform_device *pdev) if (ret) { dev_warn(dcp->dev, "Failed to start DPTX endpoint: %d\n", ret); - } else if (dcp->rtkit_adopted && - dptx_service_available(&dcp->dptxport[0])) { - /* - * The boot stage that handed this DCP over left the - * port's display up on a link it trained. Release it, - * so that the next connect trains the link and reads - * the sink again: until then the firmware only has its - * default modes and no EDID. Its HPD goes low as well; - * dcp_dptx_connect() raises it again after the link wait, - * so that the firmware sees the display plugged. - */ - ret = dptxport_set_hpd(dcp->dptxport[0].service, false); - if (!ret) - ret = dptxport_release_display(dcp->dptxport[0].service); - if (ret) - dev_warn(dcp->dev, "adopted DPTX display not released: %d\n", - ret); - ret = 0; #ifdef DCP_DPTX_DISCONNECT_ON_INIT /* * This disconnect / connect cycle on init is only necessary @@ -5198,7 +5180,8 @@ int dcp_start(struct platform_device *pdev) * Since dcp0 is not used at the moment let's avoid this * since it is possibly the cause for startup issues. */ - } else if (dptx_service_available(&dcp->dptxport[0])) { + } else if (!dcp->rtkit_adopted && + dptx_service_available(&dcp->dptxport[0])) { bool connected; /* force disconnect on start - necessary if the display * is already up from m1n1 @@ -5224,6 +5207,25 @@ int dcp_start(struct platform_device *pdev) return ret; } + if (dcp->rtkit_adopted && dptx_service_available(&dcp->dptxport[0])) { + /* + * The boot stage that handed this DCP over left the port's + * display up on a link it trained. Release it after IOMFB is + * up so firmware observes the disconnect and delivers the + * connect hotplug on the next connect, which trains the link + * and reads the sink again. Its HPD goes low as well; + * dcp_dptx_connect() raises it again, so that the firmware + * sees the display plugged. + */ + ret = dptxport_set_hpd(dcp->dptxport[0].service, false); + if (!ret) + ret = dptxport_release_display(dcp->dptxport[0].service); + if (ret) + dev_warn(dcp->dev, "adopted DPTX display not released: %d\n", + ret); + ret = 0; + } + /* On the board they have run on; elsewhere these endpoints are not started, as before. */ if (dcp->v27_j714s && !dcp->external && dcp_has_panel(dcp)) { ret = panelavep_init(dcp); From f75c5e8ecf41eab55dcee7d6e2a234675912295e Mon Sep 17 00:00:00 2001 From: Thomas Glanzmann Date: Sat, 28 Nov 2026 23:54:03 +0100 Subject: [PATCH 3/3] drm/apple: dpavservep: admit AppleDCPPS186 on DPAVSERV_ENDPOINT USB-C to HDMI docks using a Parade PS186 converter announce their AV service on DPAVSERV_ENDPOINT (0x28) as class AppleDCPPS186 with EPICUnit 0 on firmware 27.2. Admit AppleDCPPS186 alongside the MCDP29xx DP-to-HDMI converter classes (requiring unit 0 and a bounded dynamic interface ID) so displays behind PS186 docks expose their sink EDID. Add KUnit identity cases for AppleDCPPS186 unit 0 and unit 1. Signed-off-by: Thomas Glanzmann --- .../drm/apple/epic/dpavservep-identity-test.c | 12 ++++++++---- drivers/gpu/drm/apple/epic/dpavservep.c | 17 ++++++++++------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/apple/epic/dpavservep-identity-test.c b/drivers/gpu/drm/apple/epic/dpavservep-identity-test.c index c8f4ce8d339dd..ee2d7da9b3818 100644 --- a/drivers/gpu/drm/apple/epic/dpavservep-identity-test.c +++ b/drivers/gpu/drm/apple/epic/dpavservep-identity-test.c @@ -61,10 +61,10 @@ static const struct dpavid_case dpavid_cases[] = { "DCPDPService", 3, 3, false }, /* - * AFKV2 on the classic DPAV endpoint: the MCDP29xx converters and the - * generic external DP classes (DCPDP13Service, DCPDPService), with - * EPICUnit 0 and a bounded dynamic interface-id. AppleDCPDP2HDMI and - * other classes stay refused. + * AFKV2 on the classic DPAV endpoint: the MCDP29xx/PS186 converters + * and the generic external DP classes (DCPDP13Service, DCPDPService), + * with EPICUnit 0 and a bounded dynamic interface-id. AppleDCPDP2HDMI + * and other classes stay refused. */ { "v2 ep 0x28: DP13 unit 0", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, "DCPDP13Service", 0, 7, true }, @@ -76,6 +76,10 @@ static const struct dpavid_case dpavid_cases[] = { "AppleDCPMCDP2900", 0, 1, true }, { "v2 ep 0x28: MCDP2900 unit 1", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, "AppleDCPMCDP2900", 1, 1, false }, + { "v2 ep 0x28: PS186 unit 0", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, + "AppleDCPPS186", 0, 5, true }, + { "v2 ep 0x28: PS186 unit 1", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, + "AppleDCPPS186", 1, 5, false }, { "v2 ep 0x28: other MCDP part", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, "AppleDCPMCDP2800", 0, 1, false }, { "v2 ep 0x28: unit 0, channel at u16 max", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, diff --git a/drivers/gpu/drm/apple/epic/dpavservep.c b/drivers/gpu/drm/apple/epic/dpavservep.c index d6d7395a96b66..5d48bcc23cb34 100644 --- a/drivers/gpu/drm/apple/epic/dpavservep.c +++ b/drivers/gpu/drm/apple/epic/dpavservep.c @@ -43,7 +43,8 @@ static bool dcpavserv_hdr_class(const char *class) !strcmp(class, "DCPDPService") || !strcmp(class, "AppleDCPDP2HDMI") || !strcmp(class, "AppleDCPMCDP29XX") || - !strcmp(class, "AppleDCPMCDP2900")); + !strcmp(class, "AppleDCPMCDP2900") || + !strcmp(class, "AppleDCPPS186")); } static bool dcpavserv_identity(struct apple_epic_service *service, const char *name, @@ -63,16 +64,18 @@ static bool dcpavserv_identity(struct apple_epic_service *service, const char *n return (!strcmp(class, "AppleDCPDP2HDMI") || !strcmp(class, "DCPDP13Service")) && unit == service->channel; /* - * Firmware 27 names an MCDP29xx DP-to-HDMI converter's AV service after - * its part (the M2 Mac mini's HDMI port, USB-C to HDMI adapters) and - * announces it on the classic DPAV endpoint with EPICUnit 0; its - * interface-id (the channel) is dynamic across reconnects. External - * display processors announce the generic DCPDP13Service (M3/M4 Air) - * and DCPDPService (M1 dcpext) there the same way. + * Firmware 27 names DP-to-HDMI converter AV services after their part + * (MCDP29xx on M2 Mac mini HDMI and USB-C adapters, PS186 on USB-C to + * HDMI docks) and announces them on the classic DPAV endpoint with + * EPICUnit 0; the interface-id (the channel) is dynamic across + * reconnects. External display processors announce the generic + * DCPDP13Service (M3/M4 Air) and DCPDPService (M1 dcpext) there the + * same way. */ return service->ep->endpoint == DPAVSERV_ENDPOINT && unit == 0 && (!strcmp(class, "AppleDCPMCDP29XX") || !strcmp(class, "AppleDCPMCDP2900") || + !strcmp(class, "AppleDCPPS186") || !strcmp(class, "DCPDP13Service") || !strcmp(class, "DCPDPService")); }