Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6397fb5
soc: apple: rtkit: allow receivers to observe mailbox delivery time
satchlj Nov 3, 2026
2962e43
drm/apple: acquire the J613 native26 external power suppliers
satchlj Nov 3, 2026
c88b6c2
drm/apple: encode J613 native26 external primary surfaces
satchlj Nov 3, 2026
9649e59
drm/apple: support retained J613 native26 external displays
satchlj Nov 3, 2026
809a114
drm/apple: test native26 wire, attachment and PM boundaries
satchlj Nov 3, 2026
9a5ea4b
selftests: apple: refresh display and PMP host boundaries
satchlj Nov 3, 2026
1149bbb
selftests: apple: keep child-seeding mutant compilable
satchlj Nov 3, 2026
1b43131
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-342…
satchlj Nov 5, 2026
8403c86
selftests: apple: register native26 checks with the Aurora runner
satchlj Nov 5, 2026
6e5ebfa
drm/apple: preserve native26 startup and error handling on 7.3
satchlj Nov 5, 2026
745507d
selftests: apple: select the H17 allocation profile in native fixtures
satchlj Nov 5, 2026
6f7608e
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-342…
satchlj Nov 5, 2026
f675a9f
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-342…
satchlj Nov 5, 2026
a6b6a82
drm/apple: compose native crossbar admission with compact DPTX valida…
satchlj Nov 5, 2026
ea520cf
drm/apple: compose the retained external admission branch
satchlj Nov 5, 2026
77e317a
Merge branch 'satchlj/port-307-20261104' into satchlj/port-342-20261104
satchlj Nov 5, 2026
1ae4ba3
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-342…
satchlj Nov 5, 2026
d16b429
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-342…
satchlj Nov 5, 2026
8746434
Merge branch 'satchlj/port-307-20261104' into satchlj/port-342-20261104
satchlj Nov 5, 2026
576eef1
Merge branch 'satchlj/t8122-api-fixes-20261104' into satchlj/port-342…
satchlj Nov 5, 2026
1f14adb
Merge branch 'satchlj/port-307-20261104' into satchlj/port-342-20261104
satchlj Nov 5, 2026
d051eaa
drm/apple: preserve desktop modeset and GPU RTKit interfaces on 7.3
satchlj Nov 5, 2026
414cc11
drm/apple: restrict native26 hooks to the H17 template lineage
satchlj Nov 5, 2026
fac105d
selftests: apple: follow the H17 modeset guard on 7.3
satchlj Nov 5, 2026
b35b176
Merge commit '33313096c66f4afdff4ef7060d20fe9bedebc34c' into satchlj/…
satchlj Nov 5, 2026
c4837ff
Merge branch 'satchlj/port-307-20261104' into satchlj/port-342-20261104
satchlj Nov 5, 2026
3fabbfd
Merge commit 'b50066848322c6799c1433ee3a358aab2e9faabb' into satchlj/…
satchlj Nov 5, 2026
7ab2586
Merge branch 'satchlj/port-307-20261104' into satchlj/port-342-20261104
satchlj Nov 5, 2026
ce0575e
selftests: apple-afkv2: model the J613 ext26 command budget in the se…
satchlj Nov 5, 2026
bb434b2
Merge satchlj/port-307-20261104 into satchlj/port-342-20261104
satchlj Nov 8, 2026
ea03156
selftests: apple: model the H17G method profile in the native26 start…
satchlj Nov 8, 2026
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
34 changes: 34 additions & 0 deletions Documentation/devicetree/bindings/display/apple,dcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ properties:
- apple,t6000-dcp
- apple,t6020-dcp
- apple,t6041-dcp
- apple,t8122-dcp
- apple,t8140-dcp
- apple,t8142-dcp
- const: apple,dcp
Expand All @@ -34,6 +35,7 @@ properties:
- apple,t6000-dcpext
- apple,t6020-dcpext
- apple,t6041-dcpext
- apple,t8122-dcpext
- const: apple,dcpext
- items:
- const: apple,t8140-dcpext
Expand Down Expand Up @@ -228,6 +230,38 @@ properties:
maxItems: 5
description: Loader-provided firmware ABI version used for IOMFB selection.

