freedreno: fix PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE
authorRob Clark <robclark@freedesktop.org>
Wed, 22 Oct 2014 20:36:24 +0000 (16:36 -0400)
committerRob Clark <robclark@freedesktop.org>
Thu, 23 Oct 2014 14:46:51 +0000 (10:46 -0400)
commit6eabc119367f637be37d106851d9e90b1d3f07f9
treebee3d1a9812a33c5a2d6f57cc815c9e1811e1339
parentab53830b95edd82f067c26fbc2fbb1dbb278db66
freedreno: fix PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE

fd_bo_cpu_prep() doesn't realize the bo is already referenced in
unflushed cmdstream.  It could be made to do so (but would have to be
implemented twice, ie. both for msm and kgsl).  But we still can't do
the expected thing if the caller isn't using _NOSYNC.  Because of the
way the tiling works, we need to build quite a bit of cmdstream at flush
time, which is not possible to do at the libdrm level.

So rather than trying to make fd_bo_cpu_prep() smarter than it can
possibly be, just *always* discard and reallocate if the
PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE flag is set.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/freedreno_resource.c