Commit graph

47 commits

Author SHA1 Message Date
Faith Ekstrand
ae37fbba12 nouveau: Move shader topology info to nv_device_info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
1bbfdccc9f nouveau: Drop GART size from nv_device_info
The kernel always returns something rediculously high, like 40 bits or
something.  There's really no point in us tracking it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:07 +00:00
Faith Ekstrand
1756e4601a nouveau: Move gart_size to nv_device_info
This is more complicated than the others since it is a calculated value.
For nv_device_info struct, we want the raw version that raw query from
the chip.  We move the calculation into nvk_create_drm_physical_device().

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
372c884b4a nouveau: Move more stuff into nv_device_info
The device_id and is_integrated fields in nouveau_device can be dropped
entirely since they're redundant with nv_device_info::device_id and
nv_device_info::type.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Faith Ekstrand
9846c4e13e nouveau: Put PCI info in a pci substruct in nv_device_info
We separate out device_id because even non-PCI devices have one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Emma Anholt
826486339b nvk: Quiet a compiler warning.
Looks like it's always set to me, but 🤷

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:06 +00:00
Dave Airlie
d96cac61c5 nvk: add compute support for ampere
ampere has support for QMDv3, it's not mandatory but lets use it for now.

the more important change is the PCAS2_B call.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
715dff0b93 nvk: Add a build test for MMEs
This simple test compiles all the MMEs for Turing and Volta to ensure
that they build and don't run out of registers.  We could, in theory, do
actual unit testing here with gtest but just building is enough to
ensure that no one breaks driver start-up on hardware they don't own.
They can still break the driver functionally, of course, but at least
it'll initialize.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
4fb8fa5241 nouveau/push: Add an NV_PUSH_MAX_COUNT #define
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:04 +00:00
Faith Ekstrand
433e742682 nouveau/winsys: Move device type into nv_device_info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:03 +00:00
Karol Herbst
ae14362ff6 nvk: wire up M2MF for Fermi
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Karol Herbst
27d6f994ba nvk: support pre Maxwell Texture Headers
GM10x seems to disable it by default, so enable them there.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Karol Herbst
6214bfd139 nvk: bind more subchans in init_context_state
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:02 +00:00
Faith Ekstrand
0ae334b32b nouveau/parser: Handle SET_ANTI_ALIAS_SAMPLE_POSITIONS
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
c3a6b529e4 nouveau/parser: Sort METHOD_ARRAY_SIZES
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
f4fc6511ac nouveau/headers: Add generated headers to dependencies
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
9b20394b89 nouveau: Add PCI information to nv_device_info
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:01 +00:00
Faith Ekstrand
696a1fe776 nouveau/parser: Handle 6F methods
These are the methods below 0x100 which exist on all subchannels.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
bc992fc6cc nouveau/parser: Parse all fields in each method
When converting to mako, the break got moved to the wrong spot and we
were only parsing the first method.  Now we parse them all.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:32:00 +00:00
Faith Ekstrand
dee921f46d nvk: Use nv_push directly for graphics pipelines
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
5ce9d75701 nouveau: Move push dumping to nv_push.c
Because we need access to classes, we also add a basic device info
struct.  We'll expand on this a bit later.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
f89f05c94e nouveau: Move push validate to nv_push.c
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
76edce98f7 nouveau/parser: Take a FILE* in DUMP_*_MTHD_DATA
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
fb9524f5dd nouveau: Move nv_push and helpers to their own header
We put this in nvidia-headers to separate it from the pushbuf stuff.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
a6c62732da nouveau/parser: Add more arrays
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Emma Anholt
5d0aa694ee nvk: Avoid strict aliasing warning in the pushbuffer encoding.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
7f413ef104 nouveau/parser: Put the dump helpers in C files
This should make the build faster since we don't have to compile those
giant functions with giant switch statements constantly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
7e1291d7be nouveau/parser: Use more idiomatic python
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
9855b80a7a nouveau/parser: Convert to mako
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:59 +00:00
Faith Ekstrand
10d16dce1c nouveau/parser: Add array and float tags for clear values
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:58 +00:00
Faith Ekstrand
1d4c6cee45 nouveau/parser: Dump more fields as float
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:57 +00:00
Faith Ekstrand
0f203b2b44 nouveau: Generate 3D headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
ec0b9109b8 nouveau/parser: Handle arrays properly in P_IMMD()
We make a new macro VA_NVCLS_FOO which is either an array macro or a
regular macro and, either way, redirects to V_NVCLS_FOO.  This lets us
unconditionally use VA_NVCLS_FOO in P_IMMD() and, if the caller hands in
a FOO(i), it will get unwrapped and mangled to produce to V_NVCLS_FOO.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
68403e5742 nouveau/parser: Better dump float data
For now, we only do something with floats when we dump.  You still need
to use fui() when setting them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
bbdd35f155 nouveau/parser: Properly dump most arrays used by 3D
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Faith Ekstrand
76e30e64da nouveau/parser: Fix an integer overflow and a typo
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Karol Herbst
3f07cd31e3 nouveau/headers: initial 3D headers import
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:56 +00:00
Karol Herbst
e6b2c84d0f nouveau/headers: add path for 3D headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Dave Airlie
974212a581 nouveau/classes: add 906f header support.
This needed some tweaks to the generator script

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:55 +00:00
Karol Herbst
95843dd754 nouveau/headers: Generate parser functions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
bd8077bef5 nouveau/vk: add support for compute classes to generator.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:54 +00:00
Dave Airlie
4cd3d74136 nvk: move to new command stream generator.
This auto generates macros/inlines/structs from the nvidia
class headers using a python for noobs script

v2: use argparse.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
81e680edc9 nouveau/headers: add host classes
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
e47b0c42cc nouveau/headers: typedef Nv void types
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
2810d4cf6d nouveau/headers: add nvtypes.h
Nvidia does provide an nvtypes.h file within their open-gpu-kernel-modules,
but that one is painful to port over to userspace.

Just provide the defines we will need instead.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:53 +00:00
Karol Herbst
179f996c04 nouveau/headers: initial sync of headers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00
Karol Herbst
b081325fc7 nouveau/headers: add script to sync in-tree headers with open-gpu-doc
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
2023-08-04 21:31:52 +00:00