v3d: request the kernel to flush caches when TMU is dirty
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 3 Sep 2019 08:31:42 +0000 (10:31 +0200)
committerJose Maria Casanova Crespo <jmcasanova@igalia.com>
Fri, 18 Oct 2019 12:08:52 +0000 (14:08 +0200)
commitdb8743923253466b23299708a2060cbf6c715411
treeaf6324a4625bed813b9ac003351d581a14dedb80
parent66e2d3b69fbd0310597913f5099272a033963b5d
v3d: request the kernel to flush caches when TMU is dirty

This adapts the v3d driver to the new CL submit ioctl interface that
allows the driver to request a flush of the caches after the render
job has completed. This seems to eliminate the kernel write violation
errors reported during CTS and Piglit excutions, fixing some CTS tests
and GPU resets along the way.

v2:
  - Adapt to changes in the kernel side.
  - Disable shader storage and shader images if the kernel doesn't
    implement cache flushing.

Fixes CTS tests:
KHR-GLES31.core.shader_image_size.basic-nonMS-fs-float
KHR-GLES31.core.shader_image_size.basic-nonMS-fs-int
KHR-GLES31.core.shader_image_size.basic-nonMS-fs-uint
KHR-GLES31.core.shader_image_size.advanced-nonMS-fs-float
KHR-GLES31.core.shader_image_size.advanced-nonMS-fs-int
KHR-GLES31.core.shader_image_size.advanced-nonMS-fs-uint
KHR-GLES31.core.shader_atomic_counters.advanced-usage-many-draw-calls2
KHR-GLES31.core.shader_atomic_counters.advanced-usage-draw-update-draw
KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-int
KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-std140-matR
KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-std140-struct
KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-std430-matC-pad
KHR-GLES31.core.shader_storage_buffer_object.advanced-unsizedArrayLength-fs-std430-vec

Reviewed-by: Eric Anholt <eric@anholt.net>
include/drm-uapi/v3d_drm.h
src/gallium/drivers/v3d/v3d_job.c
src/gallium/drivers/v3d/v3d_screen.c
src/gallium/drivers/v3d/v3d_screen.h
src/gallium/drivers/v3d/v3dx_rcl.c
src/gallium/drivers/v3d/v3dx_simulator.c