From f35156ebd468e0d39d6b797a4adbb2404eb67a3b Mon Sep 17 00:00:00 2001 From: DjDeveloperr Date: Tue, 1 Dec 2026 04:48:45 -0500 Subject: [PATCH 1/3] drm/apple: dcp: enable AFK init-prop name fallback on T6030 internal DCP Firmware 27.2 on the T6030 internal DCP announces infrastructure services such as disp0-service without EPIC identity properties. AFK rejects those announcements and leaves the services unbound. Opt the apple,t6030-dcp hardware profile into the existing announced name fallback for firmware interfaces in the 27.0 compatibility class. Use the fallback only when the parsed properties lack EPIC identity. Keep the J716c sleep transport exception scoped to md-manager. Signed-off-by: DjDeveloperr --- drivers/gpu/drm/apple/afk.c | 4 +++- drivers/gpu/drm/apple/dcp-internal.h | 2 ++ drivers/gpu/drm/apple/dcp.c | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/apple/afk.c b/drivers/gpu/drm/apple/afk.c index a96f5f11e59ba..f02f63a5ece99 100644 --- a/drivers/gpu/drm/apple/afk.c +++ b/drivers/gpu/drm/apple/afk.c @@ -1910,12 +1910,14 @@ static void afk_recv_handle_init(struct apple_dcp_afkep *ep, u32 channel, ep->dcp->hw.firmware_compat == DCP_FIRMWARE_H17P) || ep->dcp->v27_j714s || (ep->dcp->fw_compat == DCP_FIRMWARE_V_27_0 && - dcp_has_external_output(ep->dcp)) || + (dcp_has_external_output(ep->dcp) || + ep->dcp->hw.afk_name_fallback)) || (ep->dcp->v27_sleep_transport && !strcmp(name, "md-manager")))) { /* * H17G and firmware-27 T8142 can omit EPIC identity * for powerlog-service. J716c's sleep transport * admits only md-manager by name here. + * hw.afk_name_fallback covers firmware-27 T6030 internal DCP. */ epic_name = NULL; epic_class = NULL; diff --git a/drivers/gpu/drm/apple/dcp-internal.h b/drivers/gpu/drm/apple/dcp-internal.h index f719801e5a998..e0c01007d2710 100644 --- a/drivers/gpu/drm/apple/dcp-internal.h +++ b/drivers/gpu/drm/apple/dcp-internal.h @@ -428,6 +428,8 @@ struct apple_dcp_hw_data { * properties after it are not parsed (afk_recv_handle_init()). */ bool afk_announced_names; + /* Match firmware-27 AFK services by announced name if identity is missing. */ + bool afk_name_fallback; /* * How long AFK waits for the firmware to start or stop an endpoint * and to answer a command or service call (afk_timeout_ms()); zero diff --git a/drivers/gpu/drm/apple/dcp.c b/drivers/gpu/drm/apple/dcp.c index a4f5310176b43..d8ef3df74afcb 100644 --- a/drivers/gpu/drm/apple/dcp.c +++ b/drivers/gpu/drm/apple/dcp.c @@ -11998,6 +11998,7 @@ static const struct apple_dcp_hw_data apple_dcp_hw_dcp = { static const struct apple_dcp_hw_data apple_dcp_hw_t6030 = { .iboot_handoff = "apple,t6030-handoff", .num_dptx_ports = 1, + .afk_name_fallback = true, }; static const struct apple_dcp_hw_data apple_dcp_hw_t8122 = { From 201e04f828e6233abcee439774c9b71621d02464 Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Tue, 1 Dec 2026 11:19:29 -0500 Subject: [PATCH 2/3] drm/apple: preserve invalid AFK identity errors Keep the parser error for an ill-formed EPIC dictionary. The T6030 announced-name fallback may recover from a missing identity, but it must reject an invalid one. Model the new match flag in the host fixture and cover a dictionary with a non-integer EPICUnit. Signed-off-by: Diljit Singh --- drivers/gpu/drm/apple/parser.c | 2 +- tools/asahi/dcpext26-startup-tests.py | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/apple/parser.c b/drivers/gpu/drm/apple/parser.c index 35a8c2bf25de9..bbb3b6eadbe31 100644 --- a/drivers/gpu/drm/apple/parser.c +++ b/drivers/gpu/drm/apple/parser.c @@ -2261,7 +2261,7 @@ int parse_epic_service_init(struct dcp_parse_ctx *handle, const char **name, break; } - if (!parsed_unit || !parsed_name || !parsed_class) + if (!ret && (!parsed_unit || !parsed_name || !parsed_class)) ret = -ENOENT; if (ret) { diff --git a/tools/asahi/dcpext26-startup-tests.py b/tools/asahi/dcpext26-startup-tests.py index 0985c80bd5799..19ada108be31d 100644 --- a/tools/asahi/dcpext26-startup-tests.py +++ b/tools/asahi/dcpext26-startup-tests.py @@ -95,7 +95,20 @@ def run(name,code,reject=False): struct apple_epic_service_ops {const char *name;bool reusable,optional,open_later,singleton;int (*prepare)(struct apple_epic_service *,const char *,const char *,s64);int (*revalidate)(struct apple_epic_service *,const char *,const char *,s64);void (*init)(struct apple_epic_service *,const char *,const char *,s64);void (*teardown)(struct apple_epic_service *);void (*init_props)(struct apple_epic_service *,s64,const void *,size_t);}; struct apple_epic_service {struct apple_dcp_afkep *ep;const struct apple_epic_service_ops *ops;bool enabled,torndown,pending_open,defer_start,started;unsigned users;int lock;u32 channel;void *cookie;const char *pending_name,*pending_class;s64 pending_unit;int cmd_map[1];}; struct dptx_port {struct apple_epic_service *service;s64 unit;bool enabled,connected;int enable_completion;}; -struct apple_dcp {const void *push_out_prefill;bool native,ext26_services_open,v27_j714s,v27_sleep_transport,dcpext;int fw_compat,index,dptx_controller_ready;struct {unsigned num_dptx_ports;int iomfb_method_profile,firmware_compat;bool afk_announced_names;} hw;struct dptx_port dptxport[2];void *dev,*fixed_phy;u32 nr_typec_routes;struct apple_dcp_afkep *systemep,*ibootep,*dptx_controller_ep,*dcpavservep,*dptxep,*ext26_aux[3];}; +struct apple_dcp { + const void *push_out_prefill; + bool native,ext26_services_open,v27_j714s,v27_sleep_transport,dcpext; + int fw_compat,index,dptx_controller_ready; + struct { + unsigned num_dptx_ports; + int iomfb_method_profile,firmware_compat; + bool afk_announced_names,afk_name_fallback; + } hw; + struct dptx_port dptxport[2]; + void *dev,*fixed_phy; + u32 nr_typec_routes; + struct apple_dcp_afkep *systemep,*ibootep,*dptx_controller_ep,*dcpavservep,*dptxep,*ext26_aux[3]; +}; ''' + fn((A/'dcp-internal.h').read_text(),'dcp_has_external_output') + r''' struct apple_dcp_afkep {struct apple_dcp *dcp;u32 endpoint,num_channels;bool wire_v2,stopping,match_epic_name,compact;int lock;void *wq,*service_work;const struct apple_epic_service_ops *ops,*unmatched_ops;struct apple_epic_service services[AFK_MAX_CHANNEL];int service_wq;}; #define wake_up_all(q) ((void)(q)) @@ -190,6 +203,12 @@ def run(name,code,reject=False): text(&panel,"compartment");text(&panel,"system");text(&panel,"name");text(&panel,"system");text(&panel,"interface-id");number(&panel,1); assert(!parse(panel.p,panel.n,&ctx));assert(!parse_epic_service_init(&ctx,&n,&c,&u,true,false)&&u==1&&!strcmp(n,"system"));free((void *)n);free((void *)c); assert(!parse(panel.p,panel.n,&ctx));assert(parse_epic_service_init(&ctx,&n,&c,&u,false,false)==-ENOENT); + // A present but malformed identity must not look like an absent one. + struct blob malformed={0}; + put_unaligned_le32(0xd3,malformed.p);malformed.n=4;tag(&malformed,1,1); + text(&malformed,"EPICUnit");text(&malformed,"not an integer"); + assert(!parse(malformed.p,malformed.n,&ctx)); + assert(parse_epic_service_init(&ctx,&n,&c,&u,false,false)==-EINVAL); // A failed OPEN cannot publish a prepared port; closed workqueues are never retried. struct apple_dcp_afkep failed={.dcp=&d,.endpoint=0x2a,.wire_v2=true,.ops=port_ops};failed.wq=&failed; d.dptxport[0].service=NULL;d.dptxport[0].enabled=false;open_error=-EIO;announce(&failed,1,description("dcpdptx-port-epic","AppleDCPDPTXRemotePort",0,1,false));assert(!d.dptxport[0].service&&!failed.services[0].enabled); From a57f97381dc51ffd1f23ec85a2e88053c325f51e Mon Sep 17 00:00:00 2001 From: Diljit Singh Date: Tue, 1 Dec 2026 15:28:24 -0500 Subject: [PATCH 3/3] selftests: apple-dcp: add afk_name_fallback to host fixture structs Add the afk_name_fallback field on apple_dcp_hw_data to the boot and edid host fixtures so v27-panel-handoff and service-rebind compile and pass. Signed-off-by: Diljit Singh --- tools/testing/selftests/drivers/gpu/apple-dcp/boot.py | 1 + tools/testing/selftests/drivers/gpu/apple-dcp/edid.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/boot.py b/tools/testing/selftests/drivers/gpu/apple-dcp/boot.py index a5dfa49526315..e836b0f9a25db 100644 --- a/tools/testing/selftests/drivers/gpu/apple-dcp/boot.py +++ b/tools/testing/selftests/drivers/gpu/apple-dcp/boot.py @@ -415,6 +415,7 @@ def v27_panel_handoff(root): struct device { struct device_node *of_node; }; struct apple_dcp_hw_data { bool adopt_live_session; + bool afk_name_fallback; const char *iboot_handoff; unsigned num_dptx_ports; u8 firmware_dma_bits; diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/edid.py b/tools/testing/selftests/drivers/gpu/apple-dcp/edid.py index f0e2eafd41950..24fb9bf2a8acd 100644 --- a/tools/testing/selftests/drivers/gpu/apple-dcp/edid.py +++ b/tools/testing/selftests/drivers/gpu/apple-dcp/edid.py @@ -102,7 +102,7 @@ def function(file,signature): void *dev;int fw_compat;struct apple_dcp_afkep *dcpavservep;struct apple_connector *connector; void *desktop; bool external_physically_absent,hpd_mutex,quiescing,typec_cable_connected;u64 typec_generation;unsigned int nr_modes; - struct { int iomfb_method_profile,firmware_compat; bool fw_14_7_endpoints,afk_announced_names; unsigned int num_dptx_ports; unsigned char dptx_endpoint; } hw; bool ext_dead,external_native; + struct { int iomfb_method_profile,firmware_compat; bool fw_14_7_endpoints,afk_announced_names,afk_name_fallback; unsigned int num_dptx_ports; unsigned char dptx_endpoint; } hw; bool ext_dead,external_native; struct { bool lock,enabled;u64 epoch;int enable_completion;struct apple_epic_service *service,*opened; u64 opened_epoch,close_gen,terminated_epoch,close_epoch;bool opening;struct work_struct close_wq; } dcpavserv; /* A J714s firmware 27 processor's: this one is not. */