freedreno: Add --nvtop arg
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Add a way to generate the table of gpu-ids that nvtop uses, to simplify
syncing nvtop with mesa when new gpu-ids are added.  For example:

  python3 src/freedreno/common/freedreno_devices.py -p ./$builddir/src/freedreno/registers/adreno/ --nvtop

Signed-off-by: Rob Clark <rob.clark@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40283>
This commit is contained in:
Rob Clark 2026-03-07 08:50:28 -08:00 committed by Marge Bot
parent fa90c2de03
commit a4cabc1334

View file

@ -13,6 +13,7 @@ def max_bitfield_val(high, low, shift):
parser = argparse.ArgumentParser()
parser.add_argument('-p', '--import-path', required=True)
parser.add_argument('--nvtop', action='store_true')
args = parser.parse_args()
sys.path.insert(0, args.import_path)
@ -259,5 +260,16 @@ fd_dev_info_apply_dbg_options(struct fd_dev_info *info)
}
"""
nvtop_template="""
static const struct msm_id_struct msm_ids[] = {
%for id, info in s.gpus.items():
{ ${hex(id.chip_id)}, "${id.name}" },
%endfor
};
"""
def main():
print(Template(template).render(s=s, unique_props=GPUProps.unique_props))
if args.nvtop:
print(Template(nvtop_template).render(s=s, unique_props=GPUProps.unique_props))
else:
print(Template(template).render(s=s, unique_props=GPUProps.unique_props))