Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions drivers/gpu/drm/apple/epic/dpavservep-identity-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
9 changes: 5 additions & 4 deletions drivers/gpu/drm/apple/epic/dpavservep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 16 additions & 0 deletions tools/testing/selftests/drivers/gpu/apple-dcp/edid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
Loading