On the Radeon 780M (RADV) a guest surface whose pitch is no multiple of 256
bytes (3664 px BGRA8 at 14656 bytes a row) is refused Refusal::Pitch where the
image in place is made: the driver lays its linear image's rows out at another
pitch, and refuses the DRM_FORMAT_MOD_LINEAR image at that one. The query
stopped at the route and answered InPlace, so the consumer sent such a surface
in place and got a shadow copied in for every command buffer, the case the
query exists to prevent.
Now the image in place's making is two steps, shared: Device::unplaced makes
and checks the image of a plan before any memory is bound (over pages imported
by their pointer, in_place_unbound's linear or DRM_FORMAT_MOD_LINEAR image and
its requirements against the bytes' place and memory type; over dma-buf pages,
dma_buf_image_unbound's image checked against the pages, before the caller's
source is asked), and Device::place binds it. in_place_image runs the rows
check, then the wider plans and the declared plan through both steps as
before. The query's placement_over_buffer, where the route is the image in
place, calls Device::in_place_image_made: the same rows check and the same
unbound step for the declared plan first and then the wider plans, releasing
each image unbound, answering Shadow(Refused(kind)) with the declared plan's
refusal where none is made. Its cost: one or two VkImages where the declared
plan is made in place, a pair more per wider plan where it is refused; nothing
bound or submitted. What only the bind shows stays unknown: over dma-buf pages
the caller's source and the driver's import of its dma-buf.
The new device test a_pitch_the_device_lays_no_image_at_answers_its_shadow
asks and makes BGRA8Unorm textures at pitches past their rows (61 texels at
256..1024 bytes, 3664 texels at 14656, 14672 and 14848, a render target), each
answer equal to what the making counted, and at least one Shadow(Refused(Pitch)).
(cherry picked from commit fb619a2a4f6fa9bfa524cd7ae88c6e76a10d12ed)