apple,j613-25g83-dcpext-handoff:
$ref: /schemas/types.yaml#/definitions/uint32
const: 1
description: |
Loader validation of the J613 native26 external processor. Requires
the separately validated internal mapping handoff, exact 26.6.2 image,
complete stream-5 mappings and retained locked page tables. Does not
enable hardware. Firmware reservations must also be complete.

apple,j613-25g83-dcpext-boot-state:
$ref: /schemas/types.yaml#/definitions/uint32-array
minItems: 4
maxItems: 4
description: |
Loader observations in order of powered ancestry, ASC CPU control,
ASC CPU status and firmware-DART protection. Read only while the
processor's full power ancestry is active. A powered processor must
have protected inherited roots; this is not an RTKit readiness claim.

apple,t8122-dcpext-firmware-ready:
$ref: /schemas/types.yaml#/definitions/uint32
const: 1
description: All external firmware reservations were committed by the loader.

apple,firmware-uuid:
$ref: /schemas/types.yaml#/definitions/string
description: UUID of the actual loaded display image, read from its iop nub.

apple,pmp:
$ref: /schemas/types.yaml#/definitions/phandle
description: Native PMP supplier, independent of the report request entry.

apple,t8132-dcpext-firmware-ready:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1]
Expand Down
19 changes: 18 additions & 1 deletion arch/arm64/boot/dts/apple/t8122-j613-dcp-25g83.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
};

&dcpext {
/delete-property/ apple,pmp-report;
apple,pmp-report = <&pmp_report_dispext>;
apple,pmp = <&pmp>;
};

&disp0_piodma {
Expand All @@ -37,10 +38,17 @@

/* This profile requests only DISP and ANS until external admission succeeds. */
&pmp_report_dispext {
apple,soc-device-record;
status = "disabled";
};

&pmp_report_disp {
apple,soc-device-record;
};

&pmp_report_ans {
apple,soc-device-record;
apple,no-ack;
apple,always-on;
};

Expand Down Expand Up @@ -78,3 +86,12 @@
apple,pmp = <&pmp>;
status = "disabled";
};

/* Native26 firmware and PIODMA use the same 1-TiB alias as the panel. */
&dcpext_dart {
apple,dma-range = /bits/ 64 <0x10000000000 0x1000000000>;
};

