panfrost: minify dimensions when converting modifiers
panfrost: minify dimensions when converting modifiers
When blitting resources, we need to specify the boxes in mip-level sized coordinates. For the X and Y coordinates, missing this makes things behave correctly, but only because we end up clipping away the excess area.
However, for the Z coordinate of 3D textures, this will make us read outside of the mip-chain during blitting, making us stumble and crash.
But let's fix what we do for all dimensions. And while we're at it, rewrite the code a bit, so we don't end up computing any needless values.
This is an alternative to a patch from !24942 (merged), which only fixes the problem for the Z axis.