summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
diff options
context:
space:
mode:
authorFelix Kuehling <Felix.Kuehling@amd.com>2019-05-01 18:20:13 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-06-11 11:57:45 -0500
commitbb2d2128a54c48355249b56cbc898a89e76ba7a1 (patch)
treeb4616770231c35e02518beb5e324a8a555da6dc5 /drivers/gpu/drm/amd/amdkfd/kfd_priv.h
parent052af915d826b33588749566145c9417fcfc7246 (diff)
downloadtalos-op-linux-bb2d2128a54c48355249b56cbc898a89e76ba7a1.tar.gz
talos-op-linux-bb2d2128a54c48355249b56cbc898a89e76ba7a1.zip
drm/amdkfd: Simplify eviction state logic
Always mark evicted queues with q->properties.is_evicted = true, even queues that are inactive for other reason. This simplifies maintaining the eviction state as it doesn't require updating is_evicted when other queue activation conditions change. On the other hand, we now need to check those other queue activation conditions whenever an evicted queues is restored. To minimize code duplication, move the queue activation check into a macro so it can be maintained in one central place. Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Reviewed-by: Philip Cox <Philip.Cox@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd/kfd_priv.h')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_priv.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
index b61dc53f42d2..6d29d589a4a5 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
@@ -430,6 +430,11 @@ struct queue_properties {
uint32_t *cu_mask;
};
+#define QUEUE_IS_ACTIVE(q) ((q).queue_size > 0 && \
+ (q).queue_address != 0 && \
+ (q).queue_percent > 0 && \
+ !(q).is_evicted)
+
/**
* struct queue
*
OpenPOWER on IntegriCloud