From 3fd420c565bfdbd63f40fb60d5ffeae7e62b0fe5 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Sun, 22 Nov 2026 20:53:21 +1100 Subject: [PATCH 1/2] drm/apple: dpavservep: admit DCPDP13Service on the classic DPAV endpoint On firmware 27.x the M3 and M4 Airs' external display processors announce the EDID AV service, dcpav-service-epic with class DCPDP13Service, on the classic DPAV endpoint 0x28 with EPICUnit 0 and a dynamic interface-id (1 at boot, then 5, 9, 13, 17, 21 after each reconnect and resume). Endpoint 0x28 admits only the MCDP29xx converter classes, so the service is refused with -ENODEV and the connector has no EDID source: an empty EDID blob, no monitor name, no colorimetry or HDR metadata, and no ELD for DisplayPort audio. The generic classes were refused there because using them reset the M4 Air when the external processor released its link. That reset was the display DART being unmapped while DPMS had its domains off, fixed by "drm/apple: dcp: keep the display DART dark while DPMS has its domains off" (linux#2962). With it, the service no longer resets the J713 on link release. Admit DCPDP13Service on endpoint 0x28 with EPICUnit 0, as the converter classes are. AppleDCPDP2HDMI stays refused there, endpoint 0x2a keeps requiring unit == interface-id, and the generation, epoch and owner fences are unchanged. The host regression admits DCPDP13Service on 0x28 over interface-ids 1/5/9/13 and still refuses AppleDCPDP2HDMI there, unit == interface-id on 0x28, unit 0 on 0x2a, other endpoints, compartments and classes. Signed-off-by: Ryan Murray --- drivers/gpu/drm/apple/epic/dpavservep.c | 9 +++++---- .../selftests/drivers/gpu/apple-dcp/edid.py | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/apple/epic/dpavservep.c b/drivers/gpu/drm/apple/epic/dpavservep.c index 96bbac2cf7278..de678ef34b675 100644 --- a/drivers/gpu/drm/apple/epic/dpavservep.c +++ b/drivers/gpu/drm/apple/epic/dpavservep.c @@ -66,13 +66,14 @@ 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 generic - * services stay refused there: using them resets the M4 Air when the - * external processor releases its link. + * interface-id (the channel) is dynamic across reconnects. The M3 and + * M4 Airs' external processors announce the generic DCPDP13Service + * there the same way. */ return service->ep->endpoint == DPAVSERV_ENDPOINT && unit == 0 && (!strcmp(class, "AppleDCPMCDP29XX") || - !strcmp(class, "AppleDCPMCDP2900")); + !strcmp(class, "AppleDCPMCDP2900") || + !strcmp(class, "DCPDP13Service")); } static bool dcpavserv_admission_current(struct apple_dcp *dcp, u64 generation) diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/edid.py b/tools/testing/selftests/drivers/gpu/apple-dcp/edid.py index 6fbf19d2a6329..ca7357a0ddaa8 100644 --- a/tools/testing/selftests/drivers/gpu/apple-dcp/edid.py +++ b/tools/testing/selftests/drivers/gpu/apple-dcp/edid.py @@ -301,6 +301,22 @@ def function(file,signature): const char *forged[]={"DCPDP13ServiceExtra","dcpdp13service","AppleDCPDP2HDMIExtra","unrelated-provider"}; announce(13,name,forged[variant],13);assert(opens==before && !d.dcpavserv.service); } + /* + * AFKV2 on the classic DPAV endpoint: the M3/M4 Air external DCPs announce + * DCPDP13Service with EPICUnit 0 and a dynamic interface-id. Only that + * generic class (and the MCDP29xx converters) is admitted there. + */ + ep.endpoint=0x28; + assert(!prepare(1,1,name,native_class));assert(!prepare(5,5,name,native_class)); + assert(!prepare(0,0,name,native_class));assert(!prepare(65536,0,name,native_class)); + assert(!prepare(5,0,"dcpdp-service-epic",native_class));assert(!prepare(5,0,name,"unrelated-provider")); + for(u32 channel=1;channel<=13;channel+=4) { + struct apple_epic_service *s=prepare(channel,0,name,native_class); + assert(s && "EPICUnit-0 DCPDP13Service must be admitted");afk_service_discard(s); + assert(!prepare(channel,0,name,class) && "AppleDCPDP2HDMI stays refused on 0x28"); + } + ep.endpoint=0x2c;assert(!prepare(5,0,name,native_class));ep.endpoint=0x2a; + assert(!prepare(5,0,name,native_class)); /* H17P keeps unit == interface-id. */ assert(!prepare(13,13,name,NULL)); open_error=-EIO;announce(13,name,native_class,13);assert(opens==++before && !d.dcpavserv.service);open_error=0; for(unsigned int window=0;window<5;window++) { From b38daf6cf1e6fc4116d60b302b014d8e4c5b0d45 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Thu, 26 Nov 2026 22:57:01 +1100 Subject: [PATCH 2/2] drm/apple: dpavservep: KUnit: DCPDP13Service is admitted on endpoint 0x28 The identity KUnit table still expected the generic class to be refused on the classic DPAV endpoint. Admit DCPDP13Service with EPICUnit 0 there, up to interface-id 0xffff, as the previous commit does; AppleDCPDP2HDMI, unit == interface-id, channel 0, channels over u16, other classes and other MCDP parts stay refused. Signed-off-by: Ryan Murray --- drivers/gpu/drm/apple/epic/dpavservep-identity-test.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/apple/epic/dpavservep-identity-test.c b/drivers/gpu/drm/apple/epic/dpavservep-identity-test.c index 96a6003a88cbc..584b37ccd4ff1 100644 --- a/drivers/gpu/drm/apple/epic/dpavservep-identity-test.c +++ b/drivers/gpu/drm/apple/epic/dpavservep-identity-test.c @@ -61,11 +61,12 @@ static const struct dpavid_case dpavid_cases[] = { "DCPDPService", 3, 3, false }, /* - * AFKV2 on the classic DPAV endpoint is refused: using the service there - * resets the M4 Air when the external processor releases its link. + * 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. */ { "v2 ep 0x28: DP13 unit 0", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, - "DCPDP13Service", 0, 7, false }, + "DCPDP13Service", 0, 7, true }, { "v2 ep 0x28: DP2HDMI unit 0", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, "AppleDCPDP2HDMI", 0, 1, false }, { "v2 ep 0x28: MCDP29XX unit 0", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, @@ -77,7 +78,7 @@ static const struct dpavid_case dpavid_cases[] = { { "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, - "DCPDP13Service", 0, 0xffff, false }, + "DCPDP13Service", 0, 0xffff, true }, { "v2 ep 0x28: unit == channel", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME, "DCPDP13Service", 7, 7, false }, { "v2 ep 0x28: channel 0", DPAVID_V2, DPAVSERV_ENDPOINT, DPAVID_NAME,