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
6 changes: 6 additions & 0 deletions drivers/gpu/drm/apple/dcp-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/apple/dcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

/*
Expand Down
11 changes: 11 additions & 0 deletions drivers/gpu/drm/apple/epic/dpavservep-identity-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 13 additions & 3 deletions drivers/gpu/drm/apple/epic/dpavservep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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") ||
Expand Down Expand Up @@ -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. */
Expand Down
15 changes: 11 additions & 4 deletions tools/testing/selftests/drivers/gpu/apple-dcp/edid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
'''
Loading