v3d: Restructure RO allocations using resource_from_handle.
authorEric Anholt <eric@anholt.net>
Tue, 15 Jan 2019 05:44:16 +0000 (21:44 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 17 Jan 2019 00:28:41 +0000 (16:28 -0800)
commit59527a36e97586a2c29eadb22ae555b918591aed
treeccf4f97b1046182b1067d69b5ad472d93e0f69bb
parentd70eb2302b0594c2d097fd857a8bf83f45d05ddc
v3d: Restructure RO allocations using resource_from_handle.

I had bugs in the old path where I was laying out as tiled (so we'd render
tiled) but then only allocating space in the shared object for linear
rendering.  The resource_from_handle makes it so the same layout choices
are made in both the import and export scanout cases.  Also, fixes a leak
of the fd that was tripping up the CTS.

Now that we're checking PIPE_BIND_SHARED to choose to use RO, the
DRM_FORMAT_MOD_LINEAR check wasn't needed any more.

Fixes visual corruption and MMU faults in X in renderonly mode.

Fixes: bd09bb1629a7 ("v3d: SHARED but not necessarily SCANOUT buffers on RO must be linear.")
src/gallium/drivers/v3d/v3d_resource.c