Here we go, the first big piece of layout code shared between freedreno and turnip. No regressions on my 1/100 VK CTS run, and GLES dEQP came back clean as well.
Some code organization questions:
Do we (eventually) want fdN_layout() functions per chip? I'd like to refactor the other chips to put layout up top as well, because the current interface for setup_slices() is pretty crufty imo (partially screen hooks, wrapped in a helper function, but with part of the layout up in the top-level shared code, and ubwc as a fixup after)
Do we want the layout functions to be in freedreno_layout.c, or per-chip? I think the same file might be nice, as they look pretty similar from a high level, and I suspect there will be less variation once we fill out UBWC and tiling on older chips.
Is this the right set of fields to be stored in the layout? width/height/depth are stored (because we look at width for the linear_level decision) but height/depth aren't used. nr_samples isn't stored. I don't really have a principled reason for this.