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, 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++) {