broadcom/qpu: use and expand version info at opcode description
authorAlejandro Piñeiro <apinheiro@igalia.com>
Sun, 8 Aug 2021 00:18:18 +0000 (02:18 +0200)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Wed, 18 Aug 2021 23:08:14 +0000 (01:08 +0200)
commita4cb756e4d2adeff39d25afe0cec97997ae42b7b
tree50d685855ed82b9e08c3da2a3f33739c4767939a
parent8a5f2228dbbb2c781fabe7ddfff039f20d77853e
broadcom/qpu: use and expand version info at opcode description

Right now opcode_desc struct, used to define data for all the
operations to pack/unpack, include a version field. In theory that
could be used to check if we are retrieving a opcode valid for our hw
version, or to get the correct opcode if a given one changed across hw
versions, or just the same if it didn't change.

In practice that field was not used. So for example, if by mistake we
asked for an opcode defined at version 41, while being on version 33
hardware, we would still get that opcode description.

This commit fixes that, and as we are here we expand the functionality
to allow to define version ranges, just in case a given opcode number
and their description is only valid for a given range.

v2 (from Iago feedback):
   * Fixed some comment typos
   * Simplified filtering opcode method
   * Rename filtering opcode method

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12301>
src/broadcom/qpu/qpu_pack.c