• A
    drm/amdgpu: add parameter to allocate high priority contexts v11 · c2636dc5
    Andres Rodriguez 提交于
    Add a new context creation parameter to express a global context priority.
    
    The priority ranking in descending order is as follows:
     * AMDGPU_CTX_PRIORITY_HIGH_HW
     * AMDGPU_CTX_PRIORITY_HIGH_SW
     * AMDGPU_CTX_PRIORITY_NORMAL
     * AMDGPU_CTX_PRIORITY_LOW_SW
     * AMDGPU_CTX_PRIORITY_LOW_HW
    
    The driver will attempt to schedule work to the hardware according to
    the priorities. No latency or throughput guarantees are provided by
    this patch.
    
    This interface intends to service the EGL_IMG_context_priority
    extension, and vulkan equivalents.
    
    Setting a priority above NORMAL requires CAP_SYS_NICE or DRM_MASTER.
    
    v2: Instead of using flags, repurpose __pad
    v3: Swap enum values of _NORMAL _HIGH for backwards compatibility
    v4: Validate usermode priority and store it
    v5: Move priority validation into amdgpu_ctx_ioctl(), headline reword
    v6: add UAPI note regarding priorities requiring CAP_SYS_ADMIN
    v7: remove ctx->priority
    v8: added AMDGPU_CTX_PRIORITY_LOW, s/CAP_SYS_ADMIN/CAP_SYS_NICE
    v9: change the priority parameter to __s32
    v10: split priorities into _SW and _HW
    v11: Allow DRM_MASTER without CAP_SYS_NICE
    Reviewed-by: NEmil Velikov <emil.l.velikov@gmail.com>
    Reviewed-by: NChristian König <christian.koenig@amd.com>
    Signed-off-by: NAndres Rodriguez <andresx7@gmail.com>
    Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
    c2636dc5
gpu_scheduler.h 5.6 KB