[PATCH 01/11] dma-buf/fence: make fence context 64 bit v2

Gustavo Padovan gustavo at padovan.org
Wed Jun 1 15:23:29 UTC 2016


2016-06-01 Christian König <deathsimple at vodafone.de>:

> From: Christian König <christian.koenig at amd.com>
> 
> Fence contexts are created on the fly (for example) by the GPU scheduler used
> in the amdgpu driver as a result of an userspace request. Because of this
> userspace could in theory force a wrap around of the 32bit context number
> if it doesn't behave well.
> 
> Avoid this by increasing the context number to 64bits. This way even when
> userspace manages to allocate a billion contexts per second it takes more
> than 500 years for the context number to wrap around.
> 
> v2: fix printf formats as well.
> 
> Signed-off-by: Christian König <christian.koenig at amd.com>
> ---
>  drivers/dma-buf/fence.c                 |  8 ++++----
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h     |  2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c  |  2 +-
>  drivers/gpu/drm/etnaviv/etnaviv_gpu.h   |  2 +-
>  drivers/gpu/drm/nouveau/nouveau_fence.h |  3 ++-
>  drivers/gpu/drm/qxl/qxl_release.c       |  2 +-
>  drivers/gpu/drm/radeon/radeon.h         |  2 +-
>  drivers/gpu/drm/vmwgfx/vmwgfx_fence.c   |  2 +-
>  drivers/staging/android/sync.h          |  3 ++-
>  include/linux/fence.h                   | 13 +++++++------
>  10 files changed, 21 insertions(+), 18 deletions(-)

Reviewed-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk>

	Gustavo


More information about the dri-devel mailing list