Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/ttm: don't wait for BO on initial allocation

When we use an extern reservation object that otherwise waits for every
fence registered with it.

Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Christian König and committed by
Alex Deucher
5ee7b41a eb430969

+12 -6
+12 -6
drivers/gpu/drm/ttm/ttm_bo.c
··· 998 998 lockdep_assert_held(&bo->resv->lock.base); 999 999 1000 1000 /* 1001 - * FIXME: It's possible to pipeline buffer moves. 1002 - * Have the driver move function wait for idle when necessary, 1003 - * instead of doing it here. 1001 + * Don't wait for the BO on initial allocation. This is important when 1002 + * the BO has an imported reservation object. 1004 1003 */ 1005 - ret = ttm_bo_wait(bo, false, interruptible, no_wait_gpu); 1006 - if (ret) 1007 - return ret; 1004 + if (bo->mem.mem_type != TTM_PL_SYSTEM || bo->ttm != NULL) { 1005 + /* 1006 + * FIXME: It's possible to pipeline buffer moves. 1007 + * Have the driver move function wait for idle when necessary, 1008 + * instead of doing it here. 1009 + */ 1010 + ret = ttm_bo_wait(bo, false, interruptible, no_wait_gpu); 1011 + if (ret) 1012 + return ret; 1013 + } 1008 1014 mem.num_pages = bo->num_pages; 1009 1015 mem.size = mem.num_pages << PAGE_SHIFT; 1010 1016 mem.page_alignment = bo->mem.page_alignment;