[RFC PATCH 2/3] drm/amdgpu: change hw sched list on ctx priority override

Nirmoy nirmodas at amd.com
Thu Feb 27 10:10:46 UTC 2020


Found two issues :

On 2/26/20 9:37 PM, Nirmoy Das wrote:
> +static void amdgpu_ctx_hw_priority_override(struct amdgpu_ctx *ctx,
> +					    const u32 hw_ip,
> +					    enum drm_sched_priority priority)
> +{
> +	int i;
> +
> +	for (i = 0; i < amdgpu_ctx_num_entities[hw_ip]; ++i) {
> +		if (!ctx->entities[hw_ip][i])
> +			continue;
> +
> +		/* TODO what happens with prev scheduled jobs */
> +		drm_sched_entity_destroy(&ctx->entities[hw_ip][i]->entity);
> +		amdgpu_ctx_fini_entity(ctx->entities[hw_ip][i]);
> +
> +		amdgpu_ctx_init_entity(ctx, AMDGPU_HW_IP_COMPUTE, i);
s/AMDGPU_HW_IP_COMPUTE/hw_ip
>   
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> index 18e11b0fdc3e..4501ae7afb2e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
> @@ -326,6 +326,10 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
>   
>   	ring->max_dw = max_dw;
>   	ring->priority = DRM_SCHED_PRIORITY_NORMAL;
> +	if (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE &&
> +	    ring->funcs->init_priority)
I didn't set ring->priority to DRM_SCHED_PRIORITY_HIGH in the previous 
patch
> +		ring->funcs->init_priority(ring);
> +
>   	mutex_init(&ring->priority_mutex);
>   
>   	for (i = 0; i < DRM_SCHED_PRIORITY_MAX; ++i)


More information about the amd-gfx mailing list