Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (74 loc) · 3.51 KB
/
Copy pathMakefile
File metadata and controls
93 lines (74 loc) · 3.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Makefile for AMD RDNA 3 (Radeon 780M) macOS Driver Project
CXX ?= clang++
CXXFLAGS ?= -std=c++17 -Wall -Wextra -Werror -O2
INCLUDES = -Isrc -Isrc/amd -Isrc/uapi -Isrc/winsys
TEST_BIN_DIR = build/tests
TESTS = $(TEST_BIN_DIR)/test_rdna3_discovery_uma \
$(TEST_BIN_DIR)/test_rdna3_ip_dcn \
$(TEST_BIN_DIR)/test_rdna3_ucode \
$(TEST_BIN_DIR)/test_r3n_abi \
$(TEST_BIN_DIR)/test_phx_topology \
$(TEST_BIN_DIR)/test_wait_seq \
$(TEST_BIN_DIR)/test_phx_gpu_queue \
$(TEST_BIN_DIR)/test_phx_pending_fences \
$(TEST_BIN_DIR)/test_hdmi_modeset_validation
.PHONY: all test clean kext fixtures
all: test
$(TEST_BIN_DIR):
mkdir -p $(TEST_BIN_DIR)
$(TEST_BIN_DIR)/test_hdmi_modeset_validation: tests/test_hdmi_modeset_validation.cpp $(wildcard src/amd/phx_*.h) | $(TEST_BIN_DIR)
$(CXX) $(CXXFLAGS) $(INCLUDES) $< -o $@
$(TEST_BIN_DIR)/test_phx_pending_fences: tests/test_phx_pending_fences.cpp src/phxbringup/PhxPendingFences.h | $(TEST_BIN_DIR)
$(CXX) $(CXXFLAGS) $(INCLUDES) $< -o $@
$(TEST_BIN_DIR)/test_phx_gpu_queue: tests/test_phx_gpu_queue.cpp src/phxbringup/PhxGpuQueue.h | $(TEST_BIN_DIR)
$(CXX) $(CXXFLAGS) $(INCLUDES) $< -o $@
$(TEST_BIN_DIR)/test_wait_seq: tests/test_wait_seq.cpp | $(TEST_BIN_DIR)
$(CXX) $(CXXFLAGS) $(INCLUDES) $^ -o $@ -lpthread
$(TEST_BIN_DIR)/test_phx_topology: tests/test_phx_topology.cpp | $(TEST_BIN_DIR)
$(CXX) $(CXXFLAGS) $(INCLUDES) $^ -o $@
$(TEST_BIN_DIR)/test_rdna3_discovery_uma: src/amd/rdna3_ip_discovery.cpp src/amd/rdna3_rebar_uma.cpp tests/test_rdna3_discovery_uma.cpp | $(TEST_BIN_DIR)
$(CXX) $(CXXFLAGS) $(INCLUDES) $^ -o $@
$(TEST_BIN_DIR)/test_rdna3_ip_dcn: src/amd/rdna3_ip_blocks.cpp src/amd/rdna3_dcn314_scanout.cpp src/amd/rdna3_rebar_uma.cpp tests/test_rdna3_ip_dcn.cpp | $(TEST_BIN_DIR)
$(CXX) $(CXXFLAGS) $(INCLUDES) $^ -o $@
$(TEST_BIN_DIR)/test_rdna3_ucode: src/amd/rdna3_ucode_extract.cpp tests/test_rdna3_ucode.cpp | $(TEST_BIN_DIR)
$(CXX) $(CXXFLAGS) $(INCLUDES) $^ -o $@
$(TEST_BIN_DIR)/test_r3n_abi: src/uapi/r3n_user_client.cpp src/winsys/radv_r3n_winsys.cpp tests/test_r3n_abi.cpp | $(TEST_BIN_DIR)
$(CXX) $(CXXFLAGS) $(INCLUDES) $^ -o $@
test: $(TESTS) test-panel-timing
python3 tests/test_firebat_ec.py
python3 tests/test_texture_metadata.py
python3 tests/test_accelerator_selection.py
python3 tests/test_native_bo_lifetime.py
python3 tests/test_native_stop.py
python3 tests/test_native_vm.py
python3 tests/test_native_sysmem.py
python3 tests/test_native_submit.py
python3 tests/test_install_safety.py
python3 tests/test_release_pci_matches.py
python3 tests/test_ue200watch.py
python3 tests/test_phxboot_watch.py
python3 tests/test_render_encoding_failure.py
python3 tests/test_render_load_failure.py
python3 tests/test_format_view_clear.py
python3 tests/test_render_surface_clear.py
python3 tests/test_scanout_dump.py
python3 tests/test_phxctl_cli.py
python3 tests/test_bringup_failures.py
@echo "=== Running RDNA 3 Driver Unit Tests ==="
@for t in $(TESTS); do \
echo "Running $$t..."; \
$$t || exit 1; \
done
@echo "All unit tests passed successfully!"
fixtures:
bash tools/fetch_test_firmware.sh tests/fixtures/phoenix
kext:
@echo "Building PhxBringup.kext..."
python3 tools/build_kext.py
clean:
rm -rf build/
.PHONY: test-panel-timing
test-panel-timing: | $(TEST_BIN_DIR)
$(CXX) $(CXXFLAGS) -fsanitize=address,undefined -fno-sanitize-recover=all tests/test_upstream34_panel_timing.cpp -o $(TEST_BIN_DIR)/test_panel_timing
$(TEST_BIN_DIR)/test_panel_timing
python3 tests/test_upstream34_panel_callbacks.py