Due to a series of bugs (essentially, a GPU-side use-after-free caused
by a race condition, and a hardware limitation requiring 64-byte
alignment of vertex buffer addresses), we previously copied all vertex
data to a staging buffer and passed that staging buffer to the hardware
instead. Although correct, this was a performance disaster (deploying
the workaround to glmark's refract, a scene unaffected by the bug but
affected by the costly workaround, dropped performance from 19fps to
6fps).

This series fixes each of these bugs, by introducing BO reference
counting, stubs for future work for flushing BOs (thought to be
necessary to fix this bug -- it turned out not to be, but is left in the
series as it will be necessary in the short-term future), and an offset
fixup. In total, this patch removes the staging copy in all cases
visible to us (although Gallium has to do a staging copy for user
pointers).  Performance is helped dramatically :)

Alyssa Rosenzweig (2):
  panfrost: Track BO lifetime with jobs and reference counts
  panfrost: Fixup vertex offsets to prevent shadow copy

 src/gallium/drivers/panfrost/pan_context.c  | 137 +++++++++++---------
 src/gallium/drivers/panfrost/pan_context.h  |  12 +-
 src/gallium/drivers/panfrost/pan_drm.c      |   6 +
 src/gallium/drivers/panfrost/pan_job.c      |  82 ++++++++++++
 src/gallium/drivers/panfrost/pan_job.h      |  16 +++
 src/gallium/drivers/panfrost/pan_resource.c |  70 +++++++++-
 src/gallium/drivers/panfrost/pan_resource.h |  13 ++
 src/gallium/drivers/panfrost/pan_screen.c   |   2 +-
 src/gallium/drivers/panfrost/pan_screen.h   |   5 +-
 9 files changed, 273 insertions(+), 70 deletions(-)

-- 
2.20.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to