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
2 changes: 2 additions & 0 deletions drivers/gpu/drm/apple/av-lifetime-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ static struct av_life_test *av_life_setup(struct kunit *test, work_func_t owner_
t->dcp->dev = t->dev;
dev_set_drvdata(t->dev, t->dcp);
spin_lock_init(&t->ep->lock);
INIT_LIST_HEAD(&t->ep->compact_cmds);
init_rwsem(&t->asrv->srv_rwsem);
INIT_WORK(&t->asrv->start_av_service_wq, owner_fn);
INIT_WORK(&t->asrv->terminate_wq, owner_fn);
Expand Down Expand Up @@ -484,6 +485,7 @@ static struct av_life_test *av_life_group_setup(struct kunit *test,
t->ep = devm_kzalloc(t->dev, sizeof(*t->ep), GFP_KERNEL);
KUNIT_ASSERT_NOT_NULL(test, t->ep);
spin_lock_init(&t->ep->lock);
INIT_LIST_HEAD(&t->ep->compact_cmds);
t->ep->dcp = t->dcp;
t->wq = alloc_ordered_workqueue("av-lifetime-devres", 0);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, t->wq);
Expand Down
8 changes: 7 additions & 1 deletion tools/testing/selftests/drivers/gpu/apple-dcp/README
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ Or keep translation units, commands, failure logs and source hashes:
An installed copy needs --source /path/to/kernel. --group edid, rate, phy or
lifecycle or boot selects one group. HOSTCC selects the host compiler (default clang).
Python 3 and a compiler supporting AddressSanitizer/UndefinedBehaviorSanitizer
are required. No target access, firmware command, captured fixture or kernel
are required. The usb-kconfig producer also needs GNU Make 4 or newer. The
runner uses MAKE when set, otherwise gmake if available, then make. On macOS,
install GNU Make or select an existing producer with KCONFIG_CONF. The host
fixtures use native errno definitions; Linux-only reply statuses stay local
to the synthetic callback test.

No target access, firmware command, captured fixture or kernel
configuration is required.

One TAP entry point uses shared production extraction and compiler handling.
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/drivers/gpu/apple-dcp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def source_defines(source):
def tipd_pm_header(root):
"""CD321x PM state machine for host units, with a host clamp() for minmax.h."""
header = (root / 'drivers/usb/typec/tipd/cd321x-pm.h').read_text()
# Use the host errno namespace, not the AFK Linux-numbered shim.
header = header.replace('#include <linux/errno.h>', '#include <errno.h>')
# Host integer types; a repeated identical typedef is valid C11.
header = header.replace('#include <linux/types.h>',
'#include <stdint.h>\ntypedef uint32_t u32;')
Expand Down
4 changes: 4 additions & 0 deletions tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1770,6 +1770,10 @@ def power_reply(root):
#include <stdio.h>
#include <string.h>
#include <errno.h>
/* Darwin has no EREMOTEIO; this synthetic status is never passed to libc. */
#ifndef EREMOTEIO
#define EREMOTEIO 121
#endif
typedef uint32_t u32; typedef uint64_t u64;
#define WRITE_ONCE(p,v) ((p)=(v))
#define container_of(p,t,m) ((t *)((char *)(p)-offsetof(t,m)))
Expand Down
5 changes: 3 additions & 2 deletions tools/testing/selftests/drivers/gpu/apple-dcp/pm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright 2026 Ryan Murray
"""Actual PM/HCD/mux/probe boundaries using the shared PHY extraction fixture."""
from pathlib import Path
import os, re, subprocess
import os, re, shlex, shutil, subprocess
import phy
from common import block, tipd_pm_header, atc_function

Expand Down Expand Up @@ -681,7 +681,8 @@ def kconfig(root, output):
'config PHY_APPLE_ATC\n\ttristate "PHY"\n\t' + dependency + '\n')
compiler = Path(os.environ.get('KCONFIG_CONF', root / 'scripts/kconfig/conf'))
if not compiler.is_file():
subprocess.run(['make', '-C', str(root), 'O=' + str(directory / 'producer'),
make = shlex.split(os.environ.get('MAKE', shutil.which('gmake') or 'make'))
subprocess.run(make + ['-C', str(root), 'O=' + str(directory / 'producer'),
'ARCH=arm64', 'LLVM=1', 'allnoconfig'], check=True)
compiler = directory / 'producer/scripts/kconfig/conf'
for usb, phy_setting in [('n', 'y'), ('y', 'y'), ('m', 'y'), ('m', 'm')]:
Expand Down