&dispext0_dart {
apple,dma-range = /bits/ 64 <0x10000000000 0x1000000000>;
};
106 changes: 91 additions & 15 deletions drivers/gpu/drm/apple/afk.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ void afk_service_retry(struct apple_dcp_afkep *ep)
{
unsigned long flags;

if (!ep || !ep->wire_v2 || ep != ep->dcp->dcpavservep)
if (!ep || !ep->wire_v2 ||
(!dcp_is_ext26(ep->dcp) && ep != ep->dcp->dcpavservep))
return;
spin_lock_irqsave(&ep->lock, flags);
if (!ep->stopping)
Expand Down Expand Up @@ -107,6 +108,7 @@ struct apple_dcp_afkep *afk_init(struct apple_dcp *dcp, u32 endpoint,
afkep->ops = ops;
afkep->dcp = dcp;
afkep->endpoint = endpoint;
afkep->wire_v2 = dcp_is_ext26(dcp);
afkep->wq = alloc_ordered_workqueue("apple-dcp-afkep%02x",
WQ_MEM_RECLAIM, endpoint);
if (!afkep->wq) {
Expand Down Expand Up @@ -1382,8 +1384,12 @@ static void afk_retry_service_init(struct apple_dcp_afkep *ep)

if (!service->pending_open)
continue;
ret = ops->revalidate(service, service->pending_name,
service->pending_class, service->pending_unit);
if (dcp_is_ext26(ep->dcp) &&
(!READ_ONCE(ep->dcp->ext26_services_open) ||
(ep == ep->dcp->dptxep && !dptx_native_controllers_ready(ep->dcp))))
continue;
ret = ops->revalidate ? ops->revalidate(service, service->pending_name,
service->pending_class, service->pending_unit) : 0;
if (ret) {
afk_discard_pending_open(service);
continue;
Expand All @@ -1401,8 +1407,9 @@ static void afk_retry_service_init(struct apple_dcp_afkep *ep)
}
service->pending_open = false;
afk_service_publish(service);
ops->init(service, service->pending_name, service->pending_class,
service->pending_unit);
if (ops->init)
ops->init(service, service->pending_name, service->pending_class,
service->pending_unit);
if (service->enabled)
afk_populate_service_debugfs(service);
kfree(service->pending_name);
Expand Down Expand Up @@ -1435,8 +1442,8 @@ static void afk_recv_handle_init(struct apple_dcp_afkep *ep, u32 channel,
const char *epic_name = NULL, *epic_class = NULL;
const struct apple_epic_service_ops *ops;
struct dcp_parse_ctx ctx;
u8 *props = payload + sizeof(name);
size_t props_size = payload_size - sizeof(name);
u8 *props;
size_t props_size;

previous = afk_epic_find_service(ep, channel);
/*
Expand All @@ -1461,7 +1468,8 @@ static void afk_recv_handle_init(struct apple_dcp_afkep *ep, u32 channel,

if (!pending->pending_open || pending->channel != channel)
continue;
if (!pending->ops->revalidate(pending, pending->pending_name,
if (!pending->ops->revalidate ||
!pending->ops->revalidate(pending, pending->pending_name,
pending->pending_class, pending->pending_unit))
return;
afk_discard_pending_open(pending);
Expand All @@ -1474,6 +1482,8 @@ static void afk_recv_handle_init(struct apple_dcp_afkep *ep, u32 channel,
}

strscpy(name, payload, sizeof(name));
props = payload + sizeof(name);
props_size = payload_size - sizeof(name);

/*
* in DCP firmware 13.2 DCP reports interface-name as name which starts
Expand All @@ -1490,7 +1500,17 @@ static void afk_recv_handle_init(struct apple_dcp_afkep *ep, u32 channel,
return;
}
ret = parse_epic_service_init(&ctx, &epic_name, &epic_class, &epic_unit,
ep->dcp->fw_compat == DCP_FIRMWARE_H17P);
ep->dcp->fw_compat == DCP_FIRMWARE_H17P &&
!dcp_is_ext26(ep->dcp));
/* These native infrastructure reports have no EPIC identity. */
if (dcp_is_ext26(ep->dcp) && ret == -ENOENT &&
(ep->endpoint == SYSTEM_ENDPOINT ||
ep->endpoint == DISP0_ENDPOINT)) {
dev_dbg(ep->dcp->dev,
"native26 AFK ep=%#x interface=%u report=%s has no EPIC identity; ignored\n",
ep->endpoint, channel, name);
return;
}
if (ret == -ENOENT &&
ep->dcp->hw.iomfb_method_profile == DCP_IOMFB_METHODS_H17G) {
/*
Expand All @@ -1516,6 +1536,10 @@ static void afk_recv_handle_init(struct apple_dcp_afkep *ep, u32 channel,
ops = afk_match_service(ep, epic_name);
else
ops = afk_match_service(ep, service_name);
if (dcp_is_ext26(ep->dcp))
dev_dbg(ep->dcp->dev,
"native26 AFK identity ep=%#x interface=%u name=%s class=%s unit=%lld\n",
ep->endpoint, channel, epic_name ?: name, epic_class ?: "", epic_unit);

/* T6030 14.7: the DPAV controller endpoint binds whatever it announces. */
if (!ops && ep->dcp->fw_compat == DCP_FIRMWARE_V_14_7 && ep->ops &&
Expand All @@ -1526,6 +1550,9 @@ static void afk_recv_handle_init(struct apple_dcp_afkep *ep, u32 channel,
ops = ep->ops;
}

if (!ops && dcp_is_ext26(ep->dcp) && ep->ops &&
!strcmp(ep->ops->name, "native26-observer"))
ops = ep->ops;
if (!ops) {
dev_err(ep->dcp->dev,
"AFK[ep:%02x]: unable to match service %s on channel %d\n",
Expand Down Expand Up @@ -1556,13 +1583,19 @@ static void afk_recv_handle_init(struct apple_dcp_afkep *ep, u32 channel,
"AFK optional %s (%s) is unsupported on channel %u\n",
ops->name, service_name, channel);
else
dev_err(ep->dcp->dev, "AFK service %s admission failed: %d\n",
service_name, ret);
dev_err(ep->dcp->dev,
"AFK service %s admission failed: %d (ep=%#x interface=%u name=%s unit=%lld)\n",
service_name, ret, ep->endpoint, channel, epic_name ?: name, epic_unit);
afk_service_discard(service);
goto free;
}
}
if (previous && retired && ops->revalidate) {
if ((previous && retired && ops->revalidate) ||
(dcp_is_ext26(ep->dcp) &&
(!READ_ONCE(ep->dcp->ext26_services_open) ||
(ep == ep->dcp->dptxep && !dptx_native_controllers_ready(ep->dcp))))) {
/* No reader may use a native interface before its deferred OPEN. */
WRITE_ONCE(service->enabled, false);
/* Preserve the admitted identity and its original provider ticket. */
service->pending_open = true;
service->pending_name = epic_name;
Expand Down Expand Up @@ -2836,6 +2869,22 @@ static int afk_send_command_common(struct apple_epic_service *service, u8 type,
goto err_put_service;
}

if (dcp_is_ext26(ep->dcp)) {
size_t charge = ALIGN(payload_len, SZ_16K) + ALIGN(output_len, SZ_16K);

spin_lock_irqsave(&ep->lock, flags);
ret = READ_ONCE(ep->dcp->crashed) ? -EIO :
(ep->ext26_command_count >= 255 ||
charge > SZ_16M - ep->ext26_command_bytes) ? -ENOSPC : 0;
if (!ret) {
ep->ext26_command_bytes += charge;
ep->ext26_command_count++;
}
spin_unlock_irqrestore(&ep->lock, flags);
if (ret)
goto err_put_service;
}

rxbuf = dma_alloc_coherent(ep->dcp->dev, output_len, &rxbuf_dma,
GFP_KERNEL);
if (!rxbuf) {
Expand Down Expand Up @@ -2929,7 +2978,9 @@ static int afk_send_command_common(struct apple_epic_service *service, u8 type,
*/
if (!service->cmds[idx].done) {
service->cmds[idx].completion = NULL;
service->cmds[idx].free_on_ack = true;
service->cmds[idx].free_on_ack = !dcp_is_ext26(ep->dcp);
if (dcp_is_ext26(ep->dcp))
WRITE_ONCE(ep->dcp->crashed, true);
spin_unlock_irqrestore(&service->lock, flags);
dev_warn(ep->dcp->dev,
"AFK[ep:%02x]: %s (chan:%u) command type 0x%x tag 0x%04x timed out after %u ms\n",
Expand Down Expand Up @@ -2993,9 +3044,11 @@ static int afk_send_command_common(struct apple_epic_service *service, u8 type,
spin_unlock_irqrestore(&service->lock, flags);
err_free_txbuf:
kfree(inline_command);
dma_free_coherent(ep->dcp->dev, payload_len, txbuf, txbuf_dma);
if (!dcp_is_ext26(ep->dcp))
dma_free_coherent(ep->dcp->dev, payload_len, txbuf, txbuf_dma);
err_free_rxbuf:
dma_free_coherent(ep->dcp->dev, output_len, rxbuf, rxbuf_dma);
if (!dcp_is_ext26(ep->dcp))
dma_free_coherent(ep->dcp->dev, output_len, rxbuf, rxbuf_dma);
err_put_service:
afk_service_put(service);
return ret;
Expand Down Expand Up @@ -3354,3 +3407,26 @@ static void afk_remove_service_debugfs(struct apple_epic_service *srv)
#if IS_ENABLED(CONFIG_DRM_APPLE_PARSER_KUNIT_TEST)
#include "afk-parser-test.c"
#endif

/* Called after RX and the ordered endpoint worker have been joined. */
bool afk_host_idle(struct apple_dcp_afkep *ep)
{
unsigned long flags;
unsigned int i;
bool idle = true;

spin_lock_irqsave(&ep->lock, flags);
if (ep->rxbfr.ready)
idle = READ_ONCE(*ep->rxbfr.rptr) == READ_ONCE(*ep->rxbfr.wptr);
if (ep->txbfr.ready)
idle &= READ_ONCE(*ep->txbfr.rptr) == READ_ONCE(*ep->txbfr.wptr);
spin_unlock_irqrestore(&ep->lock, flags);
for (i = 0; i < AFK_MAX_CHANNEL && idle; i++) {
struct apple_epic_service *service = &ep->services[i];

spin_lock_irqsave(&service->lock, flags);
idle = bitmap_empty(service->cmd_map, MAX_PENDING_CMDS);
spin_unlock_irqrestore(&service->lock, flags);
}
return idle;
}
5 changes: 5 additions & 0 deletions drivers/gpu/drm/apple/afk.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,8 @@ struct apple_dcp_afkep {
void *bfr;
u16 bfr_tag;
size_t bfr_size;
size_t ext26_command_bytes;
unsigned int ext26_command_count;
dma_addr_t bfr_dma;

struct afk_ringbuffer txbfr;
Expand Down Expand Up @@ -534,6 +536,9 @@ int afk_v2_copy_owned(struct apple_epic_service *service, u64 dva,
int afk_start(struct apple_dcp_afkep *ep);
int afk_start_service(struct apple_epic_service *service);
void afk_cancel_commands(struct apple_dcp_afkep *ep);
/* A sampled host boundary, never a remote-producer or DMA fence. */
bool afk_host_idle(struct apple_dcp_afkep *ep);

bool afk_compact_orphans_wait(struct apple_dcp_afkep *ep, unsigned long timeout);
unsigned int afk_compact_orphans_drop(struct apple_dcp_afkep *ep);
bool afk_compact_orphans_pending(struct apple_dcp_afkep *ep);
Expand Down
7 changes: 5 additions & 2 deletions drivers/gpu/drm/apple/apple_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,11 @@ static void apple_crtc_atomic_enable(struct drm_crtc *crtc,
}
if (crtc_state->active) {
ret = dcp_crtc_atomic_modeset(crtc, commit);
if (ret)
if (ret) {
if (dcp_is_ext26(dcp))
goto failed;
dcp_drm_crtc_error(apple_crtc, crtc_state, ret);
}
}
dcp_typec_follow_done(locked);
return;
Expand Down Expand Up @@ -931,7 +934,7 @@ static int apple_probe_per_dcp(struct device *dev,
dcp_data->hw.iomfb_method_profile ==
DCP_IOMFB_METHODS_H17G,
plane_type, interchange,
supports_premultiplied);
supports_premultiplied, dcp_is_ext26(dcp_data));
}
if (IS_ERR(planes[zpos]))
return PTR_ERR(planes[zpos]);
Expand Down
Loading
Loading