OSDN Git Service

drm/amdgpu: untie user ring ids from kernel ring ids v6
authorAndres Rodriguez <andresx7@gmail.com>
Thu, 16 Feb 2017 05:47:32 +0000 (00:47 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 31 May 2017 20:49:01 +0000 (16:49 -0400)
commiteffd924d2f3b9c52d5bd8137c3803e83f719a290
tree2705aaf11786cd79e5f17f4283cc7ff511d9f616
parentecd910eb1f091dd25f4a737a3bc50c0c8892eac7
drm/amdgpu: untie user ring ids from kernel ring ids v6

Add amdgpu_queue_mgr, a mechanism that allows disjointing usermode's
ring ids from the kernel's ring ids.

The queue manager maintains a per-file descriptor map of user ring ids
to amdgpu_ring pointers. Once a map is created it is permanent (this is
required to maintain FIFO execution guarantees for a context's ring).

Different queue map policies can be configured for each HW IP.
Currently all HW IPs use the identity mapper, i.e. kernel ring id is
equal to the user ring id.

The purpose of this mechanism is to distribute the load across multiple
queues more effectively for HW IPs that support multiple rings.
Userspace clients are unable to check whether a specific resource is in
use by a different client. Therefore, it is up to the kernel driver to
make the optimal choice.

v2: remove amdgpu_queue_mapper_funcs
v3: made amdgpu_queue_mgr per context instead of per-fd
v4: add context_put on error paths
v5: rebase and include new IPs UVD_ENC & VCN_*
v6: drop unused amdgpu_ring_is_valid_index (Alex)

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/Makefile
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c [new file with mode: 0644]