amd/registers: fix fields conflict detection
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Mon, 26 Jul 2021 08:47:20 +0000 (10:47 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 30 Jul 2021 08:50:38 +0000 (08:50 +0000)
commit3914bd457b6e91c805a6ed9977ed984205f8acae
tree1877cab8cc361402b1952be72646e6903eafb700
parent2ea88d7cea070c3288c252064cae9236bd462646
amd/registers: fix fields conflict detection

The existing code handled the case where the new definition of the
same field was larger than the old one.
This commit adds a check to handle the reverse case: the new def
is smaller than the old one (= so writing using the merged macro
would affect the next fields).

The affected fields are:
* LGKM_CNT (in SQ_WAVE_IB_STS)
* DONUT_SPLIT (in VGT_TESS_DISTRIBUTION)
* HEAD_QUEUE (in GDS_GWS_RESOURCE)

DONUT_SPLIT is the only one used by radeonsi/radv.

Fixes: e6184b08924 ("amd/registers: scripts for processing register descriptions in JSON")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12063>
src/amd/registers/makeregheader.py
src/amd/vulkan/si_cmd_buffer.c
src/gallium/drivers/radeonsi/si_state.c