mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-24 21:50:20 +01:00
Compare commits
373 commits
libdrm-2.4
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
369990d966 | ||
|
|
6bfcfc725f | ||
|
|
64ef303d70 | ||
|
|
b7861fb536 | ||
|
|
523534ee01 | ||
|
|
1b68532f88 | ||
|
|
bef7c6fcf1 | ||
|
|
b71953a199 | ||
|
|
d72d7c6eef | ||
|
|
a050f86ed8 | ||
|
|
c3c7fb21aa | ||
|
|
a8e5e10a87 | ||
|
|
31e68ea81c | ||
|
|
35a21916c8 | ||
|
|
3968028058 | ||
|
|
679c474974 | ||
|
|
7816984a20 | ||
|
|
aaf8a893e1 | ||
|
|
871e326ac7 | ||
|
|
90656fc8e4 | ||
|
|
7518cc4fdd | ||
|
|
2c1d39eff8 | ||
|
|
f7013effc3 | ||
|
|
7a325ad150 | ||
|
|
1e9b50f1d5 | ||
|
|
0a5e2c96b1 | ||
|
|
22d70b6a8f | ||
|
|
7d43d9b6fe | ||
|
|
d870a12c3a | ||
|
|
9ea8a8e93d | ||
|
|
e4bd1ba753 | ||
|
|
289175512c | ||
|
|
40aeab6fd5 | ||
|
|
76a1e97a9a | ||
|
|
3ba6183b79 | ||
|
|
fa6f0fbad7 | ||
|
|
dccb4b18e2 | ||
|
|
c3a4c985d5 | ||
|
|
e9a886f859 | ||
|
|
a0fbf455fa | ||
|
|
b65d6ede3e | ||
|
|
614f8d7391 | ||
|
|
15e174c1ed | ||
|
|
fdf384d4b5 | ||
|
|
43e8a3f86a | ||
|
|
72d3140428 | ||
|
|
5d7d7c4318 | ||
|
|
d387ec976f | ||
|
|
a7eb2cfd53 | ||
|
|
c7684a957a | ||
|
|
e7d4b1df2d | ||
|
|
1f140f7d65 | ||
|
|
38ec7dbd4d | ||
|
|
f314a43f14 | ||
|
|
e68e9b8013 | ||
|
|
50da61eebd | ||
|
|
c0a08f06ae | ||
|
|
0a1162e2af | ||
|
|
38c043dca2 | ||
|
|
bea14386bc | ||
|
|
887fec2c28 | ||
|
|
25dec5b91f | ||
|
|
f3f56f41bb | ||
|
|
88db611498 | ||
|
|
b0815faac0 | ||
|
|
4bd09d78df | ||
|
|
d9043a256f | ||
|
|
f22956a4e9 | ||
|
|
460f7907de | ||
|
|
dcb14fe0c6 | ||
|
|
6aa6411c5a | ||
|
|
c2b5759a2f | ||
|
|
aef24b66d9 | ||
|
|
aefb5fa987 | ||
|
|
21ac1816a4 | ||
|
|
11cafdd8d6 | ||
|
|
5e1e7c4d71 | ||
|
|
b065dbc5cc | ||
|
|
ad78bb591d | ||
|
|
998d2a2e81 | ||
|
|
a97bd7b4ac | ||
|
|
d096affbaa | ||
|
|
589f8e86f1 | ||
|
|
b7338fc842 | ||
|
|
90c1a35f2a | ||
|
|
0cd18d0dfb | ||
|
|
7f20912b1b | ||
|
|
70c4f836cc | ||
|
|
93d037cdd4 | ||
|
|
37265ab0ad | ||
|
|
cee441f32d | ||
|
|
058a04de62 | ||
|
|
4df9173595 | ||
|
|
362b5b0a88 | ||
|
|
1179edb49a | ||
|
|
f94a79a7a7 | ||
|
|
5a9cfb3c59 | ||
|
|
764ed8b916 | ||
|
|
fbb83f74d6 | ||
|
|
c7c3c14bfc | ||
|
|
c45ffb1edf | ||
|
|
525e80447f | ||
|
|
7275ef8eba | ||
|
|
6978f999ea | ||
|
|
96fe43a029 | ||
|
|
4376848720 | ||
|
|
c8f327ce9c | ||
|
|
1b4e04ba68 | ||
|
|
01f91aa73d | ||
|
|
7c5c742de8 | ||
|
|
1aa800d464 | ||
|
|
7ab1cdac90 | ||
|
|
140943281b | ||
|
|
9d9498f466 | ||
|
|
dfb8111ecb | ||
|
|
fb13af4398 | ||
|
|
6414474000 | ||
|
|
ad750dc608 | ||
|
|
75254bf239 | ||
|
|
6c4392f49b | ||
|
|
118addfaf8 | ||
|
|
54b1208138 | ||
|
|
fc5f2239f3 | ||
|
|
85343095fd | ||
|
|
02a41cf302 | ||
|
|
07f4948bfc | ||
|
|
7b60986640 | ||
|
|
15b7fbf3e7 | ||
|
|
6acadd495c | ||
|
|
a0b011439d | ||
|
|
584a85b891 | ||
|
|
32a03fb32c | ||
|
|
6f00a73485 | ||
|
|
bc37db5c66 | ||
|
|
9d7024218f | ||
|
|
1b8d0e5ccd | ||
|
|
8cb6d837cc | ||
|
|
5dba8d73df | ||
|
|
de88f74df9 | ||
|
|
8a933c778a | ||
|
|
a2dbfd6442 | ||
|
|
bf462d0311 | ||
|
|
c895650f5d | ||
|
|
6b9b462729 | ||
|
|
15c6657617 | ||
|
|
8134deb31f | ||
|
|
236766b0b3 | ||
|
|
6d9645bb3b | ||
|
|
eb06a81e42 | ||
|
|
5254fd1146 | ||
|
|
bd205d133e | ||
|
|
16e6a96505 | ||
|
|
a6a2ccb448 | ||
|
|
8d8357dc64 | ||
|
|
22b698a599 | ||
|
|
6abc164052 | ||
|
|
bdab606879 | ||
|
|
13691f5266 | ||
|
|
dfd00c6250 | ||
|
|
7618a64633 | ||
|
|
2e17aea573 | ||
|
|
64b09cef49 | ||
|
|
b709c3010e | ||
|
|
45f3d9bab6 | ||
|
|
4d3635fada | ||
|
|
ea5237e549 | ||
|
|
022a4d8a82 | ||
|
|
be42051ead | ||
|
|
8e5286d4f9 | ||
|
|
cd3b248cdc | ||
|
|
8db39ef7bb | ||
|
|
ee52a88a57 | ||
|
|
0be9179f41 | ||
|
|
e194de72d3 | ||
|
|
51f3109f19 | ||
|
|
d4a7ee1a56 | ||
|
|
6a961ca843 | ||
|
|
ca041d5fe6 | ||
|
|
7bdb135f0c | ||
|
|
18644eb64f | ||
|
|
3bc3cca230 | ||
|
|
7130cb163e | ||
|
|
c6013245ce | ||
|
|
431becd4e0 | ||
|
|
4de32c8609 | ||
|
|
4b51e34d1a | ||
|
|
cc8c223c9e | ||
|
|
5e0b1df4fb | ||
|
|
7d7a9901bd | ||
|
|
98e1db5011 | ||
|
|
7784d57166 | ||
|
|
03d18b44db | ||
|
|
28d9a3c4fb | ||
|
|
41121251de | ||
|
|
25e08fd9ae | ||
|
|
bf867aed27 | ||
|
|
466e3c0c24 | ||
|
|
d1681af054 | ||
|
|
332809f3ee | ||
|
|
c6d6dce99f | ||
|
|
ee558cea20 | ||
|
|
6c4c48e61c | ||
|
|
0e2c7d0571 | ||
|
|
bdcd492328 | ||
|
|
64d6fabaa1 | ||
|
|
874af99463 | ||
|
|
329eebcf32 | ||
|
|
07dae1d108 | ||
|
|
e699b28b54 | ||
|
|
0a8fad5f5c | ||
|
|
b9ca37b313 | ||
|
|
e832f5b0b8 | ||
|
|
ce22377778 | ||
|
|
fc6bc66c64 | ||
|
|
3be3b1a83f | ||
|
|
82b2b1e898 | ||
|
|
a81b9ab8f3 | ||
|
|
613cc945b3 | ||
|
|
2ca30c7e4f | ||
|
|
7e4aa50e3d | ||
|
|
74b7b618dc | ||
|
|
ffb9375a50 | ||
|
|
e08a22dc43 | ||
|
|
0bd3e4e94f | ||
|
|
2df9cc28c0 | ||
|
|
e0df5fce89 | ||
|
|
e2504b921f | ||
|
|
474894ed17 | ||
|
|
fb5c0c301a | ||
|
|
e761875fc5 | ||
|
|
baa4b8cafc | ||
|
|
03e0ab4d88 | ||
|
|
33f0009de5 | ||
|
|
d4bb19e2c4 | ||
|
|
3ff3d59ed9 | ||
|
|
cf54ebf6cf | ||
|
|
a64a176cfd | ||
|
|
26eb15165b | ||
|
|
4a7706b2a4 | ||
|
|
502f64cb30 | ||
|
|
3e3874d50d | ||
|
|
f32db9d354 | ||
|
|
1637d8b020 | ||
|
|
24163f40d3 | ||
|
|
46d1e99a5d | ||
|
|
003eb2a554 | ||
|
|
3c04686ae5 | ||
|
|
f1b897ec83 | ||
|
|
cc3c80c6ae | ||
|
|
176e6ce6f3 | ||
|
|
98794e2a0d | ||
|
|
40fcca248b | ||
|
|
512c8a88ca | ||
|
|
6070e6a798 | ||
|
|
8be3042864 | ||
|
|
e83aaae15e | ||
|
|
e214a6a6e8 | ||
|
|
60cf6bcef1 | ||
|
|
3ee004ef52 | ||
|
|
0427c1f669 | ||
|
|
50f8d51773 | ||
|
|
f7828dc180 | ||
|
|
0b21fcb214 | ||
|
|
f83ad09dc0 | ||
|
|
3bede5dbbc | ||
|
|
f801b07a60 | ||
|
|
362a93d1fb | ||
|
|
3f266e57d0 | ||
|
|
ae6d81da20 | ||
|
|
4caec56fb8 | ||
|
|
c907d4ade1 | ||
|
|
678a32b98f | ||
|
|
d95b12e7e3 | ||
|
|
62e25c8baa | ||
|
|
37d50e1cbf | ||
|
|
2b997bb4bb | ||
|
|
85393adb12 | ||
|
|
f2314a4871 | ||
|
|
7c28f52830 | ||
|
|
2e91f124a3 | ||
|
|
dce623f525 | ||
|
|
b47c057d69 | ||
|
|
8376362245 | ||
|
|
8c4887b4e1 | ||
|
|
e9ddc93d8e | ||
|
|
26b872ebad | ||
|
|
5217c5c747 | ||
|
|
fa5dc0c925 | ||
|
|
8215b29832 | ||
|
|
2ddf703bc3 | ||
|
|
b707a71654 | ||
|
|
637d6a46d3 | ||
|
|
8f8e54d688 | ||
|
|
37fbc4c892 | ||
|
|
55bc688f11 | ||
|
|
4c18828e16 | ||
|
|
b77af8ece6 | ||
|
|
dece59037d | ||
|
|
5f920e61c8 | ||
|
|
37e9695d51 | ||
|
|
69fa0dd940 | ||
|
|
abe27b1757 | ||
|
|
f7a77f6993 | ||
|
|
1842707183 | ||
|
|
e44e781603 | ||
|
|
bec2a28e98 | ||
|
|
bca42ae004 | ||
|
|
d13ab997f5 | ||
|
|
1d92f32741 | ||
|
|
56f81e6776 | ||
|
|
79fa377c8b | ||
|
|
7aede93ef9 | ||
|
|
cc16120543 | ||
|
|
38c568775e | ||
|
|
f9539d4128 | ||
|
|
52b96a6fbf | ||
|
|
eaf234c148 | ||
|
|
6b0b493555 | ||
|
|
847be2651f | ||
|
|
de84cdc563 | ||
|
|
94bc814416 | ||
|
|
63d06ad3c3 | ||
|
|
fa80f49df8 | ||
|
|
440e2d7a34 | ||
|
|
287cdb0390 | ||
|
|
0c620c5766 | ||
|
|
3d8e59ce01 | ||
|
|
d9188a7750 | ||
|
|
9324e4f054 | ||
|
|
294b9c8322 | ||
|
|
febfe0addd | ||
|
|
997edcd37f | ||
|
|
f70e8ae835 | ||
|
|
b40d0a7d6c | ||
|
|
e722ba9f67 | ||
|
|
57e0b0552e | ||
|
|
dd3d6dd321 | ||
|
|
d76c387125 | ||
|
|
e641e2a632 | ||
|
|
f256bb9afd | ||
|
|
fda3d0010f | ||
|
|
d77ccdf3ba | ||
|
|
dd3655ce73 | ||
|
|
751752d264 | ||
|
|
bf23fe37be | ||
|
|
53ef4b37a1 | ||
|
|
7b67fec649 | ||
|
|
2fda5f9b0c | ||
|
|
bd1f320bc0 | ||
|
|
80f8fbd488 | ||
|
|
7e13fe1dbf | ||
|
|
ef77e5e1eb | ||
|
|
bd26b61cff | ||
|
|
d2875fe008 | ||
|
|
02ac4a0a36 | ||
|
|
bb709e6023 | ||
|
|
e939bd1e8c | ||
|
|
f9c27a9e8c | ||
|
|
264e66b5e9 | ||
|
|
122ff0e878 | ||
|
|
02dd464bf6 | ||
|
|
a97f265c7d | ||
|
|
4529056e4f | ||
|
|
d201a41d1a | ||
|
|
a7892962e1 | ||
|
|
1a4c0ec9ae | ||
|
|
1d29e1df8b | ||
|
|
8d0fb9b3f2 | ||
|
|
149b99fe54 | ||
|
|
e6fb9ccf2a | ||
|
|
a819b9ad3b | ||
|
|
4ac7d6bf5d | ||
|
|
87a68fe9e4 |
216 changed files with 16502 additions and 21389 deletions
276
.gitlab-ci.yml
276
.gitlab-ci.yml
|
|
@ -12,69 +12,187 @@
|
|||
# main repository, it's recommended to remove the image from the source
|
||||
# repository's container registry, so that the image from the main
|
||||
# repository's registry will be used there as well.
|
||||
variables:
|
||||
UPSTREAM_REPO: mesa/drm
|
||||
DEBIAN_TAG: "2021-02-11"
|
||||
DEBIAN_VERSION: buster-slim
|
||||
DEBIAN_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
|
||||
.templates_sha: &template_sha c6aeb16f86e32525fa630fb99c66c4f3e62fc3cb # see https://docs.gitlab.com/ee/ci/yaml/#includefile
|
||||
|
||||
include:
|
||||
- project: 'wayland/ci-templates'
|
||||
ref: 0a9bdd33a98f05af6761ab118b5074952242aab0
|
||||
file: '/templates/debian.yml'
|
||||
- project: 'freedesktop/ci-templates'
|
||||
ref: *template_sha
|
||||
file:
|
||||
- '/templates/debian.yml'
|
||||
- '/templates/freebsd.yml'
|
||||
- '/templates/ci-fairy.yml'
|
||||
|
||||
variables:
|
||||
FDO_UPSTREAM_REPO: mesa/libdrm
|
||||
FDO_REPO_SUFFIX: "$BUILD_OS/$BUILD_ARCH"
|
||||
|
||||
stages:
|
||||
- containers
|
||||
- build
|
||||
- "Base container"
|
||||
- "Build"
|
||||
|
||||
|
||||
# When & how to run the CI
|
||||
.ci-run-policy:
|
||||
except:
|
||||
- schedules
|
||||
retry:
|
||||
max: 2
|
||||
when:
|
||||
- runner_system_failure
|
||||
.ci-rules:
|
||||
rules:
|
||||
- when: on_success
|
||||
|
||||
# CONTAINERS
|
||||
|
||||
debian:
|
||||
stage: containers
|
||||
extends:
|
||||
- .ci-run-policy
|
||||
- .debian@container-ifnot-exists
|
||||
.os-debian:
|
||||
variables:
|
||||
GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
|
||||
DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh'
|
||||
BUILD_OS: debian
|
||||
FDO_DISTRIBUTION_VERSION: bookworm
|
||||
FDO_DISTRIBUTION_PACKAGES: 'build-essential docbook-xsl libatomic-ops-dev libcairo2-dev libcunit1-dev libpciaccess-dev meson ninja-build pkg-config python3 python3-pip python3-wheel python3-setuptools python3-docutils valgrind'
|
||||
# bump this tag every time you change something which requires rebuilding the
|
||||
# base image
|
||||
FDO_DISTRIBUTION_TAG: "2024-06-25.0"
|
||||
|
||||
.debian-x86_64:
|
||||
extends:
|
||||
- .os-debian
|
||||
variables:
|
||||
BUILD_ARCH: "x86-64"
|
||||
|
||||
.debian-aarch64:
|
||||
extends:
|
||||
- .os-debian
|
||||
variables:
|
||||
BUILD_ARCH: "aarch64"
|
||||
|
||||
.debian-armv7:
|
||||
extends:
|
||||
- .os-debian
|
||||
variables:
|
||||
BUILD_ARCH: "armv7"
|
||||
FDO_DISTRIBUTION_PLATFORM: linux/arm/v7
|
||||
|
||||
.os-freebsd:
|
||||
variables:
|
||||
BUILD_OS: freebsd
|
||||
FDO_DISTRIBUTION_VERSION: "14.2"
|
||||
FDO_DISTRIBUTION_PACKAGES: 'meson ninja pkgconf libpciaccess textproc/py-docutils cairo'
|
||||
# bump this tag every time you change something which requires rebuilding the
|
||||
# base image
|
||||
FDO_DISTRIBUTION_TAG: "2025-05-22.0"
|
||||
|
||||
.freebsd-x86_64:
|
||||
extends:
|
||||
- .os-freebsd
|
||||
variables:
|
||||
BUILD_ARCH: "x86_64"
|
||||
|
||||
# Build our base container image, which contains the core distribution, the
|
||||
# toolchain, and all our build dependencies. This will be reused in the build
|
||||
# stage.
|
||||
x86_64-debian-container_prep:
|
||||
extends:
|
||||
- .ci-rules
|
||||
- .debian-x86_64
|
||||
- .fdo.container-build@debian
|
||||
stage: "Base container"
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
|
||||
aarch64-debian-container_prep:
|
||||
extends:
|
||||
- .ci-rules
|
||||
- .debian-aarch64
|
||||
- .fdo.container-build@debian
|
||||
tags:
|
||||
- aarch64
|
||||
stage: "Base container"
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
|
||||
armv7-debian-container_prep:
|
||||
extends:
|
||||
- .ci-rules
|
||||
- .debian-armv7
|
||||
- .fdo.container-build@debian
|
||||
tags:
|
||||
- aarch64
|
||||
stage: "Base container"
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
FDO_BASE_IMAGE: "arm32v7/debian:$FDO_DISTRIBUTION_VERSION"
|
||||
|
||||
x86_64-freebsd-container_prep:
|
||||
extends:
|
||||
- .ci-rules
|
||||
- .freebsd-x86_64
|
||||
- .fdo.qemu-build@freebsd@x86_64
|
||||
stage: "Base container"
|
||||
variables:
|
||||
GIT_STRATEGY: none
|
||||
|
||||
# Core build environment.
|
||||
.build-env:
|
||||
variables:
|
||||
MESON_BUILD_TYPE: "-Dbuildtype=debug -Doptimization=0 -Db_sanitize=address,undefined"
|
||||
|
||||
# OS/architecture-specific variants
|
||||
.build-env-debian-x86_64:
|
||||
extends:
|
||||
- .fdo.suffixed-image@debian
|
||||
- .debian-x86_64
|
||||
- .build-env
|
||||
needs:
|
||||
- job: x86_64-debian-container_prep
|
||||
artifacts: false
|
||||
|
||||
.build-env-debian-aarch64:
|
||||
extends:
|
||||
- .fdo.suffixed-image@debian
|
||||
- .debian-aarch64
|
||||
- .build-env
|
||||
variables:
|
||||
# At least with the versions we have, the LSan runtime makes fork unusably
|
||||
# slow on AArch64, which is bad news since the test suite decides to fork
|
||||
# for every single subtest. For now, in order to get AArch64 builds and
|
||||
# tests into CI, just assume that we're not going to leak any more on
|
||||
# AArch64 than we would on ARMv7 or x86-64.
|
||||
ASAN_OPTIONS: "detect_leaks=0"
|
||||
tags:
|
||||
- aarch64
|
||||
needs:
|
||||
- job: aarch64-debian-container_prep
|
||||
artifacts: false
|
||||
|
||||
.build-env-debian-armv7:
|
||||
extends:
|
||||
- .fdo.suffixed-image@debian
|
||||
- .debian-armv7
|
||||
- .build-env
|
||||
tags:
|
||||
- aarch64
|
||||
needs:
|
||||
- job: armv7-debian-container_prep
|
||||
artifacts: false
|
||||
|
||||
.build-env-freebsd-x86_64:
|
||||
variables:
|
||||
# Compiling with ASan+UBSan appears to trigger an infinite loop in the
|
||||
# compiler shipped with FreeBSD 13.0, so we only use UBSan here.
|
||||
# Additionally, sanitizers can't be used with b_lundef on FreeBSD.
|
||||
MESON_BUILD_TYPE: "-Dbuildtype=debug -Db_sanitize=undefined -Db_lundef=false"
|
||||
extends:
|
||||
- .fdo.suffixed-image@freebsd
|
||||
- .freebsd-x86_64
|
||||
- .build-env
|
||||
needs:
|
||||
- job: x86_64-freebsd-container_prep
|
||||
artifacts: false
|
||||
|
||||
# BUILD
|
||||
|
||||
.meson-build:
|
||||
stage: build
|
||||
.do-build:
|
||||
extends:
|
||||
- .ci-rules
|
||||
stage: "Build"
|
||||
variables:
|
||||
GIT_DEPTH: 10
|
||||
script:
|
||||
- meson build
|
||||
-D amdgpu=true
|
||||
-D cairo-tests=true
|
||||
-D etnaviv=true
|
||||
-D exynos=true
|
||||
-D freedreno=true
|
||||
-D freedreno-kgsl=true
|
||||
-D intel=true
|
||||
-D libkms=true
|
||||
-D man-pages=true
|
||||
-D nouveau=true
|
||||
-D omap=true
|
||||
-D radeon=true
|
||||
-D tegra=true
|
||||
- meson setup build
|
||||
--fatal-meson-warnings --auto-features=enabled
|
||||
-D udev=true
|
||||
-D valgrind=auto
|
||||
-D vc4=true
|
||||
-D vmwgfx=true
|
||||
${CROSS+--cross /cross_file-$CROSS.txt}
|
||||
- ninja -C build
|
||||
- ninja -C build test
|
||||
- DESTDIR=$PWD/install ninja -C build install
|
||||
|
|
@ -83,34 +201,47 @@ debian:
|
|||
paths:
|
||||
- build/meson-logs/*
|
||||
|
||||
meson-x86_64:
|
||||
.do-build-qemu:
|
||||
extends:
|
||||
- .ci-run-policy
|
||||
- .meson-build
|
||||
image: $DEBIAN_IMAGE
|
||||
needs:
|
||||
- debian
|
||||
- .ci-rules
|
||||
stage: "Build"
|
||||
script:
|
||||
# Start the VM and copy our workspace to the VM
|
||||
- /app/vmctl start
|
||||
- scp -r $PWD "vm:"
|
||||
# The `set +e is needed to ensure that we always copy the meson logs back to
|
||||
# the workspace to see details about the failed tests.
|
||||
- |
|
||||
set +e
|
||||
/app/vmctl exec "pkg info; cd $CI_PROJECT_NAME ; meson setup build --fatal-meson-warnings --auto-features=enabled -D etnaviv=disabled -D nouveau=disabled -D valgrind=disabled && ninja -C build"
|
||||
set -ex
|
||||
scp -r vm:$CI_PROJECT_NAME/build/meson-logs .
|
||||
/app/vmctl exec "ninja -C $CI_PROJECT_NAME/build install"
|
||||
mkdir -p $PREFIX && scp -r vm:$PREFIX/ $PREFIX/
|
||||
# Finally, shut down the VM.
|
||||
- /app/vmctl stop
|
||||
artifacts:
|
||||
when: on_failure
|
||||
paths:
|
||||
- build/meson-logs/*
|
||||
|
||||
meson-i386:
|
||||
extends: meson-x86_64
|
||||
variables:
|
||||
CROSS: i386
|
||||
# Full build and test.
|
||||
x86_64-debian-build:
|
||||
extends:
|
||||
- .build-env-debian-x86_64
|
||||
- .do-build
|
||||
|
||||
meson-aarch64:
|
||||
extends: meson-x86_64
|
||||
variables:
|
||||
CROSS: arm64
|
||||
aarch64-debian-build:
|
||||
extends:
|
||||
- .build-env-debian-aarch64
|
||||
- .do-build
|
||||
|
||||
meson-armhf:
|
||||
extends: meson-x86_64
|
||||
variables:
|
||||
CROSS: armhf
|
||||
|
||||
meson-ppc64el:
|
||||
extends: meson-x86_64
|
||||
variables:
|
||||
CROSS: ppc64el
|
||||
armv7-debian-build:
|
||||
extends:
|
||||
- .build-env-debian-armv7
|
||||
- .do-build
|
||||
|
||||
# Daily build
|
||||
meson-arch-daily:
|
||||
rules:
|
||||
- if: '$SCHEDULE == "arch-daily"'
|
||||
|
|
@ -126,4 +257,9 @@ meson-arch-daily:
|
|||
meson
|
||||
valgrind
|
||||
python-docutils
|
||||
extends: .meson-build
|
||||
extends: .do-build
|
||||
|
||||
x86_64-freebsd-build:
|
||||
extends:
|
||||
- .build-env-freebsd-x86_64
|
||||
- .do-build-qemu
|
||||
|
|
|
|||
|
|
@ -1,66 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
set -o errexit
|
||||
set -o xtrace
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
CROSS_ARCHITECTURES=(i386 armhf arm64 ppc64el)
|
||||
for arch in ${CROSS_ARCHITECTURES[@]}; do
|
||||
dpkg --add-architecture $arch
|
||||
done
|
||||
|
||||
apt-get install -y \
|
||||
ca-certificates
|
||||
|
||||
sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list
|
||||
echo 'deb https://deb.debian.org/debian buster-backports main' >/etc/apt/sources.list.d/backports.list
|
||||
|
||||
apt-get update
|
||||
|
||||
# Use newer packages from backports by default
|
||||
cat >/etc/apt/preferences <<EOF
|
||||
Package: *
|
||||
Pin: release a=buster-backports
|
||||
Pin-Priority: 500
|
||||
EOF
|
||||
|
||||
apt-get dist-upgrade -y
|
||||
|
||||
apt-get install -y --no-remove \
|
||||
build-essential \
|
||||
docbook-xsl \
|
||||
libatomic-ops-dev \
|
||||
libcairo2-dev \
|
||||
libcunit1-dev \
|
||||
libpciaccess-dev \
|
||||
meson \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-wheel \
|
||||
python3-setuptools \
|
||||
python3-docutils \
|
||||
valgrind
|
||||
|
||||
for arch in ${CROSS_ARCHITECTURES[@]}; do
|
||||
cross_file=/cross_file-$arch.txt
|
||||
|
||||
# Cross-build libdrm deps
|
||||
apt-get install -y --no-remove \
|
||||
libcairo2-dev:$arch \
|
||||
libpciaccess-dev:$arch \
|
||||
crossbuild-essential-$arch
|
||||
|
||||
# Generate cross build files for Meson
|
||||
/usr/share/meson/debcrossgen --arch $arch -o $cross_file
|
||||
|
||||
# Work around a bug in debcrossgen that should be fixed in the next release
|
||||
if [ $arch = i386 ]; then
|
||||
sed -i "s|cpu_family = 'i686'|cpu_family = 'x86'|g" $cross_file
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# Test that the oldest Meson version we claim to support is still supported
|
||||
pip3 install meson==0.46
|
||||
97
Android.bp
Normal file
97
Android.bp
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
//
|
||||
// Copyright © 2011-2012 Intel Corporation
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice (including the next
|
||||
// paragraph) shall be included in all copies or substantial portions of the
|
||||
// Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
subdirs = ["*"]
|
||||
build = ["Android.sources.bp"]
|
||||
|
||||
cc_defaults {
|
||||
name: "libdrm_defaults",
|
||||
cflags: [
|
||||
// XXX: Consider moving these to config.h analogous to autoconf.
|
||||
"-DMAJOR_IN_SYSMACROS=1",
|
||||
"-DHAVE_VISIBILITY=1",
|
||||
"-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1",
|
||||
|
||||
"-Wall",
|
||||
"-Werror",
|
||||
"-Wno-deprecated-declarations",
|
||||
"-Wno-format",
|
||||
"-Wno-gnu-variable-sized-type-not-at-end",
|
||||
"-Wno-implicit-function-declaration",
|
||||
"-Wno-int-conversion",
|
||||
"-Wno-missing-field-initializers",
|
||||
"-Wno-pointer-arith",
|
||||
"-Wno-unused-parameter",
|
||||
"-Wno-unused-variable",
|
||||
],
|
||||
export_system_include_dirs: ["."],
|
||||
}
|
||||
|
||||
cc_library_headers {
|
||||
name: "libdrm_headers",
|
||||
vendor_available: true,
|
||||
host_supported: true,
|
||||
defaults: ["libdrm_defaults"],
|
||||
export_include_dirs: ["include/drm", "android"],
|
||||
apex_available: [
|
||||
"//apex_available:platform",
|
||||
"com.android.virt",
|
||||
],
|
||||
}
|
||||
|
||||
genrule {
|
||||
name: "generated_static_table_fourcc_h",
|
||||
out: ["generated_static_table_fourcc.h"],
|
||||
srcs: ["include/drm/drm_fourcc.h"],
|
||||
tool_files: ["gen_table_fourcc.py"],
|
||||
cmd: "python3 $(location gen_table_fourcc.py) $(in) $(out)",
|
||||
}
|
||||
|
||||
// Library for the device
|
||||
cc_library {
|
||||
name: "libdrm",
|
||||
recovery_available: true,
|
||||
vendor_available: true,
|
||||
host_supported: true,
|
||||
defaults: [
|
||||
"libdrm_defaults",
|
||||
"libdrm_sources",
|
||||
],
|
||||
|
||||
generated_headers: [
|
||||
"generated_static_table_fourcc_h",
|
||||
],
|
||||
|
||||
export_include_dirs: ["include/drm", "android"],
|
||||
|
||||
cflags: [
|
||||
"-Wno-enum-conversion",
|
||||
"-Wno-pointer-arith",
|
||||
"-Wno-sign-compare",
|
||||
"-Wno-tautological-compare",
|
||||
],
|
||||
apex_available: [
|
||||
"//apex_available:platform",
|
||||
"com.android.virt",
|
||||
],
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
# XXX: Consider moving these to config.h analogous to autoconf.
|
||||
LOCAL_CFLAGS += \
|
||||
-DMAJOR_IN_SYSMACROS=1 \
|
||||
-DHAVE_ALLOCA_H=0 \
|
||||
-DHAVE_SYS_SELECT_H=0 \
|
||||
-DHAVE_SYS_SYSCTL_H=0 \
|
||||
-DHAVE_VISIBILITY=1 \
|
||||
-fvisibility=hidden \
|
||||
-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
|
||||
|
||||
LOCAL_CFLAGS += \
|
||||
-Wno-error \
|
||||
-Wno-unused-parameter \
|
||||
-Wno-missing-field-initializers \
|
||||
-Wno-pointer-arith \
|
||||
-Wno-enum-conversion
|
||||
|
||||
# Quiet down the build system and remove any .h files from the sources
|
||||
LOCAL_SRC_FILES := $(patsubst %.h, , $(LOCAL_SRC_FILES))
|
||||
LOCAL_EXPORT_C_INCLUDE_DIRS += $(LOCAL_PATH)
|
||||
|
||||
LOCAL_PROPRIETARY_MODULE := true
|
||||
74
Android.mk
74
Android.mk
|
|
@ -1,74 +0,0 @@
|
|||
#
|
||||
# Copyright © 2011-2012 Intel Corporation
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
# and/or sell copies of the Software, and to permit persons to whom the
|
||||
# Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
|
||||
LIBDRM_ANDROID_MAJOR_VERSION := $(word 1, $(subst ., , $(PLATFORM_VERSION)))
|
||||
ifneq ($(filter 2 4, $(LIBDRM_ANDROID_MAJOR_VERSION)),)
|
||||
$(error "Android 4.4 and earlier not supported")
|
||||
endif
|
||||
|
||||
LIBDRM_COMMON_MK := $(call my-dir)/Android.common.mk
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
LIBDRM_TOP := $(LOCAL_PATH)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
# Import variables LIBDRM_{,H,INCLUDE_H,INCLUDE_ANDROID_H,INCLUDE_VMWGFX_H}_FILES
|
||||
include $(LOCAL_PATH)/Makefile.sources
|
||||
|
||||
#static library for the device (recovery)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := libdrm
|
||||
|
||||
LOCAL_SRC_FILES := $(LIBDRM_FILES)
|
||||
LOCAL_EXPORT_C_INCLUDE_DIRS := \
|
||||
$(LOCAL_PATH) \
|
||||
$(LOCAL_PATH)/include/drm \
|
||||
$(LOCAL_PATH)/android
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(LOCAL_PATH)/include/drm
|
||||
|
||||
include $(LIBDRM_COMMON_MK)
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
# Shared library for the device
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := libdrm
|
||||
|
||||
LOCAL_SRC_FILES := $(LIBDRM_FILES)
|
||||
LOCAL_EXPORT_C_INCLUDE_DIRS := \
|
||||
$(LOCAL_PATH) \
|
||||
$(LOCAL_PATH)/include/drm \
|
||||
$(LOCAL_PATH)/android
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libcutils
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(LOCAL_PATH)/include/drm
|
||||
|
||||
include $(LIBDRM_COMMON_MK)
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
||||
12
Android.sources.bp
Normal file
12
Android.sources.bp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// Autogenerated with Android.sources.bp.mk
|
||||
|
||||
cc_defaults {
|
||||
name: "libdrm_sources",
|
||||
srcs: [
|
||||
"xf86drm.c",
|
||||
"xf86drmHash.c",
|
||||
"xf86drmRandom.c",
|
||||
"xf86drmSL.c",
|
||||
"xf86drmMode.c",
|
||||
],
|
||||
}
|
||||
25
Android.sources.bp.mk
Normal file
25
Android.sources.bp.mk
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Usage: make -f path/to/Android.sources.bp.mk NAMES=<> >Android.sources.bp
|
||||
#
|
||||
# It will read the Makefile.sources in the current directory, and
|
||||
# write <NAME>_FILES to stdout as an Android.bp cc_defaults module.
|
||||
|
||||
.PHONY: all
|
||||
all:
|
||||
@# Do nothing
|
||||
|
||||
include Makefile.sources
|
||||
|
||||
empty :=
|
||||
indent := $(empty) $(empty)
|
||||
|
||||
$(info // Autogenerated with Android.sources.bp.mk)
|
||||
$(foreach NAME,$(NAMES), \
|
||||
$(eval lower_name := $(shell echo $(PREFIX)$(NAME) | tr 'A-Z' 'a-z')) \
|
||||
$(info ) \
|
||||
$(info cc_defaults {) \
|
||||
$(info $(indent)name: "$(lower_name)_sources",) \
|
||||
$(info $(indent)srcs: [) \
|
||||
$(foreach f,$(filter %.c,$($(NAME)_FILES)), \
|
||||
$(info $(indent)$(indent)"$(f)",)) \
|
||||
$(info $(indent)],) \
|
||||
$(info }))
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
LIBDRM_FILES := \
|
||||
xf86drm.c \
|
||||
xf86drmHash.c \
|
||||
xf86drmHash.h \
|
||||
xf86drmRandom.c \
|
||||
xf86drmRandom.h \
|
||||
xf86drmSL.c \
|
||||
xf86drmMode.c \
|
||||
xf86atomic.h \
|
||||
libdrm_macros.h \
|
||||
libdrm_lists.h \
|
||||
util_double_list.h \
|
||||
util_math.h
|
||||
|
||||
LIBDRM_H_FILES := \
|
||||
libsync.h \
|
||||
xf86drm.h \
|
||||
xf86drmMode.h
|
||||
|
||||
LIBDRM_INCLUDE_H_FILES := \
|
||||
include/drm/drm.h \
|
||||
include/drm/drm_fourcc.h \
|
||||
include/drm/drm_mode.h \
|
||||
include/drm/drm_sarea.h \
|
||||
include/drm/i915_drm.h \
|
||||
include/drm/mach64_drm.h \
|
||||
include/drm/mga_drm.h \
|
||||
include/drm/msm_drm.h \
|
||||
include/drm/nouveau_drm.h \
|
||||
include/drm/qxl_drm.h \
|
||||
include/drm/r128_drm.h \
|
||||
include/drm/radeon_drm.h \
|
||||
include/drm/amdgpu_drm.h \
|
||||
include/drm/savage_drm.h \
|
||||
include/drm/sis_drm.h \
|
||||
include/drm/tegra_drm.h \
|
||||
include/drm/vc4_drm.h \
|
||||
include/drm/via_drm.h \
|
||||
include/drm/virtgpu_drm.h
|
||||
|
||||
LIBDRM_INCLUDE_ANDROID_H_FILES := \
|
||||
android/gralloc_handle.h
|
||||
|
||||
LIBDRM_INCLUDE_VMWGFX_H_FILES := \
|
||||
include/drm/vmwgfx_drm.h
|
||||
12
README.rst
12
README.rst
|
|
@ -49,3 +49,15 @@ Then use ninja to build and install:
|
|||
|
||||
If you are installing into a system location you will need to run install
|
||||
separately, and as root.
|
||||
|
||||
AMDGPU ASIC table file
|
||||
----------------------
|
||||
|
||||
The AMDGPU driver requires the `amdgpu.ids` file. It is usually located at
|
||||
`$PREFIX/share/libdrm`, but it is possible to specify a set of alternative
|
||||
paths at runtime by setting the `AMDGPU_ASIC_ID_TABLE_PATHS` environment
|
||||
variable with one or more colon-separated paths where to search for the
|
||||
`amdgpu.ids` file.
|
||||
|
||||
For this option to be available, the C library must support secure_getenv()
|
||||
function. In systems without it (like NetBSD), this option won't be available.
|
||||
|
|
@ -18,9 +18,9 @@ Follow these steps to release a new version of libdrm:
|
|||
builddir/meson-dist/ matches the number you bumped to. Move that
|
||||
tarball to the libdrm repo root for the release script to pick up.
|
||||
|
||||
3) Push the updated master branch with the bumped version number:
|
||||
3) Push the updated main branch with the bumped version number:
|
||||
|
||||
git push origin master
|
||||
git push origin main
|
||||
|
||||
assuming the remote for the upstream libdrm repo is called origin.
|
||||
|
||||
|
|
|
|||
16
amdgpu/Android.bp
Normal file
16
amdgpu/Android.bp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
build = ["Android.sources.bp"]
|
||||
|
||||
cc_library_shared {
|
||||
name: "libdrm_amdgpu",
|
||||
|
||||
cflags: [
|
||||
"-DAMDGPU_ASIC_ID_TABLE=\"/vendor/etc/hwdata/amdgpu.ids\""
|
||||
],
|
||||
|
||||
defaults: [
|
||||
"libdrm_defaults",
|
||||
"libdrm_amdgpu_sources",
|
||||
],
|
||||
vendor: true,
|
||||
shared_libs: ["libdrm"],
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
# Import variables LIBDRM_AMDGPU_FILES, LIBDRM_AMDGPU_H_FILES
|
||||
include $(LOCAL_PATH)/Makefile.sources
|
||||
|
||||
LOCAL_MODULE := libdrm_amdgpu
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := libdrm
|
||||
|
||||
LOCAL_SRC_FILES := $(LIBDRM_AMDGPU_FILES)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-DAMDGPU_ASIC_ID_TABLE=\"/vendor/etc/hwdata/amdgpu.ids\"
|
||||
|
||||
LOCAL_REQUIRED_MODULES := amdgpu.ids
|
||||
|
||||
include $(LIBDRM_COMMON_MK)
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
15
amdgpu/Android.sources.bp
Normal file
15
amdgpu/Android.sources.bp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Autogenerated with Android.sources.bp.mk
|
||||
|
||||
cc_defaults {
|
||||
name: "libdrm_amdgpu_sources",
|
||||
srcs: [
|
||||
"amdgpu_asic_id.c",
|
||||
"amdgpu_bo.c",
|
||||
"amdgpu_cs.c",
|
||||
"amdgpu_device.c",
|
||||
"amdgpu_gpu_info.c",
|
||||
"amdgpu_vamgr.c",
|
||||
"amdgpu_vm.c",
|
||||
"handle_table.c",
|
||||
],
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
LIBDRM_AMDGPU_FILES := \
|
||||
amdgpu_asic_id.c \
|
||||
amdgpu_bo.c \
|
||||
amdgpu_cs.c \
|
||||
amdgpu_device.c \
|
||||
amdgpu_gpu_info.c \
|
||||
amdgpu_internal.h \
|
||||
amdgpu_vamgr.c \
|
||||
amdgpu_vm.c \
|
||||
handle_table.c \
|
||||
handle_table.h
|
||||
|
||||
LIBDRM_AMDGPU_H_FILES := \
|
||||
amdgpu.h
|
||||
|
|
@ -14,6 +14,7 @@ amdgpu_bo_query_info
|
|||
amdgpu_bo_set_metadata
|
||||
amdgpu_bo_va_op
|
||||
amdgpu_bo_va_op_raw
|
||||
amdgpu_bo_va_op_raw2
|
||||
amdgpu_bo_wait_for_idle
|
||||
amdgpu_create_bo_from_user_mem
|
||||
amdgpu_cs_chunk_fence_info_to_data
|
||||
|
|
@ -25,6 +26,7 @@ amdgpu_cs_ctx_create
|
|||
amdgpu_cs_ctx_create2
|
||||
amdgpu_cs_ctx_free
|
||||
amdgpu_cs_ctx_override_priority
|
||||
amdgpu_cs_ctx_stable_pstate
|
||||
amdgpu_cs_destroy_semaphore
|
||||
amdgpu_cs_destroy_syncobj
|
||||
amdgpu_cs_export_syncobj
|
||||
|
|
@ -53,7 +55,9 @@ amdgpu_cs_syncobj_wait
|
|||
amdgpu_cs_wait_fences
|
||||
amdgpu_cs_wait_semaphore
|
||||
amdgpu_device_deinitialize
|
||||
amdgpu_device_get_fd
|
||||
amdgpu_device_initialize
|
||||
amdgpu_device_initialize2
|
||||
amdgpu_find_bo_by_cpu_mapping
|
||||
amdgpu_get_marketing_name
|
||||
amdgpu_query_buffer_size_alignment
|
||||
|
|
@ -61,15 +65,26 @@ amdgpu_query_crtc_from_id
|
|||
amdgpu_query_firmware_version
|
||||
amdgpu_query_gds_info
|
||||
amdgpu_query_gpu_info
|
||||
amdgpu_query_gpuvm_fault_info
|
||||
amdgpu_query_heap_info
|
||||
amdgpu_query_hw_ip_count
|
||||
amdgpu_query_hw_ip_info
|
||||
amdgpu_query_info
|
||||
amdgpu_query_sensor_info
|
||||
amdgpu_query_uq_fw_area_info
|
||||
amdgpu_query_video_caps_info
|
||||
amdgpu_read_mm_registers
|
||||
amdgpu_va_manager_alloc
|
||||
amdgpu_va_manager_init
|
||||
amdgpu_va_manager_deinit
|
||||
amdgpu_va_range_alloc
|
||||
amdgpu_va_range_alloc2
|
||||
amdgpu_va_range_free
|
||||
amdgpu_va_get_start_addr
|
||||
amdgpu_va_range_query
|
||||
amdgpu_vm_reserve_vmid
|
||||
amdgpu_vm_unreserve_vmid
|
||||
amdgpu_create_userqueue
|
||||
amdgpu_free_userqueue
|
||||
amdgpu_userq_signal
|
||||
amdgpu_userq_wait
|
||||
|
|
|
|||
218
amdgpu/amdgpu.h
218
amdgpu/amdgpu.h
|
|
@ -42,7 +42,10 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
struct drm_amdgpu_info_hw_ip;
|
||||
struct drm_amdgpu_info_uq_fw_areas;
|
||||
struct drm_amdgpu_bo_list_entry;
|
||||
struct drm_amdgpu_userq_signal;
|
||||
struct drm_amdgpu_userq_wait;
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/* --------------------------- Defines ------------------------------------ */
|
||||
|
|
@ -138,6 +141,12 @@ typedef struct amdgpu_bo_list *amdgpu_bo_list_handle;
|
|||
*/
|
||||
typedef struct amdgpu_va *amdgpu_va_handle;
|
||||
|
||||
/**
|
||||
* Define handle dealing with VA allocation. An amdgpu_device
|
||||
* owns one of these, but they can also be used without a device.
|
||||
*/
|
||||
typedef struct amdgpu_va_manager *amdgpu_va_manager_handle;
|
||||
|
||||
/**
|
||||
* Define handle for semaphore
|
||||
*/
|
||||
|
|
@ -527,6 +536,20 @@ int amdgpu_device_initialize(int fd,
|
|||
uint32_t *minor_version,
|
||||
amdgpu_device_handle *device_handle);
|
||||
|
||||
/**
|
||||
* Same as amdgpu_device_initialize() except when deduplicate_device
|
||||
* is false *and* fd points to a device that was already initialized.
|
||||
* In this case, amdgpu_device_initialize would return the same
|
||||
* amdgpu_device_handle while here amdgpu_device_initialize2 would
|
||||
* return a new handle.
|
||||
* amdgpu_device_initialize() should be preferred in most situations;
|
||||
* the only use-case where not-deduplicating devices make sense is
|
||||
* when one wants to have isolated device handles in the same process.
|
||||
*/
|
||||
int amdgpu_device_initialize2(int fd, bool deduplicate_device,
|
||||
uint32_t *major_version,
|
||||
uint32_t *minor_version,
|
||||
amdgpu_device_handle *device_handle);
|
||||
/**
|
||||
*
|
||||
* When access to such library does not needed any more the special
|
||||
|
|
@ -546,6 +569,19 @@ int amdgpu_device_initialize(int fd,
|
|||
*/
|
||||
int amdgpu_device_deinitialize(amdgpu_device_handle device_handle);
|
||||
|
||||
/**
|
||||
*
|
||||
* /param device_handle - \c [in] Device handle.
|
||||
* See #amdgpu_device_initialize()
|
||||
*
|
||||
* \return Returns the drm fd used for operations on this
|
||||
* device. This is still owned by the library and hence
|
||||
* should not be closed. Guaranteed to be valid until
|
||||
* #amdgpu_device_deinitialize gets called.
|
||||
*
|
||||
*/
|
||||
int amdgpu_device_get_fd(amdgpu_device_handle device_handle);
|
||||
|
||||
/*
|
||||
* Memory Management
|
||||
*
|
||||
|
|
@ -926,6 +962,21 @@ int amdgpu_cs_ctx_override_priority(amdgpu_device_handle dev,
|
|||
int master_fd,
|
||||
unsigned priority);
|
||||
|
||||
/**
|
||||
* Set or query the stable power state for GPU profiling.
|
||||
*
|
||||
* \param dev - \c [in] device handle
|
||||
* \param op - \c [in] AMDGPU_CTX_OP_{GET,SET}_STABLE_PSTATE
|
||||
* \param flags - \c [in] AMDGPU_CTX_STABLE_PSTATE_*
|
||||
* \param out_flags - \c [out] output current stable pstate
|
||||
*
|
||||
* \return 0 on success otherwise POSIX Error code.
|
||||
*/
|
||||
int amdgpu_cs_ctx_stable_pstate(amdgpu_context_handle context,
|
||||
uint32_t op,
|
||||
uint32_t flags,
|
||||
uint32_t *out_flags);
|
||||
|
||||
/**
|
||||
* Query reset state for the specific GPU Context
|
||||
*
|
||||
|
|
@ -1124,6 +1175,26 @@ int amdgpu_query_hw_ip_info(amdgpu_device_handle dev, unsigned type,
|
|||
unsigned ip_instance,
|
||||
struct drm_amdgpu_info_hw_ip *info);
|
||||
|
||||
/**
|
||||
* Query FW area related information.
|
||||
*
|
||||
* The return size is query-specific and depends on the "type" parameter.
|
||||
* No more than "size" bytes is returned.
|
||||
*
|
||||
* \param dev - \c [in] Device handle. See #amdgpu_device_initialize()
|
||||
* \param type - \c [in] AMDGPU_HW_IP_*
|
||||
* \param ip_instance - \c [in] HW IP index.
|
||||
* \param info - \c [out] The pointer to return value
|
||||
*
|
||||
* \return 0 on success\n
|
||||
* <0 - Negative POSIX error code
|
||||
*
|
||||
*/
|
||||
int amdgpu_query_uq_fw_area_info(amdgpu_device_handle dev,
|
||||
unsigned type,
|
||||
unsigned ip_instance,
|
||||
struct drm_amdgpu_info_uq_fw_areas *info);
|
||||
|
||||
/**
|
||||
* Query heap information
|
||||
*
|
||||
|
|
@ -1254,6 +1325,22 @@ int amdgpu_query_sensor_info(amdgpu_device_handle dev, unsigned sensor_type,
|
|||
int amdgpu_query_video_caps_info(amdgpu_device_handle dev, unsigned cap_type,
|
||||
unsigned size, void *value);
|
||||
|
||||
/**
|
||||
* Query information about VM faults
|
||||
*
|
||||
* The return sizeof(struct drm_amdgpu_info_gpuvm_fault)
|
||||
*
|
||||
* \param dev - \c [in] Device handle. See #amdgpu_device_initialize()
|
||||
* \param size - \c [in] Size of the returned value.
|
||||
* \param value - \c [out] Pointer to the return value.
|
||||
*
|
||||
* \return 0 on success\n
|
||||
* <0 - Negative POSIX Error code
|
||||
*
|
||||
*/
|
||||
int amdgpu_query_gpuvm_fault_info(amdgpu_device_handle dev, unsigned size,
|
||||
void *value);
|
||||
|
||||
/**
|
||||
* Read a set of consecutive memory-mapped registers.
|
||||
* Not all registers are allowed to be read by userspace.
|
||||
|
|
@ -1340,6 +1427,11 @@ int amdgpu_va_range_alloc(amdgpu_device_handle dev,
|
|||
*/
|
||||
int amdgpu_va_range_free(amdgpu_va_handle va_range_handle);
|
||||
|
||||
/**
|
||||
* Return the starting address of the allocated virtual address range.
|
||||
*/
|
||||
uint64_t amdgpu_va_get_start_addr(amdgpu_va_handle va_handle);
|
||||
|
||||
/**
|
||||
* Query virtual address range
|
||||
*
|
||||
|
|
@ -1361,6 +1453,37 @@ int amdgpu_va_range_query(amdgpu_device_handle dev,
|
|||
uint64_t *start,
|
||||
uint64_t *end);
|
||||
|
||||
/**
|
||||
* Allocate a amdgpu_va_manager object.
|
||||
* The returned object has be initialized with the amdgpu_va_manager_init
|
||||
* before use.
|
||||
* On release, amdgpu_va_manager_deinit needs to be called, then the memory
|
||||
* can be released using free().
|
||||
*/
|
||||
amdgpu_va_manager_handle amdgpu_va_manager_alloc(void);
|
||||
|
||||
void amdgpu_va_manager_init(amdgpu_va_manager_handle va_mgr,
|
||||
uint64_t low_va_offset, uint64_t low_va_max,
|
||||
uint64_t high_va_offset, uint64_t high_va_max,
|
||||
uint32_t virtual_address_alignment);
|
||||
|
||||
void amdgpu_va_manager_deinit(amdgpu_va_manager_handle va_mgr);
|
||||
|
||||
/**
|
||||
* Similar to #amdgpu_va_range_alloc() but allocates VA
|
||||
* directly from an amdgpu_va_manager_handle instead of using
|
||||
* the manager from an amdgpu_device.
|
||||
*/
|
||||
|
||||
int amdgpu_va_range_alloc2(amdgpu_va_manager_handle va_mgr,
|
||||
enum amdgpu_gpu_va_range va_range_type,
|
||||
uint64_t size,
|
||||
uint64_t va_base_alignment,
|
||||
uint64_t va_base_required,
|
||||
uint64_t *va_base_allocated,
|
||||
amdgpu_va_handle *va_range_handle,
|
||||
uint64_t flags);
|
||||
|
||||
/**
|
||||
* VA mapping/unmapping for the buffer object
|
||||
*
|
||||
|
|
@ -1411,6 +1534,42 @@ int amdgpu_bo_va_op_raw(amdgpu_device_handle dev,
|
|||
uint64_t flags,
|
||||
uint32_t ops);
|
||||
|
||||
/**
|
||||
* VA mapping/unmapping of buffer object for usermode queue.
|
||||
*
|
||||
* This is not a simple drop-in extension for amdgpu_bo_va_op; instead, all
|
||||
* parameters are treated "raw2", i.e. size is not automatically aligned, and
|
||||
* all flags must be specified explicitly.
|
||||
*
|
||||
* \param dev - \c [in] device handle
|
||||
* \param bo - \c [in] BO handle (may be NULL)
|
||||
* \param offset - \c [in] Start offset to map
|
||||
* \param size - \c [in] Size to map
|
||||
* \param addr - \c [in] Start virtual address.
|
||||
* \param flags - \c [in] Supported flags for mapping/unmapping
|
||||
* \param ops - \c [in] AMDGPU_VA_OP_MAP or AMDGPU_VA_OP_UNMAP
|
||||
* \param vm_timeline_syncobj_out - \c [out] syncobj handle for PT update fence
|
||||
* \param vm_timeline_point - \c [in] input timeline point
|
||||
* \param input_fence_syncobj_handles - \c [in] Array of syncobj handles for bo unmap,
|
||||
* clear and replace
|
||||
* \param num_syncobj_handles - \c [in] Number of syncobj handles
|
||||
*
|
||||
* \return 0 on success\n
|
||||
* <0 - Negative POSIX Error code
|
||||
*
|
||||
*/
|
||||
int amdgpu_bo_va_op_raw2(amdgpu_device_handle dev,
|
||||
amdgpu_bo_handle bo,
|
||||
uint64_t offset,
|
||||
uint64_t size,
|
||||
uint64_t addr,
|
||||
uint64_t flags,
|
||||
uint32_t ops,
|
||||
uint32_t vm_timeline_syncobj_out,
|
||||
uint64_t vm_timeline_point,
|
||||
uint64_t input_fence_syncobj_array_in,
|
||||
uint32_t num_syncobj_handles_in);
|
||||
|
||||
/**
|
||||
* create semaphore
|
||||
*
|
||||
|
|
@ -1842,6 +2001,65 @@ int amdgpu_vm_reserve_vmid(amdgpu_device_handle dev, uint32_t flags);
|
|||
*/
|
||||
int amdgpu_vm_unreserve_vmid(amdgpu_device_handle dev, uint32_t flags);
|
||||
|
||||
/**
|
||||
* Create USERQUEUE
|
||||
* \param dev - \c [in] device handle
|
||||
* \param ip_type - \c [in] ip type
|
||||
* \param doorbell_handle - \c [in] doorbell handle
|
||||
* \param doorbell_offset - \c [in] doorbell index
|
||||
* \param mqd_in - \c [in] MQD data
|
||||
* \param queue_va - \c [in] Virtual address of queue
|
||||
* \param queue_size - \c [in] userqueue size
|
||||
* \param wptr_va - \c [in] Virtual address of wptr
|
||||
* \param rptr_va - \c [in] Virtual address of rptr
|
||||
* \param queue_id - \c [out] queue id
|
||||
*
|
||||
* \return 0 on success otherwise POSIX Error code
|
||||
*/
|
||||
|
||||
int amdgpu_create_userqueue(amdgpu_device_handle dev,
|
||||
uint32_t ip_type,
|
||||
uint32_t doorbell_handle,
|
||||
uint32_t doorbell_offset,
|
||||
uint64_t queue_va,
|
||||
uint64_t queue_size,
|
||||
uint64_t wptr_va,
|
||||
uint64_t rptr_va,
|
||||
void *mqd_in,
|
||||
uint32_t flags,
|
||||
uint32_t *queue_id);
|
||||
|
||||
/**
|
||||
* Free USERQUEUE
|
||||
* \param dev - \c [in] device handle
|
||||
* \param queue_id - \c [in] queue id
|
||||
*
|
||||
* \return 0 on success otherwise POSIX Error code
|
||||
*/
|
||||
int amdgpu_free_userqueue(amdgpu_device_handle dev, uint32_t queue_id);
|
||||
|
||||
/**
|
||||
* Signal USERQUEUE
|
||||
* \param dev - \c [in] device handle
|
||||
* \param signal_data - \c [in] pointer to struct drm_amdgpu_userq_signal
|
||||
* to be filled by the caller
|
||||
*
|
||||
* \return 0 on success otherwise POSIX Error code
|
||||
*/
|
||||
int amdgpu_userq_signal(amdgpu_device_handle dev,
|
||||
struct drm_amdgpu_userq_signal *signal_data);
|
||||
|
||||
/**
|
||||
* Wait USERQUEUE
|
||||
* \param dev - \c [in] device handle
|
||||
* \param wait_data - \c [in/out] pointer to struct drm_amdgpu_userq_wait
|
||||
* to be filled by the caller
|
||||
*
|
||||
* \return 0 on success otherwise POSIX Error code
|
||||
*/
|
||||
int amdgpu_userq_wait(amdgpu_device_handle dev,
|
||||
struct drm_amdgpu_userq_wait *wait_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -22,6 +22,11 @@
|
|||
*
|
||||
*/
|
||||
|
||||
// secure_getenv requires _GNU_SOURCE
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
@ -104,6 +109,168 @@ out:
|
|||
return r;
|
||||
}
|
||||
|
||||
static void amdgpu_parse_proc_cpuinfo(struct amdgpu_device *dev)
|
||||
{
|
||||
const char *search_key = "model name";
|
||||
const char *radeon_key = "Radeon";
|
||||
char *line = NULL;
|
||||
size_t len = 0;
|
||||
FILE *fp;
|
||||
|
||||
fp = fopen("/proc/cpuinfo", "r");
|
||||
if (fp == NULL) {
|
||||
fprintf(stderr, "%s\n", strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
while (getline(&line, &len, fp) != -1) {
|
||||
char *saveptr;
|
||||
char *value;
|
||||
|
||||
if (strncmp(line, search_key, strlen(search_key)))
|
||||
continue;
|
||||
|
||||
/* check for parts that have both CPU and GPU information */
|
||||
value = strstr(line, radeon_key);
|
||||
|
||||
/* get content after the first colon */
|
||||
if (value == NULL) {
|
||||
value = strstr(line, ":");
|
||||
if (value == NULL)
|
||||
continue;
|
||||
value++;
|
||||
}
|
||||
|
||||
/* strip whitespace */
|
||||
while (*value == ' ' || *value == '\t')
|
||||
value++;
|
||||
saveptr = strchr(value, '\n');
|
||||
if (saveptr)
|
||||
*saveptr = '\0';
|
||||
|
||||
/* Add AMD to the new string if it's missing from slicing/dicing */
|
||||
if (strncmp(value, "AMD", 3) != 0) {
|
||||
char *tmp = malloc(strlen(value) + 5);
|
||||
|
||||
if (!tmp)
|
||||
break;
|
||||
sprintf(tmp, "AMD %s", value);
|
||||
dev->marketing_name = tmp;
|
||||
} else
|
||||
dev->marketing_name = strdup(value);
|
||||
break;
|
||||
}
|
||||
|
||||
free(line);
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
#if HAVE_SECURE_GETENV
|
||||
static char *join_path(const char *dir, const char *file) {
|
||||
size_t dir_len = strlen(dir);
|
||||
size_t file_len = strlen(file);
|
||||
char *full_path = NULL;
|
||||
|
||||
int need_slash = ((dir_len > 0) && (dir[dir_len - 1] != '/'));
|
||||
size_t total_len = dir_len + (need_slash ? 1 : 0) + file_len + 1; // +1 for null terminator
|
||||
|
||||
if (dir_len == 0) {
|
||||
return strdup(file);
|
||||
}
|
||||
|
||||
full_path = malloc(total_len);
|
||||
if (!full_path) {
|
||||
return NULL; // Memory allocation failed
|
||||
}
|
||||
|
||||
strcpy(full_path, dir);
|
||||
if (need_slash) {
|
||||
full_path[dir_len] = '/';
|
||||
dir_len++;
|
||||
}
|
||||
strcpy(full_path + dir_len, file);
|
||||
|
||||
return full_path;
|
||||
}
|
||||
|
||||
static char **split_env_var(const char *env_var_content)
|
||||
{
|
||||
char **ret = NULL;
|
||||
char *dup_env_val;
|
||||
int elements = 1;
|
||||
int index = 1;
|
||||
|
||||
if (!env_var_content || env_var_content[0] == '\0')
|
||||
return NULL;
|
||||
|
||||
for(char *p = (char *)env_var_content; *p; p++) {
|
||||
if (*p == ':')
|
||||
elements++;
|
||||
}
|
||||
|
||||
dup_env_val = strdup(env_var_content);
|
||||
if (!dup_env_val) {
|
||||
return NULL;
|
||||
}
|
||||
ret = malloc(sizeof(char *) * (elements + 1));
|
||||
ret[0] = dup_env_val;
|
||||
for(char *p = (char *)dup_env_val; *p; p++) {
|
||||
if (*p == ':') {
|
||||
*p = 0;
|
||||
ret[index++] = p + 1;
|
||||
}
|
||||
}
|
||||
ret[index] = NULL; // ensure that the last element in the array is NULL
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void split_env_var_free(char **split_var)
|
||||
{
|
||||
if (split_var) {
|
||||
// remember that the first element also points to the whole duplicated string,
|
||||
// which was modified in place by replacing ':' with '\0' characters
|
||||
free(split_var[0]);
|
||||
free(split_var);
|
||||
}
|
||||
}
|
||||
|
||||
static char *find_asic_id_table(void)
|
||||
{
|
||||
// first check the paths in AMDGPU_ASIC_ID_TABLE_PATHS environment variable
|
||||
const char *amdgpu_asic_id_table_paths = secure_getenv("AMDGPU_ASIC_ID_TABLE_PATHS");
|
||||
char *file_name = NULL;
|
||||
char *found_path = NULL;
|
||||
char **paths = NULL;
|
||||
|
||||
if (!amdgpu_asic_id_table_paths)
|
||||
return NULL;
|
||||
|
||||
// extract the file name from AMDGPU_ASIC_ID_TABLE
|
||||
file_name = strrchr(AMDGPU_ASIC_ID_TABLE, '/');
|
||||
if (!file_name)
|
||||
return NULL;
|
||||
file_name++; // skip the '/'
|
||||
|
||||
paths = split_env_var(amdgpu_asic_id_table_paths);
|
||||
if (!paths)
|
||||
return NULL;
|
||||
|
||||
// for each path, join with file_name and check if it exists
|
||||
for (int i = 0; paths[i] != NULL; i++) {
|
||||
char *full_path = join_path(paths[i], file_name);
|
||||
if (!full_path) {
|
||||
continue;
|
||||
}
|
||||
if (access(full_path, R_OK) == 0) {
|
||||
found_path = full_path;
|
||||
break;
|
||||
}
|
||||
}
|
||||
split_env_var_free(paths);
|
||||
return found_path;
|
||||
}
|
||||
#endif
|
||||
|
||||
void amdgpu_parse_asic_ids(struct amdgpu_device *dev)
|
||||
{
|
||||
FILE *fp;
|
||||
|
|
@ -113,11 +280,21 @@ void amdgpu_parse_asic_ids(struct amdgpu_device *dev)
|
|||
int line_num = 1;
|
||||
int r = 0;
|
||||
|
||||
fp = fopen(AMDGPU_ASIC_ID_TABLE, "r");
|
||||
char *amdgpu_asic_id_table_path = NULL;
|
||||
#if HAVE_SECURE_GETENV
|
||||
// if this system lacks secure_getenv(), don't allow extra paths
|
||||
// for security reasons.
|
||||
amdgpu_asic_id_table_path = find_asic_id_table();
|
||||
#endif
|
||||
// if not found, use the default AMDGPU_ASIC_ID_TABLE path
|
||||
if (!amdgpu_asic_id_table_path)
|
||||
amdgpu_asic_id_table_path = strdup(AMDGPU_ASIC_ID_TABLE);
|
||||
|
||||
fp = fopen(amdgpu_asic_id_table_path, "r");
|
||||
if (!fp) {
|
||||
fprintf(stderr, "%s: %s\n", AMDGPU_ASIC_ID_TABLE,
|
||||
fprintf(stderr, "%s: %s\n", amdgpu_asic_id_table_path,
|
||||
strerror(errno));
|
||||
return;
|
||||
goto get_cpu;
|
||||
}
|
||||
|
||||
/* 1st valid line is file version */
|
||||
|
|
@ -132,7 +309,7 @@ void amdgpu_parse_asic_ids(struct amdgpu_device *dev)
|
|||
continue;
|
||||
}
|
||||
|
||||
drmMsg("%s version: %s\n", AMDGPU_ASIC_ID_TABLE, line);
|
||||
drmMsg("%s version: %s\n", amdgpu_asic_id_table_path, line);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -150,7 +327,7 @@ void amdgpu_parse_asic_ids(struct amdgpu_device *dev)
|
|||
|
||||
if (r == -EINVAL) {
|
||||
fprintf(stderr, "Invalid format: %s: line %d: %s\n",
|
||||
AMDGPU_ASIC_ID_TABLE, line_num, line);
|
||||
amdgpu_asic_id_table_path, line_num, line);
|
||||
} else if (r && r != -EAGAIN) {
|
||||
fprintf(stderr, "%s: Cannot parse ASIC IDs: %s\n",
|
||||
__func__, strerror(-r));
|
||||
|
|
@ -158,4 +335,11 @@ void amdgpu_parse_asic_ids(struct amdgpu_device *dev)
|
|||
|
||||
free(line);
|
||||
fclose(fp);
|
||||
|
||||
get_cpu:
|
||||
free(amdgpu_asic_id_table_path);
|
||||
if (dev->info.ids_flags & AMDGPU_IDS_FLAGS_FUSION &&
|
||||
dev->marketing_name == NULL) {
|
||||
amdgpu_parse_proc_cpuinfo(dev);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,14 +39,6 @@
|
|||
#include "amdgpu_internal.h"
|
||||
#include "util_math.h"
|
||||
|
||||
static int amdgpu_close_kms_handle(int fd, uint32_t handle)
|
||||
{
|
||||
struct drm_gem_close args = {};
|
||||
|
||||
args.handle = handle;
|
||||
return drmIoctl(fd, DRM_IOCTL_GEM_CLOSE, &args);
|
||||
}
|
||||
|
||||
static int amdgpu_bo_create(amdgpu_device_handle dev,
|
||||
uint64_t size,
|
||||
uint32_t handle,
|
||||
|
|
@ -82,6 +74,9 @@ drm_public int amdgpu_bo_alloc(amdgpu_device_handle dev,
|
|||
union drm_amdgpu_gem_create args;
|
||||
int r;
|
||||
|
||||
if (!alloc_buffer || !buf_handle)
|
||||
return -EINVAL;
|
||||
|
||||
memset(&args, 0, sizeof(args));
|
||||
args.in.bo_size = alloc_buffer->alloc_size;
|
||||
args.in.alignment = alloc_buffer->phys_alignment;
|
||||
|
|
@ -101,7 +96,7 @@ drm_public int amdgpu_bo_alloc(amdgpu_device_handle dev,
|
|||
buf_handle);
|
||||
pthread_mutex_unlock(&dev->bo_table_mutex);
|
||||
if (r) {
|
||||
amdgpu_close_kms_handle(dev->fd, args.out.handle);
|
||||
drmCloseBufferHandle(dev->fd, args.out.handle);
|
||||
}
|
||||
|
||||
out:
|
||||
|
|
@ -113,6 +108,9 @@ drm_public int amdgpu_bo_set_metadata(amdgpu_bo_handle bo,
|
|||
{
|
||||
struct drm_amdgpu_gem_metadata args = {};
|
||||
|
||||
if (!info)
|
||||
return -EINVAL;
|
||||
|
||||
args.handle = bo->handle;
|
||||
args.op = AMDGPU_GEM_METADATA_OP_SET_METADATA;
|
||||
args.data.flags = info->flags;
|
||||
|
|
@ -140,7 +138,7 @@ drm_public int amdgpu_bo_query_info(amdgpu_bo_handle bo,
|
|||
int r;
|
||||
|
||||
/* Validate the BO passed in */
|
||||
if (!bo->handle)
|
||||
if (!bo->handle || !info)
|
||||
return -EINVAL;
|
||||
|
||||
/* Query metadata. */
|
||||
|
|
@ -216,7 +214,7 @@ static int amdgpu_bo_export_flink(amdgpu_bo_handle bo)
|
|||
bo->flink_name = flink.name;
|
||||
|
||||
if (bo->dev->flink_fd != bo->dev->fd)
|
||||
amdgpu_close_kms_handle(bo->dev->flink_fd, handle);
|
||||
drmCloseBufferHandle(bo->dev->flink_fd, handle);
|
||||
|
||||
pthread_mutex_lock(&bo->dev->bo_table_mutex);
|
||||
r = handle_table_insert(&bo->dev->bo_flink_names, bo->flink_name, bo);
|
||||
|
|
@ -342,8 +340,8 @@ drm_public int amdgpu_bo_import(amdgpu_device_handle dev,
|
|||
close(dma_fd);
|
||||
if (r)
|
||||
goto free_bo_handle;
|
||||
r = amdgpu_close_kms_handle(dev->flink_fd,
|
||||
open_arg.handle);
|
||||
r = drmCloseBufferHandle(dev->flink_fd,
|
||||
open_arg.handle);
|
||||
if (r)
|
||||
goto free_bo_handle;
|
||||
}
|
||||
|
|
@ -381,12 +379,12 @@ drm_public int amdgpu_bo_import(amdgpu_device_handle dev,
|
|||
|
||||
free_bo_handle:
|
||||
if (flink_name && open_arg.handle)
|
||||
amdgpu_close_kms_handle(dev->flink_fd, open_arg.handle);
|
||||
drmCloseBufferHandle(dev->flink_fd, open_arg.handle);
|
||||
|
||||
if (bo)
|
||||
amdgpu_bo_free(bo);
|
||||
else
|
||||
amdgpu_close_kms_handle(dev->fd, handle);
|
||||
drmCloseBufferHandle(dev->fd, handle);
|
||||
unlock:
|
||||
pthread_mutex_unlock(&dev->bo_table_mutex);
|
||||
return r;
|
||||
|
|
@ -415,7 +413,7 @@ drm_public int amdgpu_bo_free(amdgpu_bo_handle buf_handle)
|
|||
amdgpu_bo_cpu_unmap(bo);
|
||||
}
|
||||
|
||||
amdgpu_close_kms_handle(dev->fd, bo->handle);
|
||||
drmCloseBufferHandle(dev->fd, bo->handle);
|
||||
pthread_mutex_destroy(&bo->cpu_access_mutex);
|
||||
free(bo);
|
||||
}
|
||||
|
|
@ -541,7 +539,7 @@ drm_public int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev,
|
|||
amdgpu_bo_handle *buf_handle,
|
||||
uint64_t *offset_in_bo)
|
||||
{
|
||||
struct amdgpu_bo *bo;
|
||||
struct amdgpu_bo *bo = NULL;
|
||||
uint32_t i;
|
||||
int r = 0;
|
||||
|
||||
|
|
@ -559,7 +557,7 @@ drm_public int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev,
|
|||
if (!bo || !bo->cpu_ptr || size > bo->alloc_size)
|
||||
continue;
|
||||
if (cpu >= bo->cpu_ptr &&
|
||||
cpu < (void*)((uintptr_t)bo->cpu_ptr + bo->alloc_size))
|
||||
cpu < (void*)((uintptr_t)bo->cpu_ptr + (size_t)bo->alloc_size))
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -598,7 +596,7 @@ drm_public int amdgpu_create_bo_from_user_mem(amdgpu_device_handle dev,
|
|||
r = amdgpu_bo_create(dev, size, args.handle, buf_handle);
|
||||
pthread_mutex_unlock(&dev->bo_table_mutex);
|
||||
if (r) {
|
||||
amdgpu_close_kms_handle(dev->fd, args.handle);
|
||||
drmCloseBufferHandle(dev->fd, args.handle);
|
||||
}
|
||||
|
||||
out:
|
||||
|
|
@ -650,7 +648,7 @@ drm_public int amdgpu_bo_list_create(amdgpu_device_handle dev,
|
|||
unsigned i;
|
||||
int r;
|
||||
|
||||
if (!number_of_resources)
|
||||
if (!number_of_resources || !resources)
|
||||
return -EINVAL;
|
||||
|
||||
/* overflow check for multiplication */
|
||||
|
|
@ -797,3 +795,39 @@ drm_public int amdgpu_bo_va_op_raw(amdgpu_device_handle dev,
|
|||
|
||||
return r;
|
||||
}
|
||||
|
||||
drm_public int amdgpu_bo_va_op_raw2(amdgpu_device_handle dev,
|
||||
amdgpu_bo_handle bo,
|
||||
uint64_t offset,
|
||||
uint64_t size,
|
||||
uint64_t addr,
|
||||
uint64_t flags,
|
||||
uint32_t ops,
|
||||
uint32_t vm_timeline_syncobj_out,
|
||||
uint64_t vm_timeline_point,
|
||||
uint64_t input_fence_syncobj_handles,
|
||||
uint32_t num_syncobj_handles)
|
||||
{
|
||||
struct drm_amdgpu_gem_va va;
|
||||
int r;
|
||||
|
||||
if (ops != AMDGPU_VA_OP_MAP && ops != AMDGPU_VA_OP_UNMAP &&
|
||||
ops != AMDGPU_VA_OP_REPLACE && ops != AMDGPU_VA_OP_CLEAR)
|
||||
return -EINVAL;
|
||||
|
||||
memset(&va, 0, sizeof(va));
|
||||
va.handle = bo ? bo->handle : 0;
|
||||
va.operation = ops;
|
||||
va.flags = flags;
|
||||
va.va_address = addr;
|
||||
va.offset_in_bo = offset;
|
||||
va.map_size = size;
|
||||
va.vm_timeline_syncobj_out = vm_timeline_syncobj_out;
|
||||
va.vm_timeline_point = vm_timeline_point;
|
||||
va.input_fence_syncobj_handles = input_fence_syncobj_handles;
|
||||
va.num_syncobj_handles = num_syncobj_handles;
|
||||
|
||||
r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_GEM_VA, &va, sizeof(va));
|
||||
|
||||
return r;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,10 +56,22 @@ drm_public int amdgpu_cs_ctx_create2(amdgpu_device_handle dev,
|
|||
union drm_amdgpu_ctx args;
|
||||
int i, j, k;
|
||||
int r;
|
||||
char *override_priority;
|
||||
|
||||
if (!dev || !context)
|
||||
return -EINVAL;
|
||||
|
||||
override_priority = getenv("AMD_PRIORITY");
|
||||
if (override_priority) {
|
||||
/* The priority is a signed integer. The variable type is
|
||||
* wrong. If parsing fails, priority is unchanged.
|
||||
*/
|
||||
if (sscanf(override_priority, "%i", &priority) == 1) {
|
||||
printf("amdgpu: context priority changed to %i\n",
|
||||
priority);
|
||||
}
|
||||
}
|
||||
|
||||
gpu_context = calloc(1, sizeof(struct amdgpu_context));
|
||||
if (!gpu_context)
|
||||
return -ENOMEM;
|
||||
|
|
@ -128,8 +140,8 @@ drm_public int amdgpu_cs_ctx_free(amdgpu_context_handle context)
|
|||
for (i = 0; i < AMDGPU_HW_IP_NUM; i++) {
|
||||
for (j = 0; j < AMDGPU_HW_IP_INSTANCE_MAX_COUNT; j++) {
|
||||
for (k = 0; k < AMDGPU_CS_MAX_RINGS; k++) {
|
||||
amdgpu_semaphore_handle sem;
|
||||
LIST_FOR_EACH_ENTRY(sem, &context->sem_list[i][j][k], list) {
|
||||
amdgpu_semaphore_handle sem, tmp;
|
||||
LIST_FOR_EACH_ENTRY_SAFE(sem, tmp, &context->sem_list[i][j][k], list) {
|
||||
list_del(&sem->list);
|
||||
amdgpu_cs_reset_sem(sem);
|
||||
amdgpu_cs_unreference_sem(sem);
|
||||
|
|
@ -167,6 +179,28 @@ drm_public int amdgpu_cs_ctx_override_priority(amdgpu_device_handle dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
drm_public int amdgpu_cs_ctx_stable_pstate(amdgpu_context_handle context,
|
||||
uint32_t op,
|
||||
uint32_t flags,
|
||||
uint32_t *out_flags)
|
||||
{
|
||||
union drm_amdgpu_ctx args;
|
||||
int r;
|
||||
|
||||
if (!context)
|
||||
return -EINVAL;
|
||||
|
||||
memset(&args, 0, sizeof(args));
|
||||
args.in.op = op;
|
||||
args.in.ctx_id = context->id;
|
||||
args.in.flags = flags;
|
||||
r = drmCommandWriteRead(context->dev->fd, DRM_AMDGPU_CTX,
|
||||
&args, sizeof(args));
|
||||
if (!r && out_flags)
|
||||
*out_flags = args.out.pstate.flags;
|
||||
return r;
|
||||
}
|
||||
|
||||
drm_public int amdgpu_cs_query_reset_state(amdgpu_context_handle context,
|
||||
uint32_t *state, uint32_t *hangs)
|
||||
{
|
||||
|
|
@ -564,24 +598,31 @@ drm_public int amdgpu_cs_signal_semaphore(amdgpu_context_handle ctx,
|
|||
uint32_t ring,
|
||||
amdgpu_semaphore_handle sem)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!ctx || !sem)
|
||||
return -EINVAL;
|
||||
if (ip_type >= AMDGPU_HW_IP_NUM)
|
||||
return -EINVAL;
|
||||
if (ring >= AMDGPU_CS_MAX_RINGS)
|
||||
return -EINVAL;
|
||||
/* sem has been signaled */
|
||||
if (sem->signal_fence.context)
|
||||
return -EINVAL;
|
||||
|
||||
pthread_mutex_lock(&ctx->sequence_mutex);
|
||||
/* sem has been signaled */
|
||||
if (sem->signal_fence.context) {
|
||||
ret = -EINVAL;
|
||||
goto unlock;
|
||||
}
|
||||
sem->signal_fence.context = ctx;
|
||||
sem->signal_fence.ip_type = ip_type;
|
||||
sem->signal_fence.ip_instance = ip_instance;
|
||||
sem->signal_fence.ring = ring;
|
||||
sem->signal_fence.fence = ctx->last_seq[ip_type][ip_instance][ring];
|
||||
update_references(NULL, &sem->refcount);
|
||||
ret = 0;
|
||||
unlock:
|
||||
pthread_mutex_unlock(&ctx->sequence_mutex);
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
drm_public int amdgpu_cs_wait_semaphore(amdgpu_context_handle ctx,
|
||||
|
|
|
|||
|
|
@ -95,22 +95,26 @@ static int amdgpu_get_auth(int fd, int *auth)
|
|||
|
||||
static void amdgpu_device_free_internal(amdgpu_device_handle dev)
|
||||
{
|
||||
amdgpu_device_handle *node = &dev_list;
|
||||
|
||||
pthread_mutex_lock(&dev_mutex);
|
||||
while (*node != dev && (*node)->next)
|
||||
node = &(*node)->next;
|
||||
*node = (*node)->next;
|
||||
pthread_mutex_unlock(&dev_mutex);
|
||||
/* Remove dev from dev_list, if it was added there. */
|
||||
if (dev == dev_list) {
|
||||
dev_list = dev->next;
|
||||
} else {
|
||||
for (amdgpu_device_handle node = dev_list; node; node = node->next) {
|
||||
if (node->next == dev) {
|
||||
node->next = dev->next;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
close(dev->fd);
|
||||
if ((dev->flink_fd >= 0) && (dev->fd != dev->flink_fd))
|
||||
close(dev->flink_fd);
|
||||
|
||||
amdgpu_vamgr_deinit(&dev->vamgr_32);
|
||||
amdgpu_vamgr_deinit(&dev->vamgr);
|
||||
amdgpu_vamgr_deinit(&dev->vamgr_high_32);
|
||||
amdgpu_vamgr_deinit(&dev->vamgr_high);
|
||||
amdgpu_vamgr_deinit(&dev->va_mgr.vamgr_32);
|
||||
amdgpu_vamgr_deinit(&dev->va_mgr.vamgr_low);
|
||||
amdgpu_vamgr_deinit(&dev->va_mgr.vamgr_high_32);
|
||||
amdgpu_vamgr_deinit(&dev->va_mgr.vamgr_high);
|
||||
handle_table_fini(&dev->bo_handles);
|
||||
handle_table_fini(&dev->bo_flink_names);
|
||||
pthread_mutex_destroy(&dev->bo_table_mutex);
|
||||
|
|
@ -140,22 +144,23 @@ static void amdgpu_device_reference(struct amdgpu_device **dst,
|
|||
*dst = src;
|
||||
}
|
||||
|
||||
drm_public int amdgpu_device_initialize(int fd,
|
||||
uint32_t *major_version,
|
||||
uint32_t *minor_version,
|
||||
amdgpu_device_handle *device_handle)
|
||||
static int _amdgpu_device_initialize(int fd,
|
||||
uint32_t *major_version,
|
||||
uint32_t *minor_version,
|
||||
amdgpu_device_handle *device_handle,
|
||||
bool deduplicate_device)
|
||||
{
|
||||
struct amdgpu_device *dev;
|
||||
struct amdgpu_device *dev = NULL;
|
||||
drmVersionPtr version;
|
||||
int r;
|
||||
int flag_auth = 0;
|
||||
int flag_authexist=0;
|
||||
uint32_t accel_working = 0;
|
||||
uint64_t start, max;
|
||||
|
||||
*device_handle = NULL;
|
||||
|
||||
pthread_mutex_lock(&dev_mutex);
|
||||
|
||||
r = amdgpu_get_auth(fd, &flag_auth);
|
||||
if (r) {
|
||||
fprintf(stderr, "%s: amdgpu_get_auth (1) failed (%i)\n",
|
||||
|
|
@ -164,9 +169,10 @@ drm_public int amdgpu_device_initialize(int fd,
|
|||
return r;
|
||||
}
|
||||
|
||||
for (dev = dev_list; dev; dev = dev->next)
|
||||
if (fd_compare(dev->fd, fd) == 0)
|
||||
break;
|
||||
if (deduplicate_device)
|
||||
for (dev = dev_list; dev; dev = dev->next)
|
||||
if (fd_compare(dev->fd, fd) == 0)
|
||||
break;
|
||||
|
||||
if (dev) {
|
||||
r = amdgpu_get_auth(dev->fd, &flag_authexist);
|
||||
|
|
@ -238,35 +244,22 @@ drm_public int amdgpu_device_initialize(int fd,
|
|||
goto cleanup;
|
||||
}
|
||||
|
||||
start = dev->dev_info.virtual_address_offset;
|
||||
max = MIN2(dev->dev_info.virtual_address_max, 0x100000000ULL);
|
||||
amdgpu_vamgr_init(&dev->vamgr_32, start, max,
|
||||
dev->dev_info.virtual_address_alignment);
|
||||
|
||||
start = max;
|
||||
max = MAX2(dev->dev_info.virtual_address_max, 0x100000000ULL);
|
||||
amdgpu_vamgr_init(&dev->vamgr, start, max,
|
||||
dev->dev_info.virtual_address_alignment);
|
||||
|
||||
start = dev->dev_info.high_va_offset;
|
||||
max = MIN2(dev->dev_info.high_va_max, (start & ~0xffffffffULL) +
|
||||
0x100000000ULL);
|
||||
amdgpu_vamgr_init(&dev->vamgr_high_32, start, max,
|
||||
dev->dev_info.virtual_address_alignment);
|
||||
|
||||
start = max;
|
||||
max = MAX2(dev->dev_info.high_va_max, (start & ~0xffffffffULL) +
|
||||
0x100000000ULL);
|
||||
amdgpu_vamgr_init(&dev->vamgr_high, start, max,
|
||||
dev->dev_info.virtual_address_alignment);
|
||||
amdgpu_va_manager_init(&dev->va_mgr,
|
||||
dev->dev_info.virtual_address_offset,
|
||||
dev->dev_info.virtual_address_max,
|
||||
dev->dev_info.high_va_offset,
|
||||
dev->dev_info.high_va_max,
|
||||
dev->dev_info.virtual_address_alignment);
|
||||
|
||||
amdgpu_parse_asic_ids(dev);
|
||||
|
||||
*major_version = dev->major_version;
|
||||
*minor_version = dev->minor_version;
|
||||
*device_handle = dev;
|
||||
dev->next = dev_list;
|
||||
dev_list = dev;
|
||||
if (deduplicate_device) {
|
||||
dev->next = dev_list;
|
||||
dev_list = dev;
|
||||
}
|
||||
pthread_mutex_unlock(&dev_mutex);
|
||||
|
||||
return 0;
|
||||
|
|
@ -279,15 +272,41 @@ cleanup:
|
|||
return r;
|
||||
}
|
||||
|
||||
drm_public int amdgpu_device_initialize(int fd,
|
||||
uint32_t *major_version,
|
||||
uint32_t *minor_version,
|
||||
amdgpu_device_handle *device_handle)
|
||||
{
|
||||
return _amdgpu_device_initialize(fd, major_version, minor_version, device_handle, true);
|
||||
}
|
||||
|
||||
drm_public int amdgpu_device_initialize2(int fd, bool deduplicate_device,
|
||||
uint32_t *major_version,
|
||||
uint32_t *minor_version,
|
||||
amdgpu_device_handle *device_handle)
|
||||
{
|
||||
return _amdgpu_device_initialize(fd, major_version, minor_version, device_handle, deduplicate_device);
|
||||
}
|
||||
|
||||
drm_public int amdgpu_device_deinitialize(amdgpu_device_handle dev)
|
||||
{
|
||||
pthread_mutex_lock(&dev_mutex);
|
||||
amdgpu_device_reference(&dev, NULL);
|
||||
pthread_mutex_unlock(&dev_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
drm_public int amdgpu_device_get_fd(amdgpu_device_handle device_handle)
|
||||
{
|
||||
return device_handle->fd;
|
||||
}
|
||||
|
||||
drm_public const char *amdgpu_get_marketing_name(amdgpu_device_handle dev)
|
||||
{
|
||||
return dev->marketing_name;
|
||||
if (dev->marketing_name)
|
||||
return dev->marketing_name;
|
||||
else
|
||||
return "AMD Radeon Graphics";
|
||||
}
|
||||
|
||||
drm_public int amdgpu_query_sw_info(amdgpu_device_handle dev,
|
||||
|
|
@ -298,10 +317,10 @@ drm_public int amdgpu_query_sw_info(amdgpu_device_handle dev,
|
|||
|
||||
switch (info) {
|
||||
case amdgpu_sw_info_address32_hi:
|
||||
if (dev->vamgr_high_32.va_max)
|
||||
*val32 = (dev->vamgr_high_32.va_max - 1) >> 32;
|
||||
if (dev->va_mgr.vamgr_high_32.va_max)
|
||||
*val32 = (dev->va_mgr.vamgr_high_32.va_max - 1) >> 32;
|
||||
else
|
||||
*val32 = (dev->vamgr_32.va_max - 1) >> 32;
|
||||
*val32 = (dev->va_mgr.vamgr_32.va_max - 1) >> 32;
|
||||
return 0;
|
||||
}
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -137,6 +137,24 @@ drm_public int amdgpu_query_firmware_version(amdgpu_device_handle dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
drm_public int amdgpu_query_uq_fw_area_info(amdgpu_device_handle dev,
|
||||
unsigned type,
|
||||
unsigned ip_instance,
|
||||
struct drm_amdgpu_info_uq_fw_areas *info)
|
||||
{
|
||||
struct drm_amdgpu_info request;
|
||||
|
||||
memset(&request, 0, sizeof(request));
|
||||
request.return_pointer = (uintptr_t)info;
|
||||
request.return_size = sizeof(*info);
|
||||
request.query = AMDGPU_INFO_UQ_FW_AREAS;
|
||||
request.query_hw_ip.type = type;
|
||||
request.query_hw_ip.ip_instance = ip_instance;
|
||||
|
||||
return drmCommandWrite(dev->fd, DRM_AMDGPU_INFO, &request,
|
||||
sizeof(struct drm_amdgpu_info));
|
||||
}
|
||||
|
||||
drm_private int amdgpu_query_gpu_info_init(amdgpu_device_handle dev)
|
||||
{
|
||||
int r, i;
|
||||
|
|
@ -346,3 +364,17 @@ drm_public int amdgpu_query_video_caps_info(amdgpu_device_handle dev, unsigned c
|
|||
return drmCommandWrite(dev->fd, DRM_AMDGPU_INFO, &request,
|
||||
sizeof(struct drm_amdgpu_info));
|
||||
}
|
||||
|
||||
drm_public int amdgpu_query_gpuvm_fault_info(amdgpu_device_handle dev,
|
||||
unsigned size, void *value)
|
||||
{
|
||||
struct drm_amdgpu_info request;
|
||||
|
||||
memset(&request, 0, sizeof(request));
|
||||
request.return_pointer = (uintptr_t)value;
|
||||
request.return_size = size;
|
||||
request.query = AMDGPU_INFO_GPUVM_FAULT;
|
||||
|
||||
return drmCommandWrite(dev->fd, DRM_AMDGPU_INFO, &request,
|
||||
sizeof(struct drm_amdgpu_info));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,13 +57,23 @@ struct amdgpu_bo_va_mgr {
|
|||
};
|
||||
|
||||
struct amdgpu_va {
|
||||
amdgpu_device_handle dev;
|
||||
uint64_t address;
|
||||
uint64_t size;
|
||||
enum amdgpu_gpu_va_range range;
|
||||
struct amdgpu_bo_va_mgr *vamgr;
|
||||
};
|
||||
|
||||
struct amdgpu_va_manager {
|
||||
/** The VA manager for the lower virtual address space */
|
||||
struct amdgpu_bo_va_mgr vamgr_low;
|
||||
/** The VA manager for the 32bit address space */
|
||||
struct amdgpu_bo_va_mgr vamgr_32;
|
||||
/** The VA manager for the high virtual address space */
|
||||
struct amdgpu_bo_va_mgr vamgr_high;
|
||||
/** The VA manager for the 32bit high address space */
|
||||
struct amdgpu_bo_va_mgr vamgr_high_32;
|
||||
};
|
||||
|
||||
struct amdgpu_device {
|
||||
atomic_t refcount;
|
||||
struct amdgpu_device *next;
|
||||
|
|
@ -81,14 +91,8 @@ struct amdgpu_device {
|
|||
pthread_mutex_t bo_table_mutex;
|
||||
struct drm_amdgpu_info_device dev_info;
|
||||
struct amdgpu_gpu_info info;
|
||||
/** The VA manager for the lower virtual address space */
|
||||
struct amdgpu_bo_va_mgr vamgr;
|
||||
/** The VA manager for the 32bit address space */
|
||||
struct amdgpu_bo_va_mgr vamgr_32;
|
||||
/** The VA manager for the high virtual address space */
|
||||
struct amdgpu_bo_va_mgr vamgr_high;
|
||||
/** The VA manager for the 32bit high address space */
|
||||
struct amdgpu_bo_va_mgr vamgr_high_32;
|
||||
|
||||
struct amdgpu_va_manager va_mgr;
|
||||
};
|
||||
|
||||
struct amdgpu_bo {
|
||||
|
|
|
|||
123
amdgpu/amdgpu_userq.c
Normal file
123
amdgpu/amdgpu_userq.c
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
/*
|
||||
* Copyright 2024 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include "xf86drm.h"
|
||||
#include "amdgpu_drm.h"
|
||||
#include "amdgpu_internal.h"
|
||||
|
||||
drm_public int
|
||||
amdgpu_create_userqueue(amdgpu_device_handle dev,
|
||||
uint32_t ip_type,
|
||||
uint32_t doorbell_handle,
|
||||
uint32_t doorbell_offset,
|
||||
uint64_t queue_va,
|
||||
uint64_t queue_size,
|
||||
uint64_t wptr_va,
|
||||
uint64_t rptr_va,
|
||||
void *mqd_in,
|
||||
uint32_t flags,
|
||||
uint32_t *queue_id)
|
||||
{
|
||||
int ret;
|
||||
union drm_amdgpu_userq userq;
|
||||
uint64_t mqd_size;
|
||||
|
||||
if (!dev)
|
||||
return -EINVAL;
|
||||
|
||||
switch (ip_type) {
|
||||
case AMDGPU_HW_IP_GFX:
|
||||
mqd_size = sizeof(struct drm_amdgpu_userq_mqd_gfx11);
|
||||
break;
|
||||
case AMDGPU_HW_IP_DMA:
|
||||
mqd_size = sizeof(struct drm_amdgpu_userq_mqd_sdma_gfx11);
|
||||
break;
|
||||
case AMDGPU_HW_IP_COMPUTE:
|
||||
mqd_size = sizeof(struct drm_amdgpu_userq_mqd_compute_gfx11);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
memset(&userq, 0, sizeof(userq));
|
||||
|
||||
userq.in.op = AMDGPU_USERQ_OP_CREATE;
|
||||
userq.in.ip_type = ip_type;
|
||||
|
||||
userq.in.doorbell_handle = doorbell_handle;
|
||||
userq.in.doorbell_offset = doorbell_offset;
|
||||
|
||||
userq.in.queue_va = queue_va;
|
||||
userq.in.queue_size = queue_size;
|
||||
userq.in.wptr_va = wptr_va;
|
||||
userq.in.rptr_va = rptr_va;
|
||||
|
||||
userq.in.mqd = (uint64_t)mqd_in;
|
||||
userq.in.mqd_size = mqd_size;
|
||||
userq.in.flags = flags;
|
||||
|
||||
ret = drmCommandWriteRead(dev->fd, DRM_AMDGPU_USERQ,
|
||||
&userq, sizeof(userq));
|
||||
*queue_id = userq.out.queue_id;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
drm_public int
|
||||
amdgpu_free_userqueue(amdgpu_device_handle dev, uint32_t queue_id)
|
||||
{
|
||||
union drm_amdgpu_userq userq;
|
||||
|
||||
memset(&userq, 0, sizeof(userq));
|
||||
userq.in.op = AMDGPU_USERQ_OP_FREE;
|
||||
userq.in.queue_id = queue_id;
|
||||
|
||||
return drmCommandWriteRead(dev->fd, DRM_AMDGPU_USERQ,
|
||||
&userq, sizeof(userq));
|
||||
}
|
||||
|
||||
drm_public int
|
||||
amdgpu_userq_signal(amdgpu_device_handle dev,
|
||||
struct drm_amdgpu_userq_signal *signal_data)
|
||||
{
|
||||
int r;
|
||||
|
||||
r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_USERQ_SIGNAL,
|
||||
signal_data, sizeof(struct drm_amdgpu_userq_signal));
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
drm_public int
|
||||
amdgpu_userq_wait(amdgpu_device_handle dev,
|
||||
struct drm_amdgpu_userq_wait *wait_data)
|
||||
{
|
||||
int r;
|
||||
|
||||
r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_USERQ_WAIT,
|
||||
wait_data, sizeof(struct drm_amdgpu_userq_wait));
|
||||
|
||||
return r;
|
||||
}
|
||||
|
|
@ -228,25 +228,40 @@ drm_public int amdgpu_va_range_alloc(amdgpu_device_handle dev,
|
|||
uint64_t *va_base_allocated,
|
||||
amdgpu_va_handle *va_range_handle,
|
||||
uint64_t flags)
|
||||
{
|
||||
return amdgpu_va_range_alloc2(&dev->va_mgr, va_range_type, size,
|
||||
va_base_alignment, va_base_required,
|
||||
va_base_allocated, va_range_handle,
|
||||
flags);
|
||||
}
|
||||
|
||||
drm_public int amdgpu_va_range_alloc2(amdgpu_va_manager_handle va_mgr,
|
||||
enum amdgpu_gpu_va_range va_range_type,
|
||||
uint64_t size,
|
||||
uint64_t va_base_alignment,
|
||||
uint64_t va_base_required,
|
||||
uint64_t *va_base_allocated,
|
||||
amdgpu_va_handle *va_range_handle,
|
||||
uint64_t flags)
|
||||
{
|
||||
struct amdgpu_bo_va_mgr *vamgr;
|
||||
bool search_from_top = !!(flags & AMDGPU_VA_RANGE_REPLAYABLE);
|
||||
int ret;
|
||||
|
||||
/* Clear the flag when the high VA manager is not initialized */
|
||||
if (flags & AMDGPU_VA_RANGE_HIGH && !dev->vamgr_high_32.va_max)
|
||||
if (flags & AMDGPU_VA_RANGE_HIGH && !va_mgr->vamgr_high_32.va_max)
|
||||
flags &= ~AMDGPU_VA_RANGE_HIGH;
|
||||
|
||||
if (flags & AMDGPU_VA_RANGE_HIGH) {
|
||||
if (flags & AMDGPU_VA_RANGE_32_BIT)
|
||||
vamgr = &dev->vamgr_high_32;
|
||||
vamgr = &va_mgr->vamgr_high_32;
|
||||
else
|
||||
vamgr = &dev->vamgr_high;
|
||||
vamgr = &va_mgr->vamgr_high;
|
||||
} else {
|
||||
if (flags & AMDGPU_VA_RANGE_32_BIT)
|
||||
vamgr = &dev->vamgr_32;
|
||||
vamgr = &va_mgr->vamgr_32;
|
||||
else
|
||||
vamgr = &dev->vamgr;
|
||||
vamgr = &va_mgr->vamgr_low;
|
||||
}
|
||||
|
||||
va_base_alignment = MAX2(va_base_alignment, vamgr->va_alignment);
|
||||
|
|
@ -259,9 +274,9 @@ drm_public int amdgpu_va_range_alloc(amdgpu_device_handle dev,
|
|||
if (!(flags & AMDGPU_VA_RANGE_32_BIT) && ret) {
|
||||
/* fallback to 32bit address */
|
||||
if (flags & AMDGPU_VA_RANGE_HIGH)
|
||||
vamgr = &dev->vamgr_high_32;
|
||||
vamgr = &va_mgr->vamgr_high_32;
|
||||
else
|
||||
vamgr = &dev->vamgr_32;
|
||||
vamgr = &va_mgr->vamgr_32;
|
||||
ret = amdgpu_vamgr_find_va(vamgr, size,
|
||||
va_base_alignment, va_base_required,
|
||||
search_from_top, va_base_allocated);
|
||||
|
|
@ -274,7 +289,6 @@ drm_public int amdgpu_va_range_alloc(amdgpu_device_handle dev,
|
|||
amdgpu_vamgr_free_va(vamgr, *va_base_allocated, size);
|
||||
return -ENOMEM;
|
||||
}
|
||||
va->dev = dev;
|
||||
va->address = *va_base_allocated;
|
||||
va->size = size;
|
||||
va->range = va_range_type;
|
||||
|
|
@ -296,3 +310,50 @@ drm_public int amdgpu_va_range_free(amdgpu_va_handle va_range_handle)
|
|||
free(va_range_handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
drm_public uint64_t amdgpu_va_get_start_addr(amdgpu_va_handle va_handle)
|
||||
{
|
||||
return va_handle->address;
|
||||
}
|
||||
|
||||
drm_public amdgpu_va_manager_handle amdgpu_va_manager_alloc(void)
|
||||
{
|
||||
amdgpu_va_manager_handle r = calloc(1, sizeof(struct amdgpu_va_manager));
|
||||
return r;
|
||||
}
|
||||
|
||||
drm_public void amdgpu_va_manager_init(struct amdgpu_va_manager *va_mgr,
|
||||
uint64_t low_va_offset, uint64_t low_va_max,
|
||||
uint64_t high_va_offset, uint64_t high_va_max,
|
||||
uint32_t virtual_address_alignment)
|
||||
{
|
||||
uint64_t start, max;
|
||||
|
||||
start = low_va_offset;
|
||||
max = MIN2(low_va_max, 0x100000000ULL);
|
||||
amdgpu_vamgr_init(&va_mgr->vamgr_32, start, max,
|
||||
virtual_address_alignment);
|
||||
|
||||
start = max;
|
||||
max = MAX2(low_va_max, 0x100000000ULL);
|
||||
amdgpu_vamgr_init(&va_mgr->vamgr_low, start, max,
|
||||
virtual_address_alignment);
|
||||
|
||||
start = high_va_offset;
|
||||
max = MIN2(high_va_max, (start & ~0xffffffffULL) + 0x100000000ULL);
|
||||
amdgpu_vamgr_init(&va_mgr->vamgr_high_32, start, max,
|
||||
virtual_address_alignment);
|
||||
|
||||
start = max;
|
||||
max = MAX2(high_va_max, (start & ~0xffffffffULL) + 0x100000000ULL);
|
||||
amdgpu_vamgr_init(&va_mgr->vamgr_high, start, max,
|
||||
virtual_address_alignment);
|
||||
}
|
||||
|
||||
drm_public void amdgpu_va_manager_deinit(struct amdgpu_va_manager *va_mgr)
|
||||
{
|
||||
amdgpu_vamgr_deinit(&va_mgr->vamgr_32);
|
||||
amdgpu_vamgr_deinit(&va_mgr->vamgr_low);
|
||||
amdgpu_vamgr_deinit(&va_mgr->vamgr_high_32);
|
||||
amdgpu_vamgr_deinit(&va_mgr->vamgr_high);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ libdrm_amdgpu = library(
|
|||
files(
|
||||
'amdgpu_asic_id.c', 'amdgpu_bo.c', 'amdgpu_cs.c', 'amdgpu_device.c',
|
||||
'amdgpu_gpu_info.c', 'amdgpu_vamgr.c', 'amdgpu_vm.c', 'handle_table.c',
|
||||
'amdgpu_userq.c',
|
||||
),
|
||||
config_file,
|
||||
],
|
||||
|
|
@ -36,19 +37,17 @@ libdrm_amdgpu = library(
|
|||
],
|
||||
include_directories : [inc_root, inc_drm],
|
||||
link_with : libdrm,
|
||||
dependencies : [dep_pthread_stubs, dep_atomic_ops, dep_rt],
|
||||
version : '1.0.0',
|
||||
dependencies : [dep_threads, dep_atomic_ops, dep_rt],
|
||||
version : '1.@0@.0'.format(patch_ver),
|
||||
install : true,
|
||||
)
|
||||
|
||||
install_headers('amdgpu.h', subdir : 'libdrm')
|
||||
|
||||
pkg.generate(
|
||||
libdrm_amdgpu,
|
||||
name : 'libdrm_amdgpu',
|
||||
libraries : libdrm_amdgpu,
|
||||
subdirs : ['.', 'libdrm'],
|
||||
version : meson.project_version(),
|
||||
requires_private : 'libdrm',
|
||||
description : 'Userspace interface to kernel DRM services for amdgpu',
|
||||
)
|
||||
|
||||
|
|
@ -57,12 +56,14 @@ ext_libdrm_amdgpu = declare_dependency(
|
|||
include_directories : [inc_drm, include_directories('.')],
|
||||
)
|
||||
|
||||
meson.override_dependency('libdrm_amdgpu', ext_libdrm_amdgpu)
|
||||
|
||||
test(
|
||||
'amdgpu-symbols-check',
|
||||
symbols_check,
|
||||
args : [
|
||||
'--lib', libdrm_amdgpu,
|
||||
'--symbols-file', files('amdgpu-symbols.txt'),
|
||||
'--nm', prog_nm.path(),
|
||||
'--nm', prog_nm.full_path(),
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ drmAuthMagic
|
|||
drmAvailable
|
||||
drmCheckModesettingSupported
|
||||
drmClose
|
||||
drmCloseBufferHandle
|
||||
drmCloseOnce
|
||||
drmCommandNone
|
||||
drmCommandRead
|
||||
|
|
@ -57,6 +58,7 @@ drmGetContextPrivateMapping
|
|||
drmGetContextTag
|
||||
drmGetDevice
|
||||
drmGetDevice2
|
||||
drmGetDeviceFromDevId
|
||||
drmGetDeviceNameFromFd
|
||||
drmGetDeviceNameFromFd2
|
||||
drmGetDevices
|
||||
|
|
@ -68,6 +70,7 @@ drmGetLibVersion
|
|||
drmGetLock
|
||||
drmGetMagic
|
||||
drmGetMap
|
||||
drmGetNodeTypeFromDevId
|
||||
drmGetNodeTypeFromFd
|
||||
drmGetPrimaryDeviceNameFromFd
|
||||
drmGetRenderDeviceNameFromFd
|
||||
|
|
@ -101,14 +104,19 @@ drmModeAtomicGetCursor
|
|||
drmModeAtomicMerge
|
||||
drmModeAtomicSetCursor
|
||||
drmModeAttachMode
|
||||
drmModeCloseFB
|
||||
drmModeConnectorGetPossibleCrtcs
|
||||
drmModeConnectorSetProperty
|
||||
drmModeCreateDumbBuffer
|
||||
drmModeCreateLease
|
||||
drmModeCreatePropertyBlob
|
||||
drmModeCrtcGetGamma
|
||||
drmModeCrtcSetGamma
|
||||
drmModeDestroyDumbBuffer
|
||||
drmModeDestroyPropertyBlob
|
||||
drmModeDetachMode
|
||||
drmModeDirtyFB
|
||||
drmModeFormatModifierBlobIterNext
|
||||
drmModeFreeConnector
|
||||
drmModeFreeCrtc
|
||||
drmModeFreeEncoder
|
||||
|
|
@ -123,6 +131,7 @@ drmModeFreePropertyBlob
|
|||
drmModeFreeResources
|
||||
drmModeGetConnector
|
||||
drmModeGetConnectorCurrent
|
||||
drmModeGetConnectorTypeName
|
||||
drmModeGetCrtc
|
||||
drmModeGetEncoder
|
||||
drmModeGetFB
|
||||
|
|
@ -134,6 +143,7 @@ drmModeGetProperty
|
|||
drmModeGetPropertyBlob
|
||||
drmModeGetResources
|
||||
drmModeListLessees
|
||||
drmModeMapDumbBuffer
|
||||
drmModeMoveCursor
|
||||
drmModeObjectGetProperties
|
||||
drmModeObjectSetProperty
|
||||
|
|
@ -179,6 +189,7 @@ drmSLNext
|
|||
drmSwitchToContext
|
||||
drmSyncobjCreate
|
||||
drmSyncobjDestroy
|
||||
drmSyncobjEventfd
|
||||
drmSyncobjExportSyncFile
|
||||
drmSyncobjFDToHandle
|
||||
drmSyncobjHandleToFD
|
||||
|
|
@ -198,3 +209,4 @@ drmUpdateDrawableInfo
|
|||
drmWaitVBlank
|
||||
drmGetFormatModifierName
|
||||
drmGetFormatModifierVendor
|
||||
drmGetFormatName
|
||||
|
|
|
|||
6
data/Android.bp
Normal file
6
data/Android.bp
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
prebuilt_etc {
|
||||
name: "amdgpu.ids",
|
||||
proprietary: true,
|
||||
sub_dir: "hwdata",
|
||||
src: "amdgpu.ids",
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := amdgpu.ids
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_MODULE_CLASS := ETC
|
||||
LOCAL_PROPRIETARY_MODULE := true
|
||||
LOCAL_MODULE_RELATIVE_PATH := hwdata
|
||||
LOCAL_SRC_FILES := $(LOCAL_MODULE)
|
||||
include $(BUILD_PREBUILT)
|
||||
911
data/amdgpu.ids
911
data/amdgpu.ids
|
|
@ -4,257 +4,481 @@
|
|||
# device_id, revision_id, product_name <-- single tab after comma
|
||||
|
||||
1.0.0
|
||||
15DD, C3, AMD Radeon(TM) Vega 3 Graphics
|
||||
15DD, CB, AMD Radeon(TM) Vega 3 Graphics
|
||||
15DD, CE, AMD Radeon(TM) Vega 3 Graphics
|
||||
15DD, D8, AMD Radeon(TM) Vega 3 Graphics
|
||||
15DD, CC, AMD Radeon(TM) Vega 6 Graphics
|
||||
15DD, D9, AMD Radeon(TM) Vega 6 Graphics
|
||||
15DD, C2, AMD Radeon(TM) Vega 8 Graphics
|
||||
15DD, C4, AMD Radeon(TM) Vega 8 Graphics
|
||||
15DD, C8, AMD Radeon(TM) Vega 8 Graphics
|
||||
15DD, CA, AMD Radeon(TM) Vega 8 Graphics
|
||||
15DD, D1, AMD Radeon(TM) Vega 8 Graphics
|
||||
15DD, D5, AMD Radeon(TM) Vega 8 Graphics
|
||||
15DD, D7, AMD Radeon(TM) Vega 8 Graphics
|
||||
15DD, C3, AMD Radeon(TM) Vega 10 Graphics
|
||||
15DD, D0, AMD Radeon(TM) Vega 10 Graphics
|
||||
15DD, C1, AMD Radeon(TM) Vega 11 Graphics
|
||||
15DD, C6, AMD Radeon(TM) Vega 11 Graphics
|
||||
15DD, C9, AMD Radeon(TM) Vega 11 Graphics
|
||||
15DD, D3, AMD Radeon(TM) Vega 11 Graphics
|
||||
15DD, D6, AMD Radeon(TM) Vega 11 Graphics
|
||||
1114, C2, AMD Radeon 860M Graphics
|
||||
1114, C3, AMD Radeon 840M Graphics
|
||||
1114, D2, AMD Radeon 860M Graphics
|
||||
1114, D3, AMD Radeon 840M Graphics
|
||||
1309, 00, AMD Radeon R7 Graphics
|
||||
130A, 00, AMD Radeon R6 Graphics
|
||||
130B, 00, AMD Radeon R4 Graphics
|
||||
130C, 00, AMD Radeon R7 Graphics
|
||||
130D, 00, AMD Radeon R6 Graphics
|
||||
130E, 00, AMD Radeon R5 Graphics
|
||||
130F, 00, AMD Radeon R7 Graphics
|
||||
130F, D4, AMD Radeon R7 Graphics
|
||||
130F, D5, AMD Radeon R7 Graphics
|
||||
130F, D6, AMD Radeon R7 Graphics
|
||||
130F, D7, AMD Radeon R7 Graphics
|
||||
1313, 00, AMD Radeon R7 Graphics
|
||||
1313, D4, AMD Radeon R7 Graphics
|
||||
1313, D5, AMD Radeon R7 Graphics
|
||||
1313, D6, AMD Radeon R7 Graphics
|
||||
1315, 00, AMD Radeon R5 Graphics
|
||||
1315, D4, AMD Radeon R5 Graphics
|
||||
1315, D5, AMD Radeon R5 Graphics
|
||||
1315, D6, AMD Radeon R5 Graphics
|
||||
1315, D7, AMD Radeon R5 Graphics
|
||||
1316, 00, AMD Radeon R5 Graphics
|
||||
1318, 00, AMD Radeon R5 Graphics
|
||||
131B, 00, AMD Radeon R4 Graphics
|
||||
131C, 00, AMD Radeon R7 Graphics
|
||||
131D, 00, AMD Radeon R6 Graphics
|
||||
1435, AE, AMD Custom GPU 0932
|
||||
1506, C1, AMD Radeon 610M
|
||||
1506, C2, AMD Radeon 610M
|
||||
1506, C3, AMD Radeon 610M
|
||||
1506, C4, AMD Radeon 610M
|
||||
150E, C1, AMD Radeon 890M Graphics
|
||||
150E, C4, AMD Radeon 880M Graphics
|
||||
150E, C5, AMD Radeon 890M Graphics
|
||||
150E, C6, AMD Radeon 890M Graphics
|
||||
150E, D1, AMD Radeon 890M Graphics
|
||||
150E, D2, AMD Radeon 880M Graphics
|
||||
150E, D3, AMD Radeon 890M Graphics
|
||||
1586, C1, Radeon 8060S Graphics
|
||||
1586, C2, Radeon 8050S Graphics
|
||||
1586, C4, Radeon 8050S Graphics
|
||||
1586, D1, Radeon 8060S Graphics
|
||||
1586, D2, Radeon 8050S Graphics
|
||||
1586, D4, Radeon 8050S Graphics
|
||||
1586, D5, Radeon 8040S Graphics
|
||||
15BF, 00, AMD Radeon 780M Graphics
|
||||
15BF, 01, AMD Radeon 760M Graphics
|
||||
15BF, 02, AMD Radeon 780M Graphics
|
||||
15BF, 03, AMD Radeon 760M Graphics
|
||||
15BF, C1, AMD Radeon 780M Graphics
|
||||
15BF, C2, AMD Radeon 780M Graphics
|
||||
15BF, C3, AMD Radeon 760M Graphics
|
||||
15BF, C4, AMD Radeon 780M Graphics
|
||||
15BF, C5, AMD Radeon 740M Graphics
|
||||
15BF, C6, AMD Radeon 780M Graphics
|
||||
15BF, C7, AMD Radeon 780M Graphics
|
||||
15BF, C8, AMD Radeon 760M Graphics
|
||||
15BF, C9, AMD Radeon 780M Graphics
|
||||
15BF, CA, AMD Radeon 740M Graphics
|
||||
15BF, CB, AMD Radeon 760M Graphics
|
||||
15BF, CC, AMD Radeon 740M Graphics
|
||||
15BF, CD, AMD Radeon 760M Graphics
|
||||
15BF, CF, AMD Radeon 780M Graphics
|
||||
15BF, D0, AMD Radeon 780M Graphics
|
||||
15BF, D1, AMD Radeon 780M Graphics
|
||||
15BF, D2, AMD Radeon 780M Graphics
|
||||
15BF, D3, AMD Radeon 780M Graphics
|
||||
15BF, D4, AMD Radeon 780M Graphics
|
||||
15BF, D5, AMD Radeon 760M Graphics
|
||||
15BF, D6, AMD Radeon 760M Graphics
|
||||
15BF, D7, AMD Radeon 780M Graphics
|
||||
15BF, D8, AMD Radeon 740M Graphics
|
||||
15BF, D9, AMD Radeon 780M Graphics
|
||||
15BF, DA, AMD Radeon 780M Graphics
|
||||
15BF, DB, AMD Radeon 760M Graphics
|
||||
15BF, DC, AMD Radeon 760M Graphics
|
||||
15BF, DD, AMD Radeon 780M Graphics
|
||||
15BF, DE, AMD Radeon 740M Graphics
|
||||
15BF, DF, AMD Radeon 760M Graphics
|
||||
15BF, F0, AMD Radeon 760M Graphics
|
||||
15C8, C1, AMD Radeon 740M Graphics
|
||||
15C8, C2, AMD Radeon 740M Graphics
|
||||
15C8, C3, AMD Radeon 740M Graphics
|
||||
15C8, C4, AMD Radeon 740M Graphics
|
||||
15C8, D1, AMD Radeon 740M Graphics
|
||||
15C8, D2, AMD Radeon 740M Graphics
|
||||
15C8, D3, AMD Radeon 740M Graphics
|
||||
15C8, D4, AMD Radeon 740M Graphics
|
||||
15D8, 00, AMD Radeon RX Vega 8 Graphics WS
|
||||
15D8, 91, AMD Radeon Vega 3 Graphics
|
||||
15D8, 91, AMD Ryzen Embedded R1606G with Radeon Vega Gfx
|
||||
15D8, 92, AMD Radeon Vega 3 Graphics
|
||||
15D8, 92, AMD Ryzen Embedded R1505G with Radeon Vega Gfx
|
||||
15D8, 93, AMD Radeon Vega 1 Graphics
|
||||
15D8, A1, AMD Radeon Vega 10 Graphics
|
||||
15D8, A2, AMD Radeon Vega 8 Graphics
|
||||
15D8, A3, AMD Radeon Vega 6 Graphics
|
||||
15D8, A4, AMD Radeon Vega 3 Graphics
|
||||
15D8, B1, AMD Radeon Vega 10 Graphics
|
||||
15D8, B2, AMD Radeon Vega 8 Graphics
|
||||
15D8, B3, AMD Radeon Vega 6 Graphics
|
||||
15D8, B4, AMD Radeon Vega 3 Graphics
|
||||
15D8, C1, AMD Radeon Vega 10 Graphics
|
||||
15D8, C2, AMD Radeon Vega 8 Graphics
|
||||
15D8, C3, AMD Radeon Vega 6 Graphics
|
||||
15D8, C4, AMD Radeon Vega 3 Graphics
|
||||
15D8, C5, AMD Radeon Vega 3 Graphics
|
||||
15D8, C8, AMD Radeon Vega 11 Graphics
|
||||
15D8, C9, AMD Radeon Vega 8 Graphics
|
||||
15D8, CA, AMD Radeon Vega 11 Graphics
|
||||
15D8, CB, AMD Radeon Vega 8 Graphics
|
||||
15D8, CC, AMD Radeon Vega 3 Graphics
|
||||
15D8, CE, AMD Radeon Vega 3 Graphics
|
||||
15D8, CF, AMD Ryzen Embedded R1305G with Radeon Vega Gfx
|
||||
15D8, D1, AMD Radeon Vega 10 Graphics
|
||||
15D8, D2, AMD Radeon Vega 8 Graphics
|
||||
15D8, D3, AMD Radeon Vega 6 Graphics
|
||||
15D8, D4, AMD Radeon Vega 3 Graphics
|
||||
15D8, D8, AMD Radeon Vega 11 Graphics
|
||||
15D8, D9, AMD Radeon Vega 8 Graphics
|
||||
15D8, DA, AMD Radeon Vega 11 Graphics
|
||||
15D8, DB, AMD Radeon Vega 3 Graphics
|
||||
15D8, DB, AMD Radeon Vega 8 Graphics
|
||||
15D8, DC, AMD Radeon Vega 3 Graphics
|
||||
15D8, DD, AMD Radeon Vega 3 Graphics
|
||||
15D8, DE, AMD Radeon Vega 3 Graphics
|
||||
15D8, DF, AMD Radeon Vega 3 Graphics
|
||||
15D8, E3, AMD Radeon Vega 3 Graphics
|
||||
15D8, E4, AMD Ryzen Embedded R1102G with Radeon Vega Gfx
|
||||
15DD, 81, AMD Ryzen Embedded V1807B with Radeon Vega Gfx
|
||||
15DD, 82, AMD Ryzen Embedded V1756B with Radeon Vega Gfx
|
||||
15DD, 83, AMD Ryzen Embedded V1605B with Radeon Vega Gfx
|
||||
15DD, 84, AMD Radeon Vega 6 Graphics
|
||||
15DD, 85, AMD Ryzen Embedded V1202B with Radeon Vega Gfx
|
||||
15D8, 93, AMD Radeon(TM) Vega 1 Graphics
|
||||
15D8, C4, AMD Radeon(TM) Vega 3 Graphics
|
||||
15D8, C5, AMD Radeon(TM) Vega 3 Graphics
|
||||
15D8, CC, AMD Radeon(TM) Vega 3 Graphics
|
||||
15D8, CE, AMD Radeon(TM) Vega 3 Graphics
|
||||
15D8, CF, AMD Radeon(TM) Vega 3 Graphics
|
||||
15D8, D4, AMD Radeon(TM) Vega 3 Graphics
|
||||
15D8, DC, AMD Radeon(TM) Vega 3 Graphics
|
||||
15D8, DD, AMD Radeon(TM) Vega 3 Graphics
|
||||
15D8, DE, AMD Radeon(TM) Vega 3 Graphics
|
||||
15D8, DF, AMD Radeon(TM) Vega 3 Graphics
|
||||
15D8, E3, AMD Radeon(TM) Vega 3 Graphics
|
||||
15D8, E4, AMD Radeon(TM) Vega 3 Graphics
|
||||
15D8, A3, AMD Radeon(TM) Vega 6 Graphics
|
||||
15D8, B3, AMD Radeon(TM) Vega 6 Graphics
|
||||
15D8, C3, AMD Radeon(TM) Vega 6 Graphics
|
||||
15D8, D3, AMD Radeon(TM) Vega 6 Graphics
|
||||
15D8, A2, AMD Radeon(TM) Vega 8 Graphics
|
||||
15D8, B2, AMD Radeon(TM) Vega 8 Graphics
|
||||
15D8, C2, AMD Radeon(TM) Vega 8 Graphics
|
||||
15D8, C9, AMD Radeon(TM) Vega 8 Graphics
|
||||
15D8, CB, AMD Radeon(TM) Vega 8 Graphics
|
||||
15D8, D2, AMD Radeon(TM) Vega 8 Graphics
|
||||
15D8, D9, AMD Radeon(TM) Vega 8 Graphics
|
||||
15D8, DB, AMD Radeon(TM) Vega 8 Graphics
|
||||
15D8, A1, AMD Radeon(TM) Vega 10 Graphics
|
||||
15D8, B1, AMD Radeon(TM) Vega 10 Graphics
|
||||
15D8, C1, AMD Radeon(TM) Vega 10 Graphics
|
||||
15D8, D1, AMD Radeon(TM) Vega 10 Graphics
|
||||
15D8, C8, AMD Radeon(TM) Vega 11 Graphics
|
||||
15D8, CA, AMD Radeon(TM) Vega 11 Graphics
|
||||
15D8, D8, AMD Radeon(TM) Vega 11 Graphics
|
||||
15D8, DA, AMD Radeon(TM) Vega 11 Graphics
|
||||
15D8, 91, AMD Ryzen Embedded R1606G with Radeon Vega Gfx
|
||||
15D8, 92, AMD Ryzen Embedded R1505G with Radeon Vega Gfx
|
||||
15D8, CF, AMD Ryzen Embedded R1305G with Radeon Vega Gfx
|
||||
15D8, E4, AMD Ryzen Embedded R1102G with Radeon Vega Gfx
|
||||
6600, 0, AMD Radeon HD 8600/8700M
|
||||
6600, 81, AMD Radeon (TM) R7 M370
|
||||
6601, 0, AMD Radeon (TM) HD 8500M/8700M
|
||||
6604, 0, AMD Radeon R7 M265 Series
|
||||
6604, 81, AMD Radeon (TM) R7 M350
|
||||
6605, 0, AMD Radeon R7 M260 Series
|
||||
6605, 81, AMD Radeon (TM) R7 M340
|
||||
6606, 0, AMD Radeon HD 8790M
|
||||
6607, 0, AMD Radeon (TM) HD8530M
|
||||
6608, 0, AMD FirePro W2100
|
||||
6610, 0, AMD Radeon HD 8600 Series
|
||||
6610, 81, AMD Radeon (TM) R7 350
|
||||
6610, 83, AMD Radeon (TM) R5 340
|
||||
6611, 0, AMD Radeon HD 8500 Series
|
||||
6613, 0, AMD Radeon HD 8500 series
|
||||
15DD, 86, AMD Radeon Vega 11 Graphics
|
||||
15DD, 88, AMD Radeon Vega 8 Graphics
|
||||
15DD, C1, AMD Radeon Vega 11 Graphics
|
||||
15DD, C2, AMD Radeon Vega 8 Graphics
|
||||
15DD, C3, AMD Radeon Vega 3 / 10 Graphics
|
||||
15DD, C4, AMD Radeon Vega 8 Graphics
|
||||
15DD, C5, AMD Radeon Vega 3 Graphics
|
||||
15DD, C6, AMD Radeon Vega 11 Graphics
|
||||
15DD, C8, AMD Radeon Vega 8 Graphics
|
||||
15DD, C9, AMD Radeon Vega 11 Graphics
|
||||
15DD, CA, AMD Radeon Vega 8 Graphics
|
||||
15DD, CB, AMD Radeon Vega 3 Graphics
|
||||
15DD, CC, AMD Radeon Vega 6 Graphics
|
||||
15DD, CE, AMD Radeon Vega 3 Graphics
|
||||
15DD, CF, AMD Radeon Vega 3 Graphics
|
||||
15DD, D0, AMD Radeon Vega 10 Graphics
|
||||
15DD, D1, AMD Radeon Vega 8 Graphics
|
||||
15DD, D3, AMD Radeon Vega 11 Graphics
|
||||
15DD, D5, AMD Radeon Vega 8 Graphics
|
||||
15DD, D6, AMD Radeon Vega 11 Graphics
|
||||
15DD, D7, AMD Radeon Vega 8 Graphics
|
||||
15DD, D8, AMD Radeon Vega 3 Graphics
|
||||
15DD, D9, AMD Radeon Vega 6 Graphics
|
||||
15DD, E1, AMD Radeon Vega 3 Graphics
|
||||
15DD, E2, AMD Radeon Vega 3 Graphics
|
||||
163F, AE, AMD Custom GPU 0405
|
||||
163F, E1, AMD Custom GPU 0405
|
||||
164E, D8, AMD Radeon 610M
|
||||
164E, D9, AMD Radeon 610M
|
||||
164E, DA, AMD Radeon 610M
|
||||
164E, DB, AMD Radeon 610M
|
||||
164E, DC, AMD Radeon 610M
|
||||
1681, 06, AMD Radeon 680M
|
||||
1681, 07, AMD Radeon 660M
|
||||
1681, 0A, AMD Radeon 680M
|
||||
1681, 0B, AMD Radeon 660M
|
||||
1681, C7, AMD Radeon 680M
|
||||
1681, C8, AMD Radeon 680M
|
||||
1681, C9, AMD Radeon 660M
|
||||
1900, 01, AMD Radeon 780M Graphics
|
||||
1900, 02, AMD Radeon 760M Graphics
|
||||
1900, 03, AMD Radeon 780M Graphics
|
||||
1900, 04, AMD Radeon 760M Graphics
|
||||
1900, 05, AMD Radeon 780M Graphics
|
||||
1900, 06, AMD Radeon 780M Graphics
|
||||
1900, 07, AMD Radeon 760M Graphics
|
||||
1900, B0, AMD Radeon 780M Graphics
|
||||
1900, B1, AMD Radeon 780M Graphics
|
||||
1900, B2, AMD Radeon 780M Graphics
|
||||
1900, B3, AMD Radeon 780M Graphics
|
||||
1900, B4, AMD Radeon 780M Graphics
|
||||
1900, B5, AMD Radeon 780M Graphics
|
||||
1900, B6, AMD Radeon 780M Graphics
|
||||
1900, B7, AMD Radeon 760M Graphics
|
||||
1900, B8, AMD Radeon 760M Graphics
|
||||
1900, B9, AMD Radeon 780M Graphics
|
||||
1900, BA, AMD Radeon 780M Graphics
|
||||
1900, BB, AMD Radeon 780M Graphics
|
||||
1900, C0, AMD Radeon 780M Graphics
|
||||
1900, C1, AMD Radeon 760M Graphics
|
||||
1900, C2, AMD Radeon 780M Graphics
|
||||
1900, C3, AMD Radeon 760M Graphics
|
||||
1900, C4, AMD Radeon 780M Graphics
|
||||
1900, C5, AMD Radeon 780M Graphics
|
||||
1900, C6, AMD Radeon 760M Graphics
|
||||
1900, C7, AMD Radeon 780M Graphics
|
||||
1900, C8, AMD Radeon 760M Graphics
|
||||
1900, C9, AMD Radeon 780M Graphics
|
||||
1900, CA, AMD Radeon 760M Graphics
|
||||
1900, CB, AMD Radeon 780M Graphics
|
||||
1900, CC, AMD Radeon 780M Graphics
|
||||
1900, CD, AMD Radeon 760M Graphics
|
||||
1900, CE, AMD Radeon 780M Graphics
|
||||
1900, CF, AMD Radeon 760M Graphics
|
||||
1900, D0, AMD Radeon 780M Graphics
|
||||
1900, D1, AMD Radeon 760M Graphics
|
||||
1900, D2, AMD Radeon 780M Graphics
|
||||
1900, D3, AMD Radeon 760M Graphics
|
||||
1900, D4, AMD Radeon 780M Graphics
|
||||
1900, D5, AMD Radeon 780M Graphics
|
||||
1900, D6, AMD Radeon 760M Graphics
|
||||
1900, D7, AMD Radeon 780M Graphics
|
||||
1900, D8, AMD Radeon 760M Graphics
|
||||
1900, D9, AMD Radeon 780M Graphics
|
||||
1900, DA, AMD Radeon 760M Graphics
|
||||
1900, DB, AMD Radeon 780M Graphics
|
||||
1900, DC, AMD Radeon 780M Graphics
|
||||
1900, DD, AMD Radeon 760M Graphics
|
||||
1900, DE, AMD Radeon 780M Graphics
|
||||
1900, DF, AMD Radeon 760M Graphics
|
||||
1900, F0, AMD Radeon 780M Graphics
|
||||
1900, F1, AMD Radeon 780M Graphics
|
||||
1900, F2, AMD Radeon 780M Graphics
|
||||
1901, C1, AMD Radeon 740M Graphics
|
||||
1901, C2, AMD Radeon 740M Graphics
|
||||
1901, C3, AMD Radeon 740M Graphics
|
||||
1901, C6, AMD Radeon 740M Graphics
|
||||
1901, C7, AMD Radeon 740M Graphics
|
||||
1901, C8, AMD Radeon 740M Graphics
|
||||
1901, C9, AMD Radeon 740M Graphics
|
||||
1901, CA, AMD Radeon 740M Graphics
|
||||
1901, D1, AMD Radeon 740M Graphics
|
||||
1901, D2, AMD Radeon 740M Graphics
|
||||
1901, D3, AMD Radeon 740M Graphics
|
||||
1901, D4, AMD Radeon 740M Graphics
|
||||
1901, D5, AMD Radeon 740M Graphics
|
||||
1901, D6, AMD Radeon 740M Graphics
|
||||
1901, D7, AMD Radeon 740M Graphics
|
||||
1901, D8, AMD Radeon 740M Graphics
|
||||
6600, 00, AMD Radeon HD 8600 / 8700M
|
||||
6600, 81, AMD Radeon R7 M370
|
||||
6601, 00, AMD Radeon HD 8500M / 8700M
|
||||
6604, 00, AMD Radeon R7 M265 Series
|
||||
6604, 81, AMD Radeon R7 M350
|
||||
6605, 00, AMD Radeon R7 M260 Series
|
||||
6605, 81, AMD Radeon R7 M340
|
||||
6606, 00, AMD Radeon HD 8790M
|
||||
6607, 00, AMD Radeon R5 M240
|
||||
6608, 00, AMD FirePro W2100
|
||||
6610, 00, AMD Radeon R7 200 Series
|
||||
6610, 81, AMD Radeon R7 350
|
||||
6610, 83, AMD Radeon R5 340
|
||||
6610, 87, AMD Radeon R7 200 Series
|
||||
6611, 00, AMD Radeon R7 200 Series
|
||||
6611, 87, AMD Radeon R7 200 Series
|
||||
6613, 00, AMD Radeon R7 200 Series
|
||||
6617, 00, AMD Radeon R7 240 Series
|
||||
6617, 87, AMD Radeon R7 200 Series
|
||||
6617, C7, AMD Radeon R7 240 Series
|
||||
6640, 0, AMD Radeon HD 8950
|
||||
6640, 80, AMD Radeon (TM) R9 M380
|
||||
6646, 0, AMD Radeon R9 M280X
|
||||
6646, 80, AMD Radeon (TM) R9 M470X
|
||||
6647, 0, AMD Radeon R9 M270X
|
||||
6647, 80, AMD Radeon (TM) R9 M380
|
||||
6649, 0, AMD FirePro W5100
|
||||
6658, 0, AMD Radeon R7 200 Series
|
||||
665C, 0, AMD Radeon HD 7700 Series
|
||||
665D, 0, AMD Radeon R7 200 Series
|
||||
665F, 81, AMD Radeon (TM) R7 300 Series
|
||||
6660, 0, AMD Radeon HD 8600M Series
|
||||
6660, 81, AMD Radeon (TM) R5 M335
|
||||
6660, 83, AMD Radeon (TM) R5 M330
|
||||
6663, 0, AMD Radeon HD 8500M Series
|
||||
6663, 83, AMD Radeon (TM) R5 M320
|
||||
6664, 0, AMD Radeon R5 M200 Series
|
||||
6665, 0, AMD Radeon R5 M200 Series
|
||||
6665, 83, AMD Radeon (TM) R5 M320
|
||||
6667, 0, AMD Radeon R5 M200 Series
|
||||
666F, 0, AMD Radeon HD 8500M
|
||||
66A1, 06, AMD Radeon (TM) Pro VII
|
||||
6640, 00, AMD Radeon HD 8950
|
||||
6640, 80, AMD Radeon R9 M380
|
||||
6646, 00, AMD Radeon R9 M280X
|
||||
6646, 80, AMD Radeon R9 M385
|
||||
6646, 80, AMD Radeon R9 M470X
|
||||
6647, 00, AMD Radeon R9 M200X Series
|
||||
6647, 80, AMD Radeon R9 M380
|
||||
6649, 00, AMD FirePro W5100
|
||||
6658, 00, AMD Radeon R7 200 Series
|
||||
665C, 00, AMD Radeon HD 7700 Series
|
||||
665D, 00, AMD Radeon R7 200 Series
|
||||
665F, 81, AMD Radeon R7 360 Series
|
||||
6660, 00, AMD Radeon HD 8600M Series
|
||||
6660, 81, AMD Radeon R5 M335
|
||||
6660, 83, AMD Radeon R5 M330
|
||||
6663, 00, AMD Radeon HD 8500M Series
|
||||
6663, 83, AMD Radeon R5 M320
|
||||
6664, 00, AMD Radeon R5 M200 Series
|
||||
6665, 00, AMD Radeon R5 M230 Series
|
||||
6665, 83, AMD Radeon R5 M320
|
||||
6665, C3, AMD Radeon R5 M435
|
||||
6666, 00, AMD Radeon R5 M200 Series
|
||||
6667, 00, AMD Radeon R5 M200 Series
|
||||
666F, 00, AMD Radeon HD 8500M
|
||||
66A1, 02, AMD Instinct MI60 / MI50
|
||||
66A1, 06, AMD Radeon Pro VII
|
||||
66AF, C1, AMD Radeon VII
|
||||
6780, 0, ATI FirePro V (FireGL V) Graphics Adapter
|
||||
678A, 0, ATI FirePro V (FireGL V) Graphics Adapter
|
||||
6798, 0, AMD Radeon HD 7900 Series
|
||||
679A, 0, AMD Radeon HD 7900 Series
|
||||
679B, 0, AMD Radeon HD 7900 Series
|
||||
679E, 0, AMD Radeon HD 7800 Series
|
||||
67A0, 0, AMD Radeon FirePro W9100
|
||||
67A1, 0, AMD Radeon FirePro W8100
|
||||
67B0, 0, AMD Radeon R9 200 Series
|
||||
67B0, 80, AMD Radeon (TM) R9 390 Series
|
||||
67B1, 0, AMD Radeon R9 200 Series
|
||||
67B1, 80, AMD Radeon (TM) R9 390 Series
|
||||
67B9, 0, AMD Radeon R9 200 Series
|
||||
67DF, C1, Radeon RX 580 Series
|
||||
67DF, C2, Radeon RX 570 Series
|
||||
67DF, C3, Radeon RX 580 Series
|
||||
67DF, C4, AMD Radeon (TM) RX 480 Graphics
|
||||
67DF, C5, AMD Radeon (TM) RX 470 Graphics
|
||||
67DF, C6, Radeon RX 570 Series
|
||||
67DF, C7, AMD Radeon (TM) RX 480 Graphics
|
||||
67DF, CF, AMD Radeon (TM) RX 470 Graphics
|
||||
67DF, D7, Radeon(TM) RX 470 Graphics
|
||||
67DF, E0, Radeon RX 470 Series
|
||||
67DF, E1, Radeon RX 590 Series
|
||||
67DF, E3, Radeon RX Series
|
||||
67DF, E7, Radeon RX 580 Series
|
||||
67DF, EF, Radeon RX 570 Series
|
||||
67DF, F7, Radeon RX P30PH
|
||||
67C2, 01, AMD Radeon (TM) Pro V7350x2
|
||||
67C2, 02, AMD Radeon (TM) Pro V7300X
|
||||
67C4, 00, AMD Radeon (TM) Pro WX 7100 Graphics
|
||||
67C4, 80, AMD Radeon (TM) E9560/E9565 Graphics
|
||||
67C7, 00, AMD Radeon (TM) Pro WX 5100 Graphics
|
||||
67C7, 80, AMD Radeon (TM) Pro E9390 Graphics
|
||||
67C0, 00, AMD Radeon (TM) Pro WX 7100 Graphics
|
||||
67D0, 01, AMD Radeon (TM) Pro V7350x2
|
||||
67D0, 02, AMD Radeon (TM) Pro V7300X
|
||||
67E0, 00, AMD Radeon (TM) Pro WX Series
|
||||
67E3, 00, AMD Radeon (TM) Pro WX 4100
|
||||
67E8, 00, AMD Radeon (TM) Pro WX Series
|
||||
67E8, 01, AMD Radeon (TM) Pro WX Series
|
||||
67E8, 80, AMD Radeon (TM) E9260 Graphics
|
||||
67EB, 00, AMD Radeon (TM) Pro V5300X
|
||||
67EF, C0, AMD Radeon (TM) RX Graphics
|
||||
67EF, C1, AMD Radeon (TM) RX 460 Graphics
|
||||
67EF, C3, Radeon RX Series
|
||||
67EF, C5, AMD Radeon (TM) RX 460 Graphics
|
||||
67EF, C7, AMD Radeon (TM) RX Graphics
|
||||
67EF, CF, AMD Radeon (TM) RX 460 Graphics
|
||||
67EF, E2, RX 560X
|
||||
67EF, E0, Radeon RX 560 Series
|
||||
67EF, E1, Radeon RX Series
|
||||
67EF, E3, Radeon RX Series
|
||||
67EF, E5, Radeon RX 560 Series
|
||||
67EF, EF, AMD Radeon (TM) RX Graphics
|
||||
67EF, FF, Radeon(TM) RX 460 Graphics
|
||||
67FF, C0, AMD Radeon (TM) RX Graphics
|
||||
67FF, C1, AMD Radeon (TM) RX Graphics
|
||||
67FF, CF, Radeon RX 560 Series
|
||||
67FF, EF, Radeon RX 560 Series
|
||||
67FF, FF, Radeon RX 550 Series
|
||||
6800, 0, AMD Radeon HD 7970M
|
||||
6801, 0, AMD Radeon(TM) HD8970M
|
||||
6808, 0, ATI FirePro V(FireGL V) Graphics Adapter
|
||||
6809, 0, ATI FirePro V(FireGL V) Graphics Adapter
|
||||
6810, 0, AMD Radeon(TM) HD 8800 Series
|
||||
6810, 81, AMD Radeon (TM) R7 370 Series
|
||||
6811, 0, AMD Radeon(TM) HD8800 Series
|
||||
6811, 81, AMD Radeon (TM) R7 300 Series
|
||||
6818, 0, AMD Radeon HD 7800 Series
|
||||
6819, 0, AMD Radeon HD 7800 Series
|
||||
6820, 0, AMD Radeon HD 8800M Series
|
||||
6820, 81, AMD Radeon (TM) R9 M375
|
||||
6820, 83, AMD Radeon (TM) R9 M375X
|
||||
6821, 0, AMD Radeon HD 8800M Series
|
||||
6821, 87, AMD Radeon (TM) R7 M380
|
||||
6821, 83, AMD Radeon R9 (TM) M370X
|
||||
6822, 0, AMD Radeon E8860
|
||||
6823, 0, AMD Radeon HD 8800M Series
|
||||
6825, 0, AMD Radeon HD 7800M Series
|
||||
6827, 0, AMD Radeon HD 7800M Series
|
||||
6828, 0, ATI FirePro V(FireGL V) Graphics Adapter
|
||||
682B, 0, AMD Radeon HD 8800M Series
|
||||
682B, 87, AMD Radeon (TM) R9 M360
|
||||
682C, 0, AMD FirePro W4100
|
||||
682D, 0, AMD Radeon HD 7700M Series
|
||||
682F, 0, AMD Radeon HD 7700M Series
|
||||
6835, 0, AMD Radeon R7 Series / HD 9000 Series
|
||||
6837, 0, AMD Radeon HD7700 Series
|
||||
683D, 0, AMD Radeon HD 7700 Series
|
||||
683F, 0, AMD Radeon HD 7700 Series
|
||||
6860, 00, Radeon Instinct MI25
|
||||
6860, 01, Radeon Instinct MI25
|
||||
6860, 02, Radeon Instinct MI25
|
||||
6860, 03, Radeon Pro V340
|
||||
6860, 04, Radeon Instinct MI25x2
|
||||
6860, 07, Radeon (TM) Pro V320
|
||||
6861, 00, Radeon Pro WX 9100
|
||||
6862, 00, Radeon Pro SSG
|
||||
6863, 00, Radeon Vega Frontier Edition
|
||||
6864, 03, Radeon Pro V340
|
||||
6864, 04, Instinct MI25x2
|
||||
6868, 00, Radeon (TM) PRO WX 8200
|
||||
686C, 00, Radeon Instinct MI25 MxGPU
|
||||
686C, 01, Radeon Instinct MI25 MxGPU
|
||||
686C, 02, Radeon Instinct MI25 MxGPU
|
||||
686C, 03, Radeon Pro V340 MxGPU
|
||||
686C, 04, Radeon Instinct MI25x2 MxGPU
|
||||
686C, 05, Radeon Pro V340L MxGPU
|
||||
686C, 06, Radeon Instinct MI25 MxGPU
|
||||
687F, C0, Radeon RX Vega
|
||||
687F, C1, Radeon RX Vega
|
||||
687F, C3, Radeon RX Vega
|
||||
6900, 0, AMD Radeon R7 M260
|
||||
6900, 81, AMD Radeon (TM) R7 M360
|
||||
6900, 83, AMD Radeon (TM) R7 M340
|
||||
6901, 0, AMD Radeon R5 M255
|
||||
6907, 0, AMD Radeon R5 M255
|
||||
6907, 87, AMD Radeon (TM) R5 M315
|
||||
6920, 0, AMD RADEON R9 M395X
|
||||
6920, 1, AMD RADEON R9 M390X
|
||||
6921, 0, AMD Radeon R9 M295X
|
||||
6929, 0, AMD FirePro S7150
|
||||
692B, 0, AMD FirePro W7100
|
||||
6938, 0, AMD Radeon R9 200 Series
|
||||
6780, 00, AMD FirePro W9000
|
||||
6784, 00, ATI FirePro V (FireGL V) Graphics Adapter
|
||||
6788, 00, ATI FirePro V (FireGL V) Graphics Adapter
|
||||
678A, 00, AMD FirePro W8000
|
||||
6798, 00, AMD Radeon R9 200 / HD 7900 Series
|
||||
6799, 00, AMD Radeon HD 7900 Series
|
||||
679A, 00, AMD Radeon HD 7900 Series
|
||||
679B, 00, AMD Radeon HD 7900 Series
|
||||
679E, 00, AMD Radeon HD 7800 Series
|
||||
67A0, 00, AMD Radeon FirePro W9100
|
||||
67A1, 00, AMD Radeon FirePro W8100
|
||||
67B0, 00, AMD Radeon R9 200 Series
|
||||
67B0, 80, AMD Radeon R9 390 Series
|
||||
67B1, 00, AMD Radeon R9 200 Series
|
||||
67B1, 80, AMD Radeon R9 390 Series
|
||||
67B9, 00, AMD Radeon R9 200 Series
|
||||
67C0, 00, AMD Radeon Pro WX 7100 Graphics
|
||||
67C0, 80, AMD Radeon E9550
|
||||
67C2, 01, AMD Radeon Pro V7350x2
|
||||
67C2, 02, AMD Radeon Pro V7300X
|
||||
67C4, 00, AMD Radeon Pro WX 7100 Graphics
|
||||
67C4, 80, AMD Radeon E9560 / E9565 Graphics
|
||||
67C7, 00, AMD Radeon Pro WX 5100 Graphics
|
||||
67C7, 80, AMD Radeon E9390 Graphics
|
||||
67D0, 01, AMD Radeon Pro V7350x2
|
||||
67D0, 02, AMD Radeon Pro V7300X
|
||||
67DF, C0, AMD Radeon Pro 580X
|
||||
67DF, C1, AMD Radeon RX 580 Series
|
||||
67DF, C2, AMD Radeon RX 570 Series
|
||||
67DF, C3, AMD Radeon RX 580 Series
|
||||
67DF, C4, AMD Radeon RX 480 Graphics
|
||||
67DF, C5, AMD Radeon RX 470 Graphics
|
||||
67DF, C6, AMD Radeon RX 570 Series
|
||||
67DF, C7, AMD Radeon RX 480 Graphics
|
||||
67DF, CF, AMD Radeon RX 470 Graphics
|
||||
67DF, D7, AMD Radeon RX 470 Graphics
|
||||
67DF, E0, AMD Radeon RX 470 Series
|
||||
67DF, E1, AMD Radeon RX 590 Series
|
||||
67DF, E3, AMD Radeon RX Series
|
||||
67DF, E7, AMD Radeon RX 580 Series
|
||||
67DF, EB, AMD Radeon Pro 580X
|
||||
67DF, EF, AMD Radeon RX 570 Series
|
||||
67DF, F7, AMD Radeon RX P30PH
|
||||
67DF, FF, AMD Radeon RX 470 Series
|
||||
67E0, 00, AMD Radeon Pro WX Series
|
||||
67E3, 00, AMD Radeon Pro WX 4100
|
||||
67E8, 00, AMD Radeon Pro WX Series
|
||||
67E8, 01, AMD Radeon Pro WX Series
|
||||
67E8, 80, AMD Radeon E9260 Graphics
|
||||
67EB, 00, AMD Radeon Pro V5300X
|
||||
67EF, C0, AMD Radeon RX Graphics
|
||||
67EF, C1, AMD Radeon RX 460 Graphics
|
||||
67EF, C2, AMD Radeon Pro Series
|
||||
67EF, C3, AMD Radeon RX Series
|
||||
67EF, C5, AMD Radeon RX 460 Graphics
|
||||
67EF, C7, AMD Radeon RX Graphics
|
||||
67EF, CF, AMD Radeon RX 460 Graphics
|
||||
67EF, E0, AMD Radeon RX 560 Series
|
||||
67EF, E1, AMD Radeon RX Series
|
||||
67EF, E2, AMD Radeon RX 560X
|
||||
67EF, E3, AMD Radeon RX Series
|
||||
67EF, E5, AMD Radeon RX 560 Series
|
||||
67EF, E7, AMD Radeon RX 560 Series
|
||||
67EF, EF, AMD Radeon 550 Series
|
||||
67EF, FF, AMD Radeon RX 460 Graphics
|
||||
67FF, C0, AMD Radeon Pro 465
|
||||
67FF, C1, AMD Radeon RX 560 Series
|
||||
67FF, CF, AMD Radeon RX 560 Series
|
||||
67FF, EF, AMD Radeon RX 560 Series
|
||||
67FF, FF, AMD Radeon RX 550 Series
|
||||
6800, 00, AMD Radeon HD 7970M
|
||||
6801, 00, AMD Radeon HD 8970M
|
||||
6806, 00, AMD Radeon R9 M290X
|
||||
6808, 00, AMD FirePro W7000
|
||||
6808, 00, ATI FirePro V (FireGL V) Graphics Adapter
|
||||
6809, 00, ATI FirePro W5000
|
||||
6810, 00, AMD Radeon R9 200 Series
|
||||
6810, 81, AMD Radeon R9 370 Series
|
||||
6811, 00, AMD Radeon R9 200 Series
|
||||
6811, 81, AMD Radeon R7 370 Series
|
||||
6818, 00, AMD Radeon HD 7800 Series
|
||||
6819, 00, AMD Radeon HD 7800 Series
|
||||
6820, 00, AMD Radeon R9 M275X
|
||||
6820, 81, AMD Radeon R9 M375
|
||||
6820, 83, AMD Radeon R9 M375X
|
||||
6821, 00, AMD Radeon R9 M200X Series
|
||||
6821, 83, AMD Radeon R9 M370X
|
||||
6821, 87, AMD Radeon R7 M380
|
||||
6822, 00, AMD Radeon E8860
|
||||
6823, 00, AMD Radeon R9 M200X Series
|
||||
6825, 00, AMD Radeon HD 7800M Series
|
||||
6826, 00, AMD Radeon HD 7700M Series
|
||||
6827, 00, AMD Radeon HD 7800M Series
|
||||
6828, 00, AMD FirePro W600
|
||||
682B, 00, AMD Radeon HD 8800M Series
|
||||
682B, 87, AMD Radeon R9 M360
|
||||
682C, 00, AMD FirePro W4100
|
||||
682D, 00, AMD Radeon HD 7700M Series
|
||||
682F, 00, AMD Radeon HD 7700M Series
|
||||
6830, 00, AMD Radeon 7800M Series
|
||||
6831, 00, AMD Radeon 7700M Series
|
||||
6835, 00, AMD Radeon R7 Series / HD 9000 Series
|
||||
6837, 00, AMD Radeon HD 7700 Series
|
||||
683D, 00, AMD Radeon HD 7700 Series
|
||||
683F, 00, AMD Radeon HD 7700 Series
|
||||
684C, 00, ATI FirePro V (FireGL V) Graphics Adapter
|
||||
6860, 00, AMD Radeon Instinct MI25
|
||||
6860, 01, AMD Radeon Instinct MI25
|
||||
6860, 02, AMD Radeon Instinct MI25
|
||||
6860, 03, AMD Radeon Pro V340
|
||||
6860, 04, AMD Radeon Instinct MI25x2
|
||||
6860, 07, AMD Radeon Pro V320
|
||||
6861, 00, AMD Radeon Pro WX 9100
|
||||
6862, 00, AMD Radeon Pro SSG
|
||||
6863, 00, AMD Radeon Vega Frontier Edition
|
||||
6864, 03, AMD Radeon Pro V340
|
||||
6864, 04, AMD Radeon Instinct MI25x2
|
||||
6864, 05, AMD Radeon Pro V340
|
||||
6868, 00, AMD Radeon Pro WX 8200
|
||||
686C, 00, AMD Radeon Instinct MI25 MxGPU
|
||||
686C, 01, AMD Radeon Instinct MI25 MxGPU
|
||||
686C, 02, AMD Radeon Instinct MI25 MxGPU
|
||||
686C, 03, AMD Radeon Pro V340 MxGPU
|
||||
686C, 04, AMD Radeon Instinct MI25x2 MxGPU
|
||||
686C, 05, AMD Radeon Pro V340L MxGPU
|
||||
686C, 06, AMD Radeon Instinct MI25 MxGPU
|
||||
687F, 01, AMD Radeon RX Vega
|
||||
687F, C0, AMD Radeon RX Vega
|
||||
687F, C1, AMD Radeon RX Vega
|
||||
687F, C3, AMD Radeon RX Vega
|
||||
687F, C7, AMD Radeon RX Vega
|
||||
6900, 00, AMD Radeon R7 M260
|
||||
6900, 81, AMD Radeon R7 M360
|
||||
6900, 83, AMD Radeon R7 M340
|
||||
6900, C1, AMD Radeon R5 M465 Series
|
||||
6900, C3, AMD Radeon R5 M445 Series
|
||||
6900, D1, AMD Radeon 530 Series
|
||||
6900, D3, AMD Radeon 530 Series
|
||||
6901, 00, AMD Radeon R5 M255
|
||||
6902, 00, AMD Radeon Series
|
||||
6907, 00, AMD Radeon R5 M255
|
||||
6907, 87, AMD Radeon R5 M315
|
||||
6920, 00, AMD Radeon R9 M395X
|
||||
6920, 01, AMD Radeon R9 M390X
|
||||
6921, 00, AMD Radeon R9 M390X
|
||||
6929, 00, AMD FirePro S7150
|
||||
6929, 01, AMD FirePro S7100X
|
||||
692B, 00, AMD FirePro W7100
|
||||
6938, 00, AMD Radeon R9 200 Series
|
||||
6938, F0, AMD Radeon R9 200 Series
|
||||
6938, F1, AMD Radeon (TM) R9 380 Series
|
||||
6938, F1, AMD Radeon R9 380 Series
|
||||
6939, 00, AMD Radeon R9 200 Series
|
||||
6939, F0, AMD Radeon R9 200 Series
|
||||
6939, 0, AMD Radeon R9 200 Series
|
||||
6939, F1, AMD Radeon (TM) R9 380 Series
|
||||
6980, 00, Radeon Pro WX3100
|
||||
6981, 00, AMD Radeon (TM) Pro WX 3200 Series
|
||||
6981, 01, AMD Radeon (TM) Pro WX 3200 Series
|
||||
6981, 10, AMD Radeon (TM) Pro WX 3200 Series
|
||||
6985, 00, AMD Radeon Pro WX3100
|
||||
6939, F1, AMD Radeon R9 380 Series
|
||||
694C, C0, AMD Radeon RX Vega M GH Graphics
|
||||
694E, C0, AMD Radeon RX Vega M GL Graphics
|
||||
6980, 00, AMD Radeon Pro WX 3100
|
||||
6981, 00, AMD Radeon Pro WX 3200 Series
|
||||
6981, 01, AMD Radeon Pro WX 3200 Series
|
||||
6981, 10, AMD Radeon Pro WX 3200 Series
|
||||
6985, 00, AMD Radeon Pro WX 3100
|
||||
6986, 00, AMD Radeon Pro WX 2100
|
||||
6987, 80, AMD Embedded Radeon E9171
|
||||
6987, C0, Radeon 550X Series
|
||||
6987, C0, AMD Radeon 550X Series
|
||||
6987, C1, AMD Radeon RX 640
|
||||
6987, C3, Radeon 540X Series
|
||||
6995, 00, AMD Radeon Pro WX2100
|
||||
6997, 00, Radeon Pro WX2100
|
||||
6987, C3, AMD Radeon 540X Series
|
||||
6987, C7, AMD Radeon 540
|
||||
6995, 00, AMD Radeon Pro WX 2100
|
||||
6997, 00, AMD Radeon Pro WX 2100
|
||||
699F, 81, AMD Embedded Radeon E9170 Series
|
||||
699F, C0, Radeon 500 Series
|
||||
699F, C1, Radeon 540 Series
|
||||
699F, C3, Radeon 500 Series
|
||||
699F, C7, Radeon RX550/550 Series
|
||||
7300, C1, AMD FirePro (TM) S9300 x2
|
||||
7300, C8, AMD Radeon (TM) R9 Fury Series
|
||||
7300, C9, Radeon (TM) Pro Duo
|
||||
7300, CB, AMD Radeon (TM) R9 Fury Series
|
||||
7300, CA, AMD Radeon (TM) R9 Fury Series
|
||||
699F, C0, AMD Radeon 500 Series
|
||||
699F, C1, AMD Radeon 540 Series
|
||||
699F, C3, AMD Radeon 500 Series
|
||||
699F, C7, AMD Radeon RX 550 / 550 Series
|
||||
699F, C9, AMD Radeon 540
|
||||
6FDF, E7, AMD Radeon RX 590 GME
|
||||
6FDF, EF, AMD Radeon RX 580 2048SP
|
||||
7300, C1, AMD FirePro S9300 x2
|
||||
7300, C8, AMD Radeon R9 Fury Series
|
||||
7300, C9, AMD Radeon Pro Duo
|
||||
7300, CA, AMD Radeon R9 Fury Series
|
||||
7300, CB, AMD Radeon R9 Fury Series
|
||||
7312, 00, AMD Radeon Pro W5700
|
||||
731E, C6, AMD Radeon RX 5700XTB
|
||||
731E, C7, AMD Radeon RX 5700B
|
||||
|
|
@ -266,30 +490,211 @@
|
|||
731F, C5, AMD Radeon RX 5700 XT
|
||||
731F, CA, AMD Radeon RX 5600 XT
|
||||
731F, CB, AMD Radeon RX 5600 OEM
|
||||
7340, C1, Radeon RX 5500M
|
||||
7340, C5, Radeon RX 5500 XT
|
||||
7340, C7, Radeon RX 5500
|
||||
7340, C1, AMD Radeon RX 5500M
|
||||
7340, C3, AMD Radeon RX 5300M
|
||||
7340, C5, AMD Radeon RX 5500 XT
|
||||
7340, C7, AMD Radeon RX 5500
|
||||
7340, C9, AMD Radeon RX 5500XTB
|
||||
7340, CF, Radeon RX 5300
|
||||
7340, CF, AMD Radeon RX 5300
|
||||
7341, 00, AMD Radeon Pro W5500
|
||||
7347, 00, AMD Radeon Pro W5500M
|
||||
73A3, 00, AMD Radeon PRO W6800
|
||||
7360, 41, AMD Radeon Pro 5600M
|
||||
7360, C3, AMD Radeon Pro V520
|
||||
7362, C1, AMD Radeon Pro V540
|
||||
7362, C3, AMD Radeon Pro V520
|
||||
738C, 01, AMD Instinct MI100
|
||||
73A1, 00, AMD Radeon Pro V620
|
||||
73A3, 00, AMD Radeon Pro W6800
|
||||
73A5, C0, AMD Radeon RX 6950 XT
|
||||
73AE, 00, AMD Radeon Pro V620 MxGPU
|
||||
73AF, C0, AMD Radeon RX 6900 XT
|
||||
73BF, C0, AMD Radeon RX 6900 XT
|
||||
73BF, C1, AMD Radeon RX 6800 XT
|
||||
73BF, C3, AMD Radeon RX 6800
|
||||
73DF, C0, AMD Radeon RX 6750 XT
|
||||
73DF, C1, AMD Radeon RX 6700 XT
|
||||
73DF, C2, AMD Radeon RX 6800M
|
||||
73DF, C3, AMD Radeon RX 6800M
|
||||
73DF, C5, AMD Radeon RX 6700 XT
|
||||
73E1, 00, AMD Radeon PRO W6600M
|
||||
73E3, 00, AMD Radeon PRO W6600
|
||||
73DF, CF, AMD Radeon RX 6700M
|
||||
73DF, D5, AMD Radeon RX 6750 GRE 12GB
|
||||
73DF, D7, AMD TDC-235
|
||||
73DF, DF, AMD Radeon RX 6700
|
||||
73DF, E5, AMD Radeon RX 6750 GRE 12GB
|
||||
73DF, FF, AMD Radeon RX 6700
|
||||
73E0, 00, AMD Radeon RX 6600M
|
||||
73E1, 00, AMD Radeon Pro W6600M
|
||||
73E3, 00, AMD Radeon Pro W6600
|
||||
73EF, C0, AMD Radeon RX 6800S
|
||||
73EF, C1, AMD Radeon RX 6650 XT
|
||||
73EF, C2, AMD Radeon RX 6700S
|
||||
73EF, C3, AMD Radeon RX 6650M
|
||||
73EF, C4, AMD Radeon RX 6650M XT
|
||||
73FF, C1, AMD Radeon RX 6600 XT
|
||||
73FF, C3, AMD Radeon RX 6600M
|
||||
73FF, C7, AMD Radeon RX 6600
|
||||
73FF, CB, AMD Radeon RX 6600S
|
||||
73FF, CF, AMD Radeon RX 6600 LE
|
||||
73FF, DF, AMD Radeon RX 6750 GRE 10GB
|
||||
7408, 00, AMD Instinct MI250X
|
||||
740C, 01, AMD Instinct MI250X / MI250
|
||||
740F, 02, AMD Instinct MI210
|
||||
7421, 00, AMD Radeon Pro W6500M
|
||||
7422, 00, AMD Radeon Pro W6400
|
||||
7423, 00, AMD Radeon Pro W6300M
|
||||
7423, 01, AMD Radeon Pro W6300
|
||||
7424, 00, AMD Radeon RX 6300
|
||||
743F, C1, AMD Radeon RX 6500 XT
|
||||
743F, C3, AMD Radeon RX 6500
|
||||
743F, C3, AMD Radeon RX 6500M
|
||||
743F, C7, AMD Radeon RX 6400
|
||||
743F, C8, AMD Radeon RX 6500M
|
||||
743F, CC, AMD Radeon 6550S
|
||||
743F, CE, AMD Radeon RX 6450M
|
||||
743F, CF, AMD Radeon RX 6300M
|
||||
743F, D3, AMD Radeon RX 6550M
|
||||
743F, D7, AMD Radeon RX 6400
|
||||
7448, 00, AMD Radeon Pro W7900
|
||||
7449, 00, AMD Radeon Pro W7800 48GB
|
||||
744A, 00, AMD Radeon Pro W7900 Dual Slot
|
||||
744B, 00, AMD Radeon Pro W7900D
|
||||
744C, C8, AMD Radeon RX 7900 XTX
|
||||
744C, CC, AMD Radeon RX 7900 XT
|
||||
744C, CE, AMD Radeon RX 7900 GRE
|
||||
744C, CF, AMD Radeon RX 7900M
|
||||
745E, CC, AMD Radeon Pro W7800
|
||||
7460, 00, AMD Radeon Pro V710
|
||||
7461, 00, AMD Radeon Pro V710 MxGPU
|
||||
7470, 00, AMD Radeon Pro W7700
|
||||
747E, C8, AMD Radeon RX 7800 XT
|
||||
747E, D8, AMD Radeon RX 7800M
|
||||
747E, DB, AMD Radeon RX 7700
|
||||
747E, FF, AMD Radeon RX 7700 XT
|
||||
7480, 00, AMD Radeon Pro W7600
|
||||
7480, C0, AMD Radeon RX 7600 XT
|
||||
7480, C1, AMD Radeon RX 7700S
|
||||
7480, C2, AMD Radeon RX 7650 GRE
|
||||
7480, C3, AMD Radeon RX 7600S
|
||||
7480, C7, AMD Radeon RX 7600M XT
|
||||
7480, CF, AMD Radeon RX 7600
|
||||
7481, C7, AMD Steam Machine
|
||||
7483, CF, AMD Radeon RX 7600M
|
||||
7489, 00, AMD Radeon Pro W7500
|
||||
7499, 00, AMD Radeon Pro W7400
|
||||
7499, C0, AMD Radeon RX 7400
|
||||
7499, C1, AMD Radeon RX 7300
|
||||
74A0, 00, AMD Instinct MI300A
|
||||
74A1, 00, AMD Instinct MI300X
|
||||
74A2, 00, AMD Instinct MI308X
|
||||
74A5, 00, AMD Instinct MI325X
|
||||
74A8, 00, AMD Instinct MI308X HF
|
||||
74A9, 00, AMD Instinct MI300X HF
|
||||
74B5, 00, AMD Instinct MI300X VF
|
||||
74B6, 00, AMD Instinct MI308X
|
||||
74BD, 00, AMD Instinct MI300X HF
|
||||
7550, C0, AMD Radeon RX 9070 XT
|
||||
7550, C2, AMD Radeon RX 9070 GRE
|
||||
7550, C3, AMD Radeon RX 9070
|
||||
7551, C0, AMD Radeon AI PRO R9700
|
||||
7590, C0, AMD Radeon RX 9060 XT
|
||||
7590, C7, AMD Radeon RX 9060
|
||||
75A0, C0, AMD Instinct MI350X
|
||||
75A3, C0, AMD Instinct MI355X
|
||||
75B0, C0, AMD Instinct MI350X VF
|
||||
75B3, C0, AMD Instinct MI355X VF
|
||||
9830, 00, AMD Radeon HD 8400 / R3 Series
|
||||
9831, 00, AMD Radeon HD 8400E
|
||||
9832, 00, AMD Radeon HD 8330
|
||||
9833, 00, AMD Radeon HD 8330E
|
||||
9834, 00, AMD Radeon HD 8210
|
||||
9835, 00, AMD Radeon HD 8210E
|
||||
9836, 00, AMD Radeon HD 8200 / R3 Series
|
||||
9837, 00, AMD Radeon HD 8280E
|
||||
9838, 00, AMD Radeon HD 8200 / R3 series
|
||||
9839, 00, AMD Radeon HD 8180
|
||||
983D, 00, AMD Radeon HD 8250
|
||||
9850, 00, AMD Radeon R3 Graphics
|
||||
9850, 03, AMD Radeon R3 Graphics
|
||||
9850, 40, AMD Radeon R2 Graphics
|
||||
9850, 45, AMD Radeon R3 Graphics
|
||||
9851, 00, AMD Radeon R4 Graphics
|
||||
9851, 01, AMD Radeon R5E Graphics
|
||||
9851, 05, AMD Radeon R5 Graphics
|
||||
9851, 06, AMD Radeon R5E Graphics
|
||||
9851, 40, AMD Radeon R4 Graphics
|
||||
9851, 45, AMD Radeon R5 Graphics
|
||||
9852, 00, AMD Radeon R2 Graphics
|
||||
9852, 40, AMD Radeon E1 Graphics
|
||||
9853, 00, AMD Radeon R2 Graphics
|
||||
9853, 01, AMD Radeon R4E Graphics
|
||||
9853, 03, AMD Radeon R2 Graphics
|
||||
9853, 05, AMD Radeon R1E Graphics
|
||||
9853, 06, AMD Radeon R1E Graphics
|
||||
9853, 07, AMD Radeon R1E Graphics
|
||||
9853, 08, AMD Radeon R1E Graphics
|
||||
9853, 40, AMD Radeon R2 Graphics
|
||||
9854, 00, AMD Radeon R3 Graphics
|
||||
9854, 01, AMD Radeon R3E Graphics
|
||||
9854, 02, AMD Radeon R3 Graphics
|
||||
9854, 05, AMD Radeon R2 Graphics
|
||||
9854, 06, AMD Radeon R4 Graphics
|
||||
9854, 07, AMD Radeon R3 Graphics
|
||||
9855, 02, AMD Radeon R6 Graphics
|
||||
9855, 05, AMD Radeon R4 Graphics
|
||||
9856, 00, AMD Radeon R2 Graphics
|
||||
9856, 01, AMD Radeon R2E Graphics
|
||||
9856, 02, AMD Radeon R2 Graphics
|
||||
9856, 05, AMD Radeon R1E Graphics
|
||||
9856, 06, AMD Radeon R2 Graphics
|
||||
9856, 07, AMD Radeon R1E Graphics
|
||||
9856, 08, AMD Radeon R1E Graphics
|
||||
9856, 13, AMD Radeon R1E Graphics
|
||||
9874, 81, AMD Radeon R6 Graphics
|
||||
9874, 84, AMD Radeon R7 Graphics
|
||||
9874, 85, AMD Radeon R6 Graphics
|
||||
9874, 87, AMD Radeon R5 Graphics
|
||||
9874, 88, AMD Radeon R7E Graphics
|
||||
9874, 89, AMD Radeon R6E Graphics
|
||||
9874, C4, AMD Radeon R7 Graphics
|
||||
9874, C5, AMD Radeon R6 Graphics
|
||||
9874, C6, AMD Radeon R6 Graphics
|
||||
9874, C7, AMD Radeon R5 Graphics
|
||||
9874, C8, AMD Radeon R7 Graphics
|
||||
9874, 81, AMD Radeon R6 Graphics
|
||||
9874, 87, AMD Radeon R5 Graphics
|
||||
9874, 85, AMD Radeon R6 Graphics
|
||||
9874, 84, AMD Radeon R7 Graphics
|
||||
6FDF, E7, AMD Radeon RX 590 GME
|
||||
6FDF, EF, AMD Radeon RX 580 2048SP
|
||||
9874, C9, AMD Radeon R7 Graphics
|
||||
9874, CA, AMD Radeon R5 Graphics
|
||||
9874, CB, AMD Radeon R5 Graphics
|
||||
9874, CC, AMD Radeon R7 Graphics
|
||||
9874, CD, AMD Radeon R7 Graphics
|
||||
9874, CE, AMD Radeon R5 Graphics
|
||||
9874, E1, AMD Radeon R7 Graphics
|
||||
9874, E2, AMD Radeon R7 Graphics
|
||||
9874, E3, AMD Radeon R7 Graphics
|
||||
9874, E4, AMD Radeon R7 Graphics
|
||||
9874, E5, AMD Radeon R5 Graphics
|
||||
9874, E6, AMD Radeon R5 Graphics
|
||||
98E4, 80, AMD Radeon R5E Graphics
|
||||
98E4, 81, AMD Radeon R4E Graphics
|
||||
98E4, 83, AMD Radeon R2E Graphics
|
||||
98E4, 84, AMD Radeon R2E Graphics
|
||||
98E4, 86, AMD Radeon R1E Graphics
|
||||
98E4, C0, AMD Radeon R4 Graphics
|
||||
98E4, C1, AMD Radeon R5 Graphics
|
||||
98E4, C2, AMD Radeon R4 Graphics
|
||||
98E4, C4, AMD Radeon R5 Graphics
|
||||
98E4, C6, AMD Radeon R5 Graphics
|
||||
98E4, C8, AMD Radeon R4 Graphics
|
||||
98E4, C9, AMD Radeon R4 Graphics
|
||||
98E4, CA, AMD Radeon R5 Graphics
|
||||
98E4, D0, AMD Radeon R2 Graphics
|
||||
98E4, D1, AMD Radeon R2 Graphics
|
||||
98E4, D2, AMD Radeon R2 Graphics
|
||||
98E4, D4, AMD Radeon R2 Graphics
|
||||
98E4, D9, AMD Radeon R5 Graphics
|
||||
98E4, DA, AMD Radeon R5 Graphics
|
||||
98E4, DB, AMD Radeon R3 Graphics
|
||||
98E4, E1, AMD Radeon R3 Graphics
|
||||
98E4, E2, AMD Radeon R3 Graphics
|
||||
98E4, E9, AMD Radeon R4 Graphics
|
||||
98E4, EA, AMD Radeon R4 Graphics
|
||||
98E4, EB, AMD Radeon R3 Graphics
|
||||
98E4, EB, AMD Radeon R4 Graphics
|
||||
|
|
|
|||
11
etnaviv/Android.bp
Normal file
11
etnaviv/Android.bp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
build = ["Android.sources.bp"]
|
||||
|
||||
cc_library_shared {
|
||||
name: "libdrm_etnaviv",
|
||||
defaults: [
|
||||
"libdrm_defaults",
|
||||
"libdrm_etnaviv_sources",
|
||||
],
|
||||
vendor: true,
|
||||
shared_libs: ["libdrm"],
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
# Import variables LIBDRM_ETNAVIV_FILES, LIBDRM_ETNAVIV_H_FILES
|
||||
include $(LOCAL_PATH)/Makefile.sources
|
||||
|
||||
LOCAL_MODULE := libdrm_etnaviv
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := libdrm
|
||||
|
||||
LOCAL_SRC_FILES := $(LIBDRM_ETNAVIV_FILES)
|
||||
|
||||
include $(LIBDRM_COMMON_MK)
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
13
etnaviv/Android.sources.bp
Normal file
13
etnaviv/Android.sources.bp
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Autogenerated with Android.sources.bp.mk
|
||||
|
||||
cc_defaults {
|
||||
name: "libdrm_etnaviv_sources",
|
||||
srcs: [
|
||||
"etnaviv_device.c",
|
||||
"etnaviv_gpu.c",
|
||||
"etnaviv_bo.c",
|
||||
"etnaviv_bo_cache.c",
|
||||
"etnaviv_pipe.c",
|
||||
"etnaviv_cmd_stream.c",
|
||||
],
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
LIBDRM_ETNAVIV_FILES := \
|
||||
etnaviv_device.c \
|
||||
etnaviv_gpu.c \
|
||||
etnaviv_bo.c \
|
||||
etnaviv_bo_cache.c \
|
||||
etnaviv_perfmon.c \
|
||||
etnaviv_pipe.c \
|
||||
etnaviv_cmd_stream.c \
|
||||
etnaviv_drm.h \
|
||||
etnaviv_priv.h
|
||||
|
||||
LIBDRM_ETNAVIV_H_FILES := \
|
||||
etnaviv_drmif.h
|
||||
|
|
@ -48,12 +48,8 @@ drm_private void bo_del(struct etna_bo *bo)
|
|||
drmHashDelete(bo->dev->name_table, bo->name);
|
||||
|
||||
if (bo->handle) {
|
||||
struct drm_gem_close req = {
|
||||
.handle = bo->handle,
|
||||
};
|
||||
|
||||
drmHashDelete(bo->dev->handle_table, bo->handle);
|
||||
drmIoctl(bo->dev->fd, DRM_IOCTL_GEM_CLOSE, &req);
|
||||
drmCloseBufferHandle(bo->dev->fd, bo->handle);
|
||||
}
|
||||
|
||||
free(bo);
|
||||
|
|
@ -82,12 +78,7 @@ static struct etna_bo *bo_from_handle(struct etna_device *dev,
|
|||
struct etna_bo *bo = calloc(sizeof(*bo), 1);
|
||||
|
||||
if (!bo) {
|
||||
struct drm_gem_close req = {
|
||||
.handle = handle,
|
||||
};
|
||||
|
||||
drmIoctl(dev->fd, DRM_IOCTL_GEM_CLOSE, &req);
|
||||
|
||||
drmCloseBufferHandle(dev->fd, handle);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,8 +25,7 @@
|
|||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/types.h>
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include <sys/mman.h>
|
||||
#include <fcntl.h>
|
||||
|
|
|
|||
|
|
@ -73,6 +73,10 @@ struct drm_etnaviv_timespec {
|
|||
#define ETNAVIV_PARAM_GPU_INSTRUCTION_COUNT 0x18
|
||||
#define ETNAVIV_PARAM_GPU_NUM_CONSTANTS 0x19
|
||||
#define ETNAVIV_PARAM_GPU_NUM_VARYINGS 0x1a
|
||||
#define ETNAVIV_PARAM_SOFTPIN_START_ADDR 0x1b
|
||||
#define ETNAVIV_PARAM_GPU_PRODUCT_ID 0x1c
|
||||
#define ETNAVIV_PARAM_GPU_CUSTOMER_ID 0x1d
|
||||
#define ETNAVIV_PARAM_GPU_ECO_ID 0x1e
|
||||
|
||||
#define ETNA_MAX_PIPES 4
|
||||
|
||||
|
|
@ -148,6 +152,11 @@ struct drm_etnaviv_gem_submit_reloc {
|
|||
* then patching the cmdstream for this entry is skipped. This can
|
||||
* avoid kernel needing to map/access the cmdstream bo in the common
|
||||
* case.
|
||||
* If the submit is a softpin submit (ETNA_SUBMIT_SOFTPIN) the 'presumed'
|
||||
* field is interpreted as the fixed location to map the bo into the gpu
|
||||
* virtual address space. If the kernel is unable to map the buffer at
|
||||
* this location the submit will fail. This means userspace is responsible
|
||||
* for the whole gpu virtual address management.
|
||||
*/
|
||||
#define ETNA_SUBMIT_BO_READ 0x0001
|
||||
#define ETNA_SUBMIT_BO_WRITE 0x0002
|
||||
|
|
@ -177,9 +186,11 @@ struct drm_etnaviv_gem_submit_pmr {
|
|||
#define ETNA_SUBMIT_NO_IMPLICIT 0x0001
|
||||
#define ETNA_SUBMIT_FENCE_FD_IN 0x0002
|
||||
#define ETNA_SUBMIT_FENCE_FD_OUT 0x0004
|
||||
#define ETNA_SUBMIT_SOFTPIN 0x0008
|
||||
#define ETNA_SUBMIT_FLAGS (ETNA_SUBMIT_NO_IMPLICIT | \
|
||||
ETNA_SUBMIT_FENCE_FD_IN | \
|
||||
ETNA_SUBMIT_FENCE_FD_OUT)
|
||||
ETNA_SUBMIT_FENCE_FD_OUT| \
|
||||
ETNA_SUBMIT_SOFTPIN)
|
||||
#define ETNA_PIPE_3D 0x00
|
||||
#define ETNA_PIPE_2D 0x01
|
||||
#define ETNA_PIPE_VG 0x02
|
||||
|
|
|
|||
|
|
@ -31,19 +31,18 @@ libdrm_etnaviv = library(
|
|||
include_directories : [inc_root, inc_drm],
|
||||
link_with : libdrm,
|
||||
c_args : libdrm_c_args,
|
||||
dependencies : [dep_pthread_stubs, dep_rt, dep_atomic_ops],
|
||||
version : '1.0.0',
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
dependencies : [dep_threads, dep_rt, dep_atomic_ops],
|
||||
version : '1.@0@.0'.format(patch_ver),
|
||||
install : true,
|
||||
)
|
||||
|
||||
install_headers('etnaviv_drmif.h', subdir : 'libdrm')
|
||||
|
||||
pkg.generate(
|
||||
libdrm_etnaviv,
|
||||
name : 'libdrm_etnaviv',
|
||||
libraries : libdrm_etnaviv,
|
||||
subdirs : ['.', 'libdrm'],
|
||||
version : meson.project_version(),
|
||||
requires_private : 'libdrm',
|
||||
description : 'Userspace interface to Tegra kernel DRM services',
|
||||
)
|
||||
|
||||
|
|
@ -52,12 +51,14 @@ ext_libdrm_etnaviv = declare_dependency(
|
|||
include_directories : [inc_drm, include_directories('.')],
|
||||
)
|
||||
|
||||
meson.override_dependency('libdrm_etnaviv', ext_libdrm_etnaviv)
|
||||
|
||||
test(
|
||||
'etnaviv-symbols-check',
|
||||
symbols_check,
|
||||
args : [
|
||||
'--lib', libdrm_etnaviv,
|
||||
'--symbols-file', files('etnaviv-symbols.txt'),
|
||||
'--nm', prog_nm.path(),
|
||||
'--nm', prog_nm.full_path(),
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@
|
|||
#include <unistd.h>
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <linux/stddef.h>
|
||||
|
||||
#include <xf86drm.h>
|
||||
|
||||
|
|
@ -176,11 +175,7 @@ drm_public void exynos_bo_destroy(struct exynos_bo *bo)
|
|||
munmap(bo->vaddr, bo->size);
|
||||
|
||||
if (bo->handle) {
|
||||
struct drm_gem_close req = {
|
||||
.handle = bo->handle,
|
||||
};
|
||||
|
||||
drmIoctl(bo->dev->fd, DRM_IOCTL_GEM_CLOSE, &req);
|
||||
drmCloseBufferHandle(bo->dev->fd, bo->handle);
|
||||
}
|
||||
|
||||
free(bo);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <assert.h>
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <linux/stddef.h>
|
||||
|
||||
#include <xf86drm.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -22,10 +22,11 @@ libdrm_exynos = library(
|
|||
'drm_exynos',
|
||||
[files('exynos_drm.c', 'exynos_fimg2d.c'), config_file],
|
||||
c_args : libdrm_c_args,
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
include_directories : [inc_root, inc_drm],
|
||||
link_with : libdrm,
|
||||
dependencies : [dep_pthread_stubs],
|
||||
version : '1.0.0',
|
||||
dependencies : [dep_threads],
|
||||
version : '1.@0@.0'.format(patch_ver),
|
||||
install : true,
|
||||
)
|
||||
|
||||
|
|
@ -37,12 +38,13 @@ ext_libdrm_exynos = declare_dependency(
|
|||
include_directories : [inc_drm, include_directories('.')],
|
||||
)
|
||||
|
||||
meson.override_dependency('libdrm_exynos', ext_libdrm_exynos)
|
||||
|
||||
pkg.generate(
|
||||
libdrm_exynos,
|
||||
name : 'libdrm_exynos',
|
||||
libraries : libdrm_exynos,
|
||||
subdirs : ['.', 'libdrm', 'exynos'],
|
||||
version : '0.7',
|
||||
requires_private : 'libdrm',
|
||||
description : 'Userspace interface to exynos kernel DRM services',
|
||||
)
|
||||
|
||||
|
|
@ -52,6 +54,6 @@ test(
|
|||
args : [
|
||||
'--lib', libdrm_exynos,
|
||||
'--symbols-file', files('exynos-symbols.txt'),
|
||||
'--nm', prog_nm.path(),
|
||||
'--nm', prog_nm.full_path(),
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
# Import variables LIBDRM_FREEDRENO_FILES, LIBDRM_FREEDRENO_H_FILES
|
||||
include $(LOCAL_PATH)/Makefile.sources
|
||||
|
||||
LOCAL_MODULE := libdrm_freedreno
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := libdrm
|
||||
|
||||
LOCAL_SRC_FILES := $(LIBDRM_FREEDRENO_FILES)
|
||||
|
||||
include $(LIBDRM_COMMON_MK)
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
LIBDRM_FREEDRENO_FILES := \
|
||||
freedreno_device.c \
|
||||
freedreno_pipe.c \
|
||||
freedreno_priv.h \
|
||||
freedreno_ringbuffer.c \
|
||||
freedreno_bo.c \
|
||||
freedreno_bo_cache.c \
|
||||
msm/msm_bo.c \
|
||||
msm/msm_device.c \
|
||||
msm/msm_pipe.c \
|
||||
msm/msm_priv.h \
|
||||
msm/msm_ringbuffer.c
|
||||
|
||||
LIBDRM_FREEDRENO_KGSL_FILES := \
|
||||
kgsl/kgsl_bo.c \
|
||||
kgsl/kgsl_device.c \
|
||||
kgsl/kgsl_drm.h \
|
||||
kgsl/kgsl_pipe.c \
|
||||
kgsl/kgsl_priv.h \
|
||||
kgsl/kgsl_ringbuffer.c \
|
||||
kgsl/msm_kgsl.h
|
||||
|
||||
LIBDRM_FREEDRENO_H_FILES := \
|
||||
freedreno_drmif.h \
|
||||
freedreno_ringbuffer.h
|
||||
|
|
@ -62,10 +62,7 @@ static struct fd_bo * bo_from_handle(struct fd_device *dev,
|
|||
|
||||
bo = dev->funcs->bo_from_handle(dev, size, handle);
|
||||
if (!bo) {
|
||||
struct drm_gem_close req = {
|
||||
.handle = handle,
|
||||
};
|
||||
drmIoctl(dev->fd, DRM_IOCTL_GEM_CLOSE, &req);
|
||||
drmCloseBufferHandle(dev->fd, handle);
|
||||
return NULL;
|
||||
}
|
||||
bo->dev = fd_device_ref(dev);
|
||||
|
|
@ -263,13 +260,10 @@ drm_private void bo_del(struct fd_bo *bo)
|
|||
*/
|
||||
|
||||
if (bo->handle) {
|
||||
struct drm_gem_close req = {
|
||||
.handle = bo->handle,
|
||||
};
|
||||
drmHashDelete(bo->dev->handle_table, bo->handle);
|
||||
if (bo->name)
|
||||
drmHashDelete(bo->dev->name_table, bo->name);
|
||||
drmIoctl(bo->dev->fd, DRM_IOCTL_GEM_CLOSE, &req);
|
||||
drmCloseBufferHandle(bo->dev->fd, bo->handle);
|
||||
}
|
||||
|
||||
bo->funcs->destroy(bo);
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@
|
|||
|
||||
#include "kgsl_priv.h"
|
||||
|
||||
#include <linux/fb.h>
|
||||
|
||||
static int set_memtype(struct fd_device *dev, uint32_t handle, uint32_t flags)
|
||||
{
|
||||
struct drm_kgsl_gem_memtype req = {
|
||||
|
|
|
|||
|
|
@ -44,9 +44,9 @@ libdrm_freedreno = library(
|
|||
[files_freedreno, config_file],
|
||||
c_args : libdrm_c_args,
|
||||
include_directories : [inc_root, inc_drm],
|
||||
dependencies : [dep_valgrind, dep_pthread_stubs, dep_rt, dep_atomic_ops],
|
||||
dependencies : [dep_valgrind, dep_threads, dep_rt, dep_atomic_ops],
|
||||
link_with : libdrm,
|
||||
version : '1.0.0',
|
||||
version : '1.@0@.0'.format(patch_ver),
|
||||
install : true,
|
||||
)
|
||||
|
||||
|
|
@ -55,17 +55,17 @@ ext_libdrm_freedreno = declare_dependency(
|
|||
include_directories : [inc_drm, include_directories('.')],
|
||||
)
|
||||
|
||||
meson.override_dependency('libdrm_freedreno', ext_libdrm_freedreno)
|
||||
|
||||
install_headers(
|
||||
'freedreno_drmif.h', 'freedreno_ringbuffer.h',
|
||||
subdir : 'freedreno'
|
||||
)
|
||||
|
||||
pkg.generate(
|
||||
libdrm_freedreno,
|
||||
name : 'libdrm_freedreno',
|
||||
libraries : libdrm_freedreno,
|
||||
subdirs : ['.', 'libdrm', 'freedreno'],
|
||||
version : meson.project_version(),
|
||||
requires_private : 'libdrm',
|
||||
description : 'Userspace interface to freedreno kernel DRM services',
|
||||
)
|
||||
|
||||
|
|
@ -75,6 +75,6 @@ test(
|
|||
args : [
|
||||
'--lib', libdrm_freedreno,
|
||||
'--symbols-file', files('freedreno-symbols.txt'),
|
||||
'--nm', prog_nm.path(),
|
||||
'--nm', prog_nm.full_path(),
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ with open(towrite, "w") as f:
|
|||
that script instead of adding here entries manually! */
|
||||
static const struct drmFormatModifierInfo drm_format_modifier_table[] = {
|
||||
''')
|
||||
f.write(' { DRM_MODIFIER_INVALID(NONE, INVALID_MODIFIER) },\n')
|
||||
f.write(' { DRM_MODIFIER_INVALID(NONE, INVALID) },\n')
|
||||
f.write(' { DRM_MODIFIER_LINEAR(NONE, LINEAR) },\n')
|
||||
|
||||
for entry in fm_re['intel']:
|
||||
|
|
@ -64,7 +64,7 @@ static const struct drmFormatModifierInfo drm_format_modifier_table[] = {
|
|||
|
||||
for entry in fm_re['others']:
|
||||
(vendor, mod) = entry.split('_', 1)
|
||||
if vendor == 'ARM' and (mod == 'TYPE_AFBC' or mod == 'TYPE_MISC'):
|
||||
if vendor == 'ARM' and (mod == 'TYPE_AFBC' or mod == 'TYPE_MISC' or mod == 'TYPE_AFRC'):
|
||||
continue
|
||||
print_fm(f, vendor, mod, mod)
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ Note: One should not do _any_ changes to the files apart from the steps below.
|
|||
|
||||
In order to update the files do the following:
|
||||
- Switch to a Linux kernel tree/branch which is not rebased.
|
||||
For example: drm-next (https://cgit.freedesktop.org/drm/drm)
|
||||
For example: drm-next (https://gitlab.freedesktop.org/drm/kernel/)
|
||||
- Install the headers via `make headers_install' to a separate location.
|
||||
- Copy the drm header[s] + git add + git commit.
|
||||
- Note: Your commit message must include:
|
||||
|
|
|
|||
|
|
@ -54,6 +54,9 @@ extern "C" {
|
|||
#define DRM_AMDGPU_VM 0x13
|
||||
#define DRM_AMDGPU_FENCE_TO_HANDLE 0x14
|
||||
#define DRM_AMDGPU_SCHED 0x15
|
||||
#define DRM_AMDGPU_USERQ 0x16
|
||||
#define DRM_AMDGPU_USERQ_SIGNAL 0x17
|
||||
#define DRM_AMDGPU_USERQ_WAIT 0x18
|
||||
|
||||
#define DRM_IOCTL_AMDGPU_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_CREATE, union drm_amdgpu_gem_create)
|
||||
#define DRM_IOCTL_AMDGPU_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_MMAP, union drm_amdgpu_gem_mmap)
|
||||
|
|
@ -71,6 +74,9 @@ extern "C" {
|
|||
#define DRM_IOCTL_AMDGPU_VM DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_VM, union drm_amdgpu_vm)
|
||||
#define DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_FENCE_TO_HANDLE, union drm_amdgpu_fence_to_handle)
|
||||
#define DRM_IOCTL_AMDGPU_SCHED DRM_IOW(DRM_COMMAND_BASE + DRM_AMDGPU_SCHED, union drm_amdgpu_sched)
|
||||
#define DRM_IOCTL_AMDGPU_USERQ DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_USERQ, union drm_amdgpu_userq)
|
||||
#define DRM_IOCTL_AMDGPU_USERQ_SIGNAL DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_USERQ_SIGNAL, struct drm_amdgpu_userq_signal)
|
||||
#define DRM_IOCTL_AMDGPU_USERQ_WAIT DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_USERQ_WAIT, struct drm_amdgpu_userq_wait)
|
||||
|
||||
/**
|
||||
* DOC: memory domains
|
||||
|
|
@ -80,7 +86,7 @@ extern "C" {
|
|||
*
|
||||
* %AMDGPU_GEM_DOMAIN_GTT GPU accessible system memory, mapped into the
|
||||
* GPU's virtual address space via gart. Gart memory linearizes non-contiguous
|
||||
* pages of system memory, allows GPU access system memory in a linezrized
|
||||
* pages of system memory, allows GPU access system memory in a linearized
|
||||
* fashion.
|
||||
*
|
||||
* %AMDGPU_GEM_DOMAIN_VRAM Local video memory. For APUs, it is memory
|
||||
|
|
@ -94,6 +100,9 @@ extern "C" {
|
|||
*
|
||||
* %AMDGPU_GEM_DOMAIN_OA Ordered append, used by 3D or Compute engines
|
||||
* for appending data.
|
||||
*
|
||||
* %AMDGPU_GEM_DOMAIN_DOORBELL Doorbell. It is an MMIO region for
|
||||
* signalling user mode queues.
|
||||
*/
|
||||
#define AMDGPU_GEM_DOMAIN_CPU 0x1
|
||||
#define AMDGPU_GEM_DOMAIN_GTT 0x2
|
||||
|
|
@ -101,12 +110,14 @@ extern "C" {
|
|||
#define AMDGPU_GEM_DOMAIN_GDS 0x8
|
||||
#define AMDGPU_GEM_DOMAIN_GWS 0x10
|
||||
#define AMDGPU_GEM_DOMAIN_OA 0x20
|
||||
#define AMDGPU_GEM_DOMAIN_DOORBELL 0x40
|
||||
#define AMDGPU_GEM_DOMAIN_MASK (AMDGPU_GEM_DOMAIN_CPU | \
|
||||
AMDGPU_GEM_DOMAIN_GTT | \
|
||||
AMDGPU_GEM_DOMAIN_VRAM | \
|
||||
AMDGPU_GEM_DOMAIN_GDS | \
|
||||
AMDGPU_GEM_DOMAIN_GWS | \
|
||||
AMDGPU_GEM_DOMAIN_OA)
|
||||
AMDGPU_GEM_DOMAIN_OA | \
|
||||
AMDGPU_GEM_DOMAIN_DOORBELL)
|
||||
|
||||
/* Flag that CPU access will be required for the case of VRAM domain */
|
||||
#define AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED (1 << 0)
|
||||
|
|
@ -116,8 +127,6 @@ extern "C" {
|
|||
#define AMDGPU_GEM_CREATE_CPU_GTT_USWC (1 << 2)
|
||||
/* Flag that the memory should be in VRAM and cleared */
|
||||
#define AMDGPU_GEM_CREATE_VRAM_CLEARED (1 << 3)
|
||||
/* Flag that create shadow bo(GTT) while allocating vram bo */
|
||||
#define AMDGPU_GEM_CREATE_SHADOW (1 << 4)
|
||||
/* Flag that allocating the BO should use linear VRAM */
|
||||
#define AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS (1 << 5)
|
||||
/* Flag that BO is always valid in this VM */
|
||||
|
|
@ -138,6 +147,36 @@ extern "C" {
|
|||
* accessing it with various hw blocks
|
||||
*/
|
||||
#define AMDGPU_GEM_CREATE_ENCRYPTED (1 << 10)
|
||||
/* Flag that BO will be used only in preemptible context, which does
|
||||
* not require GTT memory accounting
|
||||
*/
|
||||
#define AMDGPU_GEM_CREATE_PREEMPTIBLE (1 << 11)
|
||||
/* Flag that BO can be discarded under memory pressure without keeping the
|
||||
* content.
|
||||
*/
|
||||
#define AMDGPU_GEM_CREATE_DISCARDABLE (1 << 12)
|
||||
/* Flag that BO is shared coherently between multiple devices or CPU threads.
|
||||
* May depend on GPU instructions to flush caches to system scope explicitly.
|
||||
*
|
||||
* This influences the choice of MTYPE in the PTEs on GFXv9 and later GPUs and
|
||||
* may override the MTYPE selected in AMDGPU_VA_OP_MAP.
|
||||
*/
|
||||
#define AMDGPU_GEM_CREATE_COHERENT (1 << 13)
|
||||
/* Flag that BO should not be cached by GPU. Coherent without having to flush
|
||||
* GPU caches explicitly
|
||||
*
|
||||
* This influences the choice of MTYPE in the PTEs on GFXv9 and later GPUs and
|
||||
* may override the MTYPE selected in AMDGPU_VA_OP_MAP.
|
||||
*/
|
||||
#define AMDGPU_GEM_CREATE_UNCACHED (1 << 14)
|
||||
/* Flag that BO should be coherent across devices when using device-level
|
||||
* atomics. May depend on GPU instructions to flush caches to device scope
|
||||
* explicitly, promoting them to system scope automatically.
|
||||
*
|
||||
* This influences the choice of MTYPE in the PTEs on GFXv9 and later GPUs and
|
||||
* may override the MTYPE selected in AMDGPU_VA_OP_MAP.
|
||||
*/
|
||||
#define AMDGPU_GEM_CREATE_EXT_COHERENT (1 << 15)
|
||||
|
||||
struct drm_amdgpu_gem_create_in {
|
||||
/** the requested memory size */
|
||||
|
|
@ -204,6 +243,8 @@ union drm_amdgpu_bo_list {
|
|||
#define AMDGPU_CTX_OP_FREE_CTX 2
|
||||
#define AMDGPU_CTX_OP_QUERY_STATE 3
|
||||
#define AMDGPU_CTX_OP_QUERY_STATE2 4
|
||||
#define AMDGPU_CTX_OP_GET_STABLE_PSTATE 5
|
||||
#define AMDGPU_CTX_OP_SET_STABLE_PSTATE 6
|
||||
|
||||
/* GPU reset status */
|
||||
#define AMDGPU_CTX_NO_RESET 0
|
||||
|
|
@ -214,15 +255,17 @@ union drm_amdgpu_bo_list {
|
|||
/* unknown cause */
|
||||
#define AMDGPU_CTX_UNKNOWN_RESET 3
|
||||
|
||||
/* indicate gpu reset occured after ctx created */
|
||||
/* indicate gpu reset occurred after ctx created */
|
||||
#define AMDGPU_CTX_QUERY2_FLAGS_RESET (1<<0)
|
||||
/* indicate vram lost occured after ctx created */
|
||||
/* indicate vram lost occurred after ctx created */
|
||||
#define AMDGPU_CTX_QUERY2_FLAGS_VRAMLOST (1<<1)
|
||||
/* indicate some job from this context once cause gpu hang */
|
||||
#define AMDGPU_CTX_QUERY2_FLAGS_GUILTY (1<<2)
|
||||
/* indicate some errors are detected by RAS */
|
||||
#define AMDGPU_CTX_QUERY2_FLAGS_RAS_CE (1<<3)
|
||||
#define AMDGPU_CTX_QUERY2_FLAGS_RAS_UE (1<<4)
|
||||
/* indicate that the reset hasn't completed yet */
|
||||
#define AMDGPU_CTX_QUERY2_FLAGS_RESET_IN_PROGRESS (1<<5)
|
||||
|
||||
/* Context priority level */
|
||||
#define AMDGPU_CTX_PRIORITY_UNSET -2048
|
||||
|
|
@ -236,10 +279,18 @@ union drm_amdgpu_bo_list {
|
|||
#define AMDGPU_CTX_PRIORITY_HIGH 512
|
||||
#define AMDGPU_CTX_PRIORITY_VERY_HIGH 1023
|
||||
|
||||
/* select a stable profiling pstate for perfmon tools */
|
||||
#define AMDGPU_CTX_STABLE_PSTATE_FLAGS_MASK 0xf
|
||||
#define AMDGPU_CTX_STABLE_PSTATE_NONE 0
|
||||
#define AMDGPU_CTX_STABLE_PSTATE_STANDARD 1
|
||||
#define AMDGPU_CTX_STABLE_PSTATE_MIN_SCLK 2
|
||||
#define AMDGPU_CTX_STABLE_PSTATE_MIN_MCLK 3
|
||||
#define AMDGPU_CTX_STABLE_PSTATE_PEAK 4
|
||||
|
||||
struct drm_amdgpu_ctx_in {
|
||||
/** AMDGPU_CTX_OP_* */
|
||||
__u32 op;
|
||||
/** For future use, no flags defined so far */
|
||||
/** Flags */
|
||||
__u32 flags;
|
||||
__u32 ctx_id;
|
||||
/** AMDGPU_CTX_PRIORITY_* */
|
||||
|
|
@ -260,6 +311,11 @@ union drm_amdgpu_ctx_out {
|
|||
/** Reset status since the last call of the ioctl. */
|
||||
__u32 reset_status;
|
||||
} state;
|
||||
|
||||
struct {
|
||||
__u32 flags;
|
||||
__u32 _pad;
|
||||
} pstate;
|
||||
};
|
||||
|
||||
union drm_amdgpu_ctx {
|
||||
|
|
@ -267,6 +323,261 @@ union drm_amdgpu_ctx {
|
|||
union drm_amdgpu_ctx_out out;
|
||||
};
|
||||
|
||||
/* user queue IOCTL operations */
|
||||
#define AMDGPU_USERQ_OP_CREATE 1
|
||||
#define AMDGPU_USERQ_OP_FREE 2
|
||||
|
||||
/* queue priority levels */
|
||||
#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_MASK 0x3
|
||||
#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_SHIFT 0
|
||||
#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_NORMAL_LOW 0
|
||||
#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_LOW 1
|
||||
#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_NORMAL_HIGH 2
|
||||
#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_PRIORITY_HIGH 3 /* admin only */
|
||||
/* for queues that need access to protected content */
|
||||
#define AMDGPU_USERQ_CREATE_FLAGS_QUEUE_SECURE (1 << 2)
|
||||
|
||||
/*
|
||||
* This structure is a container to pass input configuration
|
||||
* info for all supported userqueue related operations.
|
||||
* For operation AMDGPU_USERQ_OP_CREATE: user is expected
|
||||
* to set all fields, excep the parameter 'queue_id'.
|
||||
* For operation AMDGPU_USERQ_OP_FREE: the only input parameter expected
|
||||
* to be set is 'queue_id', eveything else is ignored.
|
||||
*/
|
||||
struct drm_amdgpu_userq_in {
|
||||
/** AMDGPU_USERQ_OP_* */
|
||||
__u32 op;
|
||||
/** Queue id passed for operation USERQ_OP_FREE */
|
||||
__u32 queue_id;
|
||||
/** the target GPU engine to execute workload (AMDGPU_HW_IP_*) */
|
||||
__u32 ip_type;
|
||||
/**
|
||||
* @doorbell_handle: the handle of doorbell GEM object
|
||||
* associated to this userqueue client.
|
||||
*/
|
||||
__u32 doorbell_handle;
|
||||
/**
|
||||
* @doorbell_offset: 32-bit offset of the doorbell in the doorbell bo.
|
||||
* Kernel will generate absolute doorbell offset using doorbell_handle
|
||||
* and doorbell_offset in the doorbell bo.
|
||||
*/
|
||||
__u32 doorbell_offset;
|
||||
/**
|
||||
* @flags: flags used for queue parameters
|
||||
*/
|
||||
__u32 flags;
|
||||
|
||||
/**
|
||||
* @queue_va: Virtual address of the GPU memory which holds the queue
|
||||
* object. The queue holds the workload packets.
|
||||
*/
|
||||
__u64 queue_va;
|
||||
/**
|
||||
* @queue_size: Size of the queue in bytes, this needs to be 256-byte
|
||||
* aligned.
|
||||
*/
|
||||
__u64 queue_size;
|
||||
/**
|
||||
* @rptr_va : Virtual address of the GPU memory which holds the ring RPTR.
|
||||
* This object must be at least 8 byte in size and aligned to 8-byte offset.
|
||||
*/
|
||||
__u64 rptr_va;
|
||||
/**
|
||||
* @wptr_va : Virtual address of the GPU memory which holds the ring WPTR.
|
||||
* This object must be at least 8 byte in size and aligned to 8-byte offset.
|
||||
*
|
||||
* Queue, RPTR and WPTR can come from the same object, as long as the size
|
||||
* and alignment related requirements are met.
|
||||
*/
|
||||
__u64 wptr_va;
|
||||
/**
|
||||
* @mqd: MQD (memory queue descriptor) is a set of parameters which allow
|
||||
* the GPU to uniquely define and identify a usermode queue.
|
||||
*
|
||||
* MQD data can be of different size for different GPU IP/engine and
|
||||
* their respective versions/revisions, so this points to a __u64 *
|
||||
* which holds IP specific MQD of this usermode queue.
|
||||
*/
|
||||
__u64 mqd;
|
||||
/**
|
||||
* @size: size of MQD data in bytes, it must match the MQD structure
|
||||
* size of the respective engine/revision defined in UAPI for ex, for
|
||||
* gfx11 workloads, size = sizeof(drm_amdgpu_userq_mqd_gfx11).
|
||||
*/
|
||||
__u64 mqd_size;
|
||||
};
|
||||
|
||||
/* The structure to carry output of userqueue ops */
|
||||
struct drm_amdgpu_userq_out {
|
||||
/**
|
||||
* For operation AMDGPU_USERQ_OP_CREATE: This field contains a unique
|
||||
* queue ID to represent the newly created userqueue in the system, otherwise
|
||||
* it should be ignored.
|
||||
*/
|
||||
__u32 queue_id;
|
||||
__u32 _pad;
|
||||
};
|
||||
|
||||
union drm_amdgpu_userq {
|
||||
struct drm_amdgpu_userq_in in;
|
||||
struct drm_amdgpu_userq_out out;
|
||||
};
|
||||
|
||||
/* GFX V11 IP specific MQD parameters */
|
||||
struct drm_amdgpu_userq_mqd_gfx11 {
|
||||
/**
|
||||
* @shadow_va: Virtual address of the GPU memory to hold the shadow buffer.
|
||||
* Use AMDGPU_INFO_IOCTL to find the exact size of the object.
|
||||
*/
|
||||
__u64 shadow_va;
|
||||
/**
|
||||
* @csa_va: Virtual address of the GPU memory to hold the CSA buffer.
|
||||
* Use AMDGPU_INFO_IOCTL to find the exact size of the object.
|
||||
*/
|
||||
__u64 csa_va;
|
||||
};
|
||||
|
||||
/* GFX V11 SDMA IP specific MQD parameters */
|
||||
struct drm_amdgpu_userq_mqd_sdma_gfx11 {
|
||||
/**
|
||||
* @csa_va: Virtual address of the GPU memory to hold the CSA buffer.
|
||||
* This must be a from a separate GPU object, and use AMDGPU_INFO IOCTL
|
||||
* to get the size.
|
||||
*/
|
||||
__u64 csa_va;
|
||||
};
|
||||
|
||||
/* GFX V11 Compute IP specific MQD parameters */
|
||||
struct drm_amdgpu_userq_mqd_compute_gfx11 {
|
||||
/**
|
||||
* @eop_va: Virtual address of the GPU memory to hold the EOP buffer.
|
||||
* This must be a from a separate GPU object, and use AMDGPU_INFO IOCTL
|
||||
* to get the size.
|
||||
*/
|
||||
__u64 eop_va;
|
||||
};
|
||||
|
||||
/* userq signal/wait ioctl */
|
||||
struct drm_amdgpu_userq_signal {
|
||||
/**
|
||||
* @queue_id: Queue handle used by the userq fence creation function
|
||||
* to retrieve the WPTR.
|
||||
*/
|
||||
__u32 queue_id;
|
||||
__u32 pad;
|
||||
/**
|
||||
* @syncobj_handles: The list of syncobj handles submitted by the user queue
|
||||
* job to be signaled.
|
||||
*/
|
||||
__u64 syncobj_handles;
|
||||
/**
|
||||
* @num_syncobj_handles: A count that represents the number of syncobj handles in
|
||||
* @syncobj_handles.
|
||||
*/
|
||||
__u64 num_syncobj_handles;
|
||||
/**
|
||||
* @bo_read_handles: The list of BO handles that the submitted user queue job
|
||||
* is using for read only. This will update BO fences in the kernel.
|
||||
*/
|
||||
__u64 bo_read_handles;
|
||||
/**
|
||||
* @bo_write_handles: The list of BO handles that the submitted user queue job
|
||||
* is using for write only. This will update BO fences in the kernel.
|
||||
*/
|
||||
__u64 bo_write_handles;
|
||||
/**
|
||||
* @num_bo_read_handles: A count that represents the number of read BO handles in
|
||||
* @bo_read_handles.
|
||||
*/
|
||||
__u32 num_bo_read_handles;
|
||||
/**
|
||||
* @num_bo_write_handles: A count that represents the number of write BO handles in
|
||||
* @bo_write_handles.
|
||||
*/
|
||||
__u32 num_bo_write_handles;
|
||||
|
||||
};
|
||||
|
||||
struct drm_amdgpu_userq_fence_info {
|
||||
/**
|
||||
* @va: A gpu address allocated for each queue which stores the
|
||||
* read pointer (RPTR) value.
|
||||
*/
|
||||
__u64 va;
|
||||
/**
|
||||
* @value: A 64 bit value represents the write pointer (WPTR) of the
|
||||
* queue commands which compared with the RPTR value to signal the
|
||||
* fences.
|
||||
*/
|
||||
__u64 value;
|
||||
};
|
||||
|
||||
struct drm_amdgpu_userq_wait {
|
||||
/**
|
||||
* @waitq_id: Queue handle used by the userq wait IOCTL to retrieve the
|
||||
* wait queue and maintain the fence driver references in it.
|
||||
*/
|
||||
__u32 waitq_id;
|
||||
__u32 pad;
|
||||
/**
|
||||
* @syncobj_handles: The list of syncobj handles submitted by the user queue
|
||||
* job to get the va/value pairs.
|
||||
*/
|
||||
__u64 syncobj_handles;
|
||||
/**
|
||||
* @syncobj_timeline_handles: The list of timeline syncobj handles submitted by
|
||||
* the user queue job to get the va/value pairs at given @syncobj_timeline_points.
|
||||
*/
|
||||
__u64 syncobj_timeline_handles;
|
||||
/**
|
||||
* @syncobj_timeline_points: The list of timeline syncobj points submitted by the
|
||||
* user queue job for the corresponding @syncobj_timeline_handles.
|
||||
*/
|
||||
__u64 syncobj_timeline_points;
|
||||
/**
|
||||
* @bo_read_handles: The list of read BO handles submitted by the user queue
|
||||
* job to get the va/value pairs.
|
||||
*/
|
||||
__u64 bo_read_handles;
|
||||
/**
|
||||
* @bo_write_handles: The list of write BO handles submitted by the user queue
|
||||
* job to get the va/value pairs.
|
||||
*/
|
||||
__u64 bo_write_handles;
|
||||
/**
|
||||
* @num_syncobj_timeline_handles: A count that represents the number of timeline
|
||||
* syncobj handles in @syncobj_timeline_handles.
|
||||
*/
|
||||
__u16 num_syncobj_timeline_handles;
|
||||
/**
|
||||
* @num_fences: This field can be used both as input and output. As input it defines
|
||||
* the maximum number of fences that can be returned and as output it will specify
|
||||
* how many fences were actually returned from the ioctl.
|
||||
*/
|
||||
__u16 num_fences;
|
||||
/**
|
||||
* @num_syncobj_handles: A count that represents the number of syncobj handles in
|
||||
* @syncobj_handles.
|
||||
*/
|
||||
__u32 num_syncobj_handles;
|
||||
/**
|
||||
* @num_bo_read_handles: A count that represents the number of read BO handles in
|
||||
* @bo_read_handles.
|
||||
*/
|
||||
__u32 num_bo_read_handles;
|
||||
/**
|
||||
* @num_bo_write_handles: A count that represents the number of write BO handles in
|
||||
* @bo_write_handles.
|
||||
*/
|
||||
__u32 num_bo_write_handles;
|
||||
/**
|
||||
* @out_fences: The field is a return value from the ioctl containing the list of
|
||||
* address/value pairs to wait for.
|
||||
*/
|
||||
__u64 out_fences;
|
||||
};
|
||||
|
||||
/* vm ioctl */
|
||||
#define AMDGPU_VM_OP_RESERVE_VMID 1
|
||||
#define AMDGPU_VM_OP_UNRESERVE_VMID 2
|
||||
|
|
@ -342,7 +653,7 @@ struct drm_amdgpu_gem_userptr {
|
|||
#define AMDGPU_TILING_NUM_BANKS_SHIFT 21
|
||||
#define AMDGPU_TILING_NUM_BANKS_MASK 0x3
|
||||
|
||||
/* GFX9 and later: */
|
||||
/* GFX9 - GFX11: */
|
||||
#define AMDGPU_TILING_SWIZZLE_MODE_SHIFT 0
|
||||
#define AMDGPU_TILING_SWIZZLE_MODE_MASK 0x1f
|
||||
#define AMDGPU_TILING_DCC_OFFSET_256B_SHIFT 5
|
||||
|
|
@ -356,6 +667,17 @@ struct drm_amdgpu_gem_userptr {
|
|||
#define AMDGPU_TILING_SCANOUT_SHIFT 63
|
||||
#define AMDGPU_TILING_SCANOUT_MASK 0x1
|
||||
|
||||
/* GFX12 and later: */
|
||||
#define AMDGPU_TILING_GFX12_SWIZZLE_MODE_SHIFT 0
|
||||
#define AMDGPU_TILING_GFX12_SWIZZLE_MODE_MASK 0x7
|
||||
/* These are DCC recompression setting for memory management: */
|
||||
#define AMDGPU_TILING_GFX12_DCC_MAX_COMPRESSED_BLOCK_SHIFT 3
|
||||
#define AMDGPU_TILING_GFX12_DCC_MAX_COMPRESSED_BLOCK_MASK 0x3 /* 0:64B, 1:128B, 2:256B */
|
||||
#define AMDGPU_TILING_GFX12_DCC_NUMBER_TYPE_SHIFT 5
|
||||
#define AMDGPU_TILING_GFX12_DCC_NUMBER_TYPE_MASK 0x7 /* CB_COLOR0_INFO.NUMBER_TYPE */
|
||||
#define AMDGPU_TILING_GFX12_DCC_DATA_FORMAT_SHIFT 8
|
||||
#define AMDGPU_TILING_GFX12_DCC_DATA_FORMAT_MASK 0x3f /* [0:4]:CB_COLOR0_INFO.FORMAT, [5]:MM */
|
||||
|
||||
/* Set/Get helpers for tiling flags. */
|
||||
#define AMDGPU_TILING_SET(field, value) \
|
||||
(((__u64)(value) & AMDGPU_TILING_##field##_MASK) << AMDGPU_TILING_##field##_SHIFT)
|
||||
|
|
@ -512,6 +834,8 @@ struct drm_amdgpu_gem_op {
|
|||
#define AMDGPU_VM_MTYPE_UC (4 << 5)
|
||||
/* Use Read Write MTYPE instead of default MTYPE */
|
||||
#define AMDGPU_VM_MTYPE_RW (5 << 5)
|
||||
/* don't allocate MALL */
|
||||
#define AMDGPU_VM_PAGE_NOALLOC (1 << 9)
|
||||
|
||||
struct drm_amdgpu_gem_va {
|
||||
/** GEM object handle */
|
||||
|
|
@ -527,6 +851,19 @@ struct drm_amdgpu_gem_va {
|
|||
__u64 offset_in_bo;
|
||||
/** Specify mapping size. Must be correctly aligned. */
|
||||
__u64 map_size;
|
||||
/**
|
||||
* vm_timeline_point is a sequence number used to add new timeline point.
|
||||
*/
|
||||
__u64 vm_timeline_point;
|
||||
/**
|
||||
* The vm page table update fence is installed in given vm_timeline_syncobj_out
|
||||
* at vm_timeline_point.
|
||||
*/
|
||||
__u32 vm_timeline_syncobj_out;
|
||||
/** the number of syncobj handles in @input_fence_syncobj_handles */
|
||||
__u32 num_syncobj_handles;
|
||||
/** Array of sync object handle to wait for given input fences */
|
||||
__u64 input_fence_syncobj_handles;
|
||||
};
|
||||
|
||||
#define AMDGPU_HW_IP_GFX 0
|
||||
|
|
@ -536,9 +873,14 @@ struct drm_amdgpu_gem_va {
|
|||
#define AMDGPU_HW_IP_VCE 4
|
||||
#define AMDGPU_HW_IP_UVD_ENC 5
|
||||
#define AMDGPU_HW_IP_VCN_DEC 6
|
||||
/*
|
||||
* From VCN4, AMDGPU_HW_IP_VCN_ENC is re-used to support
|
||||
* both encoding and decoding jobs.
|
||||
*/
|
||||
#define AMDGPU_HW_IP_VCN_ENC 7
|
||||
#define AMDGPU_HW_IP_VCN_JPEG 8
|
||||
#define AMDGPU_HW_IP_NUM 9
|
||||
#define AMDGPU_HW_IP_VPE 9
|
||||
#define AMDGPU_HW_IP_NUM 10
|
||||
|
||||
#define AMDGPU_HW_IP_INSTANCE_MAX_COUNT 1
|
||||
|
||||
|
|
@ -551,6 +893,7 @@ struct drm_amdgpu_gem_va {
|
|||
#define AMDGPU_CHUNK_ID_SCHEDULED_DEPENDENCIES 0x07
|
||||
#define AMDGPU_CHUNK_ID_SYNCOBJ_TIMELINE_WAIT 0x08
|
||||
#define AMDGPU_CHUNK_ID_SYNCOBJ_TIMELINE_SIGNAL 0x09
|
||||
#define AMDGPU_CHUNK_ID_CP_GFX_SHADOW 0x0a
|
||||
|
||||
struct drm_amdgpu_cs_chunk {
|
||||
__u32 chunk_id;
|
||||
|
|
@ -667,6 +1010,15 @@ struct drm_amdgpu_cs_chunk_data {
|
|||
};
|
||||
};
|
||||
|
||||
#define AMDGPU_CS_CHUNK_CP_GFX_SHADOW_FLAGS_INIT_SHADOW 0x1
|
||||
|
||||
struct drm_amdgpu_cs_chunk_cp_gfx_shadow {
|
||||
__u64 shadow_va;
|
||||
__u64 csa_va;
|
||||
__u64 gds_va;
|
||||
__u64 flags;
|
||||
};
|
||||
|
||||
/*
|
||||
* Query h/w info: Flag that this is integrated (a.h.a. fusion) GPU
|
||||
*
|
||||
|
|
@ -674,6 +1026,17 @@ struct drm_amdgpu_cs_chunk_data {
|
|||
#define AMDGPU_IDS_FLAGS_FUSION 0x1
|
||||
#define AMDGPU_IDS_FLAGS_PREEMPTION 0x2
|
||||
#define AMDGPU_IDS_FLAGS_TMZ 0x4
|
||||
#define AMDGPU_IDS_FLAGS_CONFORMANT_TRUNC_COORD 0x8
|
||||
|
||||
/*
|
||||
* Query h/w info: Flag identifying VF/PF/PT mode
|
||||
*
|
||||
*/
|
||||
#define AMDGPU_IDS_FLAGS_MODE_MASK 0x300
|
||||
#define AMDGPU_IDS_FLAGS_MODE_SHIFT 0x8
|
||||
#define AMDGPU_IDS_FLAGS_MODE_PF 0x0
|
||||
#define AMDGPU_IDS_FLAGS_MODE_VF 0x1
|
||||
#define AMDGPU_IDS_FLAGS_MODE_PT 0x2
|
||||
|
||||
/* indicate if acceleration can be working */
|
||||
#define AMDGPU_INFO_ACCEL_WORKING 0x00
|
||||
|
|
@ -726,6 +1089,20 @@ struct drm_amdgpu_cs_chunk_data {
|
|||
#define AMDGPU_INFO_FW_DMCUB 0x14
|
||||
/* Subquery id: Query TOC firmware version */
|
||||
#define AMDGPU_INFO_FW_TOC 0x15
|
||||
/* Subquery id: Query CAP firmware version */
|
||||
#define AMDGPU_INFO_FW_CAP 0x16
|
||||
/* Subquery id: Query GFX RLCP firmware version */
|
||||
#define AMDGPU_INFO_FW_GFX_RLCP 0x17
|
||||
/* Subquery id: Query GFX RLCV firmware version */
|
||||
#define AMDGPU_INFO_FW_GFX_RLCV 0x18
|
||||
/* Subquery id: Query MES_KIQ firmware version */
|
||||
#define AMDGPU_INFO_FW_MES_KIQ 0x19
|
||||
/* Subquery id: Query MES firmware version */
|
||||
#define AMDGPU_INFO_FW_MES 0x1a
|
||||
/* Subquery id: Query IMU firmware version */
|
||||
#define AMDGPU_INFO_FW_IMU 0x1b
|
||||
/* Subquery id: Query VPE firmware version */
|
||||
#define AMDGPU_INFO_FW_VPE 0x1c
|
||||
|
||||
/* number of bytes moved for TTM migration */
|
||||
#define AMDGPU_INFO_NUM_BYTES_MOVED 0x0f
|
||||
|
|
@ -755,6 +1132,8 @@ struct drm_amdgpu_cs_chunk_data {
|
|||
#define AMDGPU_INFO_VBIOS_SIZE 0x1
|
||||
/* Subquery id: Query vbios image */
|
||||
#define AMDGPU_INFO_VBIOS_IMAGE 0x2
|
||||
/* Subquery id: Query vbios info */
|
||||
#define AMDGPU_INFO_VBIOS_INFO 0x3
|
||||
/* Query UVD handles */
|
||||
#define AMDGPU_INFO_NUM_HANDLES 0x1C
|
||||
/* Query sensor related information */
|
||||
|
|
@ -777,18 +1156,17 @@ struct drm_amdgpu_cs_chunk_data {
|
|||
#define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_SCLK 0x8
|
||||
/* Subquery id: Query GPU stable pstate memory clock */
|
||||
#define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_MCLK 0x9
|
||||
/* Subquery id: Query GPU peak pstate shader clock */
|
||||
#define AMDGPU_INFO_SENSOR_PEAK_PSTATE_GFX_SCLK 0xa
|
||||
/* Subquery id: Query GPU peak pstate memory clock */
|
||||
#define AMDGPU_INFO_SENSOR_PEAK_PSTATE_GFX_MCLK 0xb
|
||||
/* Subquery id: Query input GPU power */
|
||||
#define AMDGPU_INFO_SENSOR_GPU_INPUT_POWER 0xc
|
||||
/* Number of VRAM page faults on CPU access. */
|
||||
#define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E
|
||||
#define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F
|
||||
/* query ras mask of enabled features*/
|
||||
#define AMDGPU_INFO_RAS_ENABLED_FEATURES 0x20
|
||||
/* query video encode/decode caps */
|
||||
#define AMDGPU_INFO_VIDEO_CAPS 0x21
|
||||
/* Subquery id: Decode */
|
||||
#define AMDGPU_INFO_VIDEO_CAPS_DECODE 0
|
||||
/* Subquery id: Encode */
|
||||
#define AMDGPU_INFO_VIDEO_CAPS_ENCODE 1
|
||||
|
||||
/* RAS MASK: UMC (VRAM) */
|
||||
#define AMDGPU_INFO_RAS_ENABLED_UMC (1 << 0)
|
||||
/* RAS MASK: SDMA */
|
||||
|
|
@ -817,6 +1195,18 @@ struct drm_amdgpu_cs_chunk_data {
|
|||
#define AMDGPU_INFO_RAS_ENABLED_MP1 (1 << 12)
|
||||
/* RAS MASK: FUSE */
|
||||
#define AMDGPU_INFO_RAS_ENABLED_FUSE (1 << 13)
|
||||
/* query video encode/decode caps */
|
||||
#define AMDGPU_INFO_VIDEO_CAPS 0x21
|
||||
/* Subquery id: Decode */
|
||||
#define AMDGPU_INFO_VIDEO_CAPS_DECODE 0
|
||||
/* Subquery id: Encode */
|
||||
#define AMDGPU_INFO_VIDEO_CAPS_ENCODE 1
|
||||
/* Query the max number of IBs per gang per submission */
|
||||
#define AMDGPU_INFO_MAX_IBS 0x22
|
||||
/* query last page fault info */
|
||||
#define AMDGPU_INFO_GPUVM_FAULT 0x23
|
||||
/* query FW object size and alignment */
|
||||
#define AMDGPU_INFO_UQ_FW_AREAS 0x24
|
||||
|
||||
#define AMDGPU_INFO_MMR_SE_INDEX_SHIFT 0
|
||||
#define AMDGPU_INFO_MMR_SE_INDEX_MASK 0xff
|
||||
|
|
@ -948,6 +1338,15 @@ struct drm_amdgpu_info_firmware {
|
|||
__u32 feature;
|
||||
};
|
||||
|
||||
struct drm_amdgpu_info_vbios {
|
||||
__u8 name[64];
|
||||
__u8 vbios_pn[64];
|
||||
__u32 version;
|
||||
__u32 pad;
|
||||
__u8 vbios_ver_str[32];
|
||||
__u8 date[32];
|
||||
};
|
||||
|
||||
#define AMDGPU_VRAM_TYPE_UNKNOWN 0
|
||||
#define AMDGPU_VRAM_TYPE_GDDR1 1
|
||||
#define AMDGPU_VRAM_TYPE_DDR2 2
|
||||
|
|
@ -959,6 +1358,8 @@ struct drm_amdgpu_info_firmware {
|
|||
#define AMDGPU_VRAM_TYPE_DDR4 8
|
||||
#define AMDGPU_VRAM_TYPE_GDDR6 9
|
||||
#define AMDGPU_VRAM_TYPE_DDR5 10
|
||||
#define AMDGPU_VRAM_TYPE_LPDDR4 11
|
||||
#define AMDGPU_VRAM_TYPE_LPDDR5 12
|
||||
|
||||
struct drm_amdgpu_info_device {
|
||||
/** PCI Device ID */
|
||||
|
|
@ -984,7 +1385,8 @@ struct drm_amdgpu_info_device {
|
|||
__u32 enabled_rb_pipes_mask;
|
||||
__u32 num_rb_pipes;
|
||||
__u32 num_hw_gfx_contexts;
|
||||
__u32 _pad;
|
||||
/* PCIe version (the smaller of the GPU and the CPU/motherboard) */
|
||||
__u32 pcie_gen;
|
||||
__u64 ids_flags;
|
||||
/** Starting virtual address for UMDs. */
|
||||
__u64 virtual_address_offset;
|
||||
|
|
@ -1031,7 +1433,8 @@ struct drm_amdgpu_info_device {
|
|||
__u32 gs_prim_buffer_depth;
|
||||
/* max gs wavefront per vgt*/
|
||||
__u32 max_gs_waves_per_vgt;
|
||||
__u32 _pad1;
|
||||
/* PCIe number of lanes (the smaller of the GPU and the CPU/motherboard) */
|
||||
__u32 pcie_num_lanes;
|
||||
/* always on cu bitmap */
|
||||
__u32 cu_ao_bitmap[4][4];
|
||||
/** Starting high virtual address for UMDs. */
|
||||
|
|
@ -1042,6 +1445,29 @@ struct drm_amdgpu_info_device {
|
|||
__u32 pa_sc_tile_steering_override;
|
||||
/* disabled TCCs */
|
||||
__u64 tcc_disabled_mask;
|
||||
__u64 min_engine_clock;
|
||||
__u64 min_memory_clock;
|
||||
/* The following fields are only set on gfx11+, older chips set 0. */
|
||||
__u32 tcp_cache_size; /* AKA GL0, VMEM cache */
|
||||
__u32 num_sqc_per_wgp;
|
||||
__u32 sqc_data_cache_size; /* AKA SMEM cache */
|
||||
__u32 sqc_inst_cache_size;
|
||||
__u32 gl1c_cache_size;
|
||||
__u32 gl2c_cache_size;
|
||||
__u64 mall_size; /* AKA infinity cache */
|
||||
/* high 32 bits of the rb pipes mask */
|
||||
__u32 enabled_rb_pipes_mask_hi;
|
||||
/* shadow area size for gfx11 */
|
||||
__u32 shadow_size;
|
||||
/* shadow area base virtual alignment for gfx11 */
|
||||
__u32 shadow_alignment;
|
||||
/* context save area size for gfx11 */
|
||||
__u32 csa_size;
|
||||
/* context save area base virtual alignment for gfx11 */
|
||||
__u32 csa_alignment;
|
||||
/* Userq IP mask (1 << AMDGPU_HW_IP_*) */
|
||||
__u32 userq_ip_mask;
|
||||
__u32 pad;
|
||||
};
|
||||
|
||||
struct drm_amdgpu_info_hw_ip {
|
||||
|
|
@ -1056,7 +1482,29 @@ struct drm_amdgpu_info_hw_ip {
|
|||
__u32 ib_size_alignment;
|
||||
/** Bitmask of available rings. Bit 0 means ring 0, etc. */
|
||||
__u32 available_rings;
|
||||
__u32 _pad;
|
||||
/** version info: bits 23:16 major, 15:8 minor, 7:0 revision */
|
||||
__u32 ip_discovery_version;
|
||||
};
|
||||
|
||||
/* GFX metadata BO sizes and alignment info (in bytes) */
|
||||
struct drm_amdgpu_info_uq_fw_areas_gfx {
|
||||
/* shadow area size */
|
||||
__u32 shadow_size;
|
||||
/* shadow area base virtual mem alignment */
|
||||
__u32 shadow_alignment;
|
||||
/* context save area size */
|
||||
__u32 csa_size;
|
||||
/* context save area base virtual mem alignment */
|
||||
__u32 csa_alignment;
|
||||
};
|
||||
|
||||
/* IP specific metadata related information used in the
|
||||
* subquery AMDGPU_INFO_UQ_FW_AREAS
|
||||
*/
|
||||
struct drm_amdgpu_info_uq_fw_areas {
|
||||
union {
|
||||
struct drm_amdgpu_info_uq_fw_areas_gfx gfx;
|
||||
};
|
||||
};
|
||||
|
||||
struct drm_amdgpu_info_num_handles {
|
||||
|
|
@ -1108,6 +1556,20 @@ struct drm_amdgpu_info_video_caps {
|
|||
struct drm_amdgpu_info_video_codec_info codec_info[AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_COUNT];
|
||||
};
|
||||
|
||||
#define AMDGPU_VMHUB_TYPE_MASK 0xff
|
||||
#define AMDGPU_VMHUB_TYPE_SHIFT 0
|
||||
#define AMDGPU_VMHUB_TYPE_GFX 0
|
||||
#define AMDGPU_VMHUB_TYPE_MM0 1
|
||||
#define AMDGPU_VMHUB_TYPE_MM1 2
|
||||
#define AMDGPU_VMHUB_IDX_MASK 0xff00
|
||||
#define AMDGPU_VMHUB_IDX_SHIFT 8
|
||||
|
||||
struct drm_amdgpu_info_gpuvm_fault {
|
||||
__u64 addr;
|
||||
__u32 status;
|
||||
__u32 vmhub;
|
||||
};
|
||||
|
||||
/*
|
||||
* Supported GPU families
|
||||
*/
|
||||
|
|
@ -1121,6 +1583,13 @@ struct drm_amdgpu_info_video_caps {
|
|||
#define AMDGPU_FAMILY_RV 142 /* Raven */
|
||||
#define AMDGPU_FAMILY_NV 143 /* Navi10 */
|
||||
#define AMDGPU_FAMILY_VGH 144 /* Van Gogh */
|
||||
#define AMDGPU_FAMILY_GC_11_0_0 145 /* GC 11.0.0 */
|
||||
#define AMDGPU_FAMILY_YC 146 /* Yellow Carp */
|
||||
#define AMDGPU_FAMILY_GC_11_0_1 148 /* GC 11.0.1 */
|
||||
#define AMDGPU_FAMILY_GC_10_3_6 149 /* GC 10.3.6 */
|
||||
#define AMDGPU_FAMILY_GC_10_3_7 151 /* GC 10.3.7 */
|
||||
#define AMDGPU_FAMILY_GC_11_5_0 150 /* GC 11.5.0 */
|
||||
#define AMDGPU_FAMILY_GC_12_0_0 152 /* GC 12.0.0 */
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
/**
|
||||
* \file drm.h
|
||||
/*
|
||||
* Header for the Direct Rendering Manager
|
||||
*
|
||||
* \author Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
* Author: Rickard E. (Rik) Faith <faith@valinux.com>
|
||||
*
|
||||
* \par Acknowledgments:
|
||||
* Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic \c cmpxchg.
|
||||
* Acknowledgments:
|
||||
* Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic cmpxchg.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
@ -79,7 +78,7 @@ typedef unsigned int drm_context_t;
|
|||
typedef unsigned int drm_drawable_t;
|
||||
typedef unsigned int drm_magic_t;
|
||||
|
||||
/**
|
||||
/*
|
||||
* Cliprect.
|
||||
*
|
||||
* \warning: If you change this structure, make sure you change
|
||||
|
|
@ -95,7 +94,7 @@ struct drm_clip_rect {
|
|||
unsigned short y2;
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* Drawable information.
|
||||
*/
|
||||
struct drm_drawable_info {
|
||||
|
|
@ -103,7 +102,7 @@ struct drm_drawable_info {
|
|||
struct drm_clip_rect *rects;
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* Texture region,
|
||||
*/
|
||||
struct drm_tex_region {
|
||||
|
|
@ -114,7 +113,7 @@ struct drm_tex_region {
|
|||
unsigned int age;
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* Hardware lock.
|
||||
*
|
||||
* The lock structure is a simple cache-line aligned integer. To avoid
|
||||
|
|
@ -126,7 +125,7 @@ struct drm_hw_lock {
|
|||
char padding[60]; /**< Pad to cache line */
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_VERSION ioctl argument type.
|
||||
*
|
||||
* \sa drmGetVersion().
|
||||
|
|
@ -143,7 +142,7 @@ struct drm_version {
|
|||
char *desc; /**< User-space buffer to hold desc */
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_GET_UNIQUE ioctl argument type.
|
||||
*
|
||||
* \sa drmGetBusid() and drmSetBusId().
|
||||
|
|
@ -162,7 +161,7 @@ struct drm_block {
|
|||
int unused;
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_CONTROL ioctl argument type.
|
||||
*
|
||||
* \sa drmCtlInstHandler() and drmCtlUninstHandler().
|
||||
|
|
@ -177,7 +176,7 @@ struct drm_control {
|
|||
int irq;
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* Type of memory to map.
|
||||
*/
|
||||
enum drm_map_type {
|
||||
|
|
@ -189,7 +188,7 @@ enum drm_map_type {
|
|||
_DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* Memory mapping flags.
|
||||
*/
|
||||
enum drm_map_flags {
|
||||
|
|
@ -208,7 +207,7 @@ struct drm_ctx_priv_map {
|
|||
void *handle; /**< Handle of map */
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls
|
||||
* argument type.
|
||||
*
|
||||
|
|
@ -225,7 +224,7 @@ struct drm_map {
|
|||
/* Private data */
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_GET_CLIENT ioctl argument type.
|
||||
*/
|
||||
struct drm_client {
|
||||
|
|
@ -257,7 +256,7 @@ enum drm_stat_type {
|
|||
/* Add to the *END* of the list */
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_GET_STATS ioctl argument type.
|
||||
*/
|
||||
struct drm_stats {
|
||||
|
|
@ -268,7 +267,7 @@ struct drm_stats {
|
|||
} data[15];
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* Hardware locking flags.
|
||||
*/
|
||||
enum drm_lock_flags {
|
||||
|
|
@ -283,7 +282,7 @@ enum drm_lock_flags {
|
|||
_DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type.
|
||||
*
|
||||
* \sa drmGetLock() and drmUnlock().
|
||||
|
|
@ -293,7 +292,7 @@ struct drm_lock {
|
|||
enum drm_lock_flags flags;
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DMA flags
|
||||
*
|
||||
* \warning
|
||||
|
|
@ -322,7 +321,7 @@ enum drm_dma_flags {
|
|||
_DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type.
|
||||
*
|
||||
* \sa drmAddBufs().
|
||||
|
|
@ -345,7 +344,7 @@ struct drm_buf_desc {
|
|||
*/
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_INFO_BUFS ioctl argument type.
|
||||
*/
|
||||
struct drm_buf_info {
|
||||
|
|
@ -353,7 +352,7 @@ struct drm_buf_info {
|
|||
struct drm_buf_desc *list;
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_FREE_BUFS ioctl argument type.
|
||||
*/
|
||||
struct drm_buf_free {
|
||||
|
|
@ -361,7 +360,7 @@ struct drm_buf_free {
|
|||
int *list;
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* Buffer information
|
||||
*
|
||||
* \sa drm_buf_map.
|
||||
|
|
@ -373,7 +372,7 @@ struct drm_buf_pub {
|
|||
void *address; /**< Address of buffer */
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_MAP_BUFS ioctl argument type.
|
||||
*/
|
||||
struct drm_buf_map {
|
||||
|
|
@ -386,7 +385,7 @@ struct drm_buf_map {
|
|||
struct drm_buf_pub *list; /**< Buffer information */
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_DMA ioctl argument type.
|
||||
*
|
||||
* Indices here refer to the offset into the buffer list in drm_buf_get.
|
||||
|
|
@ -411,7 +410,7 @@ enum drm_ctx_flags {
|
|||
_DRM_CONTEXT_2DONLY = 0x02
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_ADD_CTX ioctl argument type.
|
||||
*
|
||||
* \sa drmCreateContext() and drmDestroyContext().
|
||||
|
|
@ -421,7 +420,7 @@ struct drm_ctx {
|
|||
enum drm_ctx_flags flags;
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_RES_CTX ioctl argument type.
|
||||
*/
|
||||
struct drm_ctx_res {
|
||||
|
|
@ -429,14 +428,14 @@ struct drm_ctx_res {
|
|||
struct drm_ctx *contexts;
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type.
|
||||
*/
|
||||
struct drm_draw {
|
||||
drm_drawable_t handle;
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_UPDATE_DRAW ioctl argument type.
|
||||
*/
|
||||
typedef enum {
|
||||
|
|
@ -450,14 +449,14 @@ struct drm_update_draw {
|
|||
unsigned long long data;
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type.
|
||||
*/
|
||||
struct drm_auth {
|
||||
drm_magic_t magic;
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_IRQ_BUSID ioctl argument type.
|
||||
*
|
||||
* \sa drmGetInterruptFromBusID().
|
||||
|
|
@ -499,7 +498,7 @@ struct drm_wait_vblank_reply {
|
|||
long tval_usec;
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_WAIT_VBLANK ioctl argument type.
|
||||
*
|
||||
* \sa drmWaitVBlank().
|
||||
|
|
@ -512,7 +511,7 @@ union drm_wait_vblank {
|
|||
#define _DRM_PRE_MODESET 1
|
||||
#define _DRM_POST_MODESET 2
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_MODESET_CTL ioctl argument type
|
||||
*
|
||||
* \sa drmModesetCtl().
|
||||
|
|
@ -522,7 +521,7 @@ struct drm_modeset_ctl {
|
|||
__u32 cmd;
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_AGP_ENABLE ioctl argument type.
|
||||
*
|
||||
* \sa drmAgpEnable().
|
||||
|
|
@ -531,7 +530,7 @@ struct drm_agp_mode {
|
|||
unsigned long mode; /**< AGP mode */
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type.
|
||||
*
|
||||
* \sa drmAgpAlloc() and drmAgpFree().
|
||||
|
|
@ -543,7 +542,7 @@ struct drm_agp_buffer {
|
|||
unsigned long physical; /**< Physical used by i810 */
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type.
|
||||
*
|
||||
* \sa drmAgpBind() and drmAgpUnbind().
|
||||
|
|
@ -553,7 +552,7 @@ struct drm_agp_binding {
|
|||
unsigned long offset; /**< In bytes -- will round to page boundary */
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_AGP_INFO ioctl argument type.
|
||||
*
|
||||
* \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(),
|
||||
|
|
@ -574,7 +573,7 @@ struct drm_agp_info {
|
|||
unsigned short id_device;
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_SG_ALLOC ioctl argument type.
|
||||
*/
|
||||
struct drm_scatter_gather {
|
||||
|
|
@ -582,7 +581,7 @@ struct drm_scatter_gather {
|
|||
unsigned long handle; /**< Used for mapping / unmapping */
|
||||
};
|
||||
|
||||
/**
|
||||
/*
|
||||
* DRM_IOCTL_SET_VERSION ioctl argument type.
|
||||
*/
|
||||
struct drm_set_version {
|
||||
|
|
@ -592,61 +591,223 @@ struct drm_set_version {
|
|||
int drm_dd_minor;
|
||||
};
|
||||
|
||||
/** DRM_IOCTL_GEM_CLOSE ioctl argument type */
|
||||
/**
|
||||
* struct drm_gem_close - Argument for &DRM_IOCTL_GEM_CLOSE ioctl.
|
||||
* @handle: Handle of the object to be closed.
|
||||
* @pad: Padding.
|
||||
*
|
||||
* Releases the handle to an mm object.
|
||||
*/
|
||||
struct drm_gem_close {
|
||||
/** Handle of the object to be closed. */
|
||||
__u32 handle;
|
||||
__u32 pad;
|
||||
};
|
||||
|
||||
/** DRM_IOCTL_GEM_FLINK ioctl argument type */
|
||||
/**
|
||||
* struct drm_gem_flink - Argument for &DRM_IOCTL_GEM_FLINK ioctl.
|
||||
* @handle: Handle for the object being named.
|
||||
* @name: Returned global name.
|
||||
*
|
||||
* Create a global name for an object, returning the name.
|
||||
*
|
||||
* Note that the name does not hold a reference; when the object
|
||||
* is freed, the name goes away.
|
||||
*/
|
||||
struct drm_gem_flink {
|
||||
/** Handle for the object being named */
|
||||
__u32 handle;
|
||||
|
||||
/** Returned global name */
|
||||
__u32 name;
|
||||
};
|
||||
|
||||
/** DRM_IOCTL_GEM_OPEN ioctl argument type */
|
||||
/**
|
||||
* struct drm_gem_open - Argument for &DRM_IOCTL_GEM_OPEN ioctl.
|
||||
* @name: Name of object being opened.
|
||||
* @handle: Returned handle for the object.
|
||||
* @size: Returned size of the object
|
||||
*
|
||||
* Open an object using the global name, returning a handle and the size.
|
||||
*
|
||||
* This handle (of course) holds a reference to the object, so the object
|
||||
* will not go away until the handle is deleted.
|
||||
*/
|
||||
struct drm_gem_open {
|
||||
/** Name of object being opened */
|
||||
__u32 name;
|
||||
|
||||
/** Returned handle for the object */
|
||||
__u32 handle;
|
||||
|
||||
/** Returned size of the object */
|
||||
__u64 size;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct drm_gem_change_handle - Argument for &DRM_IOCTL_GEM_CHANGE_HANDLE ioctl.
|
||||
* @handle: The handle of a gem object.
|
||||
* @new_handle: An available gem handle.
|
||||
*
|
||||
* This ioctl changes the handle of a GEM object to the specified one.
|
||||
* The new handle must be unused. On success the old handle is closed
|
||||
* and all further IOCTL should refer to the new handle only.
|
||||
* Calls to DRM_IOCTL_PRIME_FD_TO_HANDLE will return the new handle.
|
||||
*/
|
||||
struct drm_gem_change_handle {
|
||||
__u32 handle;
|
||||
__u32 new_handle;
|
||||
};
|
||||
|
||||
/**
|
||||
* DRM_CAP_DUMB_BUFFER
|
||||
*
|
||||
* If set to 1, the driver supports creating dumb buffers via the
|
||||
* &DRM_IOCTL_MODE_CREATE_DUMB ioctl.
|
||||
*/
|
||||
#define DRM_CAP_DUMB_BUFFER 0x1
|
||||
/**
|
||||
* DRM_CAP_VBLANK_HIGH_CRTC
|
||||
*
|
||||
* If set to 1, the kernel supports specifying a :ref:`CRTC index<crtc_index>`
|
||||
* in the high bits of &drm_wait_vblank_request.type.
|
||||
*
|
||||
* Starting kernel version 2.6.39, this capability is always set to 1.
|
||||
*/
|
||||
#define DRM_CAP_VBLANK_HIGH_CRTC 0x2
|
||||
/**
|
||||
* DRM_CAP_DUMB_PREFERRED_DEPTH
|
||||
*
|
||||
* The preferred bit depth for dumb buffers.
|
||||
*
|
||||
* The bit depth is the number of bits used to indicate the color of a single
|
||||
* pixel excluding any padding. This is different from the number of bits per
|
||||
* pixel. For instance, XRGB8888 has a bit depth of 24 but has 32 bits per
|
||||
* pixel.
|
||||
*
|
||||
* Note that this preference only applies to dumb buffers, it's irrelevant for
|
||||
* other types of buffers.
|
||||
*/
|
||||
#define DRM_CAP_DUMB_PREFERRED_DEPTH 0x3
|
||||
/**
|
||||
* DRM_CAP_DUMB_PREFER_SHADOW
|
||||
*
|
||||
* If set to 1, the driver prefers userspace to render to a shadow buffer
|
||||
* instead of directly rendering to a dumb buffer. For best speed, userspace
|
||||
* should do streaming ordered memory copies into the dumb buffer and never
|
||||
* read from it.
|
||||
*
|
||||
* Note that this preference only applies to dumb buffers, it's irrelevant for
|
||||
* other types of buffers.
|
||||
*/
|
||||
#define DRM_CAP_DUMB_PREFER_SHADOW 0x4
|
||||
/**
|
||||
* DRM_CAP_PRIME
|
||||
*
|
||||
* Bitfield of supported PRIME sharing capabilities. See &DRM_PRIME_CAP_IMPORT
|
||||
* and &DRM_PRIME_CAP_EXPORT.
|
||||
*
|
||||
* Starting from kernel version 6.6, both &DRM_PRIME_CAP_IMPORT and
|
||||
* &DRM_PRIME_CAP_EXPORT are always advertised.
|
||||
*
|
||||
* PRIME buffers are exposed as dma-buf file descriptors.
|
||||
* See :ref:`prime_buffer_sharing`.
|
||||
*/
|
||||
#define DRM_CAP_PRIME 0x5
|
||||
/**
|
||||
* DRM_PRIME_CAP_IMPORT
|
||||
*
|
||||
* If this bit is set in &DRM_CAP_PRIME, the driver supports importing PRIME
|
||||
* buffers via the &DRM_IOCTL_PRIME_FD_TO_HANDLE ioctl.
|
||||
*
|
||||
* Starting from kernel version 6.6, this bit is always set in &DRM_CAP_PRIME.
|
||||
*/
|
||||
#define DRM_PRIME_CAP_IMPORT 0x1
|
||||
/**
|
||||
* DRM_PRIME_CAP_EXPORT
|
||||
*
|
||||
* If this bit is set in &DRM_CAP_PRIME, the driver supports exporting PRIME
|
||||
* buffers via the &DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl.
|
||||
*
|
||||
* Starting from kernel version 6.6, this bit is always set in &DRM_CAP_PRIME.
|
||||
*/
|
||||
#define DRM_PRIME_CAP_EXPORT 0x2
|
||||
/**
|
||||
* DRM_CAP_TIMESTAMP_MONOTONIC
|
||||
*
|
||||
* If set to 0, the kernel will report timestamps with ``CLOCK_REALTIME`` in
|
||||
* struct drm_event_vblank. If set to 1, the kernel will report timestamps with
|
||||
* ``CLOCK_MONOTONIC``. See ``clock_gettime(2)`` for the definition of these
|
||||
* clocks.
|
||||
*
|
||||
* Starting from kernel version 2.6.39, the default value for this capability
|
||||
* is 1. Starting kernel version 4.15, this capability is always set to 1.
|
||||
*/
|
||||
#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
|
||||
/**
|
||||
* DRM_CAP_ASYNC_PAGE_FLIP
|
||||
*
|
||||
* If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC for legacy
|
||||
* page-flips.
|
||||
*/
|
||||
#define DRM_CAP_ASYNC_PAGE_FLIP 0x7
|
||||
/*
|
||||
* The CURSOR_WIDTH and CURSOR_HEIGHT capabilities return a valid widthxheight
|
||||
* combination for the hardware cursor. The intention is that a hardware
|
||||
* agnostic userspace can query a cursor plane size to use.
|
||||
/**
|
||||
* DRM_CAP_CURSOR_WIDTH
|
||||
*
|
||||
* The ``CURSOR_WIDTH`` and ``CURSOR_HEIGHT`` capabilities return a valid
|
||||
* width x height combination for the hardware cursor. The intention is that a
|
||||
* hardware agnostic userspace can query a cursor plane size to use.
|
||||
*
|
||||
* Note that the cross-driver contract is to merely return a valid size;
|
||||
* drivers are free to attach another meaning on top, eg. i915 returns the
|
||||
* maximum plane size.
|
||||
*/
|
||||
#define DRM_CAP_CURSOR_WIDTH 0x8
|
||||
/**
|
||||
* DRM_CAP_CURSOR_HEIGHT
|
||||
*
|
||||
* See &DRM_CAP_CURSOR_WIDTH.
|
||||
*/
|
||||
#define DRM_CAP_CURSOR_HEIGHT 0x9
|
||||
/**
|
||||
* DRM_CAP_ADDFB2_MODIFIERS
|
||||
*
|
||||
* If set to 1, the driver supports supplying modifiers in the
|
||||
* &DRM_IOCTL_MODE_ADDFB2 ioctl.
|
||||
*/
|
||||
#define DRM_CAP_ADDFB2_MODIFIERS 0x10
|
||||
/**
|
||||
* DRM_CAP_PAGE_FLIP_TARGET
|
||||
*
|
||||
* If set to 1, the driver supports the &DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE and
|
||||
* &DRM_MODE_PAGE_FLIP_TARGET_RELATIVE flags in
|
||||
* &drm_mode_crtc_page_flip_target.flags for the &DRM_IOCTL_MODE_PAGE_FLIP
|
||||
* ioctl.
|
||||
*/
|
||||
#define DRM_CAP_PAGE_FLIP_TARGET 0x11
|
||||
/**
|
||||
* DRM_CAP_CRTC_IN_VBLANK_EVENT
|
||||
*
|
||||
* If set to 1, the kernel supports reporting the CRTC ID in
|
||||
* &drm_event_vblank.crtc_id for the &DRM_EVENT_VBLANK and
|
||||
* &DRM_EVENT_FLIP_COMPLETE events.
|
||||
*
|
||||
* Starting kernel version 4.12, this capability is always set to 1.
|
||||
*/
|
||||
#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12
|
||||
/**
|
||||
* DRM_CAP_SYNCOBJ
|
||||
*
|
||||
* If set to 1, the driver supports sync objects. See :ref:`drm_sync_objects`.
|
||||
*/
|
||||
#define DRM_CAP_SYNCOBJ 0x13
|
||||
/**
|
||||
* DRM_CAP_SYNCOBJ_TIMELINE
|
||||
*
|
||||
* If set to 1, the driver supports timeline operations on sync objects. See
|
||||
* :ref:`drm_sync_objects`.
|
||||
*/
|
||||
#define DRM_CAP_SYNCOBJ_TIMELINE 0x14
|
||||
/**
|
||||
* DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP
|
||||
*
|
||||
* If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC for atomic
|
||||
* commits.
|
||||
*/
|
||||
#define DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP 0x15
|
||||
|
||||
/** DRM_IOCTL_GET_CAP ioctl argument type */
|
||||
/* DRM_IOCTL_GET_CAP ioctl argument type */
|
||||
struct drm_get_cap {
|
||||
__u64 capability;
|
||||
__u64 value;
|
||||
|
|
@ -655,9 +816,12 @@ struct drm_get_cap {
|
|||
/**
|
||||
* DRM_CLIENT_CAP_STEREO_3D
|
||||
*
|
||||
* if set to 1, the DRM core will expose the stereo 3D capabilities of the
|
||||
* If set to 1, the DRM core will expose the stereo 3D capabilities of the
|
||||
* monitor by advertising the supported 3D layouts in the flags of struct
|
||||
* drm_mode_modeinfo.
|
||||
* drm_mode_modeinfo. See ``DRM_MODE_FLAG_3D_*``.
|
||||
*
|
||||
* This capability is always supported for all drivers starting from kernel
|
||||
* version 3.13.
|
||||
*/
|
||||
#define DRM_CLIENT_CAP_STEREO_3D 1
|
||||
|
||||
|
|
@ -666,13 +830,25 @@ struct drm_get_cap {
|
|||
*
|
||||
* If set to 1, the DRM core will expose all planes (overlay, primary, and
|
||||
* cursor) to userspace.
|
||||
*
|
||||
* This capability has been introduced in kernel version 3.15. Starting from
|
||||
* kernel version 3.17, this capability is always supported for all drivers.
|
||||
*/
|
||||
#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2
|
||||
|
||||
/**
|
||||
* DRM_CLIENT_CAP_ATOMIC
|
||||
*
|
||||
* If set to 1, the DRM core will expose atomic properties to userspace
|
||||
* If set to 1, the DRM core will expose atomic properties to userspace. This
|
||||
* implicitly enables &DRM_CLIENT_CAP_UNIVERSAL_PLANES and
|
||||
* &DRM_CLIENT_CAP_ASPECT_RATIO.
|
||||
*
|
||||
* If the driver doesn't support atomic mode-setting, enabling this capability
|
||||
* will fail with -EOPNOTSUPP.
|
||||
*
|
||||
* This capability has been introduced in kernel version 4.0. Starting from
|
||||
* kernel version 4.2, this capability is always supported for atomic-capable
|
||||
* drivers.
|
||||
*/
|
||||
#define DRM_CLIENT_CAP_ATOMIC 3
|
||||
|
||||
|
|
@ -680,6 +856,10 @@ struct drm_get_cap {
|
|||
* DRM_CLIENT_CAP_ASPECT_RATIO
|
||||
*
|
||||
* If set to 1, the DRM core will provide aspect ratio information in modes.
|
||||
* See ``DRM_MODE_FLAG_PIC_AR_*``.
|
||||
*
|
||||
* This capability is always supported for all drivers starting from kernel
|
||||
* version 4.18.
|
||||
*/
|
||||
#define DRM_CLIENT_CAP_ASPECT_RATIO 4
|
||||
|
||||
|
|
@ -687,12 +867,55 @@ struct drm_get_cap {
|
|||
* DRM_CLIENT_CAP_WRITEBACK_CONNECTORS
|
||||
*
|
||||
* If set to 1, the DRM core will expose special connectors to be used for
|
||||
* writing back to memory the scene setup in the commit. Depends on client
|
||||
* also supporting DRM_CLIENT_CAP_ATOMIC
|
||||
* writing back to memory the scene setup in the commit. The client must enable
|
||||
* &DRM_CLIENT_CAP_ATOMIC first.
|
||||
*
|
||||
* This capability is always supported for atomic-capable drivers starting from
|
||||
* kernel version 4.19.
|
||||
*/
|
||||
#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5
|
||||
|
||||
/** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
|
||||
/**
|
||||
* DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT
|
||||
*
|
||||
* Drivers for para-virtualized hardware (e.g. vmwgfx, qxl, virtio and
|
||||
* virtualbox) have additional restrictions for cursor planes (thus
|
||||
* making cursor planes on those drivers not truly universal,) e.g.
|
||||
* they need cursor planes to act like one would expect from a mouse
|
||||
* cursor and have correctly set hotspot properties.
|
||||
* If this client cap is not set the DRM core will hide cursor plane on
|
||||
* those virtualized drivers because not setting it implies that the
|
||||
* client is not capable of dealing with those extra restictions.
|
||||
* Clients which do set cursor hotspot and treat the cursor plane
|
||||
* like a mouse cursor should set this property.
|
||||
* The client must enable &DRM_CLIENT_CAP_ATOMIC first.
|
||||
*
|
||||
* Setting this property on drivers which do not special case
|
||||
* cursor planes (i.e. non-virtualized drivers) will return
|
||||
* EOPNOTSUPP, which can be used by userspace to gauge
|
||||
* requirements of the hardware/drivers they're running on.
|
||||
*
|
||||
* This capability is always supported for atomic-capable virtualized
|
||||
* drivers starting from kernel version 6.6.
|
||||
*/
|
||||
#define DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT 6
|
||||
|
||||
/**
|
||||
* DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE
|
||||
*
|
||||
* If set to 1 the DRM core will allow setting the COLOR_PIPELINE
|
||||
* property on a &drm_plane, as well as drm_colorop properties.
|
||||
*
|
||||
* Setting of these plane properties will be rejected when this client
|
||||
* cap is set:
|
||||
* - COLOR_ENCODING
|
||||
* - COLOR_RANGE
|
||||
*
|
||||
* The client must enable &DRM_CLIENT_CAP_ATOMIC first.
|
||||
*/
|
||||
#define DRM_CLIENT_CAP_PLANE_COLOR_PIPELINE 7
|
||||
|
||||
/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
|
||||
struct drm_set_client_cap {
|
||||
__u64 capability;
|
||||
__u64 value;
|
||||
|
|
@ -722,13 +945,17 @@ struct drm_syncobj_destroy {
|
|||
};
|
||||
|
||||
#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_IMPORT_SYNC_FILE (1 << 0)
|
||||
#define DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_TIMELINE (1 << 1)
|
||||
#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_EXPORT_SYNC_FILE (1 << 0)
|
||||
#define DRM_SYNCOBJ_HANDLE_TO_FD_FLAGS_TIMELINE (1 << 1)
|
||||
struct drm_syncobj_handle {
|
||||
__u32 handle;
|
||||
__u32 flags;
|
||||
|
||||
__s32 fd;
|
||||
__u32 pad;
|
||||
|
||||
__u64 point;
|
||||
};
|
||||
|
||||
struct drm_syncobj_transfer {
|
||||
|
|
@ -743,6 +970,7 @@ struct drm_syncobj_transfer {
|
|||
#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0)
|
||||
#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1)
|
||||
#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time point to become available */
|
||||
#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_DEADLINE (1 << 3) /* set fence deadline to deadline_nsec */
|
||||
struct drm_syncobj_wait {
|
||||
__u64 handles;
|
||||
/* absolute timeout */
|
||||
|
|
@ -751,6 +979,14 @@ struct drm_syncobj_wait {
|
|||
__u32 flags;
|
||||
__u32 first_signaled; /* only valid when not waiting all */
|
||||
__u32 pad;
|
||||
/**
|
||||
* @deadline_nsec - fence deadline hint
|
||||
*
|
||||
* Deadline hint, in absolute CLOCK_MONOTONIC, to set on backing
|
||||
* fence(s) if the DRM_SYNCOBJ_WAIT_FLAGS_WAIT_DEADLINE flag is
|
||||
* set.
|
||||
*/
|
||||
__u64 deadline_nsec;
|
||||
};
|
||||
|
||||
struct drm_syncobj_timeline_wait {
|
||||
|
|
@ -763,6 +999,35 @@ struct drm_syncobj_timeline_wait {
|
|||
__u32 flags;
|
||||
__u32 first_signaled; /* only valid when not waiting all */
|
||||
__u32 pad;
|
||||
/**
|
||||
* @deadline_nsec - fence deadline hint
|
||||
*
|
||||
* Deadline hint, in absolute CLOCK_MONOTONIC, to set on backing
|
||||
* fence(s) if the DRM_SYNCOBJ_WAIT_FLAGS_WAIT_DEADLINE flag is
|
||||
* set.
|
||||
*/
|
||||
__u64 deadline_nsec;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct drm_syncobj_eventfd
|
||||
* @handle: syncobj handle.
|
||||
* @flags: Zero to wait for the point to be signalled, or
|
||||
* &DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE to wait for a fence to be
|
||||
* available for the point.
|
||||
* @point: syncobj timeline point (set to zero for binary syncobjs).
|
||||
* @fd: Existing eventfd to sent events to.
|
||||
* @pad: Must be zero.
|
||||
*
|
||||
* Register an eventfd to be signalled by a syncobj. The eventfd counter will
|
||||
* be incremented by one.
|
||||
*/
|
||||
struct drm_syncobj_eventfd {
|
||||
__u32 handle;
|
||||
__u32 flags;
|
||||
__u64 point;
|
||||
__s32 fd;
|
||||
__u32 pad;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -803,6 +1068,13 @@ struct drm_crtc_queue_sequence {
|
|||
__u64 user_data; /* user data passed to event */
|
||||
};
|
||||
|
||||
#define DRM_CLIENT_NAME_MAX_LEN 64
|
||||
struct drm_set_client_name {
|
||||
__u64 name_len;
|
||||
__u64 name;
|
||||
};
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
|
@ -828,6 +1100,19 @@ extern "C" {
|
|||
#define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, struct drm_stats)
|
||||
#define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, struct drm_set_version)
|
||||
#define DRM_IOCTL_MODESET_CTL DRM_IOW(0x08, struct drm_modeset_ctl)
|
||||
/**
|
||||
* DRM_IOCTL_GEM_CLOSE - Close a GEM handle.
|
||||
*
|
||||
* GEM handles are not reference-counted by the kernel. User-space is
|
||||
* responsible for managing their lifetime. For example, if user-space imports
|
||||
* the same memory object twice on the same DRM file description, the same GEM
|
||||
* handle is returned by both imports, and user-space needs to ensure
|
||||
* &DRM_IOCTL_GEM_CLOSE is performed once only. The same situation can happen
|
||||
* when a memory object is allocated, then exported and imported again on the
|
||||
* same DRM file description. The &DRM_IOCTL_MODE_GETFB2 IOCTL is an exception
|
||||
* and always returns fresh new GEM handles even if an existing GEM handle
|
||||
* already refers to the same memory object before the IOCTL is performed.
|
||||
*/
|
||||
#define DRM_IOCTL_GEM_CLOSE DRM_IOW (0x09, struct drm_gem_close)
|
||||
#define DRM_IOCTL_GEM_FLINK DRM_IOWR(0x0a, struct drm_gem_flink)
|
||||
#define DRM_IOCTL_GEM_OPEN DRM_IOWR(0x0b, struct drm_gem_open)
|
||||
|
|
@ -868,7 +1153,37 @@ extern "C" {
|
|||
#define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock)
|
||||
#define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock)
|
||||
|
||||
/**
|
||||
* DRM_IOCTL_PRIME_HANDLE_TO_FD - Convert a GEM handle to a DMA-BUF FD.
|
||||
*
|
||||
* User-space sets &drm_prime_handle.handle with the GEM handle to export and
|
||||
* &drm_prime_handle.flags, and gets back a DMA-BUF file descriptor in
|
||||
* &drm_prime_handle.fd.
|
||||
*
|
||||
* The export can fail for any driver-specific reason, e.g. because export is
|
||||
* not supported for this specific GEM handle (but might be for others).
|
||||
*
|
||||
* Support for exporting DMA-BUFs is advertised via &DRM_PRIME_CAP_EXPORT.
|
||||
*/
|
||||
#define DRM_IOCTL_PRIME_HANDLE_TO_FD DRM_IOWR(0x2d, struct drm_prime_handle)
|
||||
/**
|
||||
* DRM_IOCTL_PRIME_FD_TO_HANDLE - Convert a DMA-BUF FD to a GEM handle.
|
||||
*
|
||||
* User-space sets &drm_prime_handle.fd with a DMA-BUF file descriptor to
|
||||
* import, and gets back a GEM handle in &drm_prime_handle.handle.
|
||||
* &drm_prime_handle.flags is unused.
|
||||
*
|
||||
* If an existing GEM handle refers to the memory object backing the DMA-BUF,
|
||||
* that GEM handle is returned. Therefore user-space which needs to handle
|
||||
* arbitrary DMA-BUFs must have a user-space lookup data structure to manually
|
||||
* reference-count duplicated GEM handles. For more information see
|
||||
* &DRM_IOCTL_GEM_CLOSE.
|
||||
*
|
||||
* The import can fail for any driver-specific reason, e.g. because import is
|
||||
* only supported for DMA-BUFs allocated on this DRM device.
|
||||
*
|
||||
* Support for importing DMA-BUFs is advertised via &DRM_PRIME_CAP_IMPORT.
|
||||
*/
|
||||
#define DRM_IOCTL_PRIME_FD_TO_HANDLE DRM_IOWR(0x2e, struct drm_prime_handle)
|
||||
|
||||
#define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30)
|
||||
|
|
@ -906,10 +1221,40 @@ extern "C" {
|
|||
#define DRM_IOCTL_MODE_GETPROPBLOB DRM_IOWR(0xAC, struct drm_mode_get_blob)
|
||||
#define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
|
||||
#define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
|
||||
/**
|
||||
* DRM_IOCTL_MODE_RMFB - Remove a framebuffer.
|
||||
*
|
||||
* This removes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL
|
||||
* argument is a framebuffer object ID.
|
||||
*
|
||||
* Warning: removing a framebuffer currently in-use on an enabled plane will
|
||||
* disable that plane. The CRTC the plane is linked to may also be disabled
|
||||
* (depending on driver capabilities).
|
||||
*/
|
||||
#define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int)
|
||||
#define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip)
|
||||
#define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd)
|
||||
|
||||
/**
|
||||
* DRM_IOCTL_MODE_CREATE_DUMB - Create a new dumb buffer object.
|
||||
*
|
||||
* KMS dumb buffers provide a very primitive way to allocate a buffer object
|
||||
* suitable for scanout and map it for software rendering. KMS dumb buffers are
|
||||
* not suitable for hardware-accelerated rendering nor video decoding. KMS dumb
|
||||
* buffers are not suitable to be displayed on any other device than the KMS
|
||||
* device where they were allocated from. Also see
|
||||
* :ref:`kms_dumb_buffer_objects`.
|
||||
*
|
||||
* The IOCTL argument is a struct drm_mode_create_dumb.
|
||||
*
|
||||
* User-space is expected to create a KMS dumb buffer via this IOCTL, then add
|
||||
* it as a KMS framebuffer via &DRM_IOCTL_MODE_ADDFB and map it via
|
||||
* &DRM_IOCTL_MODE_MAP_DUMB.
|
||||
*
|
||||
* &DRM_CAP_DUMB_BUFFER indicates whether this IOCTL is supported.
|
||||
* &DRM_CAP_DUMB_PREFERRED_DEPTH and &DRM_CAP_DUMB_PREFER_SHADOW indicate
|
||||
* driver preferences for dumb buffers.
|
||||
*/
|
||||
#define DRM_IOCTL_MODE_CREATE_DUMB DRM_IOWR(0xB2, struct drm_mode_create_dumb)
|
||||
#define DRM_IOCTL_MODE_MAP_DUMB DRM_IOWR(0xB3, struct drm_mode_map_dumb)
|
||||
#define DRM_IOCTL_MODE_DESTROY_DUMB DRM_IOWR(0xB4, struct drm_mode_destroy_dumb)
|
||||
|
|
@ -942,9 +1287,77 @@ extern "C" {
|
|||
#define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct drm_syncobj_transfer)
|
||||
#define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct drm_syncobj_timeline_array)
|
||||
|
||||
/**
|
||||
* DRM_IOCTL_MODE_GETFB2 - Get framebuffer metadata.
|
||||
*
|
||||
* This queries metadata about a framebuffer. User-space fills
|
||||
* &drm_mode_fb_cmd2.fb_id as the input, and the kernels fills the rest of the
|
||||
* struct as the output.
|
||||
*
|
||||
* If the client is DRM master or has &CAP_SYS_ADMIN, &drm_mode_fb_cmd2.handles
|
||||
* will be filled with GEM buffer handles. Fresh new GEM handles are always
|
||||
* returned, even if another GEM handle referring to the same memory object
|
||||
* already exists on the DRM file description. The caller is responsible for
|
||||
* removing the new handles, e.g. via the &DRM_IOCTL_GEM_CLOSE IOCTL. The same
|
||||
* new handle will be returned for multiple planes in case they use the same
|
||||
* memory object. Planes are valid until one has a zero handle -- this can be
|
||||
* used to compute the number of planes.
|
||||
*
|
||||
* Otherwise, &drm_mode_fb_cmd2.handles will be zeroed and planes are valid
|
||||
* until one has a zero &drm_mode_fb_cmd2.pitches.
|
||||
*
|
||||
* If the framebuffer has a format modifier, &DRM_MODE_FB_MODIFIERS will be set
|
||||
* in &drm_mode_fb_cmd2.flags and &drm_mode_fb_cmd2.modifier will contain the
|
||||
* modifier. Otherwise, user-space must ignore &drm_mode_fb_cmd2.modifier.
|
||||
*
|
||||
* To obtain DMA-BUF FDs for each plane without leaking GEM handles, user-space
|
||||
* can export each handle via &DRM_IOCTL_PRIME_HANDLE_TO_FD, then immediately
|
||||
* close each unique handle via &DRM_IOCTL_GEM_CLOSE, making sure to not
|
||||
* double-close handles which are specified multiple times in the array.
|
||||
*/
|
||||
#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)
|
||||
|
||||
#define DRM_IOCTL_SYNCOBJ_EVENTFD DRM_IOWR(0xCF, struct drm_syncobj_eventfd)
|
||||
|
||||
/**
|
||||
* DRM_IOCTL_MODE_CLOSEFB - Close a framebuffer.
|
||||
*
|
||||
* This closes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL
|
||||
* argument is a framebuffer object ID.
|
||||
*
|
||||
* This IOCTL is similar to &DRM_IOCTL_MODE_RMFB, except it doesn't disable
|
||||
* planes and CRTCs. As long as the framebuffer is used by a plane, it's kept
|
||||
* alive. When the plane no longer uses the framebuffer (because the
|
||||
* framebuffer is replaced with another one, or the plane is disabled), the
|
||||
* framebuffer is cleaned up.
|
||||
*
|
||||
* This is useful to implement flicker-free transitions between two processes.
|
||||
*
|
||||
* Depending on the threat model, user-space may want to ensure that the
|
||||
* framebuffer doesn't expose any sensitive user information: closed
|
||||
* framebuffers attached to a plane can be read back by the next DRM master.
|
||||
*/
|
||||
#define DRM_IOCTL_MODE_CLOSEFB DRM_IOWR(0xD0, struct drm_mode_closefb)
|
||||
|
||||
/**
|
||||
* DRM_IOCTL_SET_CLIENT_NAME - Attach a name to a drm_file
|
||||
*
|
||||
* Having a name allows for easier tracking and debugging.
|
||||
* The length of the name (without null ending char) must be
|
||||
* <= DRM_CLIENT_NAME_MAX_LEN.
|
||||
* The call will fail if the name contains whitespaces or non-printable chars.
|
||||
*/
|
||||
#define DRM_IOCTL_SET_CLIENT_NAME DRM_IOWR(0xD1, struct drm_set_client_name)
|
||||
|
||||
/**
|
||||
* DRM_IOCTL_GEM_CHANGE_HANDLE - Move an object to a different handle
|
||||
*
|
||||
* Some applications (notably CRIU) need objects to have specific gem handles.
|
||||
* This ioctl changes the object at one gem handle to use a new gem handle.
|
||||
*/
|
||||
#define DRM_IOCTL_GEM_CHANGE_HANDLE DRM_IOWR(0xD2, struct drm_gem_change_handle)
|
||||
|
||||
/*
|
||||
* Device specific ioctls should only be in their respective headers
|
||||
* The device specific ioctl range is from 0x40 to 0x9f.
|
||||
* Generic IOCTLS restart at 0xA0.
|
||||
|
|
@ -956,24 +1369,49 @@ extern "C" {
|
|||
#define DRM_COMMAND_END 0xA0
|
||||
|
||||
/**
|
||||
* Header for events written back to userspace on the drm fd. The
|
||||
* type defines the type of event, the length specifies the total
|
||||
* length of the event (including the header), and user_data is
|
||||
* typically a 64 bit value passed with the ioctl that triggered the
|
||||
* event. A read on the drm fd will always only return complete
|
||||
* events, that is, if for example the read buffer is 100 bytes, and
|
||||
* there are two 64 byte events pending, only one will be returned.
|
||||
* struct drm_event - Header for DRM events
|
||||
* @type: event type.
|
||||
* @length: total number of payload bytes (including header).
|
||||
*
|
||||
* Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and
|
||||
* up are chipset specific.
|
||||
* This struct is a header for events written back to user-space on the DRM FD.
|
||||
* A read on the DRM FD will always only return complete events: e.g. if the
|
||||
* read buffer is 100 bytes large and there are two 64 byte events pending,
|
||||
* only one will be returned.
|
||||
*
|
||||
* Event types 0 - 0x7fffffff are generic DRM events, 0x80000000 and
|
||||
* up are chipset specific. Generic DRM events include &DRM_EVENT_VBLANK,
|
||||
* &DRM_EVENT_FLIP_COMPLETE and &DRM_EVENT_CRTC_SEQUENCE.
|
||||
*/
|
||||
struct drm_event {
|
||||
__u32 type;
|
||||
__u32 length;
|
||||
};
|
||||
|
||||
/**
|
||||
* DRM_EVENT_VBLANK - vertical blanking event
|
||||
*
|
||||
* This event is sent in response to &DRM_IOCTL_WAIT_VBLANK with the
|
||||
* &_DRM_VBLANK_EVENT flag set.
|
||||
*
|
||||
* The event payload is a struct drm_event_vblank.
|
||||
*/
|
||||
#define DRM_EVENT_VBLANK 0x01
|
||||
/**
|
||||
* DRM_EVENT_FLIP_COMPLETE - page-flip completion event
|
||||
*
|
||||
* This event is sent in response to an atomic commit or legacy page-flip with
|
||||
* the &DRM_MODE_PAGE_FLIP_EVENT flag set.
|
||||
*
|
||||
* The event payload is a struct drm_event_vblank.
|
||||
*/
|
||||
#define DRM_EVENT_FLIP_COMPLETE 0x02
|
||||
/**
|
||||
* DRM_EVENT_CRTC_SEQUENCE - CRTC sequence event
|
||||
*
|
||||
* This event is sent in response to &DRM_IOCTL_CRTC_QUEUE_SEQUENCE.
|
||||
*
|
||||
* The event payload is a struct drm_event_crtc_sequence.
|
||||
*/
|
||||
#define DRM_EVENT_CRTC_SEQUENCE 0x03
|
||||
|
||||
struct drm_event_vblank {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ extern "C" {
|
|||
* Format modifiers may change any property of the buffer, including the number
|
||||
* of planes and/or the required allocation size. Format modifiers are
|
||||
* vendor-namespaced, and as such the relationship between a fourcc code and a
|
||||
* modifier is specific to the modifer being used. For example, some modifiers
|
||||
* modifier is specific to the modifier being used. For example, some modifiers
|
||||
* may preserve meaning - such as number of planes - from the fourcc code,
|
||||
* whereas others may not.
|
||||
*
|
||||
|
|
@ -79,7 +79,7 @@ extern "C" {
|
|||
* format.
|
||||
* - Higher-level programs interfacing with KMS/GBM/EGL/Vulkan/etc: these users
|
||||
* see modifiers as opaque tokens they can check for equality and intersect.
|
||||
* These users musn't need to know to reason about the modifier value
|
||||
* These users mustn't need to know to reason about the modifier value
|
||||
* (i.e. they are not expected to extract information out of the modifier).
|
||||
*
|
||||
* Vendors should document their modifier usage in as much detail as
|
||||
|
|
@ -88,6 +88,18 @@ extern "C" {
|
|||
*
|
||||
* The authoritative list of format modifier codes is found in
|
||||
* `include/uapi/drm/drm_fourcc.h`
|
||||
*
|
||||
* Open Source User Waiver
|
||||
* -----------------------
|
||||
*
|
||||
* Because this is the authoritative source for pixel formats and modifiers
|
||||
* referenced by GL, Vulkan extensions and other standards and hence used both
|
||||
* by open source and closed source driver stacks, the usual requirement for an
|
||||
* upstream in-kernel or open source userspace user does not apply.
|
||||
*
|
||||
* To ensure, as much as feasible, compatibility across stacks and avoid
|
||||
* confusion with incompatible enumerations stakeholders for all relevant driver
|
||||
* stacks should approve additions.
|
||||
*/
|
||||
|
||||
#define fourcc_code(a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \
|
||||
|
|
@ -99,12 +111,42 @@ extern "C" {
|
|||
#define DRM_FORMAT_INVALID 0
|
||||
|
||||
/* color index */
|
||||
#define DRM_FORMAT_C1 fourcc_code('C', '1', ' ', ' ') /* [7:0] C0:C1:C2:C3:C4:C5:C6:C7 1:1:1:1:1:1:1:1 eight pixels/byte */
|
||||
#define DRM_FORMAT_C2 fourcc_code('C', '2', ' ', ' ') /* [7:0] C0:C1:C2:C3 2:2:2:2 four pixels/byte */
|
||||
#define DRM_FORMAT_C4 fourcc_code('C', '4', ' ', ' ') /* [7:0] C0:C1 4:4 two pixels/byte */
|
||||
#define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */
|
||||
|
||||
/* 8 bpp Red */
|
||||
/* 1 bpp Darkness (inverse relationship between channel value and brightness) */
|
||||
#define DRM_FORMAT_D1 fourcc_code('D', '1', ' ', ' ') /* [7:0] D0:D1:D2:D3:D4:D5:D6:D7 1:1:1:1:1:1:1:1 eight pixels/byte */
|
||||
|
||||
/* 2 bpp Darkness (inverse relationship between channel value and brightness) */
|
||||
#define DRM_FORMAT_D2 fourcc_code('D', '2', ' ', ' ') /* [7:0] D0:D1:D2:D3 2:2:2:2 four pixels/byte */
|
||||
|
||||
/* 4 bpp Darkness (inverse relationship between channel value and brightness) */
|
||||
#define DRM_FORMAT_D4 fourcc_code('D', '4', ' ', ' ') /* [7:0] D0:D1 4:4 two pixels/byte */
|
||||
|
||||
/* 8 bpp Darkness (inverse relationship between channel value and brightness) */
|
||||
#define DRM_FORMAT_D8 fourcc_code('D', '8', ' ', ' ') /* [7:0] D */
|
||||
|
||||
/* 1 bpp Red (direct relationship between channel value and brightness) */
|
||||
#define DRM_FORMAT_R1 fourcc_code('R', '1', ' ', ' ') /* [7:0] R0:R1:R2:R3:R4:R5:R6:R7 1:1:1:1:1:1:1:1 eight pixels/byte */
|
||||
|
||||
/* 2 bpp Red (direct relationship between channel value and brightness) */
|
||||
#define DRM_FORMAT_R2 fourcc_code('R', '2', ' ', ' ') /* [7:0] R0:R1:R2:R3 2:2:2:2 four pixels/byte */
|
||||
|
||||
/* 4 bpp Red (direct relationship between channel value and brightness) */
|
||||
#define DRM_FORMAT_R4 fourcc_code('R', '4', ' ', ' ') /* [7:0] R0:R1 4:4 two pixels/byte */
|
||||
|
||||
/* 8 bpp Red (direct relationship between channel value and brightness) */
|
||||
#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ') /* [7:0] R */
|
||||
|
||||
/* 16 bpp Red */
|
||||
/* 10 bpp Red (direct relationship between channel value and brightness) */
|
||||
#define DRM_FORMAT_R10 fourcc_code('R', '1', '0', ' ') /* [15:0] x:R 6:10 little endian */
|
||||
|
||||
/* 12 bpp Red (direct relationship between channel value and brightness) */
|
||||
#define DRM_FORMAT_R12 fourcc_code('R', '1', '2', ' ') /* [15:0] x:R 4:12 little endian */
|
||||
|
||||
/* 16 bpp Red (direct relationship between channel value and brightness) */
|
||||
#define DRM_FORMAT_R16 fourcc_code('R', '1', '6', ' ') /* [15:0] R little endian */
|
||||
|
||||
/* 16 bpp RG */
|
||||
|
|
@ -168,8 +210,19 @@ extern "C" {
|
|||
#define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */
|
||||
#define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */
|
||||
|
||||
/* 48 bpp RGB */
|
||||
#define DRM_FORMAT_RGB161616 fourcc_code('R', 'G', '4', '8') /* [47:0] R:G:B 16:16:16 little endian */
|
||||
#define DRM_FORMAT_BGR161616 fourcc_code('B', 'G', '4', '8') /* [47:0] B:G:R 16:16:16 little endian */
|
||||
|
||||
/* 64 bpp RGB */
|
||||
#define DRM_FORMAT_XRGB16161616 fourcc_code('X', 'R', '4', '8') /* [63:0] x:R:G:B 16:16:16:16 little endian */
|
||||
#define DRM_FORMAT_XBGR16161616 fourcc_code('X', 'B', '4', '8') /* [63:0] x:B:G:R 16:16:16:16 little endian */
|
||||
|
||||
#define DRM_FORMAT_ARGB16161616 fourcc_code('A', 'R', '4', '8') /* [63:0] A:R:G:B 16:16:16:16 little endian */
|
||||
#define DRM_FORMAT_ABGR16161616 fourcc_code('A', 'B', '4', '8') /* [63:0] A:B:G:R 16:16:16:16 little endian */
|
||||
|
||||
/*
|
||||
* Floating point 64bpp RGB
|
||||
* Half-Floating point - 16b/component
|
||||
* IEEE 754-2008 binary16 half-precision float
|
||||
* [15:0] sign:exponent:mantissa 1:5:10
|
||||
*/
|
||||
|
|
@ -179,6 +232,20 @@ extern "C" {
|
|||
#define DRM_FORMAT_ARGB16161616F fourcc_code('A', 'R', '4', 'H') /* [63:0] A:R:G:B 16:16:16:16 little endian */
|
||||
#define DRM_FORMAT_ABGR16161616F fourcc_code('A', 'B', '4', 'H') /* [63:0] A:B:G:R 16:16:16:16 little endian */
|
||||
|
||||
#define DRM_FORMAT_R16F fourcc_code('R', ' ', ' ', 'H') /* [15:0] R 16 little endian */
|
||||
#define DRM_FORMAT_GR1616F fourcc_code('G', 'R', ' ', 'H') /* [31:0] G:R 16:16 little endian */
|
||||
#define DRM_FORMAT_BGR161616F fourcc_code('B', 'G', 'R', 'H') /* [47:0] B:G:R 16:16:16 little endian */
|
||||
|
||||
/*
|
||||
* Floating point - 32b/component
|
||||
* IEEE 754-2008 binary32 float
|
||||
* [31:0] sign:exponent:mantissa 1:8:23
|
||||
*/
|
||||
#define DRM_FORMAT_R32F fourcc_code('R', ' ', ' ', 'F') /* [31:0] R 32 little endian */
|
||||
#define DRM_FORMAT_GR3232F fourcc_code('G', 'R', ' ', 'F') /* [63:0] R:G 32:32 little endian */
|
||||
#define DRM_FORMAT_BGR323232F fourcc_code('B', 'G', 'R', 'F') /* [95:0] R:G:B 32:32:32 little endian */
|
||||
#define DRM_FORMAT_ABGR32323232F fourcc_code('A', 'B', '8', 'F') /* [127:0] R:G:B:A 32:32:32:32 little endian */
|
||||
|
||||
/*
|
||||
* RGBA format with 10-bit components packed in 64-bit per pixel, with 6 bits
|
||||
* of unused padding per component:
|
||||
|
|
@ -192,7 +259,9 @@ extern "C" {
|
|||
#define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */
|
||||
|
||||
#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
|
||||
#define DRM_FORMAT_AVUY8888 fourcc_code('A', 'V', 'U', 'Y') /* [31:0] A:Cr:Cb:Y 8:8:8:8 little endian */
|
||||
#define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */
|
||||
#define DRM_FORMAT_XVUY8888 fourcc_code('X', 'V', 'U', 'Y') /* [31:0] X:Cr:Cb:Y 8:8:8:8 little endian */
|
||||
#define DRM_FORMAT_VUY888 fourcc_code('V', 'U', '2', '4') /* [23:0] Cr:Cb:Y 8:8:8 little endian */
|
||||
#define DRM_FORMAT_VUY101010 fourcc_code('V', 'U', '3', '0') /* Y followed by U then V, 10:10:10. Non-linear modifier only */
|
||||
|
||||
|
|
@ -272,6 +341,8 @@ extern "C" {
|
|||
* index 1 = Cr:Cb plane, [39:0] Cr1:Cb1:Cr0:Cb0 little endian
|
||||
*/
|
||||
#define DRM_FORMAT_NV15 fourcc_code('N', 'V', '1', '5') /* 2x2 subsampled Cr:Cb plane */
|
||||
#define DRM_FORMAT_NV20 fourcc_code('N', 'V', '2', '0') /* 2x1 subsampled Cr:Cb plane */
|
||||
#define DRM_FORMAT_NV30 fourcc_code('N', 'V', '3', '0') /* non-subsampled Cr:Cb plane */
|
||||
|
||||
/*
|
||||
* 2 plane YCbCr MSB aligned
|
||||
|
|
@ -301,6 +372,13 @@ extern "C" {
|
|||
*/
|
||||
#define DRM_FORMAT_P016 fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */
|
||||
|
||||
/* 2 plane YCbCr420.
|
||||
* 3 10 bit components and 2 padding bits packed into 4 bytes.
|
||||
* index 0 = Y plane, [31:0] x:Y2:Y1:Y0 2:10:10:10 little endian
|
||||
* index 1 = Cr:Cb plane, [63:0] x:Cr2:Cb2:Cr1:x:Cb1:Cr0:Cb0 [2:10:10:10:2:10:10:10] little endian
|
||||
*/
|
||||
#define DRM_FORMAT_P030 fourcc_code('P', '0', '3', '0') /* 2x2 subsampled Cr:Cb plane 10 bits per channel packed */
|
||||
|
||||
/* 3 plane non-subsampled (444) YCbCr
|
||||
* 16 bits per component, but only 10 bits are used and 6 bits are padded
|
||||
* index 0: Y plane, [15:0] Y:x [10:6] little endian
|
||||
|
|
@ -317,6 +395,42 @@ extern "C" {
|
|||
*/
|
||||
#define DRM_FORMAT_Q401 fourcc_code('Q', '4', '0', '1')
|
||||
|
||||
/*
|
||||
* 3 plane YCbCr LSB aligned
|
||||
* In order to use these formats in a similar fashion to MSB aligned ones
|
||||
* implementation can multiply the values by 2^6=64. For that reason the padding
|
||||
* must only contain zeros.
|
||||
* index 0 = Y plane, [15:0] z:Y [6:10] little endian
|
||||
* index 1 = Cr plane, [15:0] z:Cr [6:10] little endian
|
||||
* index 2 = Cb plane, [15:0] z:Cb [6:10] little endian
|
||||
*/
|
||||
#define DRM_FORMAT_S010 fourcc_code('S', '0', '1', '0') /* 2x2 subsampled Cb (1) and Cr (2) planes 10 bits per channel */
|
||||
#define DRM_FORMAT_S210 fourcc_code('S', '2', '1', '0') /* 2x1 subsampled Cb (1) and Cr (2) planes 10 bits per channel */
|
||||
#define DRM_FORMAT_S410 fourcc_code('S', '4', '1', '0') /* non-subsampled Cb (1) and Cr (2) planes 10 bits per channel */
|
||||
|
||||
/*
|
||||
* 3 plane YCbCr LSB aligned
|
||||
* In order to use these formats in a similar fashion to MSB aligned ones
|
||||
* implementation can multiply the values by 2^4=16. For that reason the padding
|
||||
* must only contain zeros.
|
||||
* index 0 = Y plane, [15:0] z:Y [4:12] little endian
|
||||
* index 1 = Cr plane, [15:0] z:Cr [4:12] little endian
|
||||
* index 2 = Cb plane, [15:0] z:Cb [4:12] little endian
|
||||
*/
|
||||
#define DRM_FORMAT_S012 fourcc_code('S', '0', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes 12 bits per channel */
|
||||
#define DRM_FORMAT_S212 fourcc_code('S', '2', '1', '2') /* 2x1 subsampled Cb (1) and Cr (2) planes 12 bits per channel */
|
||||
#define DRM_FORMAT_S412 fourcc_code('S', '4', '1', '2') /* non-subsampled Cb (1) and Cr (2) planes 12 bits per channel */
|
||||
|
||||
/*
|
||||
* 3 plane YCbCr
|
||||
* index 0 = Y plane, [15:0] Y little endian
|
||||
* index 1 = Cr plane, [15:0] Cr little endian
|
||||
* index 2 = Cb plane, [15:0] Cb little endian
|
||||
*/
|
||||
#define DRM_FORMAT_S016 fourcc_code('S', '0', '1', '6') /* 2x2 subsampled Cb (1) and Cr (2) planes 16 bits per channel */
|
||||
#define DRM_FORMAT_S216 fourcc_code('S', '2', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes 16 bits per channel */
|
||||
#define DRM_FORMAT_S416 fourcc_code('S', '4', '1', '6') /* non-subsampled Cb (1) and Cr (2) planes 16 bits per channel */
|
||||
|
||||
/*
|
||||
* 3 plane YCbCr
|
||||
* index 0: Y plane, [7:0] Y
|
||||
|
|
@ -361,11 +475,19 @@ extern "C" {
|
|||
#define DRM_FORMAT_MOD_VENDOR_ARM 0x08
|
||||
#define DRM_FORMAT_MOD_VENDOR_ALLWINNER 0x09
|
||||
#define DRM_FORMAT_MOD_VENDOR_AMLOGIC 0x0a
|
||||
#define DRM_FORMAT_MOD_VENDOR_MTK 0x0b
|
||||
#define DRM_FORMAT_MOD_VENDOR_APPLE 0x0c
|
||||
|
||||
/* add more to the end as needed */
|
||||
|
||||
#define DRM_FORMAT_RESERVED ((1ULL << 56) - 1)
|
||||
|
||||
#define fourcc_mod_get_vendor(modifier) \
|
||||
(((modifier) >> 56) & 0xff)
|
||||
|
||||
#define fourcc_mod_is_vendor(modifier, vendor) \
|
||||
(fourcc_mod_get_vendor(modifier) == DRM_FORMAT_MOD_VENDOR_## vendor)
|
||||
|
||||
#define fourcc_mod_code(vendor, val) \
|
||||
((((__u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | ((val) & 0x00ffffffffffffffULL))
|
||||
|
||||
|
|
@ -527,6 +649,140 @@ extern "C" {
|
|||
*/
|
||||
#define I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS fourcc_mod_code(INTEL, 7)
|
||||
|
||||
/*
|
||||
* Intel Color Control Surface with Clear Color (CCS) for Gen-12 render
|
||||
* compression.
|
||||
*
|
||||
* The main surface is Y-tiled and is at plane index 0 whereas CCS is linear
|
||||
* and at index 1. The clear color is stored at index 2, and the pitch should
|
||||
* be 64 bytes aligned. The clear color structure is 256 bits. The first 128 bits
|
||||
* represents Raw Clear Color Red, Green, Blue and Alpha color each represented
|
||||
* by 32 bits. The raw clear color is consumed by the 3d engine and generates
|
||||
* the converted clear color of size 64 bits. The first 32 bits store the Lower
|
||||
* Converted Clear Color value and the next 32 bits store the Higher Converted
|
||||
* Clear Color value when applicable. The Converted Clear Color values are
|
||||
* consumed by the DE. The last 64 bits are used to store Color Discard Enable
|
||||
* and Depth Clear Value Valid which are ignored by the DE. A CCS cache line
|
||||
* corresponds to an area of 4x1 tiles in the main surface. The main surface
|
||||
* pitch is required to be a multiple of 4 tile widths.
|
||||
*/
|
||||
#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC fourcc_mod_code(INTEL, 8)
|
||||
|
||||
/*
|
||||
* Intel Tile 4 layout
|
||||
*
|
||||
* This is a tiled layout using 4KB tiles in a row-major layout. It has the same
|
||||
* shape as Tile Y at two granularities: 4KB (128B x 32) and 64B (16B x 4). It
|
||||
* only differs from Tile Y at the 256B granularity in between. At this
|
||||
* granularity, Tile Y has a shape of 16B x 32 rows, but this tiling has a shape
|
||||
* of 64B x 8 rows.
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED fourcc_mod_code(INTEL, 9)
|
||||
|
||||
/*
|
||||
* Intel color control surfaces (CCS) for DG2 render compression.
|
||||
*
|
||||
* The main surface is Tile 4 and at plane index 0. The CCS data is stored
|
||||
* outside of the GEM object in a reserved memory area dedicated for the
|
||||
* storage of the CCS data for all RC/RC_CC/MC compressible GEM objects. The
|
||||
* main surface pitch is required to be a multiple of four Tile 4 widths.
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED_DG2_RC_CCS fourcc_mod_code(INTEL, 10)
|
||||
|
||||
/*
|
||||
* Intel color control surfaces (CCS) for DG2 media compression.
|
||||
*
|
||||
* The main surface is Tile 4 and at plane index 0. For semi-planar formats
|
||||
* like NV12, the Y and UV planes are Tile 4 and are located at plane indices
|
||||
* 0 and 1, respectively. The CCS for all planes are stored outside of the
|
||||
* GEM object in a reserved memory area dedicated for the storage of the
|
||||
* CCS data for all RC/RC_CC/MC compressible GEM objects. The main surface
|
||||
* pitch is required to be a multiple of four Tile 4 widths.
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED_DG2_MC_CCS fourcc_mod_code(INTEL, 11)
|
||||
|
||||
/*
|
||||
* Intel Color Control Surface with Clear Color (CCS) for DG2 render compression.
|
||||
*
|
||||
* The main surface is Tile 4 and at plane index 0. The CCS data is stored
|
||||
* outside of the GEM object in a reserved memory area dedicated for the
|
||||
* storage of the CCS data for all RC/RC_CC/MC compressible GEM objects. The
|
||||
* main surface pitch is required to be a multiple of four Tile 4 widths. The
|
||||
* clear color is stored at plane index 1 and the pitch should be 64 bytes
|
||||
* aligned. The format of the 256 bits of clear color data matches the one used
|
||||
* for the I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC modifier, see its description
|
||||
* for details.
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED_DG2_RC_CCS_CC fourcc_mod_code(INTEL, 12)
|
||||
|
||||
/*
|
||||
* Intel Color Control Surfaces (CCS) for display ver. 14 render compression.
|
||||
*
|
||||
* The main surface is tile4 and at plane index 0, the CCS is linear and
|
||||
* at index 1. A 64B CCS cache line corresponds to an area of 4x1 tiles in
|
||||
* main surface. In other words, 4 bits in CCS map to a main surface cache
|
||||
* line pair. The main surface pitch is required to be a multiple of four
|
||||
* tile4 widths.
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED_MTL_RC_CCS fourcc_mod_code(INTEL, 13)
|
||||
|
||||
/*
|
||||
* Intel Color Control Surfaces (CCS) for display ver. 14 media compression
|
||||
*
|
||||
* The main surface is tile4 and at plane index 0, the CCS is linear and
|
||||
* at index 1. A 64B CCS cache line corresponds to an area of 4x1 tiles in
|
||||
* main surface. In other words, 4 bits in CCS map to a main surface cache
|
||||
* line pair. The main surface pitch is required to be a multiple of four
|
||||
* tile4 widths. For semi-planar formats like NV12, CCS planes follow the
|
||||
* Y and UV planes i.e., planes 0 and 1 are used for Y and UV surfaces,
|
||||
* planes 2 and 3 for the respective CCS.
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED_MTL_MC_CCS fourcc_mod_code(INTEL, 14)
|
||||
|
||||
/*
|
||||
* Intel Color Control Surface with Clear Color (CCS) for display ver. 14 render
|
||||
* compression.
|
||||
*
|
||||
* The main surface is tile4 and is at plane index 0 whereas CCS is linear
|
||||
* and at index 1. The clear color is stored at index 2, and the pitch should
|
||||
* be ignored. The clear color structure is 256 bits. The first 128 bits
|
||||
* represents Raw Clear Color Red, Green, Blue and Alpha color each represented
|
||||
* by 32 bits. The raw clear color is consumed by the 3d engine and generates
|
||||
* the converted clear color of size 64 bits. The first 32 bits store the Lower
|
||||
* Converted Clear Color value and the next 32 bits store the Higher Converted
|
||||
* Clear Color value when applicable. The Converted Clear Color values are
|
||||
* consumed by the DE. The last 64 bits are used to store Color Discard Enable
|
||||
* and Depth Clear Value Valid which are ignored by the DE. A CCS cache line
|
||||
* corresponds to an area of 4x1 tiles in the main surface. The main surface
|
||||
* pitch is required to be a multiple of 4 tile widths.
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED_MTL_RC_CCS_CC fourcc_mod_code(INTEL, 15)
|
||||
|
||||
/*
|
||||
* Intel Color Control Surfaces (CCS) for graphics ver. 20 unified compression
|
||||
* on integrated graphics
|
||||
*
|
||||
* The main surface is Tile 4 and at plane index 0. For semi-planar formats
|
||||
* like NV12, the Y and UV planes are Tile 4 and are located at plane indices
|
||||
* 0 and 1, respectively. The CCS for all planes are stored outside of the
|
||||
* GEM object in a reserved memory area dedicated for the storage of the
|
||||
* CCS data for all compressible GEM objects.
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED_LNL_CCS fourcc_mod_code(INTEL, 16)
|
||||
|
||||
/*
|
||||
* Intel Color Control Surfaces (CCS) for graphics ver. 20 unified compression
|
||||
* on discrete graphics
|
||||
*
|
||||
* The main surface is Tile 4 and at plane index 0. For semi-planar formats
|
||||
* like NV12, the Y and UV planes are Tile 4 and are located at plane indices
|
||||
* 0 and 1, respectively. The CCS for all planes are stored outside of the
|
||||
* GEM object in a reserved memory area dedicated for the storage of the
|
||||
* CCS data for all compressible GEM objects. The GEM object must be stored in
|
||||
* contiguous memory with a size aligned to 64KB
|
||||
*/
|
||||
#define I915_FORMAT_MOD_4_TILED_BMG_CCS fourcc_mod_code(INTEL, 17)
|
||||
|
||||
/*
|
||||
* Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks
|
||||
*
|
||||
|
|
@ -564,6 +820,28 @@ extern "C" {
|
|||
*/
|
||||
#define DRM_FORMAT_MOD_QCOM_COMPRESSED fourcc_mod_code(QCOM, 1)
|
||||
|
||||
/*
|
||||
* Qualcomm Tiled Format
|
||||
*
|
||||
* Similar to DRM_FORMAT_MOD_QCOM_COMPRESSED but not compressed.
|
||||
* Implementation may be platform and base-format specific.
|
||||
*
|
||||
* Each macrotile consists of m x n (mostly 4 x 4) tiles.
|
||||
* Pixel data pitch/stride is aligned with macrotile width.
|
||||
* Pixel data height is aligned with macrotile height.
|
||||
* Entire pixel data buffer is aligned with 4k(bytes).
|
||||
*/
|
||||
#define DRM_FORMAT_MOD_QCOM_TILED3 fourcc_mod_code(QCOM, 3)
|
||||
|
||||
/*
|
||||
* Qualcomm Alternate Tiled Format
|
||||
*
|
||||
* Alternate tiled format typically only used within GMEM.
|
||||
* Implementation may be platform and base-format specific.
|
||||
*/
|
||||
#define DRM_FORMAT_MOD_QCOM_TILED2 fourcc_mod_code(QCOM, 2)
|
||||
|
||||
|
||||
/* Vivante framebuffer modifiers */
|
||||
|
||||
/*
|
||||
|
|
@ -604,6 +882,35 @@ extern "C" {
|
|||
*/
|
||||
#define DRM_FORMAT_MOD_VIVANTE_SPLIT_SUPER_TILED fourcc_mod_code(VIVANTE, 4)
|
||||
|
||||
/*
|
||||
* Vivante TS (tile-status) buffer modifiers. They can be combined with all of
|
||||
* the color buffer tiling modifiers defined above. When TS is present it's a
|
||||
* separate buffer containing the clear/compression status of each tile. The
|
||||
* modifiers are defined as VIVANTE_MOD_TS_c_s, where c is the color buffer
|
||||
* tile size in bytes covered by one entry in the status buffer and s is the
|
||||
* number of status bits per entry.
|
||||
* We reserve the top 8 bits of the Vivante modifier space for tile status
|
||||
* clear/compression modifiers, as future cores might add some more TS layout
|
||||
* variations.
|
||||
*/
|
||||
#define VIVANTE_MOD_TS_64_4 (1ULL << 48)
|
||||
#define VIVANTE_MOD_TS_64_2 (2ULL << 48)
|
||||
#define VIVANTE_MOD_TS_128_4 (3ULL << 48)
|
||||
#define VIVANTE_MOD_TS_256_4 (4ULL << 48)
|
||||
#define VIVANTE_MOD_TS_MASK (0xfULL << 48)
|
||||
|
||||
/*
|
||||
* Vivante compression modifiers. Those depend on a TS modifier being present
|
||||
* as the TS bits get reinterpreted as compression tags instead of simple
|
||||
* clear markers when compression is enabled.
|
||||
*/
|
||||
#define VIVANTE_MOD_COMP_DEC400 (1ULL << 52)
|
||||
#define VIVANTE_MOD_COMP_MASK (0xfULL << 52)
|
||||
|
||||
/* Masking out the extension bits will yield the base modifier. */
|
||||
#define VIVANTE_MOD_EXT_MASK (VIVANTE_MOD_TS_MASK | \
|
||||
VIVANTE_MOD_COMP_MASK)
|
||||
|
||||
/* NVIDIA frame buffer modifiers */
|
||||
|
||||
/*
|
||||
|
|
@ -672,14 +979,20 @@ extern "C" {
|
|||
* 2 = Gob Height 8, Turing+ Page Kind mapping
|
||||
* 3 = Reserved for future use.
|
||||
*
|
||||
* 22:22 s Sector layout. On Tegra GPUs prior to Xavier, there is a further
|
||||
* bit remapping step that occurs at an even lower level than the
|
||||
* page kind and block linear swizzles. This causes the layout of
|
||||
* surfaces mapped in those SOC's GPUs to be incompatible with the
|
||||
* equivalent mapping on other GPUs in the same system.
|
||||
* 22:22 s Sector layout. There is a further bit remapping step that occurs
|
||||
* 26:27 at an even lower level than the page kind and block linear
|
||||
* swizzles. This causes the bit arrangement of surfaces in memory
|
||||
* to differ subtly, and prevents direct sharing of surfaces between
|
||||
* GPUs with different layouts.
|
||||
*
|
||||
* 0 = Tegra K1 - Tegra Parker/TX2 Layout.
|
||||
* 1 = Desktop GPU and Tegra Xavier+ Layout
|
||||
* 0 = Tegra K1 - Tegra Parker/TX2 Layout
|
||||
* 1 = Pre-GB20x, GB20x 32+ bpp, GB10, Tegra Xavier-Orin Layout
|
||||
* 2 = GB20x(Blackwell 2)+ 8 bpp surface layout
|
||||
* 3 = GB20x(Blackwell 2)+ 16 bpp surface layout
|
||||
* 4 = Reserved for future use.
|
||||
* 5 = Reserved for future use.
|
||||
* 6 = Reserved for future use.
|
||||
* 7 = Reserved for future use.
|
||||
*
|
||||
* 25:23 c Lossless Framebuffer Compression type.
|
||||
*
|
||||
|
|
@ -694,7 +1007,7 @@ extern "C" {
|
|||
* 6 = Reserved for future use
|
||||
* 7 = Reserved for future use
|
||||
*
|
||||
* 55:25 - Reserved for future use. Must be zero.
|
||||
* 55:28 - Reserved for future use. Must be zero.
|
||||
*/
|
||||
#define DRM_FORMAT_MOD_NVIDIA_BLOCK_LINEAR_2D(c, s, g, k, h) \
|
||||
fourcc_mod_code(NVIDIA, (0x10 | \
|
||||
|
|
@ -702,6 +1015,7 @@ extern "C" {
|
|||
(((k) & 0xff) << 12) | \
|
||||
(((g) & 0x3) << 20) | \
|
||||
(((s) & 0x1) << 22) | \
|
||||
(((s) & 0x6) << 25) | \
|
||||
(((c) & 0x7) << 23)))
|
||||
|
||||
/* To grandfather in prior block linear format modifiers to the above layout,
|
||||
|
|
@ -816,6 +1130,10 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
|
|||
* and UV. Some SAND-using hardware stores UV in a separate tiled
|
||||
* image from Y to reduce the column height, which is not supported
|
||||
* with these modifiers.
|
||||
*
|
||||
* The DRM_FORMAT_MOD_BROADCOM_SAND128_COL_HEIGHT modifier is also
|
||||
* supported for DRM_FORMAT_P030 where the columns remain as 128 bytes
|
||||
* wide, but as this is a 10 bpp format that translates to 96 pixels.
|
||||
*/
|
||||
|
||||
#define DRM_FORMAT_MOD_BROADCOM_SAND32_COL_HEIGHT(v) \
|
||||
|
|
@ -873,10 +1191,10 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
|
|||
*/
|
||||
|
||||
/*
|
||||
* The top 4 bits (out of the 56 bits alloted for specifying vendor specific
|
||||
* modifiers) denote the category for modifiers. Currently we have only two
|
||||
* categories of modifiers ie AFBC and MISC. We can have a maximum of sixteen
|
||||
* different categories.
|
||||
* The top 4 bits (out of the 56 bits allotted for specifying vendor specific
|
||||
* modifiers) denote the category for modifiers. Currently we have three
|
||||
* categories of modifiers ie AFBC, MISC and AFRC. We can have a maximum of
|
||||
* sixteen different categories.
|
||||
*/
|
||||
#define DRM_FORMAT_MOD_ARM_CODE(__type, __val) \
|
||||
fourcc_mod_code(ARM, ((__u64)(__type) << 52) | ((__val) & 0x000fffffffffffffULL))
|
||||
|
|
@ -991,6 +1309,109 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
|
|||
*/
|
||||
#define AFBC_FORMAT_MOD_USM (1ULL << 12)
|
||||
|
||||
/*
|
||||
* Arm Fixed-Rate Compression (AFRC) modifiers
|
||||
*
|
||||
* AFRC is a proprietary fixed rate image compression protocol and format,
|
||||
* designed to provide guaranteed bandwidth and memory footprint
|
||||
* reductions in graphics and media use-cases.
|
||||
*
|
||||
* AFRC buffers consist of one or more planes, with the same components
|
||||
* and meaning as an uncompressed buffer using the same pixel format.
|
||||
*
|
||||
* Within each plane, the pixel/luma/chroma values are grouped into
|
||||
* "coding unit" blocks which are individually compressed to a
|
||||
* fixed size (in bytes). All coding units within a given plane of a buffer
|
||||
* store the same number of values, and have the same compressed size.
|
||||
*
|
||||
* The coding unit size is configurable, allowing different rates of compression.
|
||||
*
|
||||
* The start of each AFRC buffer plane must be aligned to an alignment granule which
|
||||
* depends on the coding unit size.
|
||||
*
|
||||
* Coding Unit Size Plane Alignment
|
||||
* ---------------- ---------------
|
||||
* 16 bytes 1024 bytes
|
||||
* 24 bytes 512 bytes
|
||||
* 32 bytes 2048 bytes
|
||||
*
|
||||
* Coding units are grouped into paging tiles. AFRC buffer dimensions must be aligned
|
||||
* to a multiple of the paging tile dimensions.
|
||||
* The dimensions of each paging tile depend on whether the buffer is optimised for
|
||||
* scanline (SCAN layout) or rotated (ROT layout) access.
|
||||
*
|
||||
* Layout Paging Tile Width Paging Tile Height
|
||||
* ------ ----------------- ------------------
|
||||
* SCAN 16 coding units 4 coding units
|
||||
* ROT 8 coding units 8 coding units
|
||||
*
|
||||
* The dimensions of each coding unit depend on the number of components
|
||||
* in the compressed plane and whether the buffer is optimised for
|
||||
* scanline (SCAN layout) or rotated (ROT layout) access.
|
||||
*
|
||||
* Number of Components in Plane Layout Coding Unit Width Coding Unit Height
|
||||
* ----------------------------- --------- ----------------- ------------------
|
||||
* 1 SCAN 16 samples 4 samples
|
||||
* Example: 16x4 luma samples in a 'Y' plane
|
||||
* 16x4 chroma 'V' values, in the 'V' plane of a fully-planar YUV buffer
|
||||
* ----------------------------- --------- ----------------- ------------------
|
||||
* 1 ROT 8 samples 8 samples
|
||||
* Example: 8x8 luma samples in a 'Y' plane
|
||||
* 8x8 chroma 'V' values, in the 'V' plane of a fully-planar YUV buffer
|
||||
* ----------------------------- --------- ----------------- ------------------
|
||||
* 2 DONT CARE 8 samples 4 samples
|
||||
* Example: 8x4 chroma pairs in the 'UV' plane of a semi-planar YUV buffer
|
||||
* ----------------------------- --------- ----------------- ------------------
|
||||
* 3 DONT CARE 4 samples 4 samples
|
||||
* Example: 4x4 pixels in an RGB buffer without alpha
|
||||
* ----------------------------- --------- ----------------- ------------------
|
||||
* 4 DONT CARE 4 samples 4 samples
|
||||
* Example: 4x4 pixels in an RGB buffer with alpha
|
||||
*/
|
||||
|
||||
#define DRM_FORMAT_MOD_ARM_TYPE_AFRC 0x02
|
||||
|
||||
#define DRM_FORMAT_MOD_ARM_AFRC(__afrc_mode) \
|
||||
DRM_FORMAT_MOD_ARM_CODE(DRM_FORMAT_MOD_ARM_TYPE_AFRC, __afrc_mode)
|
||||
|
||||
/*
|
||||
* AFRC coding unit size modifier.
|
||||
*
|
||||
* Indicates the number of bytes used to store each compressed coding unit for
|
||||
* one or more planes in an AFRC encoded buffer. The coding unit size for chrominance
|
||||
* is the same for both Cb and Cr, which may be stored in separate planes.
|
||||
*
|
||||
* AFRC_FORMAT_MOD_CU_SIZE_P0 indicates the number of bytes used to store
|
||||
* each compressed coding unit in the first plane of the buffer. For RGBA buffers
|
||||
* this is the only plane, while for semi-planar and fully-planar YUV buffers,
|
||||
* this corresponds to the luma plane.
|
||||
*
|
||||
* AFRC_FORMAT_MOD_CU_SIZE_P12 indicates the number of bytes used to store
|
||||
* each compressed coding unit in the second and third planes in the buffer.
|
||||
* For semi-planar and fully-planar YUV buffers, this corresponds to the chroma plane(s).
|
||||
*
|
||||
* For single-plane buffers, AFRC_FORMAT_MOD_CU_SIZE_P0 must be specified
|
||||
* and AFRC_FORMAT_MOD_CU_SIZE_P12 must be zero.
|
||||
* For semi-planar and fully-planar buffers, both AFRC_FORMAT_MOD_CU_SIZE_P0 and
|
||||
* AFRC_FORMAT_MOD_CU_SIZE_P12 must be specified.
|
||||
*/
|
||||
#define AFRC_FORMAT_MOD_CU_SIZE_MASK 0xf
|
||||
#define AFRC_FORMAT_MOD_CU_SIZE_16 (1ULL)
|
||||
#define AFRC_FORMAT_MOD_CU_SIZE_24 (2ULL)
|
||||
#define AFRC_FORMAT_MOD_CU_SIZE_32 (3ULL)
|
||||
|
||||
#define AFRC_FORMAT_MOD_CU_SIZE_P0(__afrc_cu_size) (__afrc_cu_size)
|
||||
#define AFRC_FORMAT_MOD_CU_SIZE_P12(__afrc_cu_size) ((__afrc_cu_size) << 4)
|
||||
|
||||
/*
|
||||
* AFRC scanline memory layout.
|
||||
*
|
||||
* Indicates if the buffer uses the scanline-optimised layout
|
||||
* for an AFRC encoded buffer, otherwise, it uses the rotation-optimised layout.
|
||||
* The memory layout is the same for all planes.
|
||||
*/
|
||||
#define AFRC_FORMAT_MOD_LAYOUT_SCAN (1ULL << 8)
|
||||
|
||||
/*
|
||||
* Arm 16x16 Block U-Interleaved modifier
|
||||
*
|
||||
|
|
@ -1036,9 +1457,9 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
|
|||
* Not all combinations are valid, and different SoCs may support different
|
||||
* combinations of layout and options.
|
||||
*/
|
||||
#define __fourcc_mod_amlogic_layout_mask 0xf
|
||||
#define __fourcc_mod_amlogic_layout_mask 0xff
|
||||
#define __fourcc_mod_amlogic_options_shift 8
|
||||
#define __fourcc_mod_amlogic_options_mask 0xf
|
||||
#define __fourcc_mod_amlogic_options_mask 0xff
|
||||
|
||||
#define DRM_FORMAT_MOD_AMLOGIC_FBC(__layout, __options) \
|
||||
fourcc_mod_code(AMLOGIC, \
|
||||
|
|
@ -1086,7 +1507,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
|
|||
* Amlogic FBC Memory Saving mode
|
||||
*
|
||||
* Indicates the storage is packed when pixel size is multiple of word
|
||||
* boudaries, i.e. 8bit should be stored in this mode to save allocation
|
||||
* boundaries, i.e. 8bit should be stored in this mode to save allocation
|
||||
* memory.
|
||||
*
|
||||
* This mode reduces body layout to 3072 bytes per 64x32 superblock with
|
||||
|
|
@ -1095,6 +1516,90 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
|
|||
*/
|
||||
#define AMLOGIC_FBC_OPTION_MEM_SAVING (1ULL << 0)
|
||||
|
||||
/* MediaTek modifiers
|
||||
* Bits Parameter Notes
|
||||
* ----- ------------------------ ---------------------------------------------
|
||||
* 7: 0 TILE LAYOUT Values are MTK_FMT_MOD_TILE_*
|
||||
* 15: 8 COMPRESSION Values are MTK_FMT_MOD_COMPRESS_*
|
||||
* 23:16 10 BIT LAYOUT Values are MTK_FMT_MOD_10BIT_LAYOUT_*
|
||||
*
|
||||
*/
|
||||
|
||||
#define DRM_FORMAT_MOD_MTK(__flags) fourcc_mod_code(MTK, __flags)
|
||||
|
||||
/*
|
||||
* MediaTek Tiled Modifier
|
||||
* The lowest 8 bits of the modifier is used to specify the tiling
|
||||
* layout. Only the 16L_32S tiling is used for now, but we define an
|
||||
* "untiled" version and leave room for future expansion.
|
||||
*/
|
||||
#define MTK_FMT_MOD_TILE_MASK 0xf
|
||||
#define MTK_FMT_MOD_TILE_NONE 0x0
|
||||
#define MTK_FMT_MOD_TILE_16L32S 0x1
|
||||
|
||||
/*
|
||||
* Bits 8-15 specify compression options
|
||||
*/
|
||||
#define MTK_FMT_MOD_COMPRESS_MASK (0xf << 8)
|
||||
#define MTK_FMT_MOD_COMPRESS_NONE (0x0 << 8)
|
||||
#define MTK_FMT_MOD_COMPRESS_V1 (0x1 << 8)
|
||||
|
||||
/*
|
||||
* Bits 16-23 specify how the bits of 10 bit formats are
|
||||
* stored out in memory
|
||||
*/
|
||||
#define MTK_FMT_MOD_10BIT_LAYOUT_MASK (0xf << 16)
|
||||
#define MTK_FMT_MOD_10BIT_LAYOUT_PACKED (0x0 << 16)
|
||||
#define MTK_FMT_MOD_10BIT_LAYOUT_LSBTILED (0x1 << 16)
|
||||
#define MTK_FMT_MOD_10BIT_LAYOUT_LSBRASTER (0x2 << 16)
|
||||
|
||||
/* alias for the most common tiling format */
|
||||
#define DRM_FORMAT_MOD_MTK_16L_32S_TILE DRM_FORMAT_MOD_MTK(MTK_FMT_MOD_TILE_16L32S)
|
||||
|
||||
/*
|
||||
* Apple GPU-tiled layouts.
|
||||
*
|
||||
* Apple GPUs support nonlinear tilings with optional lossless compression.
|
||||
*
|
||||
* GPU-tiled images are divided into 16KiB tiles:
|
||||
*
|
||||
* Bytes per pixel Tile size
|
||||
* --------------- ---------
|
||||
* 1 128x128
|
||||
* 2 128x64
|
||||
* 4 64x64
|
||||
* 8 64x32
|
||||
* 16 32x32
|
||||
*
|
||||
* Tiles are raster-order. Pixels within a tile are interleaved (Morton order).
|
||||
*
|
||||
* Compressed images pad the body to 128-bytes and are immediately followed by a
|
||||
* metadata section. The metadata section rounds the image dimensions to
|
||||
* powers-of-two and contains 8 bytes for each 16x16 compression subtile.
|
||||
* Subtiles are interleaved (Morton order).
|
||||
*
|
||||
* All images are 128-byte aligned.
|
||||
*
|
||||
* These layouts fundamentally do not have meaningful strides. No matter how we
|
||||
* specify strides for these layouts, userspace unaware of Apple image layouts
|
||||
* will be unable to use correctly the specified stride for any purpose.
|
||||
* Userspace aware of the image layouts do not use strides. The most "correct"
|
||||
* convention would be setting the image stride to 0. Unfortunately, some
|
||||
* software assumes the stride is at least (width * bytes per pixel). We
|
||||
* therefore require that stride equals (width * bytes per pixel). Since the
|
||||
* stride is arbitrary here, we pick the simplest convention.
|
||||
*
|
||||
* Although containing two sections, compressed image layouts are treated in
|
||||
* software as a single plane. This is modelled after AFBC, a similar
|
||||
* scheme. Attempting to separate the sections to be "explicit" in DRM would
|
||||
* only generate more confusion, as software does not treat the image this way.
|
||||
*
|
||||
* For detailed information on the hardware image layouts, see
|
||||
* https://docs.mesa3d.org/drivers/asahi.html#image-layouts
|
||||
*/
|
||||
#define DRM_FORMAT_MOD_APPLE_GPU_TILED fourcc_mod_code(APPLE, 1)
|
||||
#define DRM_FORMAT_MOD_APPLE_GPU_TILED_COMPRESSED fourcc_mod_code(APPLE, 2)
|
||||
|
||||
/*
|
||||
* AMD modifiers
|
||||
*
|
||||
|
|
@ -1142,6 +1647,8 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
|
|||
#define AMD_FMT_MOD_TILE_VER_GFX9 1
|
||||
#define AMD_FMT_MOD_TILE_VER_GFX10 2
|
||||
#define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 3
|
||||
#define AMD_FMT_MOD_TILE_VER_GFX11 4
|
||||
#define AMD_FMT_MOD_TILE_VER_GFX12 5
|
||||
|
||||
/*
|
||||
* 64K_S is the same for GFX9/GFX10/GFX10_RBPLUS and hence has GFX9 as canonical
|
||||
|
|
@ -1152,11 +1659,30 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
|
|||
/*
|
||||
* 64K_D for non-32 bpp is the same for GFX9/GFX10/GFX10_RBPLUS and hence has
|
||||
* GFX9 as canonical version.
|
||||
*
|
||||
* 64K_D_2D on GFX12 is identical to 64K_D on GFX11.
|
||||
*/
|
||||
#define AMD_FMT_MOD_TILE_GFX9_64K_D 10
|
||||
#define AMD_FMT_MOD_TILE_GFX9_4K_D_X 22
|
||||
#define AMD_FMT_MOD_TILE_GFX9_64K_S_X 25
|
||||
#define AMD_FMT_MOD_TILE_GFX9_64K_D_X 26
|
||||
#define AMD_FMT_MOD_TILE_GFX9_64K_R_X 27
|
||||
#define AMD_FMT_MOD_TILE_GFX11_256K_R_X 31
|
||||
|
||||
/* Gfx12 swizzle modes:
|
||||
* 0 - LINEAR
|
||||
* 1 - 256B_2D - 2D block dimensions
|
||||
* 2 - 4KB_2D
|
||||
* 3 - 64KB_2D
|
||||
* 4 - 256KB_2D
|
||||
* 5 - 4KB_3D - 3D block dimensions
|
||||
* 6 - 64KB_3D
|
||||
* 7 - 256KB_3D
|
||||
*/
|
||||
#define AMD_FMT_MOD_TILE_GFX12_256B_2D 1
|
||||
#define AMD_FMT_MOD_TILE_GFX12_4K_2D 2
|
||||
#define AMD_FMT_MOD_TILE_GFX12_64K_2D 3
|
||||
#define AMD_FMT_MOD_TILE_GFX12_256K_2D 4
|
||||
|
||||
#define AMD_FMT_MOD_DCC_BLOCK_64B 0
|
||||
#define AMD_FMT_MOD_DCC_BLOCK_128B 1
|
||||
|
|
@ -1223,11 +1749,11 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
|
|||
#define AMD_FMT_MOD_PIPE_MASK 0x7
|
||||
|
||||
#define AMD_FMT_MOD_SET(field, value) \
|
||||
((uint64_t)(value) << AMD_FMT_MOD_##field##_SHIFT)
|
||||
((__u64)(value) << AMD_FMT_MOD_##field##_SHIFT)
|
||||
#define AMD_FMT_MOD_GET(field, value) \
|
||||
(((value) >> AMD_FMT_MOD_##field##_SHIFT) & AMD_FMT_MOD_##field##_MASK)
|
||||
#define AMD_FMT_MOD_CLEAR(field) \
|
||||
(~((uint64_t)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIFT))
|
||||
(~((__u64)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIFT))
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ extern "C" {
|
|||
/**
|
||||
* DOC: overview
|
||||
*
|
||||
* DRM exposes many UAPI and structure definition to have a consistent
|
||||
* and standardized interface with user.
|
||||
* DRM exposes many UAPI and structure definitions to have a consistent
|
||||
* and standardized interface with users.
|
||||
* Userspace can refer to these structure definitions and UAPI formats
|
||||
* to communicate to driver
|
||||
* to communicate to drivers.
|
||||
*/
|
||||
|
||||
#define DRM_CONNECTOR_NAME_LEN 32
|
||||
|
|
@ -218,6 +218,27 @@ extern "C" {
|
|||
#define DRM_MODE_CONTENT_PROTECTION_DESIRED 1
|
||||
#define DRM_MODE_CONTENT_PROTECTION_ENABLED 2
|
||||
|
||||
/**
|
||||
* struct drm_mode_modeinfo - Display mode information.
|
||||
* @clock: pixel clock in kHz
|
||||
* @hdisplay: horizontal display size
|
||||
* @hsync_start: horizontal sync start
|
||||
* @hsync_end: horizontal sync end
|
||||
* @htotal: horizontal total size
|
||||
* @hskew: horizontal skew
|
||||
* @vdisplay: vertical display size
|
||||
* @vsync_start: vertical sync start
|
||||
* @vsync_end: vertical sync end
|
||||
* @vtotal: vertical total size
|
||||
* @vscan: vertical scan
|
||||
* @vrefresh: approximate vertical refresh rate in Hz
|
||||
* @flags: bitmask of misc. flags, see DRM_MODE_FLAG_* defines
|
||||
* @type: bitmask of type flags, see DRM_MODE_TYPE_* defines
|
||||
* @name: string describing the mode resolution
|
||||
*
|
||||
* This is the user-space API display mode information structure. For the
|
||||
* kernel version see struct drm_display_mode.
|
||||
*/
|
||||
struct drm_mode_modeinfo {
|
||||
__u32 clock;
|
||||
__u16 hdisplay;
|
||||
|
|
@ -291,16 +312,48 @@ struct drm_mode_set_plane {
|
|||
__u32 src_w;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct drm_mode_get_plane - Get plane metadata.
|
||||
*
|
||||
* Userspace can perform a GETPLANE ioctl to retrieve information about a
|
||||
* plane.
|
||||
*
|
||||
* To retrieve the number of formats supported, set @count_format_types to zero
|
||||
* and call the ioctl. @count_format_types will be updated with the value.
|
||||
*
|
||||
* To retrieve these formats, allocate an array with the memory needed to store
|
||||
* @count_format_types formats. Point @format_type_ptr to this array and call
|
||||
* the ioctl again (with @count_format_types still set to the value returned in
|
||||
* the first ioctl call).
|
||||
*/
|
||||
struct drm_mode_get_plane {
|
||||
/**
|
||||
* @plane_id: Object ID of the plane whose information should be
|
||||
* retrieved. Set by caller.
|
||||
*/
|
||||
__u32 plane_id;
|
||||
|
||||
/** @crtc_id: Object ID of the current CRTC. */
|
||||
__u32 crtc_id;
|
||||
/** @fb_id: Object ID of the current fb. */
|
||||
__u32 fb_id;
|
||||
|
||||
/**
|
||||
* @possible_crtcs: Bitmask of CRTC's compatible with the plane. CRTC's
|
||||
* are created and they receive an index, which corresponds to their
|
||||
* position in the bitmask. Bit N corresponds to
|
||||
* :ref:`CRTC index<crtc_index>` N.
|
||||
*/
|
||||
__u32 possible_crtcs;
|
||||
/** @gamma_size: Never used. */
|
||||
__u32 gamma_size;
|
||||
|
||||
/** @count_format_types: Number of formats. */
|
||||
__u32 count_format_types;
|
||||
/**
|
||||
* @format_type_ptr: Pointer to ``__u32`` array of formats that are
|
||||
* supported by the plane. These formats do not require modifiers.
|
||||
*/
|
||||
__u64 format_type_ptr;
|
||||
};
|
||||
|
||||
|
|
@ -367,28 +420,98 @@ enum drm_mode_subconnector {
|
|||
#define DRM_MODE_CONNECTOR_DPI 17
|
||||
#define DRM_MODE_CONNECTOR_WRITEBACK 18
|
||||
#define DRM_MODE_CONNECTOR_SPI 19
|
||||
#define DRM_MODE_CONNECTOR_USB 20
|
||||
|
||||
/**
|
||||
* struct drm_mode_get_connector - Get connector metadata.
|
||||
*
|
||||
* User-space can perform a GETCONNECTOR ioctl to retrieve information about a
|
||||
* connector. User-space is expected to retrieve encoders, modes and properties
|
||||
* by performing this ioctl at least twice: the first time to retrieve the
|
||||
* number of elements, the second time to retrieve the elements themselves.
|
||||
*
|
||||
* To retrieve the number of elements, set @count_props and @count_encoders to
|
||||
* zero, set @count_modes to 1, and set @modes_ptr to a temporary struct
|
||||
* drm_mode_modeinfo element.
|
||||
*
|
||||
* To retrieve the elements, allocate arrays for @encoders_ptr, @modes_ptr,
|
||||
* @props_ptr and @prop_values_ptr, then set @count_modes, @count_props and
|
||||
* @count_encoders to their capacity.
|
||||
*
|
||||
* Performing the ioctl only twice may be racy: the number of elements may have
|
||||
* changed with a hotplug event in-between the two ioctls. User-space is
|
||||
* expected to retry the last ioctl until the number of elements stabilizes.
|
||||
* The kernel won't fill any array which doesn't have the expected length.
|
||||
*
|
||||
* **Force-probing a connector**
|
||||
*
|
||||
* If the @count_modes field is set to zero and the DRM client is the current
|
||||
* DRM master, the kernel will perform a forced probe on the connector to
|
||||
* refresh the connector status, modes and EDID. A forced-probe can be slow,
|
||||
* might cause flickering and the ioctl will block.
|
||||
*
|
||||
* User-space needs to force-probe connectors to ensure their metadata is
|
||||
* up-to-date at startup and after receiving a hot-plug event. User-space
|
||||
* may perform a forced-probe when the user explicitly requests it. User-space
|
||||
* shouldn't perform a forced-probe in other situations.
|
||||
*/
|
||||
struct drm_mode_get_connector {
|
||||
|
||||
/** @encoders_ptr: Pointer to ``__u32`` array of object IDs. */
|
||||
__u64 encoders_ptr;
|
||||
/** @modes_ptr: Pointer to struct drm_mode_modeinfo array. */
|
||||
__u64 modes_ptr;
|
||||
/** @props_ptr: Pointer to ``__u32`` array of property IDs. */
|
||||
__u64 props_ptr;
|
||||
/** @prop_values_ptr: Pointer to ``__u64`` array of property values. */
|
||||
__u64 prop_values_ptr;
|
||||
|
||||
/** @count_modes: Number of modes. */
|
||||
__u32 count_modes;
|
||||
/** @count_props: Number of properties. */
|
||||
__u32 count_props;
|
||||
/** @count_encoders: Number of encoders. */
|
||||
__u32 count_encoders;
|
||||
|
||||
__u32 encoder_id; /**< Current Encoder */
|
||||
__u32 connector_id; /**< Id */
|
||||
/** @encoder_id: Object ID of the current encoder. */
|
||||
__u32 encoder_id;
|
||||
/** @connector_id: Object ID of the connector. */
|
||||
__u32 connector_id;
|
||||
/**
|
||||
* @connector_type: Type of the connector.
|
||||
*
|
||||
* See DRM_MODE_CONNECTOR_* defines.
|
||||
*/
|
||||
__u32 connector_type;
|
||||
/**
|
||||
* @connector_type_id: Type-specific connector number.
|
||||
*
|
||||
* This is not an object ID. This is a per-type connector number. Each
|
||||
* (type, type_id) combination is unique across all connectors of a DRM
|
||||
* device.
|
||||
*
|
||||
* The (type, type_id) combination is not a stable identifier: the
|
||||
* type_id can change depending on the driver probe order.
|
||||
*/
|
||||
__u32 connector_type_id;
|
||||
|
||||
/**
|
||||
* @connection: Status of the connector.
|
||||
*
|
||||
* See enum drm_connector_status.
|
||||
*/
|
||||
__u32 connection;
|
||||
__u32 mm_width; /**< width in millimeters */
|
||||
__u32 mm_height; /**< height in millimeters */
|
||||
/** @mm_width: Width of the connected sink in millimeters. */
|
||||
__u32 mm_width;
|
||||
/** @mm_height: Height of the connected sink in millimeters. */
|
||||
__u32 mm_height;
|
||||
/**
|
||||
* @subpixel: Subpixel order of the connected sink.
|
||||
*
|
||||
* See enum subpixel_order.
|
||||
*/
|
||||
__u32 subpixel;
|
||||
|
||||
/** @pad: Padding, must be zero. */
|
||||
__u32 pad;
|
||||
};
|
||||
|
||||
|
|
@ -421,22 +544,74 @@ struct drm_mode_get_connector {
|
|||
*/
|
||||
#define DRM_MODE_PROP_ATOMIC 0x80000000
|
||||
|
||||
/**
|
||||
* struct drm_mode_property_enum - Description for an enum/bitfield entry.
|
||||
* @value: numeric value for this enum entry.
|
||||
* @name: symbolic name for this enum entry.
|
||||
*
|
||||
* See struct drm_property_enum for details.
|
||||
*/
|
||||
struct drm_mode_property_enum {
|
||||
__u64 value;
|
||||
char name[DRM_PROP_NAME_LEN];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct drm_mode_get_property - Get property metadata.
|
||||
*
|
||||
* User-space can perform a GETPROPERTY ioctl to retrieve information about a
|
||||
* property. The same property may be attached to multiple objects, see
|
||||
* "Modeset Base Object Abstraction".
|
||||
*
|
||||
* The meaning of the @values_ptr field changes depending on the property type.
|
||||
* See &drm_property.flags for more details.
|
||||
*
|
||||
* The @enum_blob_ptr and @count_enum_blobs fields are only meaningful when the
|
||||
* property has the type &DRM_MODE_PROP_ENUM or &DRM_MODE_PROP_BITMASK. For
|
||||
* backwards compatibility, the kernel will always set @count_enum_blobs to
|
||||
* zero when the property has the type &DRM_MODE_PROP_BLOB. User-space must
|
||||
* ignore these two fields if the property has a different type.
|
||||
*
|
||||
* User-space is expected to retrieve values and enums by performing this ioctl
|
||||
* at least twice: the first time to retrieve the number of elements, the
|
||||
* second time to retrieve the elements themselves.
|
||||
*
|
||||
* To retrieve the number of elements, set @count_values and @count_enum_blobs
|
||||
* to zero, then call the ioctl. @count_values will be updated with the number
|
||||
* of elements. If the property has the type &DRM_MODE_PROP_ENUM or
|
||||
* &DRM_MODE_PROP_BITMASK, @count_enum_blobs will be updated as well.
|
||||
*
|
||||
* To retrieve the elements themselves, allocate an array for @values_ptr and
|
||||
* set @count_values to its capacity. If the property has the type
|
||||
* &DRM_MODE_PROP_ENUM or &DRM_MODE_PROP_BITMASK, allocate an array for
|
||||
* @enum_blob_ptr and set @count_enum_blobs to its capacity. Calling the ioctl
|
||||
* again will fill the arrays.
|
||||
*/
|
||||
struct drm_mode_get_property {
|
||||
__u64 values_ptr; /* values and blob lengths */
|
||||
__u64 enum_blob_ptr; /* enum and blob id ptrs */
|
||||
/** @values_ptr: Pointer to a ``__u64`` array. */
|
||||
__u64 values_ptr;
|
||||
/** @enum_blob_ptr: Pointer to a struct drm_mode_property_enum array. */
|
||||
__u64 enum_blob_ptr;
|
||||
|
||||
/**
|
||||
* @prop_id: Object ID of the property which should be retrieved. Set
|
||||
* by the caller.
|
||||
*/
|
||||
__u32 prop_id;
|
||||
/**
|
||||
* @flags: ``DRM_MODE_PROP_*`` bitfield. See &drm_property.flags for
|
||||
* a definition of the flags.
|
||||
*/
|
||||
__u32 flags;
|
||||
/**
|
||||
* @name: Symbolic property name. User-space should use this field to
|
||||
* recognize properties.
|
||||
*/
|
||||
char name[DRM_PROP_NAME_LEN];
|
||||
|
||||
/** @count_values: Number of elements in @values_ptr. */
|
||||
__u32 count_values;
|
||||
/* This is only used to count enum values, not blobs. The _blobs is
|
||||
* simply because of a historical reason, i.e. backwards compat. */
|
||||
/** @count_enum_blobs: Number of elements in @enum_blob_ptr. */
|
||||
__u32 count_enum_blobs;
|
||||
};
|
||||
|
||||
|
|
@ -454,6 +629,7 @@ struct drm_mode_connector_set_property {
|
|||
#define DRM_MODE_OBJECT_FB 0xfbfbfbfb
|
||||
#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb
|
||||
#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee
|
||||
#define DRM_MODE_OBJECT_COLOROP 0xfafafafa
|
||||
#define DRM_MODE_OBJECT_ANY 0
|
||||
|
||||
struct drm_mode_obj_get_properties {
|
||||
|
|
@ -489,43 +665,75 @@ struct drm_mode_fb_cmd {
|
|||
};
|
||||
|
||||
#define DRM_MODE_FB_INTERLACED (1<<0) /* for interlaced framebuffers */
|
||||
#define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifer[] */
|
||||
#define DRM_MODE_FB_MODIFIERS (1<<1) /* enables ->modifier[] */
|
||||
|
||||
/**
|
||||
* struct drm_mode_fb_cmd2 - Frame-buffer metadata.
|
||||
*
|
||||
* This struct holds frame-buffer metadata. There are two ways to use it:
|
||||
*
|
||||
* - User-space can fill this struct and perform a &DRM_IOCTL_MODE_ADDFB2
|
||||
* ioctl to register a new frame-buffer. The new frame-buffer object ID will
|
||||
* be set by the kernel in @fb_id.
|
||||
* - User-space can set @fb_id and perform a &DRM_IOCTL_MODE_GETFB2 ioctl to
|
||||
* fetch metadata about an existing frame-buffer.
|
||||
*
|
||||
* In case of planar formats, this struct allows up to 4 buffer objects with
|
||||
* offsets and pitches per plane. The pitch and offset order are dictated by
|
||||
* the format FourCC as defined by ``drm_fourcc.h``, e.g. NV12 is described as:
|
||||
*
|
||||
* YUV 4:2:0 image with a plane of 8-bit Y samples followed by an
|
||||
* interleaved U/V plane containing 8-bit 2x2 subsampled colour difference
|
||||
* samples.
|
||||
*
|
||||
* So it would consist of a Y plane at ``offsets[0]`` and a UV plane at
|
||||
* ``offsets[1]``.
|
||||
*
|
||||
* To accommodate tiled, compressed, etc formats, a modifier can be specified.
|
||||
* For more information see the "Format Modifiers" section. Note that even
|
||||
* though it looks like we have a modifier per-plane, we in fact do not. The
|
||||
* modifier for each plane must be identical. Thus all combinations of
|
||||
* different data layouts for multi-plane formats must be enumerated as
|
||||
* separate modifiers.
|
||||
*
|
||||
* All of the entries in @handles, @pitches, @offsets and @modifier must be
|
||||
* zero when unused. Warning, for @offsets and @modifier zero can't be used to
|
||||
* figure out whether the entry is used or not since it's a valid value (a zero
|
||||
* offset is common, and a zero modifier is &DRM_FORMAT_MOD_LINEAR).
|
||||
*/
|
||||
struct drm_mode_fb_cmd2 {
|
||||
/** @fb_id: Object ID of the frame-buffer. */
|
||||
__u32 fb_id;
|
||||
/** @width: Width of the frame-buffer. */
|
||||
__u32 width;
|
||||
/** @height: Height of the frame-buffer. */
|
||||
__u32 height;
|
||||
__u32 pixel_format; /* fourcc code from drm_fourcc.h */
|
||||
__u32 flags; /* see above flags */
|
||||
/**
|
||||
* @pixel_format: FourCC format code, see ``DRM_FORMAT_*`` constants in
|
||||
* ``drm_fourcc.h``.
|
||||
*/
|
||||
__u32 pixel_format;
|
||||
/**
|
||||
* @flags: Frame-buffer flags (see &DRM_MODE_FB_INTERLACED and
|
||||
* &DRM_MODE_FB_MODIFIERS).
|
||||
*/
|
||||
__u32 flags;
|
||||
|
||||
/*
|
||||
* In case of planar formats, this ioctl allows up to 4
|
||||
* buffer objects with offsets and pitches per plane.
|
||||
* The pitch and offset order is dictated by the fourcc,
|
||||
* e.g. NV12 (https://fourcc.org/yuv.php#NV12) is described as:
|
||||
*
|
||||
* YUV 4:2:0 image with a plane of 8 bit Y samples
|
||||
* followed by an interleaved U/V plane containing
|
||||
* 8 bit 2x2 subsampled colour difference samples.
|
||||
*
|
||||
* So it would consist of Y as offsets[0] and UV as
|
||||
* offsets[1]. Note that offsets[0] will generally
|
||||
* be 0 (but this is not required).
|
||||
*
|
||||
* To accommodate tiled, compressed, etc formats, a
|
||||
* modifier can be specified. The default value of zero
|
||||
* indicates "native" format as specified by the fourcc.
|
||||
* Vendor specific modifier token. Note that even though
|
||||
* it looks like we have a modifier per-plane, we in fact
|
||||
* do not. The modifier for each plane must be identical.
|
||||
* Thus all combinations of different data layouts for
|
||||
* multi plane formats must be enumerated as separate
|
||||
* modifiers.
|
||||
/**
|
||||
* @handles: GEM buffer handle, one per plane. Set to 0 if the plane is
|
||||
* unused. The same handle can be used for multiple planes.
|
||||
*/
|
||||
__u32 handles[4];
|
||||
__u32 pitches[4]; /* pitch for each plane */
|
||||
__u32 offsets[4]; /* offset of each plane */
|
||||
__u64 modifier[4]; /* ie, tiling, compress */
|
||||
/** @pitches: Pitch (aka. stride) in bytes, one per plane. */
|
||||
__u32 pitches[4];
|
||||
/** @offsets: Offset into the buffer in bytes, one per plane. */
|
||||
__u32 offsets[4];
|
||||
/**
|
||||
* @modifier: Format modifier, one per plane. See ``DRM_FORMAT_MOD_*``
|
||||
* constants in ``drm_fourcc.h``. All planes must use the same
|
||||
* modifier. Ignored unless &DRM_MODE_FB_MODIFIERS is set in @flags.
|
||||
*/
|
||||
__u64 modifier[4];
|
||||
};
|
||||
|
||||
#define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01
|
||||
|
|
@ -630,10 +838,29 @@ struct drm_color_ctm {
|
|||
/*
|
||||
* Conversion matrix in S31.32 sign-magnitude
|
||||
* (not two's complement!) format.
|
||||
*
|
||||
* out matrix in
|
||||
* |R| |0 1 2| |R|
|
||||
* |G| = |3 4 5| x |G|
|
||||
* |B| |6 7 8| |B|
|
||||
*/
|
||||
__u64 matrix[9];
|
||||
};
|
||||
|
||||
struct drm_color_ctm_3x4 {
|
||||
/*
|
||||
* Conversion matrix with 3x4 dimensions in S31.32 sign-magnitude
|
||||
* (not two's complement!) format.
|
||||
*
|
||||
* out matrix in
|
||||
* |R| |0 1 2 3 | | R |
|
||||
* |G| = |4 5 6 7 | x | G |
|
||||
* |B| |8 9 10 11| | B |
|
||||
* |1.0|
|
||||
*/
|
||||
__u64 matrix[12];
|
||||
};
|
||||
|
||||
struct drm_color_lut {
|
||||
/*
|
||||
* Values are mapped linearly to 0.0 - 1.0 range, with 0x0 == 0.0 and
|
||||
|
|
@ -645,6 +872,138 @@ struct drm_color_lut {
|
|||
__u16 reserved;
|
||||
};
|
||||
|
||||
/*
|
||||
* struct drm_color_lut32
|
||||
*
|
||||
* 32-bit per channel color LUT entry, similar to drm_color_lut.
|
||||
*/
|
||||
struct drm_color_lut32 {
|
||||
__u32 red;
|
||||
__u32 green;
|
||||
__u32 blue;
|
||||
__u32 reserved;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum drm_colorop_type - Type of color operation
|
||||
*
|
||||
* drm_colorops can be of many different types. Each type behaves differently
|
||||
* and defines a different set of properties. This enum defines all types and
|
||||
* gives a high-level description.
|
||||
*/
|
||||
enum drm_colorop_type {
|
||||
/**
|
||||
* @DRM_COLOROP_1D_CURVE:
|
||||
*
|
||||
* enum string "1D Curve"
|
||||
*
|
||||
* A 1D curve that is being applied to all color channels. The
|
||||
* curve is specified via the CURVE_1D_TYPE colorop property.
|
||||
*/
|
||||
DRM_COLOROP_1D_CURVE,
|
||||
|
||||
/**
|
||||
* @DRM_COLOROP_1D_LUT:
|
||||
*
|
||||
* enum string "1D LUT"
|
||||
*
|
||||
* A simple 1D LUT of uniformly spaced &drm_color_lut32 entries,
|
||||
* packed into a blob via the DATA property. The driver's
|
||||
* expected LUT size is advertised via the SIZE property.
|
||||
*
|
||||
* The DATA blob is an array of struct drm_color_lut32 with size
|
||||
* of "size".
|
||||
*/
|
||||
DRM_COLOROP_1D_LUT,
|
||||
|
||||
/**
|
||||
* @DRM_COLOROP_CTM_3X4:
|
||||
*
|
||||
* enum string "3x4 Matrix"
|
||||
*
|
||||
* A 3x4 matrix. Its values are specified via the
|
||||
* &drm_color_ctm_3x4 struct provided via the DATA property.
|
||||
*
|
||||
* The DATA blob is a float[12]:
|
||||
* out matrix in
|
||||
* | R | | 0 1 2 3 | | R |
|
||||
* | G | = | 4 5 6 7 | x | G |
|
||||
* | B | | 8 9 10 12 | | B |
|
||||
*/
|
||||
DRM_COLOROP_CTM_3X4,
|
||||
|
||||
/**
|
||||
* @DRM_COLOROP_MULTIPLIER:
|
||||
*
|
||||
* enum string "Multiplier"
|
||||
*
|
||||
* A simple multiplier, applied to all color values. The
|
||||
* multiplier is specified as a S31.32 via the MULTIPLIER
|
||||
* property.
|
||||
*/
|
||||
DRM_COLOROP_MULTIPLIER,
|
||||
|
||||
/**
|
||||
* @DRM_COLOROP_3D_LUT:
|
||||
*
|
||||
* enum string "3D LUT"
|
||||
*
|
||||
* A 3D LUT of &drm_color_lut32 entries,
|
||||
* packed into a blob via the DATA property. The driver's expected
|
||||
* LUT size is advertised via the SIZE property, i.e., a 3D LUT with
|
||||
* 17x17x17 entries will have SIZE set to 17.
|
||||
*
|
||||
* The DATA blob is a 3D array of struct drm_color_lut32 with dimension
|
||||
* length of "size".
|
||||
* The LUT elements are traversed like so:
|
||||
*
|
||||
* for B in range 0..n
|
||||
* for G in range 0..n
|
||||
* for R in range 0..n
|
||||
* index = R + n * (G + n * B)
|
||||
* color = lut3d[index]
|
||||
*/
|
||||
DRM_COLOROP_3D_LUT,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum drm_colorop_lut3d_interpolation_type - type of 3DLUT interpolation
|
||||
*/
|
||||
enum drm_colorop_lut3d_interpolation_type {
|
||||
/**
|
||||
* @DRM_COLOROP_LUT3D_INTERPOLATION_TETRAHEDRAL:
|
||||
*
|
||||
* Tetrahedral 3DLUT interpolation
|
||||
*/
|
||||
DRM_COLOROP_LUT3D_INTERPOLATION_TETRAHEDRAL,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum drm_colorop_lut1d_interpolation_type - type of interpolation for 1D LUTs
|
||||
*/
|
||||
enum drm_colorop_lut1d_interpolation_type {
|
||||
/**
|
||||
* @DRM_COLOROP_LUT1D_INTERPOLATION_LINEAR:
|
||||
*
|
||||
* Linear interpolation. Values between points of the LUT will be
|
||||
* linearly interpolated.
|
||||
*/
|
||||
DRM_COLOROP_LUT1D_INTERPOLATION_LINEAR,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct drm_plane_size_hint - Plane size hints
|
||||
* @width: The width of the plane in pixel
|
||||
* @height: The height of the plane in pixel
|
||||
*
|
||||
* The plane SIZE_HINTS property blob contains an
|
||||
* array of struct drm_plane_size_hint.
|
||||
*/
|
||||
struct drm_plane_size_hint {
|
||||
__u16 width;
|
||||
__u16 height;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct hdr_metadata_infoframe - HDR Metadata Infoframe Data.
|
||||
*
|
||||
|
|
@ -669,23 +1028,23 @@ struct hdr_metadata_infoframe {
|
|||
* These are coded as unsigned 16-bit values in units of
|
||||
* 0.00002, where 0x0000 represents zero and 0xC350
|
||||
* represents 1.0000.
|
||||
* @display_primaries.x: X cordinate of color primary.
|
||||
* @display_primaries.y: Y cordinate of color primary.
|
||||
* @display_primaries.x: X coordinate of color primary.
|
||||
* @display_primaries.y: Y coordinate of color primary.
|
||||
*/
|
||||
struct {
|
||||
__u16 x, y;
|
||||
} display_primaries[3];
|
||||
} display_primaries[3];
|
||||
/**
|
||||
* @white_point: White Point of Colorspace Data.
|
||||
* These are coded as unsigned 16-bit values in units of
|
||||
* 0.00002, where 0x0000 represents zero and 0xC350
|
||||
* represents 1.0000.
|
||||
* @white_point.x: X cordinate of whitepoint of color primary.
|
||||
* @white_point.y: Y cordinate of whitepoint of color primary.
|
||||
* @white_point.x: X coordinate of whitepoint of color primary.
|
||||
* @white_point.y: Y coordinate of whitepoint of color primary.
|
||||
*/
|
||||
struct {
|
||||
__u16 x, y;
|
||||
} white_point;
|
||||
} white_point;
|
||||
/**
|
||||
* @max_display_mastering_luminance: Max Mastering Display Luminance.
|
||||
* This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
|
||||
|
|
@ -731,12 +1090,48 @@ struct hdr_output_metadata {
|
|||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* DRM_MODE_PAGE_FLIP_EVENT
|
||||
*
|
||||
* Request that the kernel sends back a vblank event (see
|
||||
* struct drm_event_vblank) with the &DRM_EVENT_FLIP_COMPLETE type when the
|
||||
* page-flip is done.
|
||||
*
|
||||
* When used with atomic uAPI, one event will be delivered per CRTC included in
|
||||
* the atomic commit. A CRTC is included in an atomic commit if one of its
|
||||
* properties is set, or if a property is set on a connector or plane linked
|
||||
* via the CRTC_ID property to the CRTC. At least one CRTC must be included,
|
||||
* and all pulled in CRTCs must be either previously or newly powered on (in
|
||||
* other words, a powered off CRTC which stays off cannot be included in the
|
||||
* atomic commit).
|
||||
*/
|
||||
#define DRM_MODE_PAGE_FLIP_EVENT 0x01
|
||||
/**
|
||||
* DRM_MODE_PAGE_FLIP_ASYNC
|
||||
*
|
||||
* Request that the page-flip is performed as soon as possible, ie. with no
|
||||
* delay due to waiting for vblank. This may cause tearing to be visible on
|
||||
* the screen.
|
||||
*
|
||||
* When used with atomic uAPI, the driver will return an error if the hardware
|
||||
* doesn't support performing an asynchronous page-flip for this update.
|
||||
* User-space should handle this, e.g. by falling back to a regular page-flip.
|
||||
*
|
||||
* Note, some hardware might need to perform one last synchronous page-flip
|
||||
* before being able to switch to asynchronous page-flips. As an exception,
|
||||
* the driver will return success even though that first page-flip is not
|
||||
* asynchronous.
|
||||
*/
|
||||
#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
|
||||
#define DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE 0x4
|
||||
#define DRM_MODE_PAGE_FLIP_TARGET_RELATIVE 0x8
|
||||
#define DRM_MODE_PAGE_FLIP_TARGET (DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE | \
|
||||
DRM_MODE_PAGE_FLIP_TARGET_RELATIVE)
|
||||
/**
|
||||
* DRM_MODE_PAGE_FLIP_FLAGS
|
||||
*
|
||||
* Bitmask of flags suitable for &drm_mode_crtc_page_flip_target.flags.
|
||||
*/
|
||||
#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT | \
|
||||
DRM_MODE_PAGE_FLIP_ASYNC | \
|
||||
DRM_MODE_PAGE_FLIP_TARGET)
|
||||
|
|
@ -801,13 +1196,73 @@ struct drm_mode_crtc_page_flip_target {
|
|||
__u64 user_data;
|
||||
};
|
||||
|
||||
/* create a dumb scanout buffer */
|
||||
/**
|
||||
* struct drm_mode_create_dumb - Create a KMS dumb buffer for scanout.
|
||||
* @height: buffer height in pixels
|
||||
* @width: buffer width in pixels
|
||||
* @bpp: color mode
|
||||
* @flags: must be zero
|
||||
* @handle: buffer object handle
|
||||
* @pitch: number of bytes between two consecutive lines
|
||||
* @size: size of the whole buffer in bytes
|
||||
*
|
||||
* User-space fills @height, @width, @bpp and @flags. If the IOCTL succeeds,
|
||||
* the kernel fills @handle, @pitch and @size.
|
||||
*
|
||||
* The value of @bpp is a color-mode number describing a specific format
|
||||
* or a variant thereof. The value often corresponds to the number of bits
|
||||
* per pixel for most modes, although there are exceptions. Each color mode
|
||||
* maps to a DRM format plus a number of modes with similar pixel layout.
|
||||
* Framebuffer layout is always linear.
|
||||
*
|
||||
* Support for all modes and formats is optional. Even if dumb-buffer
|
||||
* creation with a certain color mode succeeds, it is not guaranteed that
|
||||
* the DRM driver supports any of the related formats. Most drivers support
|
||||
* a color mode of 32 with a format of DRM_FORMAT_XRGB8888 on their primary
|
||||
* plane.
|
||||
*
|
||||
* +------------+------------------------+------------------------+
|
||||
* | Color mode | Framebuffer format | Compatible formats |
|
||||
* +============+========================+========================+
|
||||
* | 32 | * DRM_FORMAT_XRGB8888 | * DRM_FORMAT_BGRX8888 |
|
||||
* | | | * DRM_FORMAT_RGBX8888 |
|
||||
* | | | * DRM_FORMAT_XBGR8888 |
|
||||
* +------------+------------------------+------------------------+
|
||||
* | 24 | * DRM_FORMAT_RGB888 | * DRM_FORMAT_BGR888 |
|
||||
* +------------+------------------------+------------------------+
|
||||
* | 16 | * DRM_FORMAT_RGB565 | * DRM_FORMAT_BGR565 |
|
||||
* +------------+------------------------+------------------------+
|
||||
* | 15 | * DRM_FORMAT_XRGB1555 | * DRM_FORMAT_BGRX1555 |
|
||||
* | | | * DRM_FORMAT_RGBX1555 |
|
||||
* | | | * DRM_FORMAT_XBGR1555 |
|
||||
* +------------+------------------------+------------------------+
|
||||
* | 8 | * DRM_FORMAT_C8 | * DRM_FORMAT_D8 |
|
||||
* | | | * DRM_FORMAT_R8 |
|
||||
* +------------+------------------------+------------------------+
|
||||
* | 4 | * DRM_FORMAT_C4 | * DRM_FORMAT_D4 |
|
||||
* | | | * DRM_FORMAT_R4 |
|
||||
* +------------+------------------------+------------------------+
|
||||
* | 2 | * DRM_FORMAT_C2 | * DRM_FORMAT_D2 |
|
||||
* | | | * DRM_FORMAT_R2 |
|
||||
* +------------+------------------------+------------------------+
|
||||
* | 1 | * DRM_FORMAT_C1 | * DRM_FORMAT_D1 |
|
||||
* | | | * DRM_FORMAT_R1 |
|
||||
* +------------+------------------------+------------------------+
|
||||
*
|
||||
* Color modes of 10, 12, 15, 30 and 64 are only supported for use by
|
||||
* legacy user space. Please don't use them in new code. Other modes
|
||||
* are not support.
|
||||
*
|
||||
* Do not attempt to allocate anything but linear framebuffer memory
|
||||
* with single-plane RGB data. Allocation of other framebuffer
|
||||
* layouts requires dedicated ioctls in the respective DRM driver.
|
||||
*/
|
||||
struct drm_mode_create_dumb {
|
||||
__u32 height;
|
||||
__u32 width;
|
||||
__u32 bpp;
|
||||
__u32 flags;
|
||||
/* handle, pitch, size will be returned */
|
||||
|
||||
__u32 handle;
|
||||
__u32 pitch;
|
||||
__u64 size;
|
||||
|
|
@ -830,11 +1285,53 @@ struct drm_mode_destroy_dumb {
|
|||
__u32 handle;
|
||||
};
|
||||
|
||||
/* page-flip flags are valid, plus: */
|
||||
/**
|
||||
* DRM_MODE_ATOMIC_TEST_ONLY
|
||||
*
|
||||
* Do not apply the atomic commit, instead check whether the hardware supports
|
||||
* this configuration.
|
||||
*
|
||||
* See &drm_mode_config_funcs.atomic_check for more details on test-only
|
||||
* commits.
|
||||
*/
|
||||
#define DRM_MODE_ATOMIC_TEST_ONLY 0x0100
|
||||
/**
|
||||
* DRM_MODE_ATOMIC_NONBLOCK
|
||||
*
|
||||
* Do not block while applying the atomic commit. The &DRM_IOCTL_MODE_ATOMIC
|
||||
* IOCTL returns immediately instead of waiting for the changes to be applied
|
||||
* in hardware. Note, the driver will still check that the update can be
|
||||
* applied before retuning.
|
||||
*/
|
||||
#define DRM_MODE_ATOMIC_NONBLOCK 0x0200
|
||||
/**
|
||||
* DRM_MODE_ATOMIC_ALLOW_MODESET
|
||||
*
|
||||
* Allow the update to result in temporary or transient visible artifacts while
|
||||
* the update is being applied. Applying the update may also take significantly
|
||||
* more time than a page flip. All visual artifacts will disappear by the time
|
||||
* the update is completed, as signalled through the vblank event's timestamp
|
||||
* (see struct drm_event_vblank).
|
||||
*
|
||||
* This flag must be set when the KMS update might cause visible artifacts.
|
||||
* Without this flag such KMS update will return a EINVAL error. What kind of
|
||||
* update may cause visible artifacts depends on the driver and the hardware.
|
||||
* User-space that needs to know beforehand if an update might cause visible
|
||||
* artifacts can use &DRM_MODE_ATOMIC_TEST_ONLY without
|
||||
* &DRM_MODE_ATOMIC_ALLOW_MODESET to see if it fails.
|
||||
*
|
||||
* To the best of the driver's knowledge, visual artifacts are guaranteed to
|
||||
* not appear when this flag is not set. Some sinks might display visual
|
||||
* artifacts outside of the driver's control.
|
||||
*/
|
||||
#define DRM_MODE_ATOMIC_ALLOW_MODESET 0x0400
|
||||
|
||||
/**
|
||||
* DRM_MODE_ATOMIC_FLAGS
|
||||
*
|
||||
* Bitfield of flags accepted by the &DRM_IOCTL_MODE_ATOMIC IOCTL in
|
||||
* &drm_mode_atomic.flags.
|
||||
*/
|
||||
#define DRM_MODE_ATOMIC_FLAGS (\
|
||||
DRM_MODE_PAGE_FLIP_EVENT |\
|
||||
DRM_MODE_PAGE_FLIP_ASYNC |\
|
||||
|
|
@ -904,25 +1401,24 @@ struct drm_format_modifier {
|
|||
};
|
||||
|
||||
/**
|
||||
* struct drm_mode_create_blob - Create New block property
|
||||
* @data: Pointer to data to copy.
|
||||
* @length: Length of data to copy.
|
||||
* @blob_id: new property ID.
|
||||
* struct drm_mode_create_blob - Create New blob property
|
||||
*
|
||||
* Create a new 'blob' data property, copying length bytes from data pointer,
|
||||
* and returning new blob ID.
|
||||
*/
|
||||
struct drm_mode_create_blob {
|
||||
/** Pointer to data to copy. */
|
||||
/** @data: Pointer to data to copy. */
|
||||
__u64 data;
|
||||
/** Length of data to copy. */
|
||||
/** @length: Length of data to copy. */
|
||||
__u32 length;
|
||||
/** Return: new property ID. */
|
||||
/** @blob_id: Return: new property ID. */
|
||||
__u32 blob_id;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct drm_mode_destroy_blob - Destroy user blob
|
||||
* @blob_id: blob_id to destroy
|
||||
*
|
||||
* Destroy a user-created blob property.
|
||||
*
|
||||
* User-space can release blobs as soon as they do not need to refer to them by
|
||||
|
|
@ -937,36 +1433,36 @@ struct drm_mode_destroy_blob {
|
|||
|
||||
/**
|
||||
* struct drm_mode_create_lease - Create lease
|
||||
* @object_ids: Pointer to array of object ids.
|
||||
* @object_count: Number of object ids.
|
||||
* @flags: flags for new FD.
|
||||
* @lessee_id: unique identifier for lessee.
|
||||
* @fd: file descriptor to new drm_master file.
|
||||
*
|
||||
* Lease mode resources, creating another drm_master.
|
||||
*
|
||||
* The @object_ids array must reference at least one CRTC, one connector and
|
||||
* one plane if &DRM_CLIENT_CAP_UNIVERSAL_PLANES is enabled. Alternatively,
|
||||
* the lease can be completely empty.
|
||||
*/
|
||||
struct drm_mode_create_lease {
|
||||
/** Pointer to array of object ids (__u32) */
|
||||
/** @object_ids: Pointer to array of object ids (__u32) */
|
||||
__u64 object_ids;
|
||||
/** Number of object ids */
|
||||
/** @object_count: Number of object ids */
|
||||
__u32 object_count;
|
||||
/** flags for new FD (O_CLOEXEC, etc) */
|
||||
/** @flags: flags for new FD (O_CLOEXEC, etc) */
|
||||
__u32 flags;
|
||||
|
||||
/** Return: unique identifier for lessee. */
|
||||
/** @lessee_id: Return: unique identifier for lessee. */
|
||||
__u32 lessee_id;
|
||||
/** Return: file descriptor to new drm_master file */
|
||||
/** @fd: Return: file descriptor to new drm_master file */
|
||||
__u32 fd;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct drm_mode_list_lessees - List lessees
|
||||
* @count_lessees: Number of lessees.
|
||||
* @pad: pad.
|
||||
* @lessees_ptr: Pointer to lessess.
|
||||
* List lesses from a drm_master
|
||||
*
|
||||
* List lesses from a drm_master.
|
||||
*/
|
||||
struct drm_mode_list_lessees {
|
||||
/** Number of lessees.
|
||||
/**
|
||||
* @count_lessees: Number of lessees.
|
||||
*
|
||||
* On input, provides length of the array.
|
||||
* On output, provides total number. No
|
||||
* more than the input number will be written
|
||||
|
|
@ -974,23 +1470,26 @@ struct drm_mode_list_lessees {
|
|||
* the size and then the data.
|
||||
*/
|
||||
__u32 count_lessees;
|
||||
/** @pad: Padding. */
|
||||
__u32 pad;
|
||||
|
||||
/** Pointer to lessees.
|
||||
* pointer to __u64 array of lessee ids
|
||||
/**
|
||||
* @lessees_ptr: Pointer to lessees.
|
||||
*
|
||||
* Pointer to __u64 array of lessee ids
|
||||
*/
|
||||
__u64 lessees_ptr;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct drm_mode_get_lease - Get Lease
|
||||
* @count_objects: Number of leased objects.
|
||||
* @pad: pad.
|
||||
* @objects_ptr: Pointer to objects.
|
||||
* Get leased objects
|
||||
*
|
||||
* Get leased objects.
|
||||
*/
|
||||
struct drm_mode_get_lease {
|
||||
/** Number of leased objects.
|
||||
/**
|
||||
* @count_objects: Number of leased objects.
|
||||
*
|
||||
* On input, provides length of the array.
|
||||
* On output, provides total number. No
|
||||
* more than the input number will be written
|
||||
|
|
@ -998,22 +1497,22 @@ struct drm_mode_get_lease {
|
|||
* the size and then the data.
|
||||
*/
|
||||
__u32 count_objects;
|
||||
/** @pad: Padding. */
|
||||
__u32 pad;
|
||||
|
||||
/** Pointer to objects.
|
||||
* pointer to __u32 array of object ids
|
||||
/**
|
||||
* @objects_ptr: Pointer to objects.
|
||||
*
|
||||
* Pointer to __u32 array of object ids.
|
||||
*/
|
||||
__u64 objects_ptr;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct drm_mode_revoke_lease - Revoke lease
|
||||
* @lessee_id: Unique ID of lessee.
|
||||
* Revoke lease
|
||||
*/
|
||||
struct drm_mode_revoke_lease {
|
||||
/** Unique ID of lessee
|
||||
*/
|
||||
/** @lessee_id: Unique ID of lessee */
|
||||
__u32 lessee_id;
|
||||
};
|
||||
|
||||
|
|
@ -1036,6 +1535,16 @@ struct drm_mode_rect {
|
|||
__s32 y2;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct drm_mode_closefb
|
||||
* @fb_id: Framebuffer ID.
|
||||
* @pad: Must be zero.
|
||||
*/
|
||||
struct drm_mode_closefb {
|
||||
__u32 fb_id;
|
||||
__u32 pad;
|
||||
};
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,27 +1,8 @@
|
|||
/*
|
||||
* Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* Copyright (c) 2012-2020 NVIDIA Corporation */
|
||||
|
||||
#ifndef _TEGRA_DRM_H_
|
||||
#define _TEGRA_DRM_H_
|
||||
#ifndef _UAPI_TEGRA_DRM_H_
|
||||
#define _UAPI_TEGRA_DRM_H_
|
||||
|
||||
#include "drm.h"
|
||||
|
||||
|
|
@ -29,6 +10,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Tegra DRM legacy UAPI. Only enabled with STAGING */
|
||||
|
||||
#define DRM_TEGRA_GEM_CREATE_TILED (1 << 0)
|
||||
#define DRM_TEGRA_GEM_CREATE_BOTTOM_UP (1 << 1)
|
||||
|
||||
|
|
@ -649,8 +632,8 @@ struct drm_tegra_gem_get_flags {
|
|||
#define DRM_TEGRA_SYNCPT_READ 0x02
|
||||
#define DRM_TEGRA_SYNCPT_INCR 0x03
|
||||
#define DRM_TEGRA_SYNCPT_WAIT 0x04
|
||||
#define DRM_TEGRA_OPEN_CHANNEL 0x05
|
||||
#define DRM_TEGRA_CLOSE_CHANNEL 0x06
|
||||
#define DRM_TEGRA_OPEN_CHANNEL 0x05
|
||||
#define DRM_TEGRA_CLOSE_CHANNEL 0x06
|
||||
#define DRM_TEGRA_GET_SYNCPT 0x07
|
||||
#define DRM_TEGRA_SUBMIT 0x08
|
||||
#define DRM_TEGRA_GET_SYNCPT_BASE 0x09
|
||||
|
|
@ -674,6 +657,402 @@ struct drm_tegra_gem_get_flags {
|
|||
#define DRM_IOCTL_TEGRA_GEM_SET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_SET_FLAGS, struct drm_tegra_gem_set_flags)
|
||||
#define DRM_IOCTL_TEGRA_GEM_GET_FLAGS DRM_IOWR(DRM_COMMAND_BASE + DRM_TEGRA_GEM_GET_FLAGS, struct drm_tegra_gem_get_flags)
|
||||
|
||||
/* New Tegra DRM UAPI */
|
||||
|
||||
/*
|
||||
* Reported by the driver in the `capabilities` field.
|
||||
*
|
||||
* DRM_TEGRA_CHANNEL_CAP_CACHE_COHERENT: If set, the engine is cache coherent
|
||||
* with regard to the system memory.
|
||||
*/
|
||||
#define DRM_TEGRA_CHANNEL_CAP_CACHE_COHERENT (1 << 0)
|
||||
|
||||
struct drm_tegra_channel_open {
|
||||
/**
|
||||
* @host1x_class: [in]
|
||||
*
|
||||
* Host1x class of the engine that will be programmed using this
|
||||
* channel.
|
||||
*/
|
||||
__u32 host1x_class;
|
||||
|
||||
/**
|
||||
* @flags: [in]
|
||||
*
|
||||
* Flags.
|
||||
*/
|
||||
__u32 flags;
|
||||
|
||||
/**
|
||||
* @context: [out]
|
||||
*
|
||||
* Opaque identifier corresponding to the opened channel.
|
||||
*/
|
||||
__u32 context;
|
||||
|
||||
/**
|
||||
* @version: [out]
|
||||
*
|
||||
* Version of the engine hardware. This can be used by userspace
|
||||
* to determine how the engine needs to be programmed.
|
||||
*/
|
||||
__u32 version;
|
||||
|
||||
/**
|
||||
* @capabilities: [out]
|
||||
*
|
||||
* Flags describing the hardware capabilities.
|
||||
*/
|
||||
__u32 capabilities;
|
||||
__u32 padding;
|
||||
};
|
||||
|
||||
struct drm_tegra_channel_close {
|
||||
/**
|
||||
* @context: [in]
|
||||
*
|
||||
* Identifier of the channel to close.
|
||||
*/
|
||||
__u32 context;
|
||||
__u32 padding;
|
||||
};
|
||||
|
||||
/*
|
||||
* Mapping flags that can be used to influence how the mapping is created.
|
||||
*
|
||||
* DRM_TEGRA_CHANNEL_MAP_READ: create mapping that allows HW read access
|
||||
* DRM_TEGRA_CHANNEL_MAP_WRITE: create mapping that allows HW write access
|
||||
*/
|
||||
#define DRM_TEGRA_CHANNEL_MAP_READ (1 << 0)
|
||||
#define DRM_TEGRA_CHANNEL_MAP_WRITE (1 << 1)
|
||||
#define DRM_TEGRA_CHANNEL_MAP_READ_WRITE (DRM_TEGRA_CHANNEL_MAP_READ | \
|
||||
DRM_TEGRA_CHANNEL_MAP_WRITE)
|
||||
|
||||
struct drm_tegra_channel_map {
|
||||
/**
|
||||
* @context: [in]
|
||||
*
|
||||
* Identifier of the channel to which make memory available for.
|
||||
*/
|
||||
__u32 context;
|
||||
|
||||
/**
|
||||
* @handle: [in]
|
||||
*
|
||||
* GEM handle of the memory to map.
|
||||
*/
|
||||
__u32 handle;
|
||||
|
||||
/**
|
||||
* @flags: [in]
|
||||
*
|
||||
* Flags.
|
||||
*/
|
||||
__u32 flags;
|
||||
|
||||
/**
|
||||
* @mapping: [out]
|
||||
*
|
||||
* Identifier corresponding to the mapping, to be used for
|
||||
* relocations or unmapping later.
|
||||
*/
|
||||
__u32 mapping;
|
||||
};
|
||||
|
||||
struct drm_tegra_channel_unmap {
|
||||
/**
|
||||
* @context: [in]
|
||||
*
|
||||
* Channel identifier of the channel to unmap memory from.
|
||||
*/
|
||||
__u32 context;
|
||||
|
||||
/**
|
||||
* @mapping: [in]
|
||||
*
|
||||
* Mapping identifier of the memory mapping to unmap.
|
||||
*/
|
||||
__u32 mapping;
|
||||
};
|
||||
|
||||
/* Submission */
|
||||
|
||||
/**
|
||||
* Specify that bit 39 of the patched-in address should be set to switch
|
||||
* swizzling between Tegra and non-Tegra sector layout on systems that store
|
||||
* surfaces in system memory in non-Tegra sector layout.
|
||||
*/
|
||||
#define DRM_TEGRA_SUBMIT_RELOC_SECTOR_LAYOUT (1 << 0)
|
||||
|
||||
struct drm_tegra_submit_buf {
|
||||
/**
|
||||
* @mapping: [in]
|
||||
*
|
||||
* Identifier of the mapping to use in the submission.
|
||||
*/
|
||||
__u32 mapping;
|
||||
|
||||
/**
|
||||
* @flags: [in]
|
||||
*
|
||||
* Flags.
|
||||
*/
|
||||
__u32 flags;
|
||||
|
||||
/**
|
||||
* Information for relocation patching.
|
||||
*/
|
||||
struct {
|
||||
/**
|
||||
* @target_offset: [in]
|
||||
*
|
||||
* Offset from the start of the mapping of the data whose
|
||||
* address is to be patched into the gather.
|
||||
*/
|
||||
__u64 target_offset;
|
||||
|
||||
/**
|
||||
* @gather_offset_words: [in]
|
||||
*
|
||||
* Offset in words from the start of the gather data to
|
||||
* where the address should be patched into.
|
||||
*/
|
||||
__u32 gather_offset_words;
|
||||
|
||||
/**
|
||||
* @shift: [in]
|
||||
*
|
||||
* Number of bits the address should be shifted right before
|
||||
* patching in.
|
||||
*/
|
||||
__u32 shift;
|
||||
} reloc;
|
||||
};
|
||||
|
||||
/**
|
||||
* Execute `words` words of Host1x opcodes specified in the `gather_data_ptr`
|
||||
* buffer. Each GATHER_UPTR command uses successive words from the buffer.
|
||||
*/
|
||||
#define DRM_TEGRA_SUBMIT_CMD_GATHER_UPTR 0
|
||||
/**
|
||||
* Wait for a syncpoint to reach a value before continuing with further
|
||||
* commands.
|
||||
*/
|
||||
#define DRM_TEGRA_SUBMIT_CMD_WAIT_SYNCPT 1
|
||||
/**
|
||||
* Wait for a syncpoint to reach a value before continuing with further
|
||||
* commands. The threshold is calculated relative to the start of the job.
|
||||
*/
|
||||
#define DRM_TEGRA_SUBMIT_CMD_WAIT_SYNCPT_RELATIVE 2
|
||||
|
||||
struct drm_tegra_submit_cmd_gather_uptr {
|
||||
__u32 words;
|
||||
__u32 reserved[3];
|
||||
};
|
||||
|
||||
struct drm_tegra_submit_cmd_wait_syncpt {
|
||||
__u32 id;
|
||||
__u32 value;
|
||||
__u32 reserved[2];
|
||||
};
|
||||
|
||||
struct drm_tegra_submit_cmd {
|
||||
/**
|
||||
* @type: [in]
|
||||
*
|
||||
* Command type to execute. One of the DRM_TEGRA_SUBMIT_CMD*
|
||||
* defines.
|
||||
*/
|
||||
__u32 type;
|
||||
|
||||
/**
|
||||
* @flags: [in]
|
||||
*
|
||||
* Flags.
|
||||
*/
|
||||
__u32 flags;
|
||||
|
||||
union {
|
||||
struct drm_tegra_submit_cmd_gather_uptr gather_uptr;
|
||||
struct drm_tegra_submit_cmd_wait_syncpt wait_syncpt;
|
||||
__u32 reserved[4];
|
||||
};
|
||||
};
|
||||
|
||||
struct drm_tegra_submit_syncpt {
|
||||
/**
|
||||
* @id: [in]
|
||||
*
|
||||
* ID of the syncpoint that the job will increment.
|
||||
*/
|
||||
__u32 id;
|
||||
|
||||
/**
|
||||
* @flags: [in]
|
||||
*
|
||||
* Flags.
|
||||
*/
|
||||
__u32 flags;
|
||||
|
||||
/**
|
||||
* @increments: [in]
|
||||
*
|
||||
* Number of times the job will increment this syncpoint.
|
||||
*/
|
||||
__u32 increments;
|
||||
|
||||
/**
|
||||
* @value: [out]
|
||||
*
|
||||
* Value the syncpoint will have once the job has completed all
|
||||
* its specified syncpoint increments.
|
||||
*
|
||||
* Note that the kernel may increment the syncpoint before or after
|
||||
* the job. These increments are not reflected in this field.
|
||||
*
|
||||
* If the job hangs or times out, not all of the increments may
|
||||
* get executed.
|
||||
*/
|
||||
__u32 value;
|
||||
};
|
||||
|
||||
struct drm_tegra_channel_submit {
|
||||
/**
|
||||
* @context: [in]
|
||||
*
|
||||
* Identifier of the channel to submit this job to.
|
||||
*/
|
||||
__u32 context;
|
||||
|
||||
/**
|
||||
* @num_bufs: [in]
|
||||
*
|
||||
* Number of elements in the `bufs_ptr` array.
|
||||
*/
|
||||
__u32 num_bufs;
|
||||
|
||||
/**
|
||||
* @num_cmds: [in]
|
||||
*
|
||||
* Number of elements in the `cmds_ptr` array.
|
||||
*/
|
||||
__u32 num_cmds;
|
||||
|
||||
/**
|
||||
* @gather_data_words: [in]
|
||||
*
|
||||
* Number of 32-bit words in the `gather_data_ptr` array.
|
||||
*/
|
||||
__u32 gather_data_words;
|
||||
|
||||
/**
|
||||
* @bufs_ptr: [in]
|
||||
*
|
||||
* Pointer to an array of drm_tegra_submit_buf structures.
|
||||
*/
|
||||
__u64 bufs_ptr;
|
||||
|
||||
/**
|
||||
* @cmds_ptr: [in]
|
||||
*
|
||||
* Pointer to an array of drm_tegra_submit_cmd structures.
|
||||
*/
|
||||
__u64 cmds_ptr;
|
||||
|
||||
/**
|
||||
* @gather_data_ptr: [in]
|
||||
*
|
||||
* Pointer to an array of Host1x opcodes to be used by GATHER_UPTR
|
||||
* commands.
|
||||
*/
|
||||
__u64 gather_data_ptr;
|
||||
|
||||
/**
|
||||
* @syncobj_in: [in]
|
||||
*
|
||||
* Handle for DRM syncobj that will be waited before submission.
|
||||
* Ignored if zero.
|
||||
*/
|
||||
__u32 syncobj_in;
|
||||
|
||||
/**
|
||||
* @syncobj_out: [in]
|
||||
*
|
||||
* Handle for DRM syncobj that will have its fence replaced with
|
||||
* the job's completion fence. Ignored if zero.
|
||||
*/
|
||||
__u32 syncobj_out;
|
||||
|
||||
/**
|
||||
* @syncpt_incr: [in,out]
|
||||
*
|
||||
* Information about the syncpoint the job will increment.
|
||||
*/
|
||||
struct drm_tegra_submit_syncpt syncpt;
|
||||
};
|
||||
|
||||
struct drm_tegra_syncpoint_allocate {
|
||||
/**
|
||||
* @id: [out]
|
||||
*
|
||||
* ID of allocated syncpoint.
|
||||
*/
|
||||
__u32 id;
|
||||
__u32 padding;
|
||||
};
|
||||
|
||||
struct drm_tegra_syncpoint_free {
|
||||
/**
|
||||
* @id: [in]
|
||||
*
|
||||
* ID of syncpoint to free.
|
||||
*/
|
||||
__u32 id;
|
||||
__u32 padding;
|
||||
};
|
||||
|
||||
struct drm_tegra_syncpoint_wait {
|
||||
/**
|
||||
* @timeout: [in]
|
||||
*
|
||||
* Absolute timestamp at which the wait will time out.
|
||||
*/
|
||||
__s64 timeout_ns;
|
||||
|
||||
/**
|
||||
* @id: [in]
|
||||
*
|
||||
* ID of syncpoint to wait on.
|
||||
*/
|
||||
__u32 id;
|
||||
|
||||
/**
|
||||
* @threshold: [in]
|
||||
*
|
||||
* Threshold to wait for.
|
||||
*/
|
||||
__u32 threshold;
|
||||
|
||||
/**
|
||||
* @value: [out]
|
||||
*
|
||||
* Value of the syncpoint upon wait completion.
|
||||
*/
|
||||
__u32 value;
|
||||
|
||||
__u32 padding;
|
||||
};
|
||||
|
||||
#define DRM_IOCTL_TEGRA_CHANNEL_OPEN DRM_IOWR(DRM_COMMAND_BASE + 0x10, struct drm_tegra_channel_open)
|
||||
#define DRM_IOCTL_TEGRA_CHANNEL_CLOSE DRM_IOWR(DRM_COMMAND_BASE + 0x11, struct drm_tegra_channel_close)
|
||||
#define DRM_IOCTL_TEGRA_CHANNEL_MAP DRM_IOWR(DRM_COMMAND_BASE + 0x12, struct drm_tegra_channel_map)
|
||||
#define DRM_IOCTL_TEGRA_CHANNEL_UNMAP DRM_IOWR(DRM_COMMAND_BASE + 0x13, struct drm_tegra_channel_unmap)
|
||||
#define DRM_IOCTL_TEGRA_CHANNEL_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + 0x14, struct drm_tegra_channel_submit)
|
||||
|
||||
#define DRM_IOCTL_TEGRA_SYNCPOINT_ALLOCATE DRM_IOWR(DRM_COMMAND_BASE + 0x20, struct drm_tegra_syncpoint_allocate)
|
||||
#define DRM_IOCTL_TEGRA_SYNCPOINT_FREE DRM_IOWR(DRM_COMMAND_BASE + 0x21, struct drm_tegra_syncpoint_free)
|
||||
#define DRM_IOCTL_TEGRA_SYNCPOINT_WAIT DRM_IOWR(DRM_COMMAND_BASE + 0x22, struct drm_tegra_syncpoint_wait)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -46,12 +46,16 @@ extern "C" {
|
|||
#define DRM_VIRTGPU_TRANSFER_TO_HOST 0x07
|
||||
#define DRM_VIRTGPU_WAIT 0x08
|
||||
#define DRM_VIRTGPU_GET_CAPS 0x09
|
||||
#define DRM_VIRTGPU_RESOURCE_CREATE_BLOB 0x0a
|
||||
#define DRM_VIRTGPU_CONTEXT_INIT 0x0b
|
||||
|
||||
#define VIRTGPU_EXECBUF_FENCE_FD_IN 0x01
|
||||
#define VIRTGPU_EXECBUF_FENCE_FD_OUT 0x02
|
||||
#define VIRTGPU_EXECBUF_RING_IDX 0x04
|
||||
#define VIRTGPU_EXECBUF_FLAGS (\
|
||||
VIRTGPU_EXECBUF_FENCE_FD_IN |\
|
||||
VIRTGPU_EXECBUF_FENCE_FD_OUT |\
|
||||
VIRTGPU_EXECBUF_RING_IDX |\
|
||||
0)
|
||||
|
||||
struct drm_virtgpu_map {
|
||||
|
|
@ -60,6 +64,17 @@ struct drm_virtgpu_map {
|
|||
__u32 pad;
|
||||
};
|
||||
|
||||
#define VIRTGPU_EXECBUF_SYNCOBJ_RESET 0x01
|
||||
#define VIRTGPU_EXECBUF_SYNCOBJ_FLAGS ( \
|
||||
VIRTGPU_EXECBUF_SYNCOBJ_RESET | \
|
||||
0)
|
||||
struct drm_virtgpu_execbuffer_syncobj {
|
||||
__u32 handle;
|
||||
__u32 flags;
|
||||
__u64 point;
|
||||
};
|
||||
|
||||
/* fence_fd is modified on success if VIRTGPU_EXECBUF_FENCE_FD_OUT flag is set. */
|
||||
struct drm_virtgpu_execbuffer {
|
||||
__u32 flags;
|
||||
__u32 size;
|
||||
|
|
@ -67,10 +82,22 @@ struct drm_virtgpu_execbuffer {
|
|||
__u64 bo_handles;
|
||||
__u32 num_bo_handles;
|
||||
__s32 fence_fd; /* in/out fence fd (see VIRTGPU_EXECBUF_FENCE_FD_IN/OUT) */
|
||||
__u32 ring_idx; /* command ring index (see VIRTGPU_EXECBUF_RING_IDX) */
|
||||
__u32 syncobj_stride; /* size of @drm_virtgpu_execbuffer_syncobj */
|
||||
__u32 num_in_syncobjs;
|
||||
__u32 num_out_syncobjs;
|
||||
__u64 in_syncobjs;
|
||||
__u64 out_syncobjs;
|
||||
};
|
||||
|
||||
#define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */
|
||||
#define VIRTGPU_PARAM_CAPSET_QUERY_FIX 2 /* do we have the capset fix */
|
||||
#define VIRTGPU_PARAM_RESOURCE_BLOB 3 /* DRM_VIRTGPU_RESOURCE_CREATE_BLOB */
|
||||
#define VIRTGPU_PARAM_HOST_VISIBLE 4 /* Host blob resources are mappable */
|
||||
#define VIRTGPU_PARAM_CROSS_DEVICE 5 /* Cross virtio-device resource sharing */
|
||||
#define VIRTGPU_PARAM_CONTEXT_INIT 6 /* DRM_VIRTGPU_CONTEXT_INIT */
|
||||
#define VIRTGPU_PARAM_SUPPORTED_CAPSET_IDs 7 /* Bitmask of supported capability set ids */
|
||||
#define VIRTGPU_PARAM_EXPLICIT_DEBUG_NAME 8 /* Ability to set debug name from userspace */
|
||||
|
||||
struct drm_virtgpu_getparam {
|
||||
__u64 param;
|
||||
|
|
@ -100,7 +127,7 @@ struct drm_virtgpu_resource_info {
|
|||
__u32 bo_handle;
|
||||
__u32 res_handle;
|
||||
__u32 size;
|
||||
__u32 stride;
|
||||
__u32 blob_mem;
|
||||
};
|
||||
|
||||
struct drm_virtgpu_3d_box {
|
||||
|
|
@ -117,6 +144,8 @@ struct drm_virtgpu_3d_transfer_to_host {
|
|||
struct drm_virtgpu_3d_box box;
|
||||
__u32 level;
|
||||
__u32 offset;
|
||||
__u32 stride;
|
||||
__u32 layer_stride;
|
||||
};
|
||||
|
||||
struct drm_virtgpu_3d_transfer_from_host {
|
||||
|
|
@ -124,6 +153,8 @@ struct drm_virtgpu_3d_transfer_from_host {
|
|||
struct drm_virtgpu_3d_box box;
|
||||
__u32 level;
|
||||
__u32 offset;
|
||||
__u32 stride;
|
||||
__u32 layer_stride;
|
||||
};
|
||||
|
||||
#define VIRTGPU_WAIT_NOWAIT 1 /* like it */
|
||||
|
|
@ -132,6 +163,12 @@ struct drm_virtgpu_3d_wait {
|
|||
__u32 flags;
|
||||
};
|
||||
|
||||
#define VIRTGPU_DRM_CAPSET_VIRGL 1
|
||||
#define VIRTGPU_DRM_CAPSET_VIRGL2 2
|
||||
#define VIRTGPU_DRM_CAPSET_GFXSTREAM_VULKAN 3
|
||||
#define VIRTGPU_DRM_CAPSET_VENUS 4
|
||||
#define VIRTGPU_DRM_CAPSET_CROSS_DOMAIN 5
|
||||
#define VIRTGPU_DRM_CAPSET_DRM 6
|
||||
struct drm_virtgpu_get_caps {
|
||||
__u32 cap_set_id;
|
||||
__u32 cap_set_ver;
|
||||
|
|
@ -140,6 +177,55 @@ struct drm_virtgpu_get_caps {
|
|||
__u32 pad;
|
||||
};
|
||||
|
||||
struct drm_virtgpu_resource_create_blob {
|
||||
#define VIRTGPU_BLOB_MEM_GUEST 0x0001
|
||||
#define VIRTGPU_BLOB_MEM_HOST3D 0x0002
|
||||
#define VIRTGPU_BLOB_MEM_HOST3D_GUEST 0x0003
|
||||
|
||||
#define VIRTGPU_BLOB_FLAG_USE_MAPPABLE 0x0001
|
||||
#define VIRTGPU_BLOB_FLAG_USE_SHAREABLE 0x0002
|
||||
#define VIRTGPU_BLOB_FLAG_USE_CROSS_DEVICE 0x0004
|
||||
/* zero is invalid blob_mem */
|
||||
__u32 blob_mem;
|
||||
__u32 blob_flags;
|
||||
__u32 bo_handle;
|
||||
__u32 res_handle;
|
||||
__u64 size;
|
||||
|
||||
/*
|
||||
* for 3D contexts with VIRTGPU_BLOB_MEM_HOST3D_GUEST and
|
||||
* VIRTGPU_BLOB_MEM_HOST3D otherwise, must be zero.
|
||||
*/
|
||||
__u32 pad;
|
||||
__u32 cmd_size;
|
||||
__u64 cmd;
|
||||
__u64 blob_id;
|
||||
};
|
||||
|
||||
#define VIRTGPU_CONTEXT_PARAM_CAPSET_ID 0x0001
|
||||
#define VIRTGPU_CONTEXT_PARAM_NUM_RINGS 0x0002
|
||||
#define VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK 0x0003
|
||||
#define VIRTGPU_CONTEXT_PARAM_DEBUG_NAME 0x0004
|
||||
struct drm_virtgpu_context_set_param {
|
||||
__u64 param;
|
||||
__u64 value;
|
||||
};
|
||||
|
||||
struct drm_virtgpu_context_init {
|
||||
__u32 num_params;
|
||||
__u32 pad;
|
||||
|
||||
/* pointer to drm_virtgpu_context_set_param array */
|
||||
__u64 ctx_set_params;
|
||||
};
|
||||
|
||||
/*
|
||||
* Event code that's given when VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK is in
|
||||
* effect. The event size is sizeof(drm_event), since there is no additional
|
||||
* payload.
|
||||
*/
|
||||
#define VIRTGPU_EVENT_FENCE_SIGNALED 0x90000000
|
||||
|
||||
#define DRM_IOCTL_VIRTGPU_MAP \
|
||||
DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_MAP, struct drm_virtgpu_map)
|
||||
|
||||
|
|
@ -175,6 +261,14 @@ struct drm_virtgpu_get_caps {
|
|||
DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GET_CAPS, \
|
||||
struct drm_virtgpu_get_caps)
|
||||
|
||||
#define DRM_IOCTL_VIRTGPU_RESOURCE_CREATE_BLOB \
|
||||
DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_CREATE_BLOB, \
|
||||
struct drm_virtgpu_resource_create_blob)
|
||||
|
||||
#define DRM_IOCTL_VIRTGPU_CONTEXT_INIT \
|
||||
DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_CONTEXT_INIT, \
|
||||
struct drm_virtgpu_context_init)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
36
intel/Android.bp
Normal file
36
intel/Android.bp
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
//
|
||||
// Copyright © 2011 Intel Corporation
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the "Software"),
|
||||
// to deal in the Software without restriction, including without limitation
|
||||
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
// and/or sell copies of the Software, and to permit persons to whom the
|
||||
// Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice (including the next
|
||||
// paragraph) shall be included in all copies or substantial portions of the
|
||||
// Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
// IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
build = ["Android.sources.bp"]
|
||||
|
||||
cc_library_shared {
|
||||
name: "libdrm_intel",
|
||||
defaults: [
|
||||
"libdrm_defaults",
|
||||
"libdrm_intel_sources",
|
||||
],
|
||||
vendor: true,
|
||||
|
||||
// Removed dependency to libpciaccess: not used on Android
|
||||
shared_libs: ["libdrm"],
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
#
|
||||
# Copyright © 2011 Intel Corporation
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
# and/or sell copies of the Software, and to permit persons to whom the
|
||||
# Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
# Import variables LIBDRM_INTEL_FILES, LIBDRM_INTEL_H_FILES
|
||||
include $(LOCAL_PATH)/Makefile.sources
|
||||
|
||||
LOCAL_MODULE := libdrm_intel
|
||||
|
||||
LOCAL_SRC_FILES := $(LIBDRM_INTEL_FILES)
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libdrm
|
||||
|
||||
include $(LIBDRM_COMMON_MK)
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
12
intel/Android.sources.bp
Normal file
12
intel/Android.sources.bp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// Autogenerated with Android.sources.bp.mk
|
||||
|
||||
cc_defaults {
|
||||
name: "libdrm_intel_sources",
|
||||
srcs: [
|
||||
"intel_bufmgr.c",
|
||||
"intel_bufmgr_fake.c",
|
||||
"intel_bufmgr_gem.c",
|
||||
"intel_decode.c",
|
||||
"mm.c",
|
||||
],
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
LIBDRM_INTEL_FILES := \
|
||||
i915_pciids.h \
|
||||
intel_bufmgr.c \
|
||||
intel_bufmgr_priv.h \
|
||||
intel_bufmgr_fake.c \
|
||||
intel_bufmgr_gem.c \
|
||||
intel_decode.c \
|
||||
intel_chipset.h \
|
||||
intel_chipset.c \
|
||||
mm.c \
|
||||
mm.h \
|
||||
uthash.h
|
||||
|
||||
LIBDRM_INTEL_H_FILES := \
|
||||
intel_bufmgr.h \
|
||||
intel_aub.h \
|
||||
intel_debug.h
|
||||
|
|
@ -1,669 +0,0 @@
|
|||
/*
|
||||
* Copyright 2013 Intel Corporation
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#ifndef _I915_PCIIDS_H
|
||||
#define _I915_PCIIDS_H
|
||||
|
||||
/*
|
||||
* A pci_device_id struct {
|
||||
* __u32 vendor, device;
|
||||
* __u32 subvendor, subdevice;
|
||||
* __u32 class, class_mask;
|
||||
* kernel_ulong_t driver_data;
|
||||
* };
|
||||
* Don't use C99 here because "class" is reserved and we want to
|
||||
* give userspace flexibility.
|
||||
*/
|
||||
#define INTEL_VGA_DEVICE(id, info) { \
|
||||
0x8086, id, \
|
||||
~0, ~0, \
|
||||
0x030000, 0xff0000, \
|
||||
(unsigned long) info }
|
||||
|
||||
#define INTEL_QUANTA_VGA_DEVICE(info) { \
|
||||
0x8086, 0x16a, \
|
||||
0x152d, 0x8990, \
|
||||
0x030000, 0xff0000, \
|
||||
(unsigned long) info }
|
||||
|
||||
#define INTEL_I810_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x7121, info), /* I810 */ \
|
||||
INTEL_VGA_DEVICE(0x7123, info), /* I810_DC100 */ \
|
||||
INTEL_VGA_DEVICE(0x7125, info) /* I810_E */
|
||||
|
||||
#define INTEL_I815_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x1132, info) /* I815*/
|
||||
|
||||
#define INTEL_I830_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x3577, info)
|
||||
|
||||
#define INTEL_I845G_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2562, info)
|
||||
|
||||
#define INTEL_I85X_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x3582, info), /* I855_GM */ \
|
||||
INTEL_VGA_DEVICE(0x358e, info)
|
||||
|
||||
#define INTEL_I865G_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2572, info) /* I865_G */
|
||||
|
||||
#define INTEL_I915G_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2582, info), /* I915_G */ \
|
||||
INTEL_VGA_DEVICE(0x258a, info) /* E7221_G */
|
||||
|
||||
#define INTEL_I915GM_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2592, info) /* I915_GM */
|
||||
|
||||
#define INTEL_I945G_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2772, info) /* I945_G */
|
||||
|
||||
#define INTEL_I945GM_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x27a2, info), /* I945_GM */ \
|
||||
INTEL_VGA_DEVICE(0x27ae, info) /* I945_GME */
|
||||
|
||||
#define INTEL_I965G_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2972, info), /* I946_GZ */ \
|
||||
INTEL_VGA_DEVICE(0x2982, info), /* G35_G */ \
|
||||
INTEL_VGA_DEVICE(0x2992, info), /* I965_Q */ \
|
||||
INTEL_VGA_DEVICE(0x29a2, info) /* I965_G */
|
||||
|
||||
#define INTEL_G33_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x29b2, info), /* Q35_G */ \
|
||||
INTEL_VGA_DEVICE(0x29c2, info), /* G33_G */ \
|
||||
INTEL_VGA_DEVICE(0x29d2, info) /* Q33_G */
|
||||
|
||||
#define INTEL_I965GM_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2a02, info), /* I965_GM */ \
|
||||
INTEL_VGA_DEVICE(0x2a12, info) /* I965_GME */
|
||||
|
||||
#define INTEL_GM45_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2a42, info) /* GM45_G */
|
||||
|
||||
#define INTEL_G45_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x2e02, info), /* IGD_E_G */ \
|
||||
INTEL_VGA_DEVICE(0x2e12, info), /* Q45_G */ \
|
||||
INTEL_VGA_DEVICE(0x2e22, info), /* G45_G */ \
|
||||
INTEL_VGA_DEVICE(0x2e32, info), /* G41_G */ \
|
||||
INTEL_VGA_DEVICE(0x2e42, info), /* B43_G */ \
|
||||
INTEL_VGA_DEVICE(0x2e92, info) /* B43_G.1 */
|
||||
|
||||
#define INTEL_PINEVIEW_G_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0xa001, info)
|
||||
|
||||
#define INTEL_PINEVIEW_M_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0xa011, info)
|
||||
|
||||
#define INTEL_IRONLAKE_D_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0042, info)
|
||||
|
||||
#define INTEL_IRONLAKE_M_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0046, info)
|
||||
|
||||
#define INTEL_SNB_D_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0102, info), \
|
||||
INTEL_VGA_DEVICE(0x010A, info)
|
||||
|
||||
#define INTEL_SNB_D_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0112, info), \
|
||||
INTEL_VGA_DEVICE(0x0122, info)
|
||||
|
||||
#define INTEL_SNB_D_IDS(info) \
|
||||
INTEL_SNB_D_GT1_IDS(info), \
|
||||
INTEL_SNB_D_GT2_IDS(info)
|
||||
|
||||
#define INTEL_SNB_M_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0106, info)
|
||||
|
||||
#define INTEL_SNB_M_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0116, info), \
|
||||
INTEL_VGA_DEVICE(0x0126, info)
|
||||
|
||||
#define INTEL_SNB_M_IDS(info) \
|
||||
INTEL_SNB_M_GT1_IDS(info), \
|
||||
INTEL_SNB_M_GT2_IDS(info)
|
||||
|
||||
#define INTEL_IVB_M_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0156, info) /* GT1 mobile */
|
||||
|
||||
#define INTEL_IVB_M_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0166, info) /* GT2 mobile */
|
||||
|
||||
#define INTEL_IVB_M_IDS(info) \
|
||||
INTEL_IVB_M_GT1_IDS(info), \
|
||||
INTEL_IVB_M_GT2_IDS(info)
|
||||
|
||||
#define INTEL_IVB_D_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0152, info), /* GT1 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x015a, info) /* GT1 server */
|
||||
|
||||
#define INTEL_IVB_D_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0162, info), /* GT2 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x016a, info) /* GT2 server */
|
||||
|
||||
#define INTEL_IVB_D_IDS(info) \
|
||||
INTEL_IVB_D_GT1_IDS(info), \
|
||||
INTEL_IVB_D_GT2_IDS(info)
|
||||
|
||||
#define INTEL_IVB_Q_IDS(info) \
|
||||
INTEL_QUANTA_VGA_DEVICE(info) /* Quanta transcode */
|
||||
|
||||
#define INTEL_HSW_ULT_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0A02, info), /* ULT GT1 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0A06, info), /* ULT GT1 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0A0A, info), /* ULT GT1 server */ \
|
||||
INTEL_VGA_DEVICE(0x0A0B, info) /* ULT GT1 reserved */
|
||||
|
||||
#define INTEL_HSW_ULX_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0A0E, info) /* ULX GT1 mobile */
|
||||
|
||||
#define INTEL_HSW_GT1_IDS(info) \
|
||||
INTEL_HSW_ULT_GT1_IDS(info), \
|
||||
INTEL_HSW_ULX_GT1_IDS(info), \
|
||||
INTEL_VGA_DEVICE(0x0402, info), /* GT1 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0406, info), /* GT1 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x040A, info), /* GT1 server */ \
|
||||
INTEL_VGA_DEVICE(0x040B, info), /* GT1 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x040E, info), /* GT1 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0C02, info), /* SDV GT1 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0C06, info), /* SDV GT1 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0C0A, info), /* SDV GT1 server */ \
|
||||
INTEL_VGA_DEVICE(0x0C0B, info), /* SDV GT1 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0C0E, info), /* SDV GT1 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0D02, info), /* CRW GT1 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0D06, info), /* CRW GT1 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0D0A, info), /* CRW GT1 server */ \
|
||||
INTEL_VGA_DEVICE(0x0D0B, info), /* CRW GT1 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0D0E, info) /* CRW GT1 reserved */
|
||||
|
||||
#define INTEL_HSW_ULT_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0A12, info), /* ULT GT2 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0A16, info), /* ULT GT2 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0A1A, info), /* ULT GT2 server */ \
|
||||
INTEL_VGA_DEVICE(0x0A1B, info) /* ULT GT2 reserved */ \
|
||||
|
||||
#define INTEL_HSW_ULX_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0A1E, info) /* ULX GT2 mobile */ \
|
||||
|
||||
#define INTEL_HSW_GT2_IDS(info) \
|
||||
INTEL_HSW_ULT_GT2_IDS(info), \
|
||||
INTEL_HSW_ULX_GT2_IDS(info), \
|
||||
INTEL_VGA_DEVICE(0x0412, info), /* GT2 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0416, info), /* GT2 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x041A, info), /* GT2 server */ \
|
||||
INTEL_VGA_DEVICE(0x041B, info), /* GT2 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x041E, info), /* GT2 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0C12, info), /* SDV GT2 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0C16, info), /* SDV GT2 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0C1A, info), /* SDV GT2 server */ \
|
||||
INTEL_VGA_DEVICE(0x0C1B, info), /* SDV GT2 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0C1E, info), /* SDV GT2 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0D12, info), /* CRW GT2 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0D16, info), /* CRW GT2 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0D1A, info), /* CRW GT2 server */ \
|
||||
INTEL_VGA_DEVICE(0x0D1B, info), /* CRW GT2 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0D1E, info) /* CRW GT2 reserved */
|
||||
|
||||
#define INTEL_HSW_ULT_GT3_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0A22, info), /* ULT GT3 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0A26, info), /* ULT GT3 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0A2A, info), /* ULT GT3 server */ \
|
||||
INTEL_VGA_DEVICE(0x0A2B, info), /* ULT GT3 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0A2E, info) /* ULT GT3 reserved */
|
||||
|
||||
#define INTEL_HSW_GT3_IDS(info) \
|
||||
INTEL_HSW_ULT_GT3_IDS(info), \
|
||||
INTEL_VGA_DEVICE(0x0422, info), /* GT3 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0426, info), /* GT3 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x042A, info), /* GT3 server */ \
|
||||
INTEL_VGA_DEVICE(0x042B, info), /* GT3 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x042E, info), /* GT3 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0C22, info), /* SDV GT3 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0C26, info), /* SDV GT3 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0C2A, info), /* SDV GT3 server */ \
|
||||
INTEL_VGA_DEVICE(0x0C2B, info), /* SDV GT3 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0C2E, info), /* SDV GT3 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0D22, info), /* CRW GT3 desktop */ \
|
||||
INTEL_VGA_DEVICE(0x0D26, info), /* CRW GT3 mobile */ \
|
||||
INTEL_VGA_DEVICE(0x0D2A, info), /* CRW GT3 server */ \
|
||||
INTEL_VGA_DEVICE(0x0D2B, info), /* CRW GT3 reserved */ \
|
||||
INTEL_VGA_DEVICE(0x0D2E, info) /* CRW GT3 reserved */
|
||||
|
||||
#define INTEL_HSW_IDS(info) \
|
||||
INTEL_HSW_GT1_IDS(info), \
|
||||
INTEL_HSW_GT2_IDS(info), \
|
||||
INTEL_HSW_GT3_IDS(info)
|
||||
|
||||
#define INTEL_VLV_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0f30, info), \
|
||||
INTEL_VGA_DEVICE(0x0f31, info), \
|
||||
INTEL_VGA_DEVICE(0x0f32, info), \
|
||||
INTEL_VGA_DEVICE(0x0f33, info)
|
||||
|
||||
#define INTEL_BDW_ULT_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x1606, info), /* GT1 ULT */ \
|
||||
INTEL_VGA_DEVICE(0x160B, info) /* GT1 Iris */
|
||||
|
||||
#define INTEL_BDW_ULX_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x160E, info) /* GT1 ULX */
|
||||
|
||||
#define INTEL_BDW_GT1_IDS(info) \
|
||||
INTEL_BDW_ULT_GT1_IDS(info), \
|
||||
INTEL_BDW_ULX_GT1_IDS(info), \
|
||||
INTEL_VGA_DEVICE(0x1602, info), /* GT1 ULT */ \
|
||||
INTEL_VGA_DEVICE(0x160A, info), /* GT1 Server */ \
|
||||
INTEL_VGA_DEVICE(0x160D, info) /* GT1 Workstation */
|
||||
|
||||
#define INTEL_BDW_ULT_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x1616, info), /* GT2 ULT */ \
|
||||
INTEL_VGA_DEVICE(0x161B, info) /* GT2 ULT */
|
||||
|
||||
#define INTEL_BDW_ULX_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x161E, info) /* GT2 ULX */
|
||||
|
||||
#define INTEL_BDW_GT2_IDS(info) \
|
||||
INTEL_BDW_ULT_GT2_IDS(info), \
|
||||
INTEL_BDW_ULX_GT2_IDS(info), \
|
||||
INTEL_VGA_DEVICE(0x1612, info), /* GT2 Halo */ \
|
||||
INTEL_VGA_DEVICE(0x161A, info), /* GT2 Server */ \
|
||||
INTEL_VGA_DEVICE(0x161D, info) /* GT2 Workstation */
|
||||
|
||||
#define INTEL_BDW_ULT_GT3_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x1626, info), /* ULT */ \
|
||||
INTEL_VGA_DEVICE(0x162B, info) /* Iris */ \
|
||||
|
||||
#define INTEL_BDW_ULX_GT3_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x162E, info) /* ULX */
|
||||
|
||||
#define INTEL_BDW_GT3_IDS(info) \
|
||||
INTEL_BDW_ULT_GT3_IDS(info), \
|
||||
INTEL_BDW_ULX_GT3_IDS(info), \
|
||||
INTEL_VGA_DEVICE(0x1622, info), /* ULT */ \
|
||||
INTEL_VGA_DEVICE(0x162A, info), /* Server */ \
|
||||
INTEL_VGA_DEVICE(0x162D, info) /* Workstation */
|
||||
|
||||
#define INTEL_BDW_ULT_RSVD_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x1636, info), /* ULT */ \
|
||||
INTEL_VGA_DEVICE(0x163B, info) /* Iris */
|
||||
|
||||
#define INTEL_BDW_ULX_RSVD_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x163E, info) /* ULX */
|
||||
|
||||
#define INTEL_BDW_RSVD_IDS(info) \
|
||||
INTEL_BDW_ULT_RSVD_IDS(info), \
|
||||
INTEL_BDW_ULX_RSVD_IDS(info), \
|
||||
INTEL_VGA_DEVICE(0x1632, info), /* ULT */ \
|
||||
INTEL_VGA_DEVICE(0x163A, info), /* Server */ \
|
||||
INTEL_VGA_DEVICE(0x163D, info) /* Workstation */
|
||||
|
||||
#define INTEL_BDW_IDS(info) \
|
||||
INTEL_BDW_GT1_IDS(info), \
|
||||
INTEL_BDW_GT2_IDS(info), \
|
||||
INTEL_BDW_GT3_IDS(info), \
|
||||
INTEL_BDW_RSVD_IDS(info)
|
||||
|
||||
#define INTEL_CHV_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x22b0, info), \
|
||||
INTEL_VGA_DEVICE(0x22b1, info), \
|
||||
INTEL_VGA_DEVICE(0x22b2, info), \
|
||||
INTEL_VGA_DEVICE(0x22b3, info)
|
||||
|
||||
#define INTEL_SKL_ULT_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x1906, info), /* ULT GT1 */ \
|
||||
INTEL_VGA_DEVICE(0x1913, info) /* ULT GT1.5 */
|
||||
|
||||
#define INTEL_SKL_ULX_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x190E, info), /* ULX GT1 */ \
|
||||
INTEL_VGA_DEVICE(0x1915, info) /* ULX GT1.5 */
|
||||
|
||||
#define INTEL_SKL_GT1_IDS(info) \
|
||||
INTEL_SKL_ULT_GT1_IDS(info), \
|
||||
INTEL_SKL_ULX_GT1_IDS(info), \
|
||||
INTEL_VGA_DEVICE(0x1902, info), /* DT GT1 */ \
|
||||
INTEL_VGA_DEVICE(0x190A, info), /* SRV GT1 */ \
|
||||
INTEL_VGA_DEVICE(0x190B, info), /* Halo GT1 */ \
|
||||
INTEL_VGA_DEVICE(0x1917, info) /* DT GT1.5 */
|
||||
|
||||
#define INTEL_SKL_ULT_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x1916, info), /* ULT GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x1921, info) /* ULT GT2F */
|
||||
|
||||
#define INTEL_SKL_ULX_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x191E, info) /* ULX GT2 */
|
||||
|
||||
#define INTEL_SKL_GT2_IDS(info) \
|
||||
INTEL_SKL_ULT_GT2_IDS(info), \
|
||||
INTEL_SKL_ULX_GT2_IDS(info), \
|
||||
INTEL_VGA_DEVICE(0x1912, info), /* DT GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x191A, info), /* SRV GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x191B, info), /* Halo GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x191D, info) /* WKS GT2 */
|
||||
|
||||
#define INTEL_SKL_ULT_GT3_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x1923, info), /* ULT GT3 */ \
|
||||
INTEL_VGA_DEVICE(0x1926, info), /* ULT GT3e */ \
|
||||
INTEL_VGA_DEVICE(0x1927, info) /* ULT GT3e */
|
||||
|
||||
#define INTEL_SKL_GT3_IDS(info) \
|
||||
INTEL_SKL_ULT_GT3_IDS(info), \
|
||||
INTEL_VGA_DEVICE(0x192A, info), /* SRV GT3 */ \
|
||||
INTEL_VGA_DEVICE(0x192B, info), /* Halo GT3e */ \
|
||||
INTEL_VGA_DEVICE(0x192D, info) /* SRV GT3e */
|
||||
|
||||
#define INTEL_SKL_GT4_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x1932, info), /* DT GT4 */ \
|
||||
INTEL_VGA_DEVICE(0x193A, info), /* SRV GT4e */ \
|
||||
INTEL_VGA_DEVICE(0x193B, info), /* Halo GT4e */ \
|
||||
INTEL_VGA_DEVICE(0x193D, info) /* WKS GT4e */
|
||||
|
||||
#define INTEL_SKL_IDS(info) \
|
||||
INTEL_SKL_GT1_IDS(info), \
|
||||
INTEL_SKL_GT2_IDS(info), \
|
||||
INTEL_SKL_GT3_IDS(info), \
|
||||
INTEL_SKL_GT4_IDS(info)
|
||||
|
||||
#define INTEL_BXT_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x0A84, info), \
|
||||
INTEL_VGA_DEVICE(0x1A84, info), \
|
||||
INTEL_VGA_DEVICE(0x1A85, info), \
|
||||
INTEL_VGA_DEVICE(0x5A84, info), /* APL HD Graphics 505 */ \
|
||||
INTEL_VGA_DEVICE(0x5A85, info) /* APL HD Graphics 500 */
|
||||
|
||||
#define INTEL_GLK_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x3184, info), \
|
||||
INTEL_VGA_DEVICE(0x3185, info)
|
||||
|
||||
#define INTEL_KBL_ULT_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x5906, info), /* ULT GT1 */ \
|
||||
INTEL_VGA_DEVICE(0x5913, info) /* ULT GT1.5 */
|
||||
|
||||
#define INTEL_KBL_ULX_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x590E, info), /* ULX GT1 */ \
|
||||
INTEL_VGA_DEVICE(0x5915, info) /* ULX GT1.5 */
|
||||
|
||||
#define INTEL_KBL_GT1_IDS(info) \
|
||||
INTEL_KBL_ULT_GT1_IDS(info), \
|
||||
INTEL_KBL_ULX_GT1_IDS(info), \
|
||||
INTEL_VGA_DEVICE(0x5902, info), /* DT GT1 */ \
|
||||
INTEL_VGA_DEVICE(0x5908, info), /* Halo GT1 */ \
|
||||
INTEL_VGA_DEVICE(0x590A, info), /* SRV GT1 */ \
|
||||
INTEL_VGA_DEVICE(0x590B, info) /* Halo GT1 */
|
||||
|
||||
#define INTEL_KBL_ULT_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x5916, info), /* ULT GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x5921, info) /* ULT GT2F */
|
||||
|
||||
#define INTEL_KBL_ULX_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x591E, info) /* ULX GT2 */
|
||||
|
||||
#define INTEL_KBL_GT2_IDS(info) \
|
||||
INTEL_KBL_ULT_GT2_IDS(info), \
|
||||
INTEL_KBL_ULX_GT2_IDS(info), \
|
||||
INTEL_VGA_DEVICE(0x5912, info), /* DT GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x5917, info), /* Mobile GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x591A, info), /* SRV GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x591B, info), /* Halo GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x591D, info) /* WKS GT2 */
|
||||
|
||||
#define INTEL_KBL_ULT_GT3_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x5926, info) /* ULT GT3 */
|
||||
|
||||
#define INTEL_KBL_GT3_IDS(info) \
|
||||
INTEL_KBL_ULT_GT3_IDS(info), \
|
||||
INTEL_VGA_DEVICE(0x5923, info), /* ULT GT3 */ \
|
||||
INTEL_VGA_DEVICE(0x5927, info) /* ULT GT3 */
|
||||
|
||||
#define INTEL_KBL_GT4_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x593B, info) /* Halo GT4 */
|
||||
|
||||
/* AML/KBL Y GT2 */
|
||||
#define INTEL_AML_KBL_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x591C, info), /* ULX GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x87C0, info) /* ULX GT2 */
|
||||
|
||||
/* AML/CFL Y GT2 */
|
||||
#define INTEL_AML_CFL_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x87CA, info)
|
||||
|
||||
/* CML GT1 */
|
||||
#define INTEL_CML_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x9BA2, info), \
|
||||
INTEL_VGA_DEVICE(0x9BA4, info), \
|
||||
INTEL_VGA_DEVICE(0x9BA5, info), \
|
||||
INTEL_VGA_DEVICE(0x9BA8, info)
|
||||
|
||||
#define INTEL_CML_U_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x9B21, info), \
|
||||
INTEL_VGA_DEVICE(0x9BAA, info), \
|
||||
INTEL_VGA_DEVICE(0x9BAC, info)
|
||||
|
||||
/* CML GT2 */
|
||||
#define INTEL_CML_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x9BC2, info), \
|
||||
INTEL_VGA_DEVICE(0x9BC4, info), \
|
||||
INTEL_VGA_DEVICE(0x9BC5, info), \
|
||||
INTEL_VGA_DEVICE(0x9BC6, info), \
|
||||
INTEL_VGA_DEVICE(0x9BC8, info), \
|
||||
INTEL_VGA_DEVICE(0x9BE6, info), \
|
||||
INTEL_VGA_DEVICE(0x9BF6, info)
|
||||
|
||||
#define INTEL_CML_U_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x9B41, info), \
|
||||
INTEL_VGA_DEVICE(0x9BCA, info), \
|
||||
INTEL_VGA_DEVICE(0x9BCC, info)
|
||||
|
||||
#define INTEL_KBL_IDS(info) \
|
||||
INTEL_KBL_GT1_IDS(info), \
|
||||
INTEL_KBL_GT2_IDS(info), \
|
||||
INTEL_KBL_GT3_IDS(info), \
|
||||
INTEL_KBL_GT4_IDS(info), \
|
||||
INTEL_AML_KBL_GT2_IDS(info)
|
||||
|
||||
/* CFL S */
|
||||
#define INTEL_CFL_S_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x3E90, info), /* SRV GT1 */ \
|
||||
INTEL_VGA_DEVICE(0x3E93, info), /* SRV GT1 */ \
|
||||
INTEL_VGA_DEVICE(0x3E99, info) /* SRV GT1 */
|
||||
|
||||
#define INTEL_CFL_S_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x3E91, info), /* SRV GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x3E92, info), /* SRV GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x3E96, info), /* SRV GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x3E98, info), /* SRV GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x3E9A, info) /* SRV GT2 */
|
||||
|
||||
/* CFL H */
|
||||
#define INTEL_CFL_H_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x3E9C, info)
|
||||
|
||||
#define INTEL_CFL_H_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x3E94, info), /* Halo GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x3E9B, info) /* Halo GT2 */
|
||||
|
||||
/* CFL U GT2 */
|
||||
#define INTEL_CFL_U_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x3EA9, info)
|
||||
|
||||
/* CFL U GT3 */
|
||||
#define INTEL_CFL_U_GT3_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x3EA5, info), /* ULT GT3 */ \
|
||||
INTEL_VGA_DEVICE(0x3EA6, info), /* ULT GT3 */ \
|
||||
INTEL_VGA_DEVICE(0x3EA7, info), /* ULT GT3 */ \
|
||||
INTEL_VGA_DEVICE(0x3EA8, info) /* ULT GT3 */
|
||||
|
||||
/* WHL/CFL U GT1 */
|
||||
#define INTEL_WHL_U_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x3EA1, info), \
|
||||
INTEL_VGA_DEVICE(0x3EA4, info)
|
||||
|
||||
/* WHL/CFL U GT2 */
|
||||
#define INTEL_WHL_U_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x3EA0, info), \
|
||||
INTEL_VGA_DEVICE(0x3EA3, info)
|
||||
|
||||
/* WHL/CFL U GT3 */
|
||||
#define INTEL_WHL_U_GT3_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x3EA2, info)
|
||||
|
||||
#define INTEL_CFL_IDS(info) \
|
||||
INTEL_CFL_S_GT1_IDS(info), \
|
||||
INTEL_CFL_S_GT2_IDS(info), \
|
||||
INTEL_CFL_H_GT1_IDS(info), \
|
||||
INTEL_CFL_H_GT2_IDS(info), \
|
||||
INTEL_CFL_U_GT2_IDS(info), \
|
||||
INTEL_CFL_U_GT3_IDS(info), \
|
||||
INTEL_WHL_U_GT1_IDS(info), \
|
||||
INTEL_WHL_U_GT2_IDS(info), \
|
||||
INTEL_WHL_U_GT3_IDS(info), \
|
||||
INTEL_AML_CFL_GT2_IDS(info), \
|
||||
INTEL_CML_GT1_IDS(info), \
|
||||
INTEL_CML_GT2_IDS(info), \
|
||||
INTEL_CML_U_GT1_IDS(info), \
|
||||
INTEL_CML_U_GT2_IDS(info)
|
||||
|
||||
/* CNL */
|
||||
#define INTEL_CNL_PORT_F_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x5A44, info), \
|
||||
INTEL_VGA_DEVICE(0x5A4C, info), \
|
||||
INTEL_VGA_DEVICE(0x5A54, info), \
|
||||
INTEL_VGA_DEVICE(0x5A5C, info)
|
||||
|
||||
#define INTEL_CNL_IDS(info) \
|
||||
INTEL_CNL_PORT_F_IDS(info), \
|
||||
INTEL_VGA_DEVICE(0x5A40, info), \
|
||||
INTEL_VGA_DEVICE(0x5A41, info), \
|
||||
INTEL_VGA_DEVICE(0x5A42, info), \
|
||||
INTEL_VGA_DEVICE(0x5A49, info), \
|
||||
INTEL_VGA_DEVICE(0x5A4A, info), \
|
||||
INTEL_VGA_DEVICE(0x5A50, info), \
|
||||
INTEL_VGA_DEVICE(0x5A51, info), \
|
||||
INTEL_VGA_DEVICE(0x5A52, info), \
|
||||
INTEL_VGA_DEVICE(0x5A59, info), \
|
||||
INTEL_VGA_DEVICE(0x5A5A, info)
|
||||
|
||||
/* ICL */
|
||||
#define INTEL_ICL_PORT_F_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x8A50, info), \
|
||||
INTEL_VGA_DEVICE(0x8A52, info), \
|
||||
INTEL_VGA_DEVICE(0x8A53, info), \
|
||||
INTEL_VGA_DEVICE(0x8A54, info), \
|
||||
INTEL_VGA_DEVICE(0x8A56, info), \
|
||||
INTEL_VGA_DEVICE(0x8A57, info), \
|
||||
INTEL_VGA_DEVICE(0x8A58, info), \
|
||||
INTEL_VGA_DEVICE(0x8A59, info), \
|
||||
INTEL_VGA_DEVICE(0x8A5A, info), \
|
||||
INTEL_VGA_DEVICE(0x8A5B, info), \
|
||||
INTEL_VGA_DEVICE(0x8A5C, info), \
|
||||
INTEL_VGA_DEVICE(0x8A70, info), \
|
||||
INTEL_VGA_DEVICE(0x8A71, info)
|
||||
|
||||
#define INTEL_ICL_11_IDS(info) \
|
||||
INTEL_ICL_PORT_F_IDS(info), \
|
||||
INTEL_VGA_DEVICE(0x8A51, info), \
|
||||
INTEL_VGA_DEVICE(0x8A5D, info)
|
||||
|
||||
/* EHL */
|
||||
#define INTEL_EHL_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x4541, info), \
|
||||
INTEL_VGA_DEVICE(0x4551, info), \
|
||||
INTEL_VGA_DEVICE(0x4555, info), \
|
||||
INTEL_VGA_DEVICE(0x4557, info), \
|
||||
INTEL_VGA_DEVICE(0x4571, info)
|
||||
|
||||
/* JSL */
|
||||
#define INTEL_JSL_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x4E51, info), \
|
||||
INTEL_VGA_DEVICE(0x4E55, info), \
|
||||
INTEL_VGA_DEVICE(0x4E57, info), \
|
||||
INTEL_VGA_DEVICE(0x4E61, info), \
|
||||
INTEL_VGA_DEVICE(0x4E71, info)
|
||||
|
||||
/* TGL */
|
||||
#define INTEL_TGL_12_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x9A60, info), \
|
||||
INTEL_VGA_DEVICE(0x9A68, info), \
|
||||
INTEL_VGA_DEVICE(0x9A70, info)
|
||||
|
||||
#define INTEL_TGL_12_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x9A40, info), \
|
||||
INTEL_VGA_DEVICE(0x9A49, info), \
|
||||
INTEL_VGA_DEVICE(0x9A59, info), \
|
||||
INTEL_VGA_DEVICE(0x9A78, info), \
|
||||
INTEL_VGA_DEVICE(0x9AC0, info), \
|
||||
INTEL_VGA_DEVICE(0x9AC9, info), \
|
||||
INTEL_VGA_DEVICE(0x9AD9, info), \
|
||||
INTEL_VGA_DEVICE(0x9AF8, info)
|
||||
|
||||
#define INTEL_TGL_12_IDS(info) \
|
||||
INTEL_TGL_12_GT1_IDS(info), \
|
||||
INTEL_TGL_12_GT2_IDS(info)
|
||||
|
||||
/* RKL */
|
||||
#define INTEL_RKL_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x4C80, info), \
|
||||
INTEL_VGA_DEVICE(0x4C8A, info), \
|
||||
INTEL_VGA_DEVICE(0x4C8B, info), \
|
||||
INTEL_VGA_DEVICE(0x4C8C, info), \
|
||||
INTEL_VGA_DEVICE(0x4C90, info), \
|
||||
INTEL_VGA_DEVICE(0x4C9A, info)
|
||||
|
||||
/* DG1 */
|
||||
#define INTEL_DG1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x4905, info), \
|
||||
INTEL_VGA_DEVICE(0x4906, info), \
|
||||
INTEL_VGA_DEVICE(0x4907, info), \
|
||||
INTEL_VGA_DEVICE(0x4908, info)
|
||||
|
||||
/* ADL-S */
|
||||
#define INTEL_ADLS_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x4680, info), \
|
||||
INTEL_VGA_DEVICE(0x4681, info), \
|
||||
INTEL_VGA_DEVICE(0x4682, info), \
|
||||
INTEL_VGA_DEVICE(0x4683, info), \
|
||||
INTEL_VGA_DEVICE(0x4690, info), \
|
||||
INTEL_VGA_DEVICE(0x4691, info), \
|
||||
INTEL_VGA_DEVICE(0x4692, info), \
|
||||
INTEL_VGA_DEVICE(0x4693, info)
|
||||
|
||||
/* ADL-P */
|
||||
#define INTEL_ADLP_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x46A0, info), \
|
||||
INTEL_VGA_DEVICE(0x46A1, info), \
|
||||
INTEL_VGA_DEVICE(0x46A2, info), \
|
||||
INTEL_VGA_DEVICE(0x46A3, info), \
|
||||
INTEL_VGA_DEVICE(0x46A6, info), \
|
||||
INTEL_VGA_DEVICE(0x46A8, info), \
|
||||
INTEL_VGA_DEVICE(0x46AA, info), \
|
||||
INTEL_VGA_DEVICE(0x462A, info), \
|
||||
INTEL_VGA_DEVICE(0x4626, info), \
|
||||
INTEL_VGA_DEVICE(0x4628, info), \
|
||||
INTEL_VGA_DEVICE(0x46B0, info), \
|
||||
INTEL_VGA_DEVICE(0x46B1, info), \
|
||||
INTEL_VGA_DEVICE(0x46B2, info), \
|
||||
INTEL_VGA_DEVICE(0x46B3, info), \
|
||||
INTEL_VGA_DEVICE(0x46C0, info), \
|
||||
INTEL_VGA_DEVICE(0x46C1, info), \
|
||||
INTEL_VGA_DEVICE(0x46C2, info), \
|
||||
INTEL_VGA_DEVICE(0x46C3, info)
|
||||
|
||||
#endif /* _I915_PCIIDS_H */
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright © 2007 Red Hat Inc.
|
||||
* Copyright © 2007-2012 Intel Corporation
|
||||
* Copyright © 2007 Red Hat Inc.
|
||||
* Copyright © 2007-2012 Intel Corporation
|
||||
* Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA
|
||||
* All Rights Reserved.
|
||||
*
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
*
|
||||
**************************************************************************/
|
||||
/*
|
||||
* Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
|
||||
* Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
|
||||
* Keith Whitwell <keithw-at-tungstengraphics-dot-com>
|
||||
* Eric Anholt <eric@anholt.net>
|
||||
* Dave Airlie <airlied@linux.ie>
|
||||
|
|
@ -114,7 +114,6 @@ typedef struct _drm_intel_bufmgr_gem {
|
|||
|
||||
pthread_mutex_t lock;
|
||||
|
||||
struct drm_i915_gem_exec_object *exec_objects;
|
||||
struct drm_i915_gem_exec_object2 *exec2_objects;
|
||||
drm_intel_bo **exec_bos;
|
||||
int exec_size;
|
||||
|
|
@ -479,44 +478,6 @@ drm_intel_gem_bo_reference(drm_intel_bo *bo)
|
|||
* with the intersection of the memory type flags and the union of the
|
||||
* access flags.
|
||||
*/
|
||||
static void
|
||||
drm_intel_add_validate_buffer(drm_intel_bo *bo)
|
||||
{
|
||||
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr;
|
||||
drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
|
||||
int index;
|
||||
|
||||
if (bo_gem->validate_index != -1)
|
||||
return;
|
||||
|
||||
/* Extend the array of validation entries as necessary. */
|
||||
if (bufmgr_gem->exec_count == bufmgr_gem->exec_size) {
|
||||
int new_size = bufmgr_gem->exec_size * 2;
|
||||
|
||||
if (new_size == 0)
|
||||
new_size = 5;
|
||||
|
||||
bufmgr_gem->exec_objects =
|
||||
realloc(bufmgr_gem->exec_objects,
|
||||
sizeof(*bufmgr_gem->exec_objects) * new_size);
|
||||
bufmgr_gem->exec_bos =
|
||||
realloc(bufmgr_gem->exec_bos,
|
||||
sizeof(*bufmgr_gem->exec_bos) * new_size);
|
||||
bufmgr_gem->exec_size = new_size;
|
||||
}
|
||||
|
||||
index = bufmgr_gem->exec_count;
|
||||
bo_gem->validate_index = index;
|
||||
/* Fill in array entry */
|
||||
bufmgr_gem->exec_objects[index].handle = bo_gem->gem_handle;
|
||||
bufmgr_gem->exec_objects[index].relocation_count = bo_gem->reloc_count;
|
||||
bufmgr_gem->exec_objects[index].relocs_ptr = (uintptr_t) bo_gem->relocs;
|
||||
bufmgr_gem->exec_objects[index].alignment = bo->align;
|
||||
bufmgr_gem->exec_objects[index].offset = 0;
|
||||
bufmgr_gem->exec_bos[index] = bo;
|
||||
bufmgr_gem->exec_count++;
|
||||
}
|
||||
|
||||
static void
|
||||
drm_intel_add_validate_buffer2(drm_intel_bo *bo, int need_fence)
|
||||
{
|
||||
|
|
@ -1191,7 +1152,6 @@ drm_intel_gem_bo_free(drm_intel_bo *bo)
|
|||
{
|
||||
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr;
|
||||
drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
|
||||
struct drm_gem_close close;
|
||||
int ret;
|
||||
|
||||
DRMLISTDEL(&bo_gem->vma_list);
|
||||
|
|
@ -1215,11 +1175,9 @@ drm_intel_gem_bo_free(drm_intel_bo *bo)
|
|||
HASH_DELETE(handle_hh, bufmgr_gem->handle_table, bo_gem);
|
||||
|
||||
/* Close this object */
|
||||
memclear(close);
|
||||
close.handle = bo_gem->gem_handle;
|
||||
ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_GEM_CLOSE, &close);
|
||||
ret = drmCloseBufferHandle(bufmgr_gem->fd, bo_gem->gem_handle);
|
||||
if (ret != 0) {
|
||||
DBG("DRM_IOCTL_GEM_CLOSE %d failed (%s): %s\n",
|
||||
DBG("drmCloseBufferHandle %d failed (%s): %s\n",
|
||||
bo_gem->gem_handle, bo_gem->name, strerror(errno));
|
||||
}
|
||||
free(bo);
|
||||
|
|
@ -1421,25 +1379,26 @@ static void drm_intel_gem_bo_unreference_locked_timed(drm_intel_bo *bo,
|
|||
static void drm_intel_gem_bo_unreference(drm_intel_bo *bo)
|
||||
{
|
||||
drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
|
||||
drm_intel_bufmgr_gem *bufmgr_gem;
|
||||
struct timespec time;
|
||||
|
||||
assert(atomic_read(&bo_gem->refcount) > 0);
|
||||
|
||||
if (atomic_add_unless(&bo_gem->refcount, -1, 1)) {
|
||||
drm_intel_bufmgr_gem *bufmgr_gem =
|
||||
(drm_intel_bufmgr_gem *) bo->bufmgr;
|
||||
struct timespec time;
|
||||
if (atomic_add_unless(&bo_gem->refcount, -1, 1))
|
||||
return;
|
||||
|
||||
clock_gettime(CLOCK_MONOTONIC, &time);
|
||||
bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr;
|
||||
|
||||
pthread_mutex_lock(&bufmgr_gem->lock);
|
||||
clock_gettime(CLOCK_MONOTONIC, &time);
|
||||
|
||||
if (atomic_dec_and_test(&bo_gem->refcount)) {
|
||||
drm_intel_gem_bo_unreference_final(bo, time.tv_sec);
|
||||
drm_intel_gem_cleanup_bo_cache(bufmgr_gem, time.tv_sec);
|
||||
}
|
||||
pthread_mutex_lock(&bufmgr_gem->lock);
|
||||
|
||||
pthread_mutex_unlock(&bufmgr_gem->lock);
|
||||
if (atomic_dec_and_test(&bo_gem->refcount)) {
|
||||
drm_intel_gem_bo_unreference_final(bo, time.tv_sec);
|
||||
drm_intel_gem_cleanup_bo_cache(bufmgr_gem, time.tv_sec);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&bufmgr_gem->lock);
|
||||
}
|
||||
|
||||
static int drm_intel_gem_bo_map(drm_intel_bo *bo, int write_enable)
|
||||
|
|
@ -2002,11 +1961,9 @@ static void
|
|||
drm_intel_bufmgr_gem_destroy(drm_intel_bufmgr *bufmgr)
|
||||
{
|
||||
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bufmgr;
|
||||
struct drm_gem_close close_bo;
|
||||
int i, ret;
|
||||
|
||||
free(bufmgr_gem->exec2_objects);
|
||||
free(bufmgr_gem->exec_objects);
|
||||
free(bufmgr_gem->exec_bos);
|
||||
|
||||
pthread_mutex_destroy(&bufmgr_gem->lock);
|
||||
|
|
@ -2028,9 +1985,8 @@ drm_intel_bufmgr_gem_destroy(drm_intel_bufmgr *bufmgr)
|
|||
|
||||
/* Release userptr bo kept hanging around for optimisation. */
|
||||
if (bufmgr_gem->userptr_active.ptr) {
|
||||
memclear(close_bo);
|
||||
close_bo.handle = bufmgr_gem->userptr_active.handle;
|
||||
ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_GEM_CLOSE, &close_bo);
|
||||
ret = drmCloseBufferHandle(bufmgr_gem->fd,
|
||||
bufmgr_gem->userptr_active.handle);
|
||||
free(bufmgr_gem->userptr_active.ptr);
|
||||
if (ret)
|
||||
fprintf(stderr,
|
||||
|
|
@ -2265,31 +2221,6 @@ drm_intel_gem_bo_clear_relocs(drm_intel_bo *bo, int start)
|
|||
* validations to be performed and update the relocation buffers with
|
||||
* index values into the validation list.
|
||||
*/
|
||||
static void
|
||||
drm_intel_gem_bo_process_reloc(drm_intel_bo *bo)
|
||||
{
|
||||
drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
|
||||
int i;
|
||||
|
||||
if (bo_gem->relocs == NULL)
|
||||
return;
|
||||
|
||||
for (i = 0; i < bo_gem->reloc_count; i++) {
|
||||
drm_intel_bo *target_bo = bo_gem->reloc_target_info[i].bo;
|
||||
|
||||
if (target_bo == bo)
|
||||
continue;
|
||||
|
||||
drm_intel_gem_bo_mark_mmaps_incoherent(bo);
|
||||
|
||||
/* Continue walking the tree depth-first. */
|
||||
drm_intel_gem_bo_process_reloc(target_bo);
|
||||
|
||||
/* Add the target to the validate list */
|
||||
drm_intel_add_validate_buffer(target_bo);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
drm_intel_gem_bo_process_reloc2(drm_intel_bo *bo)
|
||||
{
|
||||
|
|
@ -2330,30 +2261,6 @@ drm_intel_gem_bo_process_reloc2(drm_intel_bo *bo)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
drm_intel_update_buffer_offsets(drm_intel_bufmgr_gem *bufmgr_gem)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < bufmgr_gem->exec_count; i++) {
|
||||
drm_intel_bo *bo = bufmgr_gem->exec_bos[i];
|
||||
drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
|
||||
|
||||
/* Update the buffer offset */
|
||||
if (bufmgr_gem->exec_objects[i].offset != bo->offset64) {
|
||||
DBG("BO %d (%s) migrated: 0x%08x %08x -> 0x%08x %08x\n",
|
||||
bo_gem->gem_handle, bo_gem->name,
|
||||
upper_32_bits(bo->offset64),
|
||||
lower_32_bits(bo->offset64),
|
||||
upper_32_bits(bufmgr_gem->exec_objects[i].offset),
|
||||
lower_32_bits(bufmgr_gem->exec_objects[i].offset));
|
||||
bo->offset64 = bufmgr_gem->exec_objects[i].offset;
|
||||
bo->offset = bufmgr_gem->exec_objects[i].offset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
drm_intel_update_buffer_offsets2 (drm_intel_bufmgr_gem *bufmgr_gem)
|
||||
{
|
||||
|
|
@ -2389,73 +2296,6 @@ drm_intel_gem_bo_aub_dump_bmp(drm_intel_bo *bo,
|
|||
{
|
||||
}
|
||||
|
||||
static int
|
||||
drm_intel_gem_bo_exec(drm_intel_bo *bo, int used,
|
||||
drm_clip_rect_t * cliprects, int num_cliprects, int DR4)
|
||||
{
|
||||
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bo->bufmgr;
|
||||
struct drm_i915_gem_execbuffer execbuf;
|
||||
int ret, i;
|
||||
|
||||
if (to_bo_gem(bo)->has_error)
|
||||
return -ENOMEM;
|
||||
|
||||
pthread_mutex_lock(&bufmgr_gem->lock);
|
||||
/* Update indices and set up the validate list. */
|
||||
drm_intel_gem_bo_process_reloc(bo);
|
||||
|
||||
/* Add the batch buffer to the validation list. There are no
|
||||
* relocations pointing to it.
|
||||
*/
|
||||
drm_intel_add_validate_buffer(bo);
|
||||
|
||||
memclear(execbuf);
|
||||
execbuf.buffers_ptr = (uintptr_t) bufmgr_gem->exec_objects;
|
||||
execbuf.buffer_count = bufmgr_gem->exec_count;
|
||||
execbuf.batch_start_offset = 0;
|
||||
execbuf.batch_len = used;
|
||||
execbuf.cliprects_ptr = (uintptr_t) cliprects;
|
||||
execbuf.num_cliprects = num_cliprects;
|
||||
execbuf.DR1 = 0;
|
||||
execbuf.DR4 = DR4;
|
||||
|
||||
ret = drmIoctl(bufmgr_gem->fd,
|
||||
DRM_IOCTL_I915_GEM_EXECBUFFER,
|
||||
&execbuf);
|
||||
if (ret != 0) {
|
||||
ret = -errno;
|
||||
if (errno == ENOSPC) {
|
||||
DBG("Execbuffer fails to pin. "
|
||||
"Estimate: %u. Actual: %u. Available: %u\n",
|
||||
drm_intel_gem_estimate_batch_space(bufmgr_gem->exec_bos,
|
||||
bufmgr_gem->
|
||||
exec_count),
|
||||
drm_intel_gem_compute_batch_space(bufmgr_gem->exec_bos,
|
||||
bufmgr_gem->
|
||||
exec_count),
|
||||
(unsigned int)bufmgr_gem->gtt_size);
|
||||
}
|
||||
}
|
||||
drm_intel_update_buffer_offsets(bufmgr_gem);
|
||||
|
||||
if (bufmgr_gem->bufmgr.debug)
|
||||
drm_intel_gem_dump_validation_list(bufmgr_gem);
|
||||
|
||||
for (i = 0; i < bufmgr_gem->exec_count; i++) {
|
||||
drm_intel_bo_gem *bo_gem = to_bo_gem(bufmgr_gem->exec_bos[i]);
|
||||
|
||||
bo_gem->idle = false;
|
||||
|
||||
/* Disconnect the buffer from the validate list */
|
||||
bo_gem->validate_index = -1;
|
||||
bufmgr_gem->exec_bos[i] = NULL;
|
||||
}
|
||||
bufmgr_gem->exec_count = 0;
|
||||
pthread_mutex_unlock(&bufmgr_gem->lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
do_exec2(drm_intel_bo *bo, int used, drm_intel_context *ctx,
|
||||
drm_clip_rect_t *cliprects, int num_cliprects, int DR4,
|
||||
|
|
@ -2933,9 +2773,7 @@ drm_public void
|
|||
drm_intel_bufmgr_gem_enable_fenced_relocs(drm_intel_bufmgr *bufmgr)
|
||||
{
|
||||
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr;
|
||||
|
||||
if (bufmgr_gem->bufmgr.bo_exec == drm_intel_gem_bo_exec2)
|
||||
bufmgr_gem->fenced_relocs = true;
|
||||
bufmgr_gem->fenced_relocs = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -3540,16 +3378,17 @@ drm_intel_bufmgr_gem_unref(drm_intel_bufmgr *bufmgr)
|
|||
{
|
||||
drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bufmgr;
|
||||
|
||||
if (atomic_add_unless(&bufmgr_gem->refcount, -1, 1)) {
|
||||
pthread_mutex_lock(&bufmgr_list_mutex);
|
||||
if (atomic_add_unless(&bufmgr_gem->refcount, -1, 1))
|
||||
return;
|
||||
|
||||
if (atomic_dec_and_test(&bufmgr_gem->refcount)) {
|
||||
DRMLISTDEL(&bufmgr_gem->managers);
|
||||
drm_intel_bufmgr_gem_destroy(bufmgr);
|
||||
}
|
||||
pthread_mutex_lock(&bufmgr_list_mutex);
|
||||
|
||||
pthread_mutex_unlock(&bufmgr_list_mutex);
|
||||
if (atomic_dec_and_test(&bufmgr_gem->refcount)) {
|
||||
DRMLISTDEL(&bufmgr_gem->managers);
|
||||
drm_intel_bufmgr_gem_destroy(bufmgr);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&bufmgr_list_mutex);
|
||||
}
|
||||
|
||||
drm_public void *drm_intel_gem_bo_map__gtt(drm_intel_bo *bo)
|
||||
|
|
@ -3700,7 +3539,6 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
|
|||
struct drm_i915_gem_get_aperture aperture;
|
||||
drm_i915_getparam_t gp;
|
||||
int ret, tmp;
|
||||
bool exec2 = false;
|
||||
|
||||
pthread_mutex_lock(&bufmgr_list_mutex);
|
||||
|
||||
|
|
@ -3752,13 +3590,9 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
|
|||
bufmgr_gem->gen = 6;
|
||||
else if (IS_GEN7(bufmgr_gem->pci_device))
|
||||
bufmgr_gem->gen = 7;
|
||||
else if (IS_GEN8(bufmgr_gem->pci_device))
|
||||
else
|
||||
/* Treat all further unmatched platforms the same as gen8 */
|
||||
bufmgr_gem->gen = 8;
|
||||
else if (!intel_get_genx(bufmgr_gem->pci_device, &bufmgr_gem->gen)) {
|
||||
free(bufmgr_gem);
|
||||
bufmgr_gem = NULL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (IS_GEN3(bufmgr_gem->pci_device) &&
|
||||
bufmgr_gem->gtt_size > 256*1024*1024) {
|
||||
|
|
@ -3774,8 +3608,12 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
|
|||
|
||||
gp.param = I915_PARAM_HAS_EXECBUF2;
|
||||
ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp);
|
||||
if (!ret)
|
||||
exec2 = true;
|
||||
if (ret) {
|
||||
fprintf(stderr, "i915 does not support EXECBUFER2\n");
|
||||
free(bufmgr_gem);
|
||||
bufmgr_gem = NULL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
gp.param = I915_PARAM_HAS_BSD;
|
||||
ret = drmIoctl(bufmgr_gem->fd, DRM_IOCTL_I915_GETPARAM, &gp);
|
||||
|
|
@ -3878,12 +3716,8 @@ drm_intel_bufmgr_gem_init(int fd, int batch_size)
|
|||
bufmgr_gem->bufmgr.bo_get_tiling = drm_intel_gem_bo_get_tiling;
|
||||
bufmgr_gem->bufmgr.bo_set_tiling = drm_intel_gem_bo_set_tiling;
|
||||
bufmgr_gem->bufmgr.bo_flink = drm_intel_gem_bo_flink;
|
||||
/* Use the new one if available */
|
||||
if (exec2) {
|
||||
bufmgr_gem->bufmgr.bo_exec = drm_intel_gem_bo_exec2;
|
||||
bufmgr_gem->bufmgr.bo_mrb_exec = drm_intel_gem_bo_mrb_exec2;
|
||||
} else
|
||||
bufmgr_gem->bufmgr.bo_exec = drm_intel_gem_bo_exec;
|
||||
bufmgr_gem->bufmgr.bo_exec = drm_intel_gem_bo_exec2;
|
||||
bufmgr_gem->bufmgr.bo_mrb_exec = drm_intel_gem_bo_mrb_exec2;
|
||||
bufmgr_gem->bufmgr.bo_busy = drm_intel_gem_bo_busy;
|
||||
bufmgr_gem->bufmgr.bo_madvise = drm_intel_gem_bo_madvise;
|
||||
bufmgr_gem->bufmgr.destroy = drm_intel_bufmgr_gem_unref;
|
||||
|
|
|
|||
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
#include "intel_chipset.h"
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "i915_pciids.h"
|
||||
|
||||
#undef INTEL_VGA_DEVICE
|
||||
#define INTEL_VGA_DEVICE(id, gen) { id, gen }
|
||||
|
||||
static const struct pci_device {
|
||||
uint16_t device;
|
||||
uint16_t gen;
|
||||
} pciids[] = {
|
||||
/* Keep ids sorted by gen; latest gen first */
|
||||
INTEL_ADLP_IDS(12),
|
||||
INTEL_ADLS_IDS(12),
|
||||
INTEL_RKL_IDS(12),
|
||||
INTEL_DG1_IDS(12),
|
||||
INTEL_TGL_12_IDS(12),
|
||||
INTEL_JSL_IDS(11),
|
||||
INTEL_EHL_IDS(11),
|
||||
INTEL_ICL_11_IDS(11),
|
||||
INTEL_CNL_IDS(10),
|
||||
INTEL_CFL_IDS(9),
|
||||
INTEL_GLK_IDS(9),
|
||||
INTEL_KBL_IDS(9),
|
||||
INTEL_BXT_IDS(9),
|
||||
INTEL_SKL_IDS(9),
|
||||
};
|
||||
|
||||
drm_private bool intel_is_genx(unsigned int devid, int gen)
|
||||
{
|
||||
const struct pci_device *p,
|
||||
*pend = pciids + sizeof(pciids) / sizeof(pciids[0]);
|
||||
|
||||
for (p = pciids; p < pend; p++) {
|
||||
/* PCI IDs are sorted */
|
||||
if (p->gen < gen)
|
||||
break;
|
||||
|
||||
if (p->device != devid)
|
||||
continue;
|
||||
|
||||
if (gen == p->gen)
|
||||
return true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
drm_private bool intel_get_genx(unsigned int devid, int *gen)
|
||||
{
|
||||
const struct pci_device *p,
|
||||
*pend = pciids + sizeof(pciids) / sizeof(pciids[0]);
|
||||
|
||||
for (p = pciids; p < pend; p++) {
|
||||
if (p->device != devid)
|
||||
continue;
|
||||
|
||||
if (gen)
|
||||
*gen = p->gen;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -331,20 +331,6 @@
|
|||
#include <stdbool.h>
|
||||
#include <libdrm_macros.h>
|
||||
|
||||
drm_private bool intel_is_genx(unsigned int devid, int gen);
|
||||
drm_private bool intel_get_genx(unsigned int devid, int *gen);
|
||||
|
||||
#define IS_GEN9(devid) intel_is_genx(devid, 9)
|
||||
#define IS_GEN10(devid) intel_is_genx(devid, 10)
|
||||
#define IS_GEN11(devid) intel_is_genx(devid, 11)
|
||||
#define IS_GEN12(devid) intel_is_genx(devid, 12)
|
||||
|
||||
#define IS_9XX(dev) (IS_GEN3(dev) || \
|
||||
IS_GEN4(dev) || \
|
||||
IS_GEN5(dev) || \
|
||||
IS_GEN6(dev) || \
|
||||
IS_GEN7(dev) || \
|
||||
IS_GEN8(dev) || \
|
||||
intel_get_genx(dev, NULL))
|
||||
#define IS_9XX(dev) (!IS_GEN2(dev))
|
||||
|
||||
#endif /* _INTEL_CHIPSET_H */
|
||||
|
|
|
|||
|
|
@ -3815,33 +3815,37 @@ drm_public struct drm_intel_decode *
|
|||
drm_intel_decode_context_alloc(uint32_t devid)
|
||||
{
|
||||
struct drm_intel_decode *ctx;
|
||||
int gen = 0;
|
||||
|
||||
if (IS_GEN8(devid))
|
||||
gen = 8;
|
||||
else if (IS_GEN7(devid))
|
||||
gen = 7;
|
||||
else if (IS_GEN6(devid))
|
||||
gen = 6;
|
||||
else if (IS_GEN5(devid))
|
||||
gen = 5;
|
||||
else if (IS_GEN4(devid))
|
||||
gen = 4;
|
||||
else if (IS_GEN3(devid))
|
||||
gen = 3;
|
||||
else if (IS_GEN2(devid))
|
||||
gen = 2;
|
||||
else
|
||||
/* Just assume future unknown platforms behave as gen8. */
|
||||
gen = 8;
|
||||
|
||||
if (!gen)
|
||||
return NULL;
|
||||
|
||||
ctx = calloc(1, sizeof(struct drm_intel_decode));
|
||||
if (!ctx)
|
||||
return NULL;
|
||||
|
||||
ctx->devid = devid;
|
||||
ctx->gen = gen;
|
||||
ctx->out = stdout;
|
||||
|
||||
if (intel_get_genx(devid, &ctx->gen))
|
||||
;
|
||||
else if (IS_GEN8(devid))
|
||||
ctx->gen = 8;
|
||||
else if (IS_GEN7(devid))
|
||||
ctx->gen = 7;
|
||||
else if (IS_GEN6(devid))
|
||||
ctx->gen = 6;
|
||||
else if (IS_GEN5(devid))
|
||||
ctx->gen = 5;
|
||||
else if (IS_GEN4(devid))
|
||||
ctx->gen = 4;
|
||||
else if (IS_9XX(devid))
|
||||
ctx->gen = 3;
|
||||
else {
|
||||
assert(IS_GEN2(devid));
|
||||
ctx->gen = 2;
|
||||
}
|
||||
|
||||
return ctx;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,15 +23,16 @@ libdrm_intel = library(
|
|||
[
|
||||
files(
|
||||
'intel_bufmgr.c', 'intel_bufmgr_fake.c', 'intel_bufmgr_gem.c',
|
||||
'intel_decode.c', 'mm.c', 'intel_chipset.c',
|
||||
'intel_decode.c', 'mm.c',
|
||||
),
|
||||
config_file,
|
||||
],
|
||||
include_directories : [inc_root, inc_drm],
|
||||
link_with : libdrm,
|
||||
dependencies : [dep_pciaccess, dep_pthread_stubs, dep_rt, dep_valgrind, dep_atomic_ops],
|
||||
dependencies : [dep_pciaccess, dep_threads, dep_rt, dep_valgrind, dep_atomic_ops],
|
||||
c_args : libdrm_c_args,
|
||||
version : '1.0.0',
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
version : '1.@0@.0'.format(patch_ver),
|
||||
install : true,
|
||||
)
|
||||
|
||||
|
|
@ -40,16 +41,17 @@ ext_libdrm_intel = declare_dependency(
|
|||
include_directories : [inc_drm, include_directories('.')],
|
||||
)
|
||||
|
||||
meson.override_dependency('libdrm_intel', ext_libdrm_intel)
|
||||
|
||||
install_headers(
|
||||
'intel_bufmgr.h', 'intel_aub.h', 'intel_debug.h',
|
||||
subdir : 'libdrm',
|
||||
)
|
||||
|
||||
pkg.generate(
|
||||
libdrm_intel,
|
||||
name : 'libdrm_intel',
|
||||
libraries : libdrm_intel,
|
||||
subdirs : ['.', 'libdrm'],
|
||||
version : meson.project_version(),
|
||||
requires : 'libdrm',
|
||||
description : 'Userspace interface to intel kernel DRM services',
|
||||
)
|
||||
|
|
@ -60,6 +62,7 @@ test_decode = executable(
|
|||
include_directories : [inc_root, inc_drm],
|
||||
link_with : [libdrm, libdrm_intel],
|
||||
c_args : libdrm_c_args,
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
)
|
||||
|
||||
test(
|
||||
|
|
@ -99,6 +102,6 @@ test(
|
|||
args : [
|
||||
'--lib', libdrm_intel,
|
||||
'--symbols-file', files('intel-symbols.txt'),
|
||||
'--nm', prog_nm.path(),
|
||||
'--nm', prog_nm.full_path(),
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -86,7 +86,8 @@ static void
|
|||
compare_batch(struct drm_intel_decode *ctx, const char *batch_filename)
|
||||
{
|
||||
FILE *out = NULL;
|
||||
void *ptr, *ref_ptr, *batch_ptr;
|
||||
char *ptr;
|
||||
void *ref_ptr, *batch_ptr;
|
||||
#if HAVE_OPEN_MEMSTREAM
|
||||
size_t size;
|
||||
#endif
|
||||
|
|
@ -106,7 +107,7 @@ compare_batch(struct drm_intel_decode *ctx, const char *batch_filename)
|
|||
* inside of an automake project's test infrastructure.
|
||||
*/
|
||||
#if HAVE_OPEN_MEMSTREAM
|
||||
out = open_memstream((char **)&ptr, &size);
|
||||
out = open_memstream(&ptr, &size);
|
||||
#else
|
||||
fprintf(stderr, "platform lacks open_memstream, skipping.\n");
|
||||
exit(77);
|
||||
|
|
|
|||
|
|
@ -648,11 +648,11 @@ do {
|
|||
#define MUR_PLUS2_ALIGNED(p) (((unsigned long)p & 3UL) == 2UL)
|
||||
#define MUR_PLUS3_ALIGNED(p) (((unsigned long)p & 3UL) == 3UL)
|
||||
#define WP(p) ((uint32_t*)((unsigned long)(p) & ~3UL))
|
||||
#if (defined(__BIG_ENDIAN__) || defined(SPARC) || defined(__ppc__) || defined(__ppc64__))
|
||||
#ifdef HAVE_BIG_ENDIAN
|
||||
#define MUR_THREE_ONE(p) ((((*WP(p))&0x00ffffff) << 8) | (((*(WP(p)+1))&0xff000000) >> 24))
|
||||
#define MUR_TWO_TWO(p) ((((*WP(p))&0x0000ffff) <<16) | (((*(WP(p)+1))&0xffff0000) >> 16))
|
||||
#define MUR_ONE_THREE(p) ((((*WP(p))&0x000000ff) <<24) | (((*(WP(p)+1))&0xffffff00) >> 8))
|
||||
#else /* assume little endian non-intel */
|
||||
#else /* little endian non-intel */
|
||||
#define MUR_THREE_ONE(p) ((((*WP(p))&0xffffff00) >> 8) | (((*(WP(p)+1))&0x000000ff) << 24))
|
||||
#define MUR_TWO_TWO(p) ((((*WP(p))&0xffff0000) >>16) | (((*(WP(p)+1))&0x0000ffff) << 16))
|
||||
#define MUR_ONE_THREE(p) ((((*WP(p))&0xff000000) >>24) | (((*(WP(p)+1))&0x00ffffff) << 8))
|
||||
|
|
|
|||
|
|
@ -96,19 +96,19 @@ typedef struct _drmMMListHead
|
|||
(__item) = (__temp), (__temp) = (__item)->prev)
|
||||
|
||||
#define DRMLISTFOREACHENTRY(__item, __list, __head) \
|
||||
for ((__item) = DRMLISTENTRY(typeof(*__item), (__list)->next, __head); \
|
||||
&(__item)->__head != (__list); \
|
||||
(__item) = DRMLISTENTRY(typeof(*__item), \
|
||||
(__item)->__head.next, __head))
|
||||
for ((__item) = DRMLISTENTRY(__typeof__(*__item), (__list)->next, __head); \
|
||||
&(__item)->__head != (__list); \
|
||||
(__item) = DRMLISTENTRY(__typeof__(*__item), \
|
||||
(__item)->__head.next, __head))
|
||||
|
||||
#define DRMLISTFOREACHENTRYSAFE(__item, __temp, __list, __head) \
|
||||
for ((__item) = DRMLISTENTRY(typeof(*__item), (__list)->next, __head), \
|
||||
(__temp) = DRMLISTENTRY(typeof(*__item), \
|
||||
(__item)->__head.next, __head); \
|
||||
&(__item)->__head != (__list); \
|
||||
(__item) = (__temp), \
|
||||
(__temp) = DRMLISTENTRY(typeof(*__item), \
|
||||
(__temp)->__head.next, __head))
|
||||
for ((__item) = DRMLISTENTRY(__typeof__(*__item), (__list)->next, __head), \
|
||||
(__temp) = DRMLISTENTRY(__typeof__(*__item), \
|
||||
(__item)->__head.next, __head); \
|
||||
&(__item)->__head != (__list); \
|
||||
(__item) = (__temp), \
|
||||
(__temp) = DRMLISTENTRY(__typeof__(*__item), \
|
||||
(__temp)->__head.next, __head))
|
||||
|
||||
#define DRMLISTJOIN(__list, __join) if (!DRMLISTEMPTY(__list)) { \
|
||||
(__list)->next->prev = (__join); \
|
||||
|
|
|
|||
|
|
@ -1,51 +0,0 @@
|
|||
DRM_GPU_DRIVERS := $(strip $(filter-out swrast, $(BOARD_GPU_DRIVERS)))
|
||||
|
||||
intel_drivers := i915 i965 i915g iris
|
||||
radeon_drivers := r300g r600g radeonsi
|
||||
nouveau_drivers := nouveau
|
||||
virgl_drivers := virgl
|
||||
vmwgfx_drivers := vmwgfx
|
||||
|
||||
valid_drivers := \
|
||||
$(intel_drivers) \
|
||||
$(radeon_drivers) \
|
||||
$(nouveau_drivers) \
|
||||
$(virgl_drivers) \
|
||||
$(vmwgfx_drivers)
|
||||
|
||||
# warn about invalid drivers
|
||||
invalid_drivers := $(filter-out $(valid_drivers), $(DRM_GPU_DRIVERS))
|
||||
ifneq ($(invalid_drivers),)
|
||||
$(warning invalid GPU drivers: $(invalid_drivers))
|
||||
# tidy up
|
||||
DRM_GPU_DRIVERS := $(filter-out $(invalid_drivers), $(DRM_GPU_DRIVERS))
|
||||
endif
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
include $(LOCAL_PATH)/Makefile.sources
|
||||
|
||||
LOCAL_SRC_FILES := $(LIBKMS_FILES)
|
||||
|
||||
ifneq ($(filter $(vmwgfx_drivers), $(DRM_GPU_DRIVERS)),)
|
||||
LOCAL_SRC_FILES += $(LIBKMS_VMWGFX_FILES)
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(intel_drivers), $(DRM_GPU_DRIVERS)),)
|
||||
LOCAL_SRC_FILES += $(LIBKMS_INTEL_FILES)
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(nouveau_drivers), $(DRM_GPU_DRIVERS)),)
|
||||
LOCAL_SRC_FILES += $(LIBKMS_NOUVEAU_FILES)
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(radeon_drivers), $(DRM_GPU_DRIVERS)),)
|
||||
LOCAL_SRC_FILES += $(LIBKMS_RADEON_FILES)
|
||||
endif
|
||||
|
||||
LOCAL_MODULE := libkms
|
||||
LOCAL_SHARED_LIBRARIES := libdrm
|
||||
|
||||
include $(LIBDRM_COMMON_MK)
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
LIBKMS_FILES := \
|
||||
internal.h \
|
||||
linux.c \
|
||||
dumb.c \
|
||||
api.c
|
||||
|
||||
LIBKMS_VMWGFX_FILES := \
|
||||
vmwgfx.c
|
||||
|
||||
LIBKMS_INTEL_FILES := \
|
||||
intel.c
|
||||
|
||||
LIBKMS_NOUVEAU_FILES := \
|
||||
nouveau.c
|
||||
|
||||
LIBKMS_RADEON_FILES := \
|
||||
radeon.c
|
||||
|
||||
LIBKMS_EXYNOS_FILES := \
|
||||
exynos.c
|
||||
|
||||
LIBKMS_H_FILES := \
|
||||
libkms.h
|
||||
139
libkms/api.c
139
libkms/api.c
|
|
@ -1,139 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright © 2009 VMware, Inc., Palo Alto, CA., USA
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "libdrm_macros.h"
|
||||
#include "internal.h"
|
||||
|
||||
drm_public int kms_create(int fd, struct kms_driver **out)
|
||||
{
|
||||
return linux_create(fd, out);
|
||||
}
|
||||
|
||||
drm_public int kms_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)
|
||||
{
|
||||
switch (key) {
|
||||
case KMS_BO_TYPE:
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
return kms->get_prop(kms, key, out);
|
||||
}
|
||||
|
||||
drm_public int kms_destroy(struct kms_driver **kms)
|
||||
{
|
||||
if (!(*kms))
|
||||
return 0;
|
||||
|
||||
free(*kms);
|
||||
*kms = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
drm_public int kms_bo_create(struct kms_driver *kms, const unsigned *attr, struct kms_bo **out)
|
||||
{
|
||||
unsigned width = 0;
|
||||
unsigned height = 0;
|
||||
enum kms_bo_type type = KMS_BO_TYPE_SCANOUT_X8R8G8B8;
|
||||
int i;
|
||||
|
||||
for (i = 0; attr[i];) {
|
||||
unsigned key = attr[i++];
|
||||
unsigned value = attr[i++];
|
||||
|
||||
switch (key) {
|
||||
case KMS_WIDTH:
|
||||
width = value;
|
||||
break;
|
||||
case KMS_HEIGHT:
|
||||
height = value;
|
||||
break;
|
||||
case KMS_BO_TYPE:
|
||||
type = value;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
if (width == 0 || height == 0)
|
||||
return -EINVAL;
|
||||
|
||||
/* XXX sanity check type */
|
||||
|
||||
if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8 &&
|
||||
(width != 64 || height != 64))
|
||||
return -EINVAL;
|
||||
|
||||
return kms->bo_create(kms, width, height, type, attr, out);
|
||||
}
|
||||
|
||||
drm_public int kms_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out)
|
||||
{
|
||||
switch (key) {
|
||||
case KMS_PITCH:
|
||||
*out = bo->pitch;
|
||||
break;
|
||||
case KMS_HANDLE:
|
||||
*out = bo->handle;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
drm_public int kms_bo_map(struct kms_bo *bo, void **out)
|
||||
{
|
||||
return bo->kms->bo_map(bo, out);
|
||||
}
|
||||
|
||||
drm_public int kms_bo_unmap(struct kms_bo *bo)
|
||||
{
|
||||
return bo->kms->bo_unmap(bo);
|
||||
}
|
||||
|
||||
drm_public int kms_bo_destroy(struct kms_bo **bo)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!(*bo))
|
||||
return 0;
|
||||
|
||||
ret = (*bo)->kms->bo_destroy(*bo);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
*bo = NULL;
|
||||
return 0;
|
||||
}
|
||||
216
libkms/dumb.c
216
libkms/dumb.c
|
|
@ -1,216 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright © 2009 VMware, Inc., Palo Alto, CA., USA
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "internal.h"
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include "xf86drm.h"
|
||||
#include "libdrm_macros.h"
|
||||
|
||||
struct dumb_bo
|
||||
{
|
||||
struct kms_bo base;
|
||||
unsigned map_count;
|
||||
};
|
||||
|
||||
static int
|
||||
dumb_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)
|
||||
{
|
||||
switch (key) {
|
||||
case KMS_BO_TYPE:
|
||||
*out = KMS_BO_TYPE_SCANOUT_X8R8G8B8 | KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
dumb_destroy(struct kms_driver *kms)
|
||||
{
|
||||
free(kms);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
dumb_bo_create(struct kms_driver *kms,
|
||||
const unsigned width, const unsigned height,
|
||||
const enum kms_bo_type type, const unsigned *attr,
|
||||
struct kms_bo **out)
|
||||
{
|
||||
struct drm_mode_create_dumb arg;
|
||||
struct dumb_bo *bo;
|
||||
int i, ret;
|
||||
|
||||
for (i = 0; attr[i]; i += 2) {
|
||||
switch (attr[i]) {
|
||||
case KMS_WIDTH:
|
||||
case KMS_HEIGHT:
|
||||
break;
|
||||
case KMS_BO_TYPE:
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
bo = calloc(1, sizeof(*bo));
|
||||
if (!bo)
|
||||
return -ENOMEM;
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
|
||||
/* All BO_TYPE currently are 32bpp formats */
|
||||
arg.bpp = 32;
|
||||
arg.width = width;
|
||||
arg.height = height;
|
||||
|
||||
ret = drmIoctl(kms->fd, DRM_IOCTL_MODE_CREATE_DUMB, &arg);
|
||||
if (ret)
|
||||
goto err_free;
|
||||
|
||||
bo->base.kms = kms;
|
||||
bo->base.handle = arg.handle;
|
||||
bo->base.size = arg.size;
|
||||
bo->base.pitch = arg.pitch;
|
||||
|
||||
*out = &bo->base;
|
||||
|
||||
return 0;
|
||||
|
||||
err_free:
|
||||
free(bo);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
dumb_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out)
|
||||
{
|
||||
switch (key) {
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
dumb_bo_map(struct kms_bo *_bo, void **out)
|
||||
{
|
||||
struct dumb_bo *bo = (struct dumb_bo *)_bo;
|
||||
struct drm_mode_map_dumb arg;
|
||||
void *map = NULL;
|
||||
int ret;
|
||||
|
||||
if (bo->base.ptr) {
|
||||
bo->map_count++;
|
||||
*out = bo->base.ptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.handle = bo->base.handle;
|
||||
|
||||
ret = drmIoctl(bo->base.kms->fd, DRM_IOCTL_MODE_MAP_DUMB, &arg);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
map = drm_mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset);
|
||||
if (map == MAP_FAILED)
|
||||
return -errno;
|
||||
|
||||
bo->base.ptr = map;
|
||||
bo->map_count++;
|
||||
*out = bo->base.ptr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
dumb_bo_unmap(struct kms_bo *_bo)
|
||||
{
|
||||
struct dumb_bo *bo = (struct dumb_bo *)_bo;
|
||||
bo->map_count--;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
dumb_bo_destroy(struct kms_bo *_bo)
|
||||
{
|
||||
struct dumb_bo *bo = (struct dumb_bo *)_bo;
|
||||
struct drm_mode_destroy_dumb arg;
|
||||
int ret;
|
||||
|
||||
if (bo->base.ptr) {
|
||||
/* XXX Sanity check map_count */
|
||||
drm_munmap(bo->base.ptr, bo->base.size);
|
||||
bo->base.ptr = NULL;
|
||||
}
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.handle = bo->base.handle;
|
||||
|
||||
ret = drmIoctl(bo->base.kms->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &arg);
|
||||
if (ret)
|
||||
return -errno;
|
||||
|
||||
free(bo);
|
||||
return 0;
|
||||
}
|
||||
|
||||
drm_private int
|
||||
dumb_create(int fd, struct kms_driver **out)
|
||||
{
|
||||
struct kms_driver *kms;
|
||||
int ret;
|
||||
uint64_t cap = 0;
|
||||
|
||||
ret = drmGetCap(fd, DRM_CAP_DUMB_BUFFER, &cap);
|
||||
if (ret || cap == 0)
|
||||
return -EINVAL;
|
||||
|
||||
kms = calloc(1, sizeof(*kms));
|
||||
if (!kms)
|
||||
return -ENOMEM;
|
||||
|
||||
kms->fd = fd;
|
||||
|
||||
kms->bo_create = dumb_bo_create;
|
||||
kms->bo_map = dumb_bo_map;
|
||||
kms->bo_unmap = dumb_bo_unmap;
|
||||
kms->bo_get_prop = dumb_bo_get_prop;
|
||||
kms->bo_destroy = dumb_bo_destroy;
|
||||
kms->get_prop = dumb_get_prop;
|
||||
kms->destroy = dumb_destroy;
|
||||
*out = kms;
|
||||
|
||||
return 0;
|
||||
}
|
||||
220
libkms/exynos.c
220
libkms/exynos.c
|
|
@ -1,220 +0,0 @@
|
|||
/* exynos.c
|
||||
*
|
||||
* Copyright 2009 Samsung Electronics Co., Ltd.
|
||||
* Authors:
|
||||
* SooChan Lim <sc1.lim@samsung.com>
|
||||
* Sangjin LEE <lsj119@samsung.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "internal.h"
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include "xf86drm.h"
|
||||
|
||||
#include "libdrm_macros.h"
|
||||
#include "exynos_drm.h"
|
||||
|
||||
struct exynos_bo
|
||||
{
|
||||
struct kms_bo base;
|
||||
unsigned map_count;
|
||||
};
|
||||
|
||||
static int
|
||||
exynos_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)
|
||||
{
|
||||
switch (key) {
|
||||
case KMS_BO_TYPE:
|
||||
*out = KMS_BO_TYPE_SCANOUT_X8R8G8B8 | KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
exynos_destroy(struct kms_driver *kms)
|
||||
{
|
||||
free(kms);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
exynos_bo_create(struct kms_driver *kms,
|
||||
const unsigned width, const unsigned height,
|
||||
const enum kms_bo_type type, const unsigned *attr,
|
||||
struct kms_bo **out)
|
||||
{
|
||||
struct drm_exynos_gem_create arg;
|
||||
unsigned size, pitch;
|
||||
struct exynos_bo *bo;
|
||||
int i, ret;
|
||||
|
||||
for (i = 0; attr[i]; i += 2) {
|
||||
switch (attr[i]) {
|
||||
case KMS_WIDTH:
|
||||
case KMS_HEIGHT:
|
||||
case KMS_BO_TYPE:
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
bo = calloc(1, sizeof(*bo));
|
||||
if (!bo)
|
||||
return -ENOMEM;
|
||||
|
||||
if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8) {
|
||||
pitch = 64 * 4;
|
||||
size = 64 * 64 * 4;
|
||||
} else if (type == KMS_BO_TYPE_SCANOUT_X8R8G8B8) {
|
||||
pitch = width * 4;
|
||||
pitch = (pitch + 512 - 1) & ~(512 - 1);
|
||||
size = pitch * ((height + 4 - 1) & ~(4 - 1));
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
goto err_free;
|
||||
}
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.size = size;
|
||||
|
||||
ret = drmCommandWriteRead(kms->fd, DRM_EXYNOS_GEM_CREATE, &arg, sizeof(arg));
|
||||
if (ret)
|
||||
goto err_free;
|
||||
|
||||
bo->base.kms = kms;
|
||||
bo->base.handle = arg.handle;
|
||||
bo->base.size = size;
|
||||
bo->base.pitch = pitch;
|
||||
|
||||
*out = &bo->base;
|
||||
|
||||
return 0;
|
||||
|
||||
err_free:
|
||||
free(bo);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
exynos_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out)
|
||||
{
|
||||
switch (key) {
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
exynos_bo_map(struct kms_bo *_bo, void **out)
|
||||
{
|
||||
struct exynos_bo *bo = (struct exynos_bo *)_bo;
|
||||
struct drm_mode_map_dumb arg;
|
||||
void *map = NULL;
|
||||
int ret;
|
||||
|
||||
if (bo->base.ptr) {
|
||||
bo->map_count++;
|
||||
*out = bo->base.ptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.handle = bo->base.handle;
|
||||
|
||||
ret = drmIoctl(bo->base.kms->fd, DRM_IOCTL_MODE_MAP_DUMB, &arg);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
map = drm_mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset);
|
||||
if (map == MAP_FAILED)
|
||||
return -errno;
|
||||
|
||||
bo->base.ptr = map;
|
||||
bo->map_count++;
|
||||
*out = bo->base.ptr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
exynos_bo_unmap(struct kms_bo *_bo)
|
||||
{
|
||||
struct exynos_bo *bo = (struct exynos_bo *)_bo;
|
||||
bo->map_count--;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
exynos_bo_destroy(struct kms_bo *_bo)
|
||||
{
|
||||
struct exynos_bo *bo = (struct exynos_bo *)_bo;
|
||||
struct drm_gem_close arg;
|
||||
int ret;
|
||||
|
||||
if (bo->base.ptr) {
|
||||
/* XXX Sanity check map_count */
|
||||
munmap(bo->base.ptr, bo->base.size);
|
||||
bo->base.ptr = NULL;
|
||||
}
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.handle = bo->base.handle;
|
||||
|
||||
ret = drmIoctl(bo->base.kms->fd, DRM_IOCTL_GEM_CLOSE, &arg);
|
||||
if (ret)
|
||||
return -errno;
|
||||
|
||||
free(bo);
|
||||
return 0;
|
||||
}
|
||||
|
||||
drm_private int
|
||||
exynos_create(int fd, struct kms_driver **out)
|
||||
{
|
||||
struct kms_driver *kms;
|
||||
|
||||
kms = calloc(1, sizeof(*kms));
|
||||
if (!kms)
|
||||
return -ENOMEM;
|
||||
|
||||
kms->fd = fd;
|
||||
|
||||
kms->bo_create = exynos_bo_create;
|
||||
kms->bo_map = exynos_bo_map;
|
||||
kms->bo_unmap = exynos_bo_unmap;
|
||||
kms->bo_get_prop = exynos_bo_get_prop;
|
||||
kms->bo_destroy = exynos_bo_destroy;
|
||||
kms->get_prop = exynos_get_prop;
|
||||
kms->destroy = exynos_destroy;
|
||||
*out = kms;
|
||||
|
||||
return 0;
|
||||
}
|
||||
236
libkms/intel.c
236
libkms/intel.c
|
|
@ -1,236 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright © 2009 VMware, Inc., Palo Alto, CA., USA
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "internal.h"
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include "xf86drm.h"
|
||||
#include "libdrm_macros.h"
|
||||
|
||||
#include "i915_drm.h"
|
||||
|
||||
struct intel_bo
|
||||
{
|
||||
struct kms_bo base;
|
||||
unsigned map_count;
|
||||
};
|
||||
|
||||
static int
|
||||
intel_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)
|
||||
{
|
||||
switch (key) {
|
||||
case KMS_BO_TYPE:
|
||||
*out = KMS_BO_TYPE_SCANOUT_X8R8G8B8 | KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
intel_destroy(struct kms_driver *kms)
|
||||
{
|
||||
free(kms);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
intel_bo_create(struct kms_driver *kms,
|
||||
const unsigned width, const unsigned height,
|
||||
const enum kms_bo_type type, const unsigned *attr,
|
||||
struct kms_bo **out)
|
||||
{
|
||||
struct drm_i915_gem_create arg;
|
||||
unsigned size, pitch;
|
||||
struct intel_bo *bo;
|
||||
int i, ret;
|
||||
|
||||
for (i = 0; attr[i]; i += 2) {
|
||||
switch (attr[i]) {
|
||||
case KMS_WIDTH:
|
||||
case KMS_HEIGHT:
|
||||
case KMS_BO_TYPE:
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
bo = calloc(1, sizeof(*bo));
|
||||
if (!bo)
|
||||
return -ENOMEM;
|
||||
|
||||
if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8) {
|
||||
pitch = 64 * 4;
|
||||
size = 64 * 64 * 4;
|
||||
} else if (type == KMS_BO_TYPE_SCANOUT_X8R8G8B8) {
|
||||
pitch = width * 4;
|
||||
pitch = (pitch + 512 - 1) & ~(512 - 1);
|
||||
size = pitch * ((height + 4 - 1) & ~(4 - 1));
|
||||
} else {
|
||||
free(bo);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.size = size;
|
||||
|
||||
ret = drmCommandWriteRead(kms->fd, DRM_I915_GEM_CREATE, &arg, sizeof(arg));
|
||||
if (ret)
|
||||
goto err_free;
|
||||
|
||||
bo->base.kms = kms;
|
||||
bo->base.handle = arg.handle;
|
||||
bo->base.size = size;
|
||||
bo->base.pitch = pitch;
|
||||
|
||||
*out = &bo->base;
|
||||
if (type == KMS_BO_TYPE_SCANOUT_X8R8G8B8 && pitch > 512) {
|
||||
struct drm_i915_gem_set_tiling tile;
|
||||
|
||||
memset(&tile, 0, sizeof(tile));
|
||||
tile.handle = bo->base.handle;
|
||||
tile.tiling_mode = I915_TILING_X;
|
||||
tile.stride = bo->base.pitch;
|
||||
|
||||
ret = drmCommandWriteRead(kms->fd, DRM_I915_GEM_SET_TILING, &tile, sizeof(tile));
|
||||
#if 0
|
||||
if (ret) {
|
||||
kms_bo_destroy(out);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_free:
|
||||
free(bo);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
intel_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out)
|
||||
{
|
||||
switch (key) {
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
intel_bo_map(struct kms_bo *_bo, void **out)
|
||||
{
|
||||
struct intel_bo *bo = (struct intel_bo *)_bo;
|
||||
struct drm_i915_gem_mmap_gtt arg;
|
||||
void *map = NULL;
|
||||
int ret;
|
||||
|
||||
if (bo->base.ptr) {
|
||||
bo->map_count++;
|
||||
*out = bo->base.ptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.handle = bo->base.handle;
|
||||
|
||||
ret = drmCommandWriteRead(bo->base.kms->fd, DRM_I915_GEM_MMAP_GTT, &arg, sizeof(arg));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
map = drm_mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, arg.offset);
|
||||
if (map == MAP_FAILED)
|
||||
return -errno;
|
||||
|
||||
bo->base.ptr = map;
|
||||
bo->map_count++;
|
||||
*out = bo->base.ptr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
intel_bo_unmap(struct kms_bo *_bo)
|
||||
{
|
||||
struct intel_bo *bo = (struct intel_bo *)_bo;
|
||||
bo->map_count--;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
intel_bo_destroy(struct kms_bo *_bo)
|
||||
{
|
||||
struct intel_bo *bo = (struct intel_bo *)_bo;
|
||||
struct drm_gem_close arg;
|
||||
int ret;
|
||||
|
||||
if (bo->base.ptr) {
|
||||
/* XXX Sanity check map_count */
|
||||
drm_munmap(bo->base.ptr, bo->base.size);
|
||||
bo->base.ptr = NULL;
|
||||
}
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.handle = bo->base.handle;
|
||||
|
||||
ret = drmIoctl(bo->base.kms->fd, DRM_IOCTL_GEM_CLOSE, &arg);
|
||||
if (ret)
|
||||
return -errno;
|
||||
|
||||
free(bo);
|
||||
return 0;
|
||||
}
|
||||
|
||||
drm_private int
|
||||
intel_create(int fd, struct kms_driver **out)
|
||||
{
|
||||
struct kms_driver *kms;
|
||||
|
||||
kms = calloc(1, sizeof(*kms));
|
||||
if (!kms)
|
||||
return -ENOMEM;
|
||||
|
||||
kms->fd = fd;
|
||||
|
||||
kms->bo_create = intel_bo_create;
|
||||
kms->bo_map = intel_bo_map;
|
||||
kms->bo_unmap = intel_bo_unmap;
|
||||
kms->bo_get_prop = intel_bo_get_prop;
|
||||
kms->bo_destroy = intel_bo_destroy;
|
||||
kms->get_prop = intel_get_prop;
|
||||
kms->destroy = intel_destroy;
|
||||
*out = kms;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright © 2009 VMware, Inc., Palo Alto, CA., USA
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef INTERNAL_H_
|
||||
#define INTERNAL_H_
|
||||
|
||||
#include "libdrm_macros.h"
|
||||
#include "libkms.h"
|
||||
|
||||
struct kms_driver
|
||||
{
|
||||
int (*get_prop)(struct kms_driver *kms, const unsigned key,
|
||||
unsigned *out);
|
||||
int (*destroy)(struct kms_driver *kms);
|
||||
|
||||
int (*bo_create)(struct kms_driver *kms,
|
||||
unsigned width,
|
||||
unsigned height,
|
||||
enum kms_bo_type type,
|
||||
const unsigned *attr,
|
||||
struct kms_bo **out);
|
||||
int (*bo_get_prop)(struct kms_bo *bo, const unsigned key,
|
||||
unsigned *out);
|
||||
int (*bo_map)(struct kms_bo *bo, void **out);
|
||||
int (*bo_unmap)(struct kms_bo *bo);
|
||||
int (*bo_destroy)(struct kms_bo *bo);
|
||||
|
||||
int fd;
|
||||
};
|
||||
|
||||
struct kms_bo
|
||||
{
|
||||
struct kms_driver *kms;
|
||||
void *ptr;
|
||||
size_t size;
|
||||
size_t offset;
|
||||
size_t pitch;
|
||||
unsigned handle;
|
||||
};
|
||||
|
||||
drm_private int linux_create(int fd, struct kms_driver **out);
|
||||
|
||||
drm_private int vmwgfx_create(int fd, struct kms_driver **out);
|
||||
|
||||
drm_private int intel_create(int fd, struct kms_driver **out);
|
||||
|
||||
drm_private int dumb_create(int fd, struct kms_driver **out);
|
||||
|
||||
drm_private int nouveau_create(int fd, struct kms_driver **out);
|
||||
|
||||
drm_private int radeon_create(int fd, struct kms_driver **out);
|
||||
|
||||
drm_private int exynos_create(int fd, struct kms_driver **out);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
kms_bo_create
|
||||
kms_bo_destroy
|
||||
kms_bo_get_prop
|
||||
kms_bo_map
|
||||
kms_bo_unmap
|
||||
kms_create
|
||||
kms_destroy
|
||||
kms_get_prop
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright © 2009 VMware, Inc., Palo Alto, CA., USA
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef _LIBKMS_H_
|
||||
#define _LIBKMS_H_
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
*/
|
||||
|
||||
struct kms_driver;
|
||||
struct kms_bo;
|
||||
|
||||
enum kms_attrib
|
||||
{
|
||||
KMS_TERMINATE_PROP_LIST,
|
||||
#define KMS_TERMINATE_PROP_LIST KMS_TERMINATE_PROP_LIST
|
||||
KMS_BO_TYPE,
|
||||
#define KMS_BO_TYPE KMS_BO_TYPE
|
||||
KMS_WIDTH,
|
||||
#define KMS_WIDTH KMS_WIDTH
|
||||
KMS_HEIGHT,
|
||||
#define KMS_HEIGHT KMS_HEIGHT
|
||||
KMS_PITCH,
|
||||
#define KMS_PITCH KMS_PITCH
|
||||
KMS_HANDLE,
|
||||
#define KMS_HANDLE KMS_HANDLE
|
||||
};
|
||||
|
||||
enum kms_bo_type
|
||||
{
|
||||
KMS_BO_TYPE_SCANOUT_X8R8G8B8 = (1 << 0),
|
||||
#define KMS_BO_TYPE_SCANOUT_X8R8G8B8 KMS_BO_TYPE_SCANOUT_X8R8G8B8
|
||||
KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8 = (1 << 1),
|
||||
#define KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8 KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8
|
||||
};
|
||||
|
||||
int kms_create(int fd, struct kms_driver **out);
|
||||
int kms_get_prop(struct kms_driver *kms, unsigned key, unsigned *out);
|
||||
int kms_destroy(struct kms_driver **kms);
|
||||
|
||||
int kms_bo_create(struct kms_driver *kms, const unsigned *attr, struct kms_bo **out);
|
||||
int kms_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out);
|
||||
int kms_bo_map(struct kms_bo *bo, void **out);
|
||||
int kms_bo_unmap(struct kms_bo *bo);
|
||||
int kms_bo_destroy(struct kms_bo **bo);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: libkms
|
||||
Description: Library that abstracts away the different mm interface for kernel drivers
|
||||
Version: 1.0.0
|
||||
Libs: -L${libdir} -lkms
|
||||
Cflags: -I${includedir}/libkms
|
||||
Requires.private: libdrm
|
||||
147
libkms/linux.c
147
libkms/linux.c
|
|
@ -1,147 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright © 2009 VMware, Inc., Palo Alto, CA., USA
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
/*
|
||||
* Thanks to krh and jcristau for the tips on
|
||||
* going from fd to pci id via fstat and udev.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <xf86drm.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef MAJOR_IN_MKDEV
|
||||
#include <sys/mkdev.h>
|
||||
#endif
|
||||
#ifdef MAJOR_IN_SYSMACROS
|
||||
#include <sys/sysmacros.h>
|
||||
#endif
|
||||
|
||||
#include "libdrm_macros.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define PATH_SIZE 512
|
||||
|
||||
static int
|
||||
linux_name_from_sysfs(int fd, char **out)
|
||||
{
|
||||
char path[PATH_SIZE+1] = ""; /* initialize to please valgrind */
|
||||
char link[PATH_SIZE+1] = "";
|
||||
struct stat buffer;
|
||||
unsigned maj, min;
|
||||
char* slash_name;
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* Inside the sysfs directory for the device there is a symlink
|
||||
* to the directory representing the driver module, that path
|
||||
* happens to hold the name of the driver.
|
||||
*
|
||||
* So lets get the symlink for the drm device. Then read the link
|
||||
* and filter out the last directory which happens to be the name
|
||||
* of the driver, which we can use to load the correct interface.
|
||||
*
|
||||
* Thanks to Ray Strode of Plymouth for the code.
|
||||
*/
|
||||
|
||||
ret = fstat(fd, &buffer);
|
||||
if (ret)
|
||||
return -EINVAL;
|
||||
|
||||
if (!S_ISCHR(buffer.st_mode))
|
||||
return -EINVAL;
|
||||
|
||||
maj = major(buffer.st_rdev);
|
||||
min = minor(buffer.st_rdev);
|
||||
|
||||
snprintf(path, PATH_SIZE, "/sys/dev/char/%d:%d/device/driver", maj, min);
|
||||
|
||||
if (readlink(path, link, PATH_SIZE) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
/* link looks something like this: ../../../bus/pci/drivers/intel */
|
||||
slash_name = strrchr(link, '/');
|
||||
if (!slash_name)
|
||||
return -EINVAL;
|
||||
|
||||
/* copy name and at the same time remove the slash */
|
||||
*out = strdup(slash_name + 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
linux_from_sysfs(int fd, struct kms_driver **out)
|
||||
{
|
||||
char *name;
|
||||
int ret;
|
||||
|
||||
ret = linux_name_from_sysfs(fd, &name);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
#if HAVE_INTEL
|
||||
if (!strcmp(name, "intel"))
|
||||
ret = intel_create(fd, out);
|
||||
else
|
||||
#endif
|
||||
#if HAVE_VMWGFX
|
||||
if (!strcmp(name, "vmwgfx"))
|
||||
ret = vmwgfx_create(fd, out);
|
||||
else
|
||||
#endif
|
||||
#if HAVE_NOUVEAU
|
||||
if (!strcmp(name, "nouveau"))
|
||||
ret = nouveau_create(fd, out);
|
||||
else
|
||||
#endif
|
||||
#if HAVE_RADEON
|
||||
if (!strcmp(name, "radeon"))
|
||||
ret = radeon_create(fd, out);
|
||||
else
|
||||
#endif
|
||||
#if HAVE_EXYNOS
|
||||
if (!strcmp(name, "exynos"))
|
||||
ret = exynos_create(fd, out);
|
||||
else
|
||||
#endif
|
||||
ret = -ENOSYS;
|
||||
|
||||
free(name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
drm_private int
|
||||
linux_create(int fd, struct kms_driver **out)
|
||||
{
|
||||
if (!dumb_create(fd, out))
|
||||
return 0;
|
||||
|
||||
return linux_from_sysfs(fd, out);
|
||||
}
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
# Copyright © 2017-2018 Intel Corporation
|
||||
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
# in the Software without restriction, including without limitation the rights
|
||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
# copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
libkms_include = [inc_root, inc_drm]
|
||||
files_libkms = files(
|
||||
'linux.c',
|
||||
'dumb.c',
|
||||
'api.c',
|
||||
)
|
||||
if with_vmwgfx
|
||||
files_libkms += files('vmwgfx.c')
|
||||
endif
|
||||
if with_intel
|
||||
files_libkms += files('intel.c')
|
||||
endif
|
||||
if with_nouveau
|
||||
files_libkms += files('nouveau.c')
|
||||
endif
|
||||
if with_radeon
|
||||
files_libkms += files('radeon.c')
|
||||
endif
|
||||
if with_exynos
|
||||
files_libkms += files('exynos.c')
|
||||
libkms_include += include_directories('../exynos')
|
||||
endif
|
||||
|
||||
libkms = library(
|
||||
'kms',
|
||||
[files_libkms, config_file],
|
||||
c_args : libdrm_c_args,
|
||||
include_directories : libkms_include,
|
||||
link_with : libdrm,
|
||||
version : '1.0.0',
|
||||
install : true,
|
||||
)
|
||||
|
||||
ext_libkms = declare_dependency(
|
||||
link_with : [libdrm, libkms],
|
||||
include_directories : [libkms_include],
|
||||
)
|
||||
|
||||
install_headers('libkms.h', subdir : 'libkms')
|
||||
|
||||
pkg.generate(
|
||||
name : 'libkms',
|
||||
libraries : libkms,
|
||||
subdirs : ['libkms'],
|
||||
version : '1.0.0',
|
||||
requires_private : 'libdrm',
|
||||
description : 'Library that abstracts away the different mm interfaces for kernel drivers',
|
||||
)
|
||||
|
||||
test(
|
||||
'kms-symbols-check',
|
||||
symbols_check,
|
||||
args : [
|
||||
'--lib', libkms,
|
||||
'--symbols-file', files('kms-symbols.txt'),
|
||||
'--nm', prog_nm.path(),
|
||||
],
|
||||
)
|
||||
218
libkms/nouveau.c
218
libkms/nouveau.c
|
|
@ -1,218 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright © 2009 VMware, Inc., Palo Alto, CA., USA
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "internal.h"
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include "xf86drm.h"
|
||||
#include "libdrm_macros.h"
|
||||
|
||||
#include "nouveau_drm.h"
|
||||
|
||||
struct nouveau_bo
|
||||
{
|
||||
struct kms_bo base;
|
||||
uint64_t map_handle;
|
||||
unsigned map_count;
|
||||
};
|
||||
|
||||
static int
|
||||
nouveau_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)
|
||||
{
|
||||
switch (key) {
|
||||
case KMS_BO_TYPE:
|
||||
*out = KMS_BO_TYPE_SCANOUT_X8R8G8B8 | KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
nouveau_destroy(struct kms_driver *kms)
|
||||
{
|
||||
free(kms);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
nouveau_bo_create(struct kms_driver *kms,
|
||||
const unsigned width, const unsigned height,
|
||||
const enum kms_bo_type type, const unsigned *attr,
|
||||
struct kms_bo **out)
|
||||
{
|
||||
struct drm_nouveau_gem_new arg;
|
||||
unsigned size, pitch;
|
||||
struct nouveau_bo *bo;
|
||||
int i, ret;
|
||||
|
||||
for (i = 0; attr[i]; i += 2) {
|
||||
switch (attr[i]) {
|
||||
case KMS_WIDTH:
|
||||
case KMS_HEIGHT:
|
||||
case KMS_BO_TYPE:
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
bo = calloc(1, sizeof(*bo));
|
||||
if (!bo)
|
||||
return -ENOMEM;
|
||||
|
||||
if (type == KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8) {
|
||||
pitch = 64 * 4;
|
||||
size = 64 * 64 * 4;
|
||||
} else if (type == KMS_BO_TYPE_SCANOUT_X8R8G8B8) {
|
||||
pitch = width * 4;
|
||||
pitch = (pitch + 512 - 1) & ~(512 - 1);
|
||||
size = pitch * height;
|
||||
} else {
|
||||
free(bo);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.info.size = size;
|
||||
arg.info.domain = NOUVEAU_GEM_DOMAIN_MAPPABLE | NOUVEAU_GEM_DOMAIN_VRAM;
|
||||
arg.info.tile_mode = 0;
|
||||
arg.info.tile_flags = 0;
|
||||
arg.align = 512;
|
||||
arg.channel_hint = 0;
|
||||
|
||||
ret = drmCommandWriteRead(kms->fd, DRM_NOUVEAU_GEM_NEW, &arg, sizeof(arg));
|
||||
if (ret)
|
||||
goto err_free;
|
||||
|
||||
bo->base.kms = kms;
|
||||
bo->base.handle = arg.info.handle;
|
||||
bo->base.size = size;
|
||||
bo->base.pitch = pitch;
|
||||
bo->map_handle = arg.info.map_handle;
|
||||
|
||||
*out = &bo->base;
|
||||
|
||||
return 0;
|
||||
|
||||
err_free:
|
||||
free(bo);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
nouveau_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out)
|
||||
{
|
||||
switch (key) {
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
nouveau_bo_map(struct kms_bo *_bo, void **out)
|
||||
{
|
||||
struct nouveau_bo *bo = (struct nouveau_bo *)_bo;
|
||||
void *map = NULL;
|
||||
|
||||
if (bo->base.ptr) {
|
||||
bo->map_count++;
|
||||
*out = bo->base.ptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
map = drm_mmap(0, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, bo->map_handle);
|
||||
if (map == MAP_FAILED)
|
||||
return -errno;
|
||||
|
||||
bo->base.ptr = map;
|
||||
bo->map_count++;
|
||||
*out = bo->base.ptr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
nouveau_bo_unmap(struct kms_bo *_bo)
|
||||
{
|
||||
struct nouveau_bo *bo = (struct nouveau_bo *)_bo;
|
||||
bo->map_count--;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
nouveau_bo_destroy(struct kms_bo *_bo)
|
||||
{
|
||||
struct nouveau_bo *bo = (struct nouveau_bo *)_bo;
|
||||
struct drm_gem_close arg;
|
||||
int ret;
|
||||
|
||||
if (bo->base.ptr) {
|
||||
/* XXX Sanity check map_count */
|
||||
drm_munmap(bo->base.ptr, bo->base.size);
|
||||
bo->base.ptr = NULL;
|
||||
}
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.handle = bo->base.handle;
|
||||
|
||||
ret = drmIoctl(bo->base.kms->fd, DRM_IOCTL_GEM_CLOSE, &arg);
|
||||
if (ret)
|
||||
return -errno;
|
||||
|
||||
free(bo);
|
||||
return 0;
|
||||
}
|
||||
|
||||
drm_private int
|
||||
nouveau_create(int fd, struct kms_driver **out)
|
||||
{
|
||||
struct kms_driver *kms;
|
||||
|
||||
kms = calloc(1, sizeof(*kms));
|
||||
if (!kms)
|
||||
return -ENOMEM;
|
||||
|
||||
kms->fd = fd;
|
||||
|
||||
kms->bo_create = nouveau_bo_create;
|
||||
kms->bo_map = nouveau_bo_map;
|
||||
kms->bo_unmap = nouveau_bo_unmap;
|
||||
kms->bo_get_prop = nouveau_bo_get_prop;
|
||||
kms->bo_destroy = nouveau_bo_destroy;
|
||||
kms->get_prop = nouveau_get_prop;
|
||||
kms->destroy = nouveau_destroy;
|
||||
*out = kms;
|
||||
|
||||
return 0;
|
||||
}
|
||||
239
libkms/radeon.c
239
libkms/radeon.c
|
|
@ -1,239 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright © 2009 VMware, Inc., Palo Alto, CA., USA
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "internal.h"
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include "xf86drm.h"
|
||||
#include "libdrm_macros.h"
|
||||
|
||||
#include "radeon_drm.h"
|
||||
|
||||
|
||||
#define ALIGNMENT 512
|
||||
|
||||
struct radeon_bo
|
||||
{
|
||||
struct kms_bo base;
|
||||
unsigned map_count;
|
||||
};
|
||||
|
||||
static int
|
||||
radeon_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)
|
||||
{
|
||||
switch (key) {
|
||||
case KMS_BO_TYPE:
|
||||
*out = KMS_BO_TYPE_SCANOUT_X8R8G8B8 | KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
radeon_destroy(struct kms_driver *kms)
|
||||
{
|
||||
free(kms);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
radeon_bo_create(struct kms_driver *kms,
|
||||
const unsigned width, const unsigned height,
|
||||
const enum kms_bo_type type, const unsigned *attr,
|
||||
struct kms_bo **out)
|
||||
{
|
||||
struct drm_radeon_gem_create arg;
|
||||
unsigned size, pitch;
|
||||
struct radeon_bo *bo;
|
||||
int i, ret;
|
||||
|
||||
for (i = 0; attr[i]; i += 2) {
|
||||
switch (attr[i]) {
|
||||
case KMS_WIDTH:
|
||||
case KMS_HEIGHT:
|
||||
case KMS_BO_TYPE:
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8:
|
||||
pitch = 4 * 64;
|
||||
size = 4 * 64 * 64;
|
||||
break;
|
||||
case KMS_BO_TYPE_SCANOUT_X8R8G8B8:
|
||||
pitch = width * 4;
|
||||
pitch = (pitch + ALIGNMENT - 1) & ~(ALIGNMENT - 1);
|
||||
size = pitch * height;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bo = calloc(1, sizeof(*bo));
|
||||
if (!bo)
|
||||
return -ENOMEM;
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.size = size;
|
||||
arg.alignment = ALIGNMENT;
|
||||
arg.initial_domain = RADEON_GEM_DOMAIN_CPU;
|
||||
arg.flags = 0;
|
||||
arg.handle = 0;
|
||||
|
||||
ret = drmCommandWriteRead(kms->fd, DRM_RADEON_GEM_CREATE,
|
||||
&arg, sizeof(arg));
|
||||
if (ret)
|
||||
goto err_free;
|
||||
|
||||
bo->base.kms = kms;
|
||||
bo->base.handle = arg.handle;
|
||||
bo->base.size = size;
|
||||
bo->base.pitch = pitch;
|
||||
bo->base.offset = 0;
|
||||
bo->map_count = 0;
|
||||
|
||||
*out = &bo->base;
|
||||
|
||||
return 0;
|
||||
|
||||
err_free:
|
||||
free(bo);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
radeon_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out)
|
||||
{
|
||||
switch (key) {
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
radeon_bo_map(struct kms_bo *_bo, void **out)
|
||||
{
|
||||
struct radeon_bo *bo = (struct radeon_bo *)_bo;
|
||||
struct drm_radeon_gem_mmap arg;
|
||||
void *map = NULL;
|
||||
int ret;
|
||||
|
||||
if (bo->base.ptr) {
|
||||
bo->map_count++;
|
||||
*out = bo->base.ptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.handle = bo->base.handle;
|
||||
arg.offset = bo->base.offset;
|
||||
arg.size = (uint64_t)bo->base.size;
|
||||
|
||||
ret = drmCommandWriteRead(bo->base.kms->fd, DRM_RADEON_GEM_MMAP,
|
||||
&arg, sizeof(arg));
|
||||
if (ret)
|
||||
return -errno;
|
||||
|
||||
map = drm_mmap(0, arg.size, PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||
bo->base.kms->fd, arg.addr_ptr);
|
||||
if (map == MAP_FAILED)
|
||||
return -errno;
|
||||
|
||||
bo->base.ptr = map;
|
||||
bo->map_count++;
|
||||
*out = bo->base.ptr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
radeon_bo_unmap(struct kms_bo *_bo)
|
||||
{
|
||||
struct radeon_bo *bo = (struct radeon_bo *)_bo;
|
||||
if (--bo->map_count == 0) {
|
||||
drm_munmap(bo->base.ptr, bo->base.size);
|
||||
bo->base.ptr = NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
radeon_bo_destroy(struct kms_bo *_bo)
|
||||
{
|
||||
struct radeon_bo *bo = (struct radeon_bo *)_bo;
|
||||
struct drm_gem_close arg;
|
||||
int ret;
|
||||
|
||||
if (bo->base.ptr) {
|
||||
/* XXX Sanity check map_count */
|
||||
drm_munmap(bo->base.ptr, bo->base.size);
|
||||
bo->base.ptr = NULL;
|
||||
}
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.handle = bo->base.handle;
|
||||
|
||||
ret = drmIoctl(bo->base.kms->fd, DRM_IOCTL_GEM_CLOSE, &arg);
|
||||
if (ret)
|
||||
return -errno;
|
||||
|
||||
free(bo);
|
||||
return 0;
|
||||
}
|
||||
|
||||
drm_private int
|
||||
radeon_create(int fd, struct kms_driver **out)
|
||||
{
|
||||
struct kms_driver *kms;
|
||||
|
||||
kms = calloc(1, sizeof(*kms));
|
||||
if (!kms)
|
||||
return -ENOMEM;
|
||||
|
||||
kms->fd = fd;
|
||||
|
||||
kms->bo_create = radeon_bo_create;
|
||||
kms->bo_map = radeon_bo_map;
|
||||
kms->bo_unmap = radeon_bo_unmap;
|
||||
kms->bo_get_prop = radeon_bo_get_prop;
|
||||
kms->bo_destroy = radeon_bo_destroy;
|
||||
kms->get_prop = radeon_get_prop;
|
||||
kms->destroy = radeon_destroy;
|
||||
*out = kms;
|
||||
|
||||
return 0;
|
||||
}
|
||||
207
libkms/vmwgfx.c
207
libkms/vmwgfx.c
|
|
@ -1,207 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright © 2009 VMware, Inc., Palo Alto, CA., USA
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#define _WANT_KERNEL_ERRNO
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "internal.h"
|
||||
|
||||
#include "xf86drm.h"
|
||||
#include "libdrm_macros.h"
|
||||
#include "vmwgfx_drm.h"
|
||||
|
||||
struct vmwgfx_bo
|
||||
{
|
||||
struct kms_bo base;
|
||||
uint64_t map_handle;
|
||||
unsigned map_count;
|
||||
};
|
||||
|
||||
static int
|
||||
vmwgfx_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)
|
||||
{
|
||||
switch (key) {
|
||||
case KMS_BO_TYPE:
|
||||
*out = KMS_BO_TYPE_SCANOUT_X8R8G8B8 | KMS_BO_TYPE_CURSOR_64X64_A8R8G8B8;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
vmwgfx_destroy(struct kms_driver *kms)
|
||||
{
|
||||
free(kms);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
vmwgfx_bo_create(struct kms_driver *kms,
|
||||
const unsigned width, const unsigned height,
|
||||
const enum kms_bo_type type, const unsigned *attr,
|
||||
struct kms_bo **out)
|
||||
{
|
||||
struct vmwgfx_bo *bo;
|
||||
int i, ret;
|
||||
|
||||
for (i = 0; attr[i]; i += 2) {
|
||||
switch (attr[i]) {
|
||||
case KMS_WIDTH:
|
||||
case KMS_HEIGHT:
|
||||
case KMS_BO_TYPE:
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
bo = calloc(1, sizeof(*bo));
|
||||
if (!bo)
|
||||
return -EINVAL;
|
||||
|
||||
{
|
||||
union drm_vmw_alloc_dmabuf_arg arg;
|
||||
struct drm_vmw_alloc_dmabuf_req *req = &arg.req;
|
||||
struct drm_vmw_dmabuf_rep *rep = &arg.rep;
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
req->size = width * height * 4;
|
||||
bo->base.size = req->size;
|
||||
bo->base.pitch = width * 4;
|
||||
bo->base.kms = kms;
|
||||
|
||||
do {
|
||||
ret = drmCommandWriteRead(bo->base.kms->fd,
|
||||
DRM_VMW_ALLOC_DMABUF,
|
||||
&arg, sizeof(arg));
|
||||
} while (ret == -ERESTART);
|
||||
|
||||
if (ret)
|
||||
goto err_free;
|
||||
|
||||
bo->base.handle = rep->handle;
|
||||
bo->map_handle = rep->map_handle;
|
||||
bo->base.handle = rep->cur_gmr_id;
|
||||
bo->base.offset = rep->cur_gmr_offset;
|
||||
}
|
||||
|
||||
*out = &bo->base;
|
||||
|
||||
return 0;
|
||||
|
||||
err_free:
|
||||
free(bo);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
vmwgfx_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out)
|
||||
{
|
||||
switch (key) {
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
vmwgfx_bo_map(struct kms_bo *_bo, void **out)
|
||||
{
|
||||
struct vmwgfx_bo *bo = (struct vmwgfx_bo *)_bo;
|
||||
void *map;
|
||||
|
||||
if (bo->base.ptr) {
|
||||
bo->map_count++;
|
||||
*out = bo->base.ptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
map = drm_mmap(NULL, bo->base.size, PROT_READ | PROT_WRITE, MAP_SHARED, bo->base.kms->fd, bo->map_handle);
|
||||
if (map == MAP_FAILED)
|
||||
return -errno;
|
||||
|
||||
bo->base.ptr = map;
|
||||
bo->map_count++;
|
||||
*out = bo->base.ptr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
vmwgfx_bo_unmap(struct kms_bo *_bo)
|
||||
{
|
||||
struct vmwgfx_bo *bo = (struct vmwgfx_bo *)_bo;
|
||||
bo->map_count--;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
vmwgfx_bo_destroy(struct kms_bo *_bo)
|
||||
{
|
||||
struct vmwgfx_bo *bo = (struct vmwgfx_bo *)_bo;
|
||||
struct drm_vmw_unref_dmabuf_arg arg;
|
||||
|
||||
if (bo->base.ptr) {
|
||||
/* XXX Sanity check map_count */
|
||||
drm_munmap(bo->base.ptr, bo->base.size);
|
||||
bo->base.ptr = NULL;
|
||||
}
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.handle = bo->base.handle;
|
||||
drmCommandWrite(bo->base.kms->fd, DRM_VMW_UNREF_DMABUF, &arg, sizeof(arg));
|
||||
|
||||
free(bo);
|
||||
return 0;
|
||||
}
|
||||
|
||||
drm_private int
|
||||
vmwgfx_create(int fd, struct kms_driver **out)
|
||||
{
|
||||
struct kms_driver *kms;
|
||||
|
||||
kms = calloc(1, sizeof(*kms));
|
||||
if (!kms)
|
||||
return -ENOMEM;
|
||||
|
||||
kms->fd = fd;
|
||||
|
||||
kms->bo_create = vmwgfx_bo_create;
|
||||
kms->bo_map = vmwgfx_bo_map;
|
||||
kms->bo_unmap = vmwgfx_bo_unmap;
|
||||
kms->bo_get_prop = vmwgfx_bo_get_prop;
|
||||
kms->bo_destroy = vmwgfx_bo_destroy;
|
||||
kms->get_prop = vmwgfx_get_prop;
|
||||
kms->destroy = vmwgfx_destroy;
|
||||
*out = kms;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/poll.h>
|
||||
#include <poll.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
|||
|
|
@ -102,13 +102,13 @@ for the selected connector. See the *Examples* section below for more
|
|||
information.
|
||||
|
||||
All valid modes for a connector can be retrieved with a call to
|
||||
drmModeGetConnector3 You need to select the mode you want to use and save it.
|
||||
**drmModeGetConnector**\ (3) You need to select the mode you want to use and save it.
|
||||
The first mode in the list is the default mode with the highest resolution
|
||||
possible and often a suitable choice.
|
||||
|
||||
After you have a working connector+CRTC+mode combination, you need to create a
|
||||
framebuffer that is used for scanout. Memory buffer allocation is
|
||||
driver-depedent and described in **drm-memory**\ (7). You need to create a
|
||||
driver-dependent and described in **drm-memory**\ (7). You need to create a
|
||||
buffer big enough for your selected mode. Now you can create a framebuffer
|
||||
object that uses your memory-buffer as scanout buffer. You can do this with
|
||||
**drmModeAddFB**\ (3) and **drmModeAddFB2**\ (3).
|
||||
|
|
@ -214,7 +214,7 @@ Reporting Bugs
|
|||
==============
|
||||
|
||||
Bugs in this manual should be reported to
|
||||
https://gitlab.freedesktop.org/mesa/drm/-/issues
|
||||
https://gitlab.freedesktop.org/mesa/libdrm/-/issues
|
||||
|
||||
See Also
|
||||
========
|
||||
|
|
|
|||
|
|
@ -169,19 +169,10 @@ rendering, cursors and CPU-access. See the libgbm library for more information
|
|||
or look at the driver-dependent man-pages (for example **drm-intel**\ (7) or
|
||||
**drm-radeon**\ (7)).
|
||||
|
||||
GEM-buffers can be closed with the ``DRM_IOCTL_GEM_CLOSE`` ioctl. It takes as
|
||||
argument a structure of type ``struct drm_gem_close``:
|
||||
|
||||
::
|
||||
|
||||
struct drm_gem_close {
|
||||
__u32 handle;
|
||||
__u32 pad;
|
||||
};
|
||||
|
||||
The *handle* field is the GEM-handle to be closed. The *pad* field is unused
|
||||
padding. It must be zeroed. After this call the GEM handle cannot be used by
|
||||
this process anymore and may be reused for new GEM objects by the GEM API.
|
||||
GEM-buffers can be closed with **drmCloseBufferHandle**\ (3). It takes as
|
||||
argument the GEM-handle to be closed. After this call the GEM handle cannot be
|
||||
used by this process anymore and may be reused for new GEM objects by the GEM
|
||||
API.
|
||||
|
||||
If you want to share GEM-objects between different processes, you can create a
|
||||
name for them and pass this name to other processes which can then open this
|
||||
|
|
@ -313,7 +304,7 @@ Reporting Bugs
|
|||
==============
|
||||
|
||||
Bugs in this manual should be reported to
|
||||
https://gitlab.freedesktop.org/mesa/drm/-/issues
|
||||
https://gitlab.freedesktop.org/mesa/libdrm/-/issues
|
||||
|
||||
See Also
|
||||
========
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ driver dependent. However, two generic frameworks are available that are
|
|||
used by most DRM drivers. These are the *Translation Table Manager*
|
||||
(TTM) and the *Graphics Execution Manager* (GEM). They provide generic
|
||||
APIs to create, destroy and access buffers from user-space. However,
|
||||
there are still many differences between the drivers so driver-depedent
|
||||
there are still many differences between the drivers so driver-dependent
|
||||
code is still needed. Many helpers are provided in *libgbm* (Graphics
|
||||
Buffer Manager) from the *Mesa* project. For more information on DRM
|
||||
memory management, see **drm-memory**\ (7).
|
||||
|
|
@ -82,7 +82,7 @@ Reporting Bugs
|
|||
==============
|
||||
|
||||
Bugs in this manual should be reported to
|
||||
https://gitlab.freedesktop.org/mesa/drm/-/issues.
|
||||
https://gitlab.freedesktop.org/mesa/libdrm/-/issues.
|
||||
|
||||
See Also
|
||||
========
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ Reporting Bugs
|
|||
==============
|
||||
|
||||
Bugs in this function should be reported to
|
||||
https://gitlab.freedesktop.org/mesa/drm/-/issues
|
||||
https://gitlab.freedesktop.org/mesa/libdrm/-/issues
|
||||
|
||||
See Also
|
||||
========
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ Reporting Bugs
|
|||
==============
|
||||
|
||||
Bugs in this function should be reported to
|
||||
https://gitlab.freedesktop.org/mesa/drm/-/issues
|
||||
https://gitlab.freedesktop.org/mesa/libdrm/-/issues
|
||||
|
||||
See Also
|
||||
========
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ Reporting Bugs
|
|||
==============
|
||||
|
||||
Bugs in this function should be reported to
|
||||
https://gitlab.freedesktop.org/mesa/drm/-/issues
|
||||
https://gitlab.freedesktop.org/mesa/libdrm/-/issues
|
||||
|
||||
See Also
|
||||
========
|
||||
|
|
|
|||
313
meson.build
313
meson.build
|
|
@ -18,15 +18,26 @@
|
|||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
# The versioning should always stay at 2.4.x. If bumping away from this,
|
||||
# you must ensure that all users of patch_ver are changed such that DSO versions
|
||||
# continuously increment (e.g. blindly bumping from 2.4.122 to 2.5.0 would
|
||||
# roll the libdrm DSO versioning from libdrm.so.2.122.0 back to libdrm.so.2.0.0
|
||||
# which would be bad)
|
||||
project(
|
||||
'libdrm',
|
||||
['c'],
|
||||
version : '2.4.107',
|
||||
version : '2.4.131',
|
||||
license : 'MIT',
|
||||
meson_version : '>= 0.46',
|
||||
default_options : ['buildtype=debugoptimized', 'c_std=gnu99'],
|
||||
meson_version : '>= 0.59',
|
||||
default_options : ['buildtype=debugoptimized', 'c_std=c11'],
|
||||
)
|
||||
|
||||
patch_ver = meson.project_version().split('.')[2]
|
||||
|
||||
if ['windows', 'darwin'].contains(host_machine.system())
|
||||
error('unsupported OS: @0@'.format(host_machine.system()))
|
||||
endif
|
||||
|
||||
pkg = import('pkgconfig')
|
||||
|
||||
config = configuration_data()
|
||||
|
|
@ -34,16 +45,22 @@ config = configuration_data()
|
|||
config.set10('UDEV', get_option('udev'))
|
||||
with_freedreno_kgsl = get_option('freedreno-kgsl')
|
||||
with_install_tests = get_option('install-test-programs')
|
||||
with_tests = get_option('tests')
|
||||
|
||||
if ['freebsd', 'dragonfly', 'netbsd'].contains(host_machine.system())
|
||||
dep_pthread_stubs = dependency('pthread-stubs', version : '>= 0.4')
|
||||
else
|
||||
dep_pthread_stubs = []
|
||||
endif
|
||||
dep_threads = dependency('threads')
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
config.set10('HAVE_SECURE_GETENV', cc.has_function('secure_getenv'))
|
||||
|
||||
android = cc.compiles('''int func() { return __ANDROID__; }''')
|
||||
|
||||
# Solaris / Illumos
|
||||
if host_machine.system() == 'sunos'
|
||||
add_global_arguments('-D__EXTENSIONS__', language : 'c')
|
||||
add_global_arguments('-D_POSIX_C_SOURCE=3', language : 'c')
|
||||
endif
|
||||
|
||||
symbols_check = find_program('symbols-check.py')
|
||||
prog_nm = find_program('nm')
|
||||
|
||||
|
|
@ -52,8 +69,10 @@ intel_atomics = false
|
|||
lib_atomics = false
|
||||
|
||||
python3 = import('python').find_installation()
|
||||
format_mod_static_table = custom_target('format_mod_static_table',
|
||||
output : 'generated_static_table_fourcc.h', input: 'include/drm/drm_fourcc.h',
|
||||
format_mod_static_table = custom_target(
|
||||
'format_mod_static_table',
|
||||
output : 'generated_static_table_fourcc.h',
|
||||
input : 'include/drm/drm_fourcc.h',
|
||||
command : [python3, files('gen_table_fourcc.py'), '@INPUT@', '@OUTPUT@'])
|
||||
|
||||
dep_atomic_ops = dependency('atomic_ops', required : false)
|
||||
|
|
@ -78,101 +97,64 @@ endif
|
|||
config.set10('HAVE_LIBDRM_ATOMIC_PRIMITIVES', intel_atomics)
|
||||
config.set10('HAVE_LIB_ATOMIC_OPS', lib_atomics)
|
||||
|
||||
with_intel = false
|
||||
_intel = get_option('intel')
|
||||
if _intel != 'false'
|
||||
if _intel == 'true' and not with_atomics
|
||||
error('libdrm_intel requires atomics.')
|
||||
else
|
||||
with_intel = _intel == 'true' or host_machine.cpu_family().startswith('x86')
|
||||
endif
|
||||
endif
|
||||
dep_pciaccess = dependency('pciaccess', version : '>= 0.10', required : get_option('intel'))
|
||||
|
||||
with_radeon = false
|
||||
_radeon = get_option('radeon')
|
||||
if _radeon != 'false'
|
||||
if _radeon == 'true' and not with_atomics
|
||||
error('libdrm_radeon requires atomics.')
|
||||
endif
|
||||
with_radeon = true
|
||||
endif
|
||||
with_intel = get_option('intel') \
|
||||
.require(with_atomics, error_message : 'libdrm_intel requires atomics') \
|
||||
.require(dep_pciaccess.found(), error_message : 'libdrm_intel requires libpciaccess') \
|
||||
.disable_auto_if(not host_machine.cpu_family().startswith('x86')) \
|
||||
.allowed()
|
||||
summary('Intel', with_intel)
|
||||
|
||||
with_amdgpu = false
|
||||
_amdgpu = get_option('amdgpu')
|
||||
if _amdgpu != 'false'
|
||||
if _amdgpu == 'true' and not with_atomics
|
||||
error('libdrm_amdgpu requires atomics.')
|
||||
endif
|
||||
with_amdgpu = true
|
||||
endif
|
||||
with_radeon = get_option('radeon') \
|
||||
.require(with_atomics, error_message : 'libdrm_radeon requires atomics') \
|
||||
.allowed()
|
||||
summary('Radeon', with_radeon)
|
||||
|
||||
with_nouveau = false
|
||||
_nouveau = get_option('nouveau')
|
||||
if _nouveau != 'false'
|
||||
if _nouveau == 'true' and not with_atomics
|
||||
error('libdrm_nouveau requires atomics.')
|
||||
endif
|
||||
with_nouveau = true
|
||||
endif
|
||||
with_amdgpu = get_option('amdgpu') \
|
||||
.require(with_atomics, error_message : 'libdrm_amdgpu requires atomics') \
|
||||
.allowed()
|
||||
summary('AMDGPU', with_amdgpu)
|
||||
|
||||
with_vmwgfx = false
|
||||
_vmwgfx = get_option('vmwgfx')
|
||||
if _vmwgfx != 'false'
|
||||
with_vmwgfx = true
|
||||
endif
|
||||
with_nouveau = get_option('nouveau') \
|
||||
.require(with_atomics, error_message : 'libdrm_nouveau requires atomics') \
|
||||
.allowed()
|
||||
summary('Nouveau', with_nouveau)
|
||||
|
||||
with_omap = false
|
||||
_omap = get_option('omap')
|
||||
if _omap == 'true'
|
||||
if not with_atomics
|
||||
error('libdrm_omap requires atomics.')
|
||||
endif
|
||||
with_omap = true
|
||||
endif
|
||||
with_vmwgfx = get_option('vmwgfx').allowed()
|
||||
summary('vmwgfx', with_vmwgfx)
|
||||
|
||||
with_freedreno = false
|
||||
_freedreno = get_option('freedreno')
|
||||
if _freedreno != 'false'
|
||||
if _freedreno == 'true' and not with_atomics
|
||||
error('libdrm_freedreno requires atomics.')
|
||||
else
|
||||
with_freedreno = _freedreno == 'true' or ['arm', 'aarch64'].contains(host_machine.cpu_family())
|
||||
endif
|
||||
endif
|
||||
with_omap = get_option('omap') \
|
||||
.require(with_atomics, error_message : 'libdrm_omap requires atomics') \
|
||||
.enabled()
|
||||
summary('OMAP', with_omap)
|
||||
|
||||
with_tegra = false
|
||||
_tegra = get_option('tegra')
|
||||
if _tegra == 'true'
|
||||
if not with_atomics
|
||||
error('libdrm_tegra requires atomics.')
|
||||
endif
|
||||
with_tegra = true
|
||||
endif
|
||||
with_freedreno = get_option('freedreno') \
|
||||
.require(with_atomics, error_message : 'libdrm_freedreno requires atomics') \
|
||||
.disable_auto_if(not ['arm', 'aarch64'].contains(host_machine.cpu_family())) \
|
||||
.allowed()
|
||||
summary('Freedreno', with_freedreno)
|
||||
summary('Freedreon-kgsl', with_freedreno_kgsl)
|
||||
|
||||
with_etnaviv = false
|
||||
_etnaviv = get_option('etnaviv')
|
||||
if _etnaviv == 'true'
|
||||
if not with_atomics
|
||||
error('libdrm_etnaviv requires atomics.')
|
||||
endif
|
||||
with_etnaviv = true
|
||||
endif
|
||||
with_tegra = get_option('tegra') \
|
||||
.require(with_atomics, error_message : 'libdrm_tegra requires atomics') \
|
||||
.disable_auto_if(not ['arm', 'aarch64'].contains(host_machine.cpu_family())) \
|
||||
.enabled()
|
||||
summary('Tegra', with_tegra)
|
||||
|
||||
with_exynos = get_option('exynos') == 'true'
|
||||
with_etnaviv = get_option('etnaviv') \
|
||||
.require(with_atomics, error_message : 'libdrm_etnaviv requires atomics') \
|
||||
.disable_auto_if(not ['arm', 'aarch64', 'arc', 'mips', 'mips64', 'loongarch64'].contains(host_machine.cpu_family())) \
|
||||
.allowed()
|
||||
summary('Etnaviv', with_etnaviv)
|
||||
|
||||
with_vc4 = false
|
||||
_vc4 = get_option('vc4')
|
||||
if _vc4 != 'false'
|
||||
with_vc4 = _vc4 == 'true' or ['arm', 'aarch64'].contains(host_machine.cpu_family())
|
||||
endif
|
||||
with_exynos = get_option('exynos').enabled()
|
||||
summary('EXYNOS', with_exynos)
|
||||
|
||||
# XXX: Apparently only freebsd and dragonfly bsd actually need this (and
|
||||
# gnu/kfreebsd), not openbsd and netbsd
|
||||
with_libkms = false
|
||||
_libkms = get_option('libkms')
|
||||
if _libkms != 'false'
|
||||
with_libkms = _libkms == 'true' or ['linux', 'freebsd', 'dragonfly'].contains(host_machine.system())
|
||||
endif
|
||||
with_vc4 = get_option('vc4') \
|
||||
.disable_auto_if(not ['arm', 'aarch64'].contains(host_machine.cpu_family())) \
|
||||
.allowed()
|
||||
summary('VC4', with_vc4)
|
||||
|
||||
# Among others FreeBSD does not have a separate dl library.
|
||||
if not cc.has_function('dlsym')
|
||||
|
|
@ -187,10 +169,9 @@ if not cc.has_function('clock_gettime', prefix : '#define _GNU_SOURCE\n#include
|
|||
else
|
||||
dep_rt = []
|
||||
endif
|
||||
dep_m = cc.find_library('m', required : false)
|
||||
|
||||
# The header is not required on Linux, and is in fact deprecated in glibc 2.30+
|
||||
if ['linux'].contains(host_machine.system())
|
||||
if host_machine.system() == 'linux'
|
||||
config.set10('HAVE_SYS_SYSCTL_H', false)
|
||||
else
|
||||
# From Niclas Zeising:
|
||||
|
|
@ -201,8 +182,7 @@ else
|
|||
endif
|
||||
|
||||
foreach header : ['sys/select.h', 'alloca.h']
|
||||
config.set10('HAVE_' + header.underscorify().to_upper(),
|
||||
cc.compiles('#include <@0@>'.format(header), name : '@0@ works'.format(header)))
|
||||
config.set10('HAVE_' + header.underscorify().to_upper(), cc.check_header(header))
|
||||
endforeach
|
||||
|
||||
if (cc.has_header_symbol('sys/sysmacros.h', 'major') and
|
||||
|
|
@ -217,61 +197,30 @@ if (cc.has_header_symbol('sys/mkdev.h', 'major') and
|
|||
endif
|
||||
config.set10('HAVE_OPEN_MEMSTREAM', cc.has_function('open_memstream'))
|
||||
|
||||
warn_c_args = []
|
||||
foreach a : ['-Wall', '-Wextra', '-Wsign-compare', '-Werror=undef',
|
||||
'-Werror=implicit-function-declaration', '-Wpointer-arith',
|
||||
'-Wwrite-strings', '-Wstrict-prototypes', '-Wmissing-prototypes',
|
||||
'-Wmissing-declarations', '-Wnested-externs', '-Wpacked',
|
||||
'-Wswitch-enum', '-Wmissing-format-attribute',
|
||||
'-Wstrict-aliasing=2', '-Winit-self', '-Winline', '-Wshadow',
|
||||
'-Wdeclaration-after-statement', '-Wold-style-definition']
|
||||
if cc.has_argument(a)
|
||||
warn_c_args += a
|
||||
endif
|
||||
endforeach
|
||||
# GCC will never error for -Wno-*, so check for -W* then add -Wno-* to the list
|
||||
# of options
|
||||
foreach a : ['unused-parameter', 'attributes', 'long-long',
|
||||
'missing-field-initializers']
|
||||
if cc.has_argument('-W@0@'.format(a))
|
||||
warn_c_args += '-Wno-@0@'.format(a)
|
||||
endif
|
||||
endforeach
|
||||
libdrm_c_args = cc.get_supported_arguments([
|
||||
'-Wsign-compare', '-Werror=undef', '-Werror=implicit-function-declaration',
|
||||
'-Wpointer-arith', '-Wwrite-strings', '-Wstrict-prototypes',
|
||||
'-Wmissing-prototypes', '-Wmissing-declarations', '-Wnested-externs',
|
||||
'-Wpacked', '-Wswitch-enum', '-Wmissing-format-attribute',
|
||||
'-Wstrict-aliasing=2', '-Winit-self', '-Winline', '-Wshadow',
|
||||
'-Wdeclaration-after-statement', '-Wold-style-definition',
|
||||
'-Wno-unused-parameter', '-Wno-attributes', '-Wno-long-long',
|
||||
'-Wno-missing-field-initializers'])
|
||||
|
||||
# all c args:
|
||||
libdrm_c_args = warn_c_args + ['-fvisibility=hidden']
|
||||
dep_cairo = dependency('cairo', required : get_option('cairo-tests'))
|
||||
with_cairo_tests = dep_cairo.found()
|
||||
|
||||
|
||||
dep_pciaccess = dependency('pciaccess', version : '>= 0.10', required : with_intel)
|
||||
dep_cunit = dependency('cunit', version : '>= 2.1', required : false)
|
||||
_cairo_tests = get_option('cairo-tests')
|
||||
if _cairo_tests != 'false'
|
||||
dep_cairo = dependency('cairo', required : _cairo_tests == 'true')
|
||||
with_cairo_tests = dep_cairo.found()
|
||||
else
|
||||
dep_cairo = []
|
||||
with_cairo_tests = false
|
||||
endif
|
||||
_valgrind = get_option('valgrind')
|
||||
if _valgrind != 'false'
|
||||
if with_freedreno
|
||||
dep_valgrind = dependency('valgrind', required : _valgrind == 'true', version : '>=3.10.0')
|
||||
else
|
||||
dep_valgrind = dependency('valgrind', required : _valgrind == 'true')
|
||||
endif
|
||||
with_valgrind = dep_valgrind.found()
|
||||
else
|
||||
dep_valgrind = []
|
||||
with_valgrind = false
|
||||
valgrind_version = []
|
||||
if with_freedreno
|
||||
valgrind_version = '>=3.10.0'
|
||||
endif
|
||||
dep_valgrind = dependency('valgrind', required : get_option('valgrind'), version : valgrind_version)
|
||||
with_valgrind = dep_valgrind.found()
|
||||
|
||||
with_man_pages = get_option('man-pages')
|
||||
prog_rst2man = find_program('rst2man', 'rst2man.py', required: with_man_pages == 'true')
|
||||
with_man_pages = with_man_pages != 'false' and prog_rst2man.found()
|
||||
prog_rst2man = find_program('rst2man', 'rst2man.py', required: get_option('man-pages'))
|
||||
with_man_pages = prog_rst2man.found()
|
||||
|
||||
config.set10('HAVE_VISIBILITY',
|
||||
cc.compiles('''int foo_hidden(void) __attribute__((visibility(("hidden"))));''',
|
||||
name : 'compiler supports __attribute__(("hidden"))'))
|
||||
config.set10('HAVE_VISIBILITY', cc.has_function_attribute('visibility:hidden'))
|
||||
|
||||
foreach t : [
|
||||
[with_exynos, 'EXYNOS'],
|
||||
|
|
@ -290,28 +239,47 @@ if with_freedreno_kgsl and not with_freedreno
|
|||
error('cannot enable freedreno-kgsl without freedreno support')
|
||||
endif
|
||||
config.set10('_GNU_SOURCE', true)
|
||||
|
||||
if target_machine.endian() == 'big'
|
||||
config.set('HAVE_BIG_ENDIAN', 1)
|
||||
endif
|
||||
|
||||
if android
|
||||
config.set('BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD', 1)
|
||||
endif
|
||||
|
||||
config_file = configure_file(
|
||||
configuration : config,
|
||||
output : 'config.h',
|
||||
)
|
||||
add_project_arguments('-include', '@0@'.format(config_file), language : 'c')
|
||||
add_project_arguments('-include', meson.current_build_dir() / 'config.h', language : 'c')
|
||||
|
||||
inc_root = include_directories('.')
|
||||
inc_drm = include_directories('include/drm')
|
||||
|
||||
libdrm_files = [files(
|
||||
'xf86drm.c', 'xf86drmHash.c', 'xf86drmRandom.c', 'xf86drmSL.c',
|
||||
'xf86drmMode.c'
|
||||
),
|
||||
config_file, format_mod_static_table
|
||||
]
|
||||
|
||||
# Build an unversioned so on android
|
||||
if android
|
||||
libdrm_kw = {}
|
||||
else
|
||||
libdrm_kw = { 'version' : '2.@0@.0'.format(patch_ver) }
|
||||
endif
|
||||
|
||||
libdrm = library(
|
||||
'drm',
|
||||
[files(
|
||||
'xf86drm.c', 'xf86drmHash.c', 'xf86drmRandom.c', 'xf86drmSL.c',
|
||||
'xf86drmMode.c'
|
||||
),
|
||||
config_file, format_mod_static_table
|
||||
],
|
||||
libdrm_files,
|
||||
c_args : libdrm_c_args,
|
||||
dependencies : [dep_valgrind, dep_rt, dep_m],
|
||||
dependencies : [dep_valgrind, dep_rt],
|
||||
include_directories : inc_drm,
|
||||
version : '2.4.0',
|
||||
install : true,
|
||||
kwargs : libdrm_kw,
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
)
|
||||
|
||||
test(
|
||||
|
|
@ -320,7 +288,7 @@ test(
|
|||
args : [
|
||||
'--lib', libdrm,
|
||||
'--symbols-file', files('core-symbols.txt'),
|
||||
'--nm', prog_nm.path(),
|
||||
'--nm', prog_nm.full_path(),
|
||||
],
|
||||
)
|
||||
|
||||
|
|
@ -329,6 +297,8 @@ ext_libdrm = declare_dependency(
|
|||
include_directories : [inc_root, inc_drm],
|
||||
)
|
||||
|
||||
meson.override_dependency('libdrm', ext_libdrm)
|
||||
|
||||
install_headers('libsync.h', 'xf86drm.h', 'xf86drmMode.h')
|
||||
install_headers(
|
||||
'include/drm/drm.h', 'include/drm/drm_fourcc.h', 'include/drm/drm_mode.h',
|
||||
|
|
@ -347,16 +317,12 @@ if with_vmwgfx
|
|||
endif
|
||||
|
||||
pkg.generate(
|
||||
libdrm,
|
||||
name : 'libdrm',
|
||||
libraries : libdrm,
|
||||
subdirs : ['.', 'libdrm'],
|
||||
version : meson.project_version(),
|
||||
description : 'Userspace interface to kernel DRM services',
|
||||
)
|
||||
|
||||
if with_libkms
|
||||
subdir('libkms')
|
||||
endif
|
||||
if with_intel
|
||||
subdir('intel')
|
||||
endif
|
||||
|
|
@ -391,21 +357,6 @@ if with_man_pages
|
|||
subdir('man')
|
||||
endif
|
||||
subdir('data')
|
||||
subdir('tests')
|
||||
|
||||
message('')
|
||||
message('@0@ will be compiled with:'.format(meson.project_name()))
|
||||
message('')
|
||||
message(' libkms @0@'.format(with_libkms))
|
||||
message(' Intel API @0@'.format(with_intel))
|
||||
message(' vmwgfx API @0@'.format(with_vmwgfx))
|
||||
message(' Radeon API @0@'.format(with_radeon))
|
||||
message(' AMDGPU API @0@'.format(with_amdgpu))
|
||||
message(' Nouveau API @0@'.format(with_nouveau))
|
||||
message(' OMAP API @0@'.format(with_omap))
|
||||
message(' EXYNOS API @0@'.format(with_exynos))
|
||||
message(' Freedreno API @0@ (kgsl: @1@)'.format(with_freedreno, with_freedreno_kgsl))
|
||||
message(' Tegra API @0@'.format(with_tegra))
|
||||
message(' VC4 API @0@'.format(with_vc4))
|
||||
message(' Etnaviv API @0@'.format(with_etnaviv))
|
||||
message('')
|
||||
if with_tests
|
||||
subdir('tests')
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -18,109 +18,77 @@
|
|||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
option(
|
||||
'libkms',
|
||||
type : 'combo',
|
||||
value : 'auto',
|
||||
choices : ['true', 'false', 'auto'],
|
||||
description : 'Build libkms mm abstraction library.',
|
||||
)
|
||||
option(
|
||||
'intel',
|
||||
type : 'combo',
|
||||
value : 'auto',
|
||||
choices : ['true', 'false', 'auto'],
|
||||
type : 'feature',
|
||||
description : '''Enable support for Intel's KMS API.''',
|
||||
)
|
||||
option(
|
||||
'radeon',
|
||||
type : 'combo',
|
||||
value : 'auto',
|
||||
choices : ['true', 'false', 'auto'],
|
||||
type : 'feature',
|
||||
description : '''Enable support for radeons's KMS API.''',
|
||||
)
|
||||
option(
|
||||
'amdgpu',
|
||||
type : 'combo',
|
||||
value : 'auto',
|
||||
choices : ['true', 'false', 'auto'],
|
||||
type : 'feature',
|
||||
description : '''Enable support for amdgpu's KMS API.''',
|
||||
)
|
||||
option(
|
||||
'nouveau',
|
||||
type : 'combo',
|
||||
value : 'auto',
|
||||
choices : ['true', 'false', 'auto'],
|
||||
type : 'feature',
|
||||
description : '''Enable support for nouveau's KMS API.''',
|
||||
)
|
||||
option(
|
||||
'vmwgfx',
|
||||
type : 'combo',
|
||||
value : 'true',
|
||||
choices : ['true', 'false', 'auto'],
|
||||
type : 'feature',
|
||||
description : '''Enable support for vmgfx's KMS API.''',
|
||||
)
|
||||
option(
|
||||
'omap',
|
||||
type : 'combo',
|
||||
value : 'false',
|
||||
choices : ['true', 'false', 'auto'],
|
||||
type : 'feature',
|
||||
value : 'disabled',
|
||||
description : '''Enable support for OMAP's experimental KMS API.''',
|
||||
)
|
||||
option(
|
||||
'exynos',
|
||||
type : 'combo',
|
||||
value : 'false',
|
||||
choices : ['true', 'false', 'auto'],
|
||||
type : 'feature',
|
||||
value : 'disabled',
|
||||
description : '''Enable support for EXYNOS's experimental KMS API.''',
|
||||
)
|
||||
option(
|
||||
'freedreno',
|
||||
type : 'combo',
|
||||
value : 'auto',
|
||||
choices : ['true', 'false', 'auto'],
|
||||
type : 'feature',
|
||||
description : '''Enable support for freedreno's KMS API.''',
|
||||
)
|
||||
option(
|
||||
'tegra',
|
||||
type : 'combo',
|
||||
value : 'false',
|
||||
choices : ['true', 'false', 'auto'],
|
||||
type : 'feature',
|
||||
value : 'disabled',
|
||||
description : '''Enable support for Tegra's experimental KMS API.''',
|
||||
)
|
||||
option(
|
||||
'vc4',
|
||||
type : 'combo',
|
||||
value : 'auto',
|
||||
choices : ['true', 'false', 'auto'],
|
||||
type : 'feature',
|
||||
description : '''Enable support for vc4's KMS API.''',
|
||||
)
|
||||
option(
|
||||
'etnaviv',
|
||||
type : 'combo',
|
||||
value : 'false',
|
||||
choices : ['true', 'false', 'auto'],
|
||||
description : '''Enable support for etnaviv's experimental KMS API.''',
|
||||
type : 'feature',
|
||||
description : '''Enable support for etnaviv's KMS API.''',
|
||||
)
|
||||
option(
|
||||
'cairo-tests',
|
||||
type : 'combo',
|
||||
value : 'auto',
|
||||
choices : ['true', 'false', 'auto'],
|
||||
type : 'feature',
|
||||
description : 'Enable support for Cairo rendering in tests.',
|
||||
)
|
||||
option(
|
||||
'man-pages',
|
||||
type : 'combo',
|
||||
value : 'auto',
|
||||
choices : ['true', 'false', 'auto'],
|
||||
type : 'feature',
|
||||
description : 'Enable manpage generation and installation.',
|
||||
)
|
||||
option(
|
||||
'valgrind',
|
||||
type : 'combo',
|
||||
value : 'auto',
|
||||
choices : ['true', 'false', 'auto'],
|
||||
type : 'feature',
|
||||
description : 'Build libdrm with valgrind support.',
|
||||
)
|
||||
option(
|
||||
|
|
@ -141,3 +109,9 @@ option(
|
|||
value : false,
|
||||
description : 'Enable support for using udev instead of mknod.',
|
||||
)
|
||||
option(
|
||||
'tests',
|
||||
type : 'boolean',
|
||||
value : true,
|
||||
description : 'Build test programs.',
|
||||
)
|
||||
|
|
|
|||
11
nouveau/Android.bp
Normal file
11
nouveau/Android.bp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
build = ["Android.sources.bp"]
|
||||
|
||||
cc_library_shared {
|
||||
name: "libdrm_nouveau",
|
||||
defaults: [
|
||||
"libdrm_defaults",
|
||||
"libdrm_nouveau_sources",
|
||||
],
|
||||
vendor: true,
|
||||
shared_libs: ["libdrm"],
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
LOCAL_PATH := $(call my-dir)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
# Import variables LIBDRM_NOUVEAU_FILES, LIBDRM_NOUVEAU_H_FILES
|
||||
include $(LOCAL_PATH)/Makefile.sources
|
||||
|
||||
LOCAL_MODULE := libdrm_nouveau
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := libdrm
|
||||
|
||||
LOCAL_SRC_FILES := $(LIBDRM_NOUVEAU_FILES)
|
||||
|
||||
include $(LIBDRM_COMMON_MK)
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
11
nouveau/Android.sources.bp
Normal file
11
nouveau/Android.sources.bp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Autogenerated with Android.sources.bp.mk
|
||||
|
||||
cc_defaults {
|
||||
name: "libdrm_nouveau_sources",
|
||||
srcs: [
|
||||
"nouveau.c",
|
||||
"pushbuf.c",
|
||||
"bufctx.c",
|
||||
"abi16.c",
|
||||
],
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
LIBDRM_NOUVEAU_FILES := \
|
||||
nouveau.c \
|
||||
pushbuf.c \
|
||||
bufctx.c \
|
||||
abi16.c \
|
||||
private.h
|
||||
|
||||
LIBDRM_NOUVEAU_H_FILES := \
|
||||
nouveau.h
|
||||
|
|
@ -23,10 +23,11 @@ libdrm_nouveau = library(
|
|||
'drm_nouveau',
|
||||
[files( 'nouveau.c', 'pushbuf.c', 'bufctx.c', 'abi16.c'), config_file],
|
||||
c_args : libdrm_c_args,
|
||||
gnu_symbol_visibility : 'hidden',
|
||||
include_directories : [inc_root, inc_drm],
|
||||
link_with : libdrm,
|
||||
dependencies : [dep_threads, dep_atomic_ops],
|
||||
version : '2.0.0',
|
||||
version : '2.@0@.0'.format(patch_ver),
|
||||
install : true,
|
||||
)
|
||||
|
||||
|
|
@ -35,6 +36,8 @@ ext_libdrm_nouveau = declare_dependency(
|
|||
include_directories : [inc_drm, include_directories('.')],
|
||||
)
|
||||
|
||||
meson.override_dependency('libdrm_nouveau', ext_libdrm_nouveau)
|
||||
|
||||
install_headers('nouveau.h', subdir : 'libdrm/nouveau')
|
||||
install_headers(
|
||||
'nvif/class.h', 'nvif/cl0080.h', 'nvif/cl9097.h', 'nvif/if0002.h',
|
||||
|
|
@ -43,11 +46,9 @@ install_headers(
|
|||
)
|
||||
|
||||
pkg.generate(
|
||||
libdrm_nouveau,
|
||||
name : 'libdrm_nouveau',
|
||||
libraries : libdrm_nouveau,
|
||||
subdirs : ['.', 'libdrm', 'libdrm/nouveau'],
|
||||
version : meson.project_version(),
|
||||
requires_private : 'libdrm',
|
||||
description : 'Userspace interface to nouveau kernel DRM services',
|
||||
)
|
||||
|
||||
|
|
@ -57,6 +58,6 @@ test(
|
|||
args : [
|
||||
'--lib', libdrm_nouveau,
|
||||
'--symbols-file', files('nouveau-symbols.txt'),
|
||||
'--nm', prog_nm.path(),
|
||||
'--nm', prog_nm.full_path(),
|
||||
],
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
nouveau_bo_make_global
|
||||
nouveau_bo_map
|
||||
nouveau_bo_name_get
|
||||
nouveau_bo_name_ref
|
||||
|
|
@ -12,6 +13,7 @@ nouveau_bufctx_mthd
|
|||
nouveau_bufctx_new
|
||||
nouveau_bufctx_refn
|
||||
nouveau_bufctx_reset
|
||||
nouveau_check_dead_channel
|
||||
nouveau_client_del
|
||||
nouveau_client_new
|
||||
nouveau_device_del
|
||||
|
|
|
|||
|
|
@ -607,7 +607,6 @@ nouveau_bo_del(struct nouveau_bo *bo)
|
|||
struct nouveau_drm *drm = nouveau_drm(&bo->device->object);
|
||||
struct nouveau_device_priv *nvdev = nouveau_device(bo->device);
|
||||
struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
|
||||
struct drm_gem_close req = { .handle = bo->handle };
|
||||
|
||||
if (nvbo->head.next) {
|
||||
pthread_mutex_lock(&nvdev->lock);
|
||||
|
|
@ -621,11 +620,11 @@ nouveau_bo_del(struct nouveau_bo *bo)
|
|||
* might cause the bo to be closed accidentally while
|
||||
* re-importing.
|
||||
*/
|
||||
drmIoctl(drm->fd, DRM_IOCTL_GEM_CLOSE, &req);
|
||||
drmCloseBufferHandle(drm->fd, bo->handle);
|
||||
}
|
||||
pthread_mutex_unlock(&nvdev->lock);
|
||||
} else {
|
||||
drmIoctl(drm->fd, DRM_IOCTL_GEM_CLOSE, &req);
|
||||
drmCloseBufferHandle(drm->fd, bo->handle);
|
||||
}
|
||||
if (bo->map)
|
||||
drm_munmap(bo->map, bo->size);
|
||||
|
|
@ -712,7 +711,7 @@ nouveau_bo_wrap_locked(struct nouveau_device *dev, uint32_t handle,
|
|||
}
|
||||
|
||||
static void
|
||||
nouveau_bo_make_global(struct nouveau_bo_priv *nvbo)
|
||||
nouveau_nvbo_make_global(struct nouveau_bo_priv *nvbo)
|
||||
{
|
||||
if (!nvbo->head.next) {
|
||||
struct nouveau_device_priv *nvdev = nouveau_device(nvbo->base.device);
|
||||
|
|
@ -723,6 +722,14 @@ nouveau_bo_make_global(struct nouveau_bo_priv *nvbo)
|
|||
}
|
||||
}
|
||||
|
||||
drm_public void
|
||||
nouveau_bo_make_global(struct nouveau_bo *bo)
|
||||
{
|
||||
struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
|
||||
|
||||
nouveau_nvbo_make_global(nvbo);
|
||||
}
|
||||
|
||||
drm_public int
|
||||
nouveau_bo_wrap(struct nouveau_device *dev, uint32_t handle,
|
||||
struct nouveau_bo **pbo)
|
||||
|
|
@ -781,7 +788,7 @@ nouveau_bo_name_get(struct nouveau_bo *bo, uint32_t *name)
|
|||
}
|
||||
nvbo->name = *name = req.name;
|
||||
|
||||
nouveau_bo_make_global(nvbo);
|
||||
nouveau_nvbo_make_global(nvbo);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -831,7 +838,7 @@ nouveau_bo_set_prime(struct nouveau_bo *bo, int *prime_fd)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
nouveau_bo_make_global(nvbo);
|
||||
nouveau_nvbo_make_global(nvbo);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ struct nouveau_bo {
|
|||
int nouveau_bo_new(struct nouveau_device *, uint32_t flags, uint32_t align,
|
||||
uint64_t size, union nouveau_bo_config *,
|
||||
struct nouveau_bo **);
|
||||
void nouveau_bo_make_global(struct nouveau_bo *);
|
||||
int nouveau_bo_wrap(struct nouveau_device *, uint32_t handle,
|
||||
struct nouveau_bo **);
|
||||
int nouveau_bo_name_ref(struct nouveau_device *v, uint32_t name,
|
||||
|
|
@ -273,4 +274,8 @@ struct nv04_notify {
|
|||
uint32_t offset;
|
||||
uint32_t length;
|
||||
};
|
||||
|
||||
bool
|
||||
nouveau_check_dead_channel(struct nouveau_drm *, struct nouveau_object *chan);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <xf86drm.h>
|
||||
#include <xf86atomic.h>
|
||||
|
|
@ -274,9 +275,10 @@ pushbuf_dump(struct nouveau_pushbuf_krec *krec, int krec_id, int chid)
|
|||
|
||||
kref = krec->buffer;
|
||||
for (i = 0; i < krec->nr_buffer; i++, kref++) {
|
||||
err("ch%d: buf %08x %08x %08x %08x %08x\n", chid, i,
|
||||
bo = (void *)(uintptr_t)kref->user_priv;
|
||||
err("ch%d: buf %08x %08x %08x %08x %08x %p 0x%"PRIx64" 0x%"PRIx64"\n", chid, i,
|
||||
kref->handle, kref->valid_domains,
|
||||
kref->read_domains, kref->write_domains);
|
||||
kref->read_domains, kref->write_domains, bo->map, bo->offset, bo->size);
|
||||
}
|
||||
|
||||
krel = krec->reloc;
|
||||
|
|
@ -780,3 +782,19 @@ nouveau_pushbuf_kick(struct nouveau_pushbuf *push, struct nouveau_object *chan)
|
|||
pushbuf_flush(push);
|
||||
return pushbuf_validate(push, false);
|
||||
}
|
||||
|
||||
drm_public bool
|
||||
nouveau_check_dead_channel(struct nouveau_drm *drm, struct nouveau_object *chan)
|
||||
{
|
||||
struct drm_nouveau_gem_pushbuf req = {};
|
||||
struct nouveau_fifo *fifo = chan->data;
|
||||
int ret;
|
||||
|
||||
req.channel = fifo->channel;
|
||||
req.nr_push = 0;
|
||||
|
||||
ret = drmCommandWriteRead(drm->fd, DRM_NOUVEAU_GEM_PUSHBUF,
|
||||
&req, sizeof(req));
|
||||
/* nouveau returns ENODEV once the channel was killed */
|
||||
return ret == -ENODEV;
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue