drm/ttm: fix logic inversion in ttm_eu_reserve_buffers
authorChristian König <christian.koenig@amd.com>
Mon, 11 Apr 2022 13:21:59 +0000 (15:21 +0200)
committerChristian König <christian.koenig@amd.com>
Mon, 11 Apr 2022 14:00:57 +0000 (16:00 +0200)
That should have been max, not min.

Signed-off-by: Christian König <christian.koenig@amd.com>
Fixes: c8d4c18bfbc4 ("dma-buf/drivers: make reserving a shared slot mandatory v4")
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220411134537.2854-1-christian.koenig@amd.com
drivers/gpu/drm/ttm/ttm_execbuf_util.c

index 0eb995d25df171e17a0b94aad9671e0b477f128f..dbee34a058dfde04e0ce24528557a858a5dbbeb6 100644 (file)
@@ -101,7 +101,7 @@ int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket,
                        continue;
                }
 
-               num_fences = min(entry->num_shared, 1u);
+               num_fences = max(entry->num_shared, 1u);
                if (!ret) {
                        ret = dma_resv_reserve_fences(bo->base.resv,
                                                      num_fences);