.. | .. |
---|
23 | 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
---|
24 | 24 | */ |
---|
25 | 25 | |
---|
26 | | -#include <drm/drmP.h> |
---|
27 | 26 | #include <trace/events/dma_fence.h> |
---|
| 27 | + |
---|
28 | 28 | #include "virtgpu_drv.h" |
---|
| 29 | + |
---|
| 30 | +#define to_virtio_fence(x) \ |
---|
| 31 | + container_of(x, struct virtio_gpu_fence, f) |
---|
29 | 32 | |
---|
30 | 33 | static const char *virtio_get_driver_name(struct dma_fence *f) |
---|
31 | 34 | { |
---|
.. | .. |
---|
37 | 40 | return "controlq"; |
---|
38 | 41 | } |
---|
39 | 42 | |
---|
40 | | -bool virtio_fence_signaled(struct dma_fence *f) |
---|
| 43 | +static bool virtio_fence_signaled(struct dma_fence *f) |
---|
41 | 44 | { |
---|
42 | 45 | struct virtio_gpu_fence *fence = to_virtio_fence(f); |
---|
43 | 46 | |
---|
| 47 | + if (WARN_ON_ONCE(fence->f.seqno == 0)) |
---|
| 48 | + /* leaked fence outside driver before completing |
---|
| 49 | + * initialization with virtio_gpu_fence_emit */ |
---|
| 50 | + return false; |
---|
44 | 51 | if (atomic64_read(&fence->drv->last_seq) >= fence->f.seqno) |
---|
45 | 52 | return true; |
---|
46 | 53 | return false; |
---|
.. | .. |
---|
48 | 55 | |
---|
49 | 56 | static void virtio_fence_value_str(struct dma_fence *f, char *str, int size) |
---|
50 | 57 | { |
---|
51 | | - snprintf(str, size, "%llu", (long long unsigned int) f->seqno); |
---|
| 58 | + snprintf(str, size, "%llu", f->seqno); |
---|
52 | 59 | } |
---|
53 | 60 | |
---|
54 | 61 | static void virtio_timeline_value_str(struct dma_fence *f, char *str, int size) |
---|