Skip to content

freedreno: Add support to match GPU based on chip-id

Rob Clark requested to merge robclark/mesa:fd/rework-gpu-id into main

This MR adds support that will be needed to work with the upstream "7c3" (queued up in msm-next-staging currently), which does not report a gpu-id, by abstracting the device matching into fd_dev_id, which is then extended to add chip-id.

There are a handful of remaining places in the gallium driver that still use gpu_id, but it is limited a5xx and earlier (which should be safe, we won't be seeing new GPUs in the older generations without a gpu-id, but could be cleaned up further by moving things into fd_dev_info). And there is a fair bit of churn in the gallium driver and ir3, but most of it seems worthwhile, like converting matching based on range of gpu-id (ie 500 <= gpu_id < 600 to gen == 5).

We could alternatively do a less churny thing and generate a gpu-id from the chip-id, but I think that is just kicking the can down the road.. not all possible chip-id values map to a possible gpu-id value, and I think we are going to need to support matching on more than just chip-id in the future (although exactly what is still tbd)


Based on top of !12135 (merged) (as otherwise there would be some small merge conflicts and I expect !12135 (merged) to land first)

Edited by Rob Clark

Merge request reports