diff --git a/Documentation/accel/apple-ane.rst b/Documentation/accel/apple-ane.rst index 06a4912034354..d817cf9335527 100644 --- a/Documentation/accel/apple-ane.rst +++ b/Documentation/accel/apple-ane.rst @@ -884,15 +884,18 @@ descriptor (BAR ID, bit offset and width) adds one custom-BAR record with selector 1, value type 0 and the first pool DSID, 36. The scratch form sends none. -Each H16_EXEC copies inputs into the private input mappings and poisons the -output mapping. It then sends 0x002d with 0, keeps the request UUID pending -before publishing EXECUTE on channel 7, and treats the channel-7 reply as -transport acknowledgment only. Completion is a state-1 0x0300 report whose -UUID, program, process and procedure IDs all match. Then 0x002d with 1 and -a DMA read barrier precede the output copy. A state-2 report, a mismatched -ID, a malformed report or a timeout quarantines the session. Reports with -an unknown UUID never complete a request. Closing the file sends TERMINATE -then UNLOAD. Mappings stay until reboot. +Each H16_EXEC copies inputs into the private input mappings and does not +touch the output mapping. The surfaces are zeroed at H16_LOAD and belong to +one open file, so output bytes that the engine does not write keep the +value of that file's previous execute. H16_EXEC then sends 0x002d with 0, +keeps the request UUID pending before publishing EXECUTE on channel 7, and +treats the channel-7 reply as transport acknowledgment only. Completion is +a state-1 0x0300 report whose UUID, program, process and procedure IDs all +match. Then 0x002d with 1 and a DMA read barrier precede the output copy. A +state-2 report, a mismatched ID, a malformed report or a timeout +quarantines the session. Reports with an unknown UUID never complete a +request. Closing the file sends TERMINATE then UNLOAD. Mappings stay until +reboot. One program lifetime per firmware boot is mandatory. On this firmware family the first EXECUTE of a newly loaded program can write into the diff --git a/drivers/accel/ane/ane_h16_accel.c b/drivers/accel/ane/ane_h16_accel.c index 20bfc2ebb03ed..a5a68c2bf0442 100644 --- a/drivers/accel/ane/ane_h16_accel.c +++ b/drivers/accel/ane/ane_h16_accel.c @@ -720,12 +720,8 @@ static int ane_h16_exec_ioctl(struct drm_device *drm, void *data, struct drm_fil locked = ktime_get_ns(); /* This program's shared surfaces are ours through the final copy-out. */ for (i = 0; i < args->count && !in_place; i++) { - void *cpu = p->surfaces[i]->cpu; - if (p->resources[i].permissions == 1) - ane_h16_user_copy(&user[i], cpu, false); - else - memset(cpu, 0xff, buffers[i].size); + ane_h16_user_copy(&user[i], p->surfaces[i]->cpu, false); } ane_h16_session_sync(a->session, p, true); copied = ktime_get_ns();