Commit 0d801007 authored by Jiansong Chen's avatar Jiansong Chen Committed by Alex Deucher

drm/amdkfd: correct pipe offset calculation

Correct pipe offset calculation in is_pipe_enabled function,
it should be done in queues.
Signed-off-by: default avatarJiansong Chen <Jiansong.Chen@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0269764a
...@@ -72,8 +72,8 @@ enum KFD_MQD_TYPE get_mqd_type_from_queue_type(enum kfd_queue_type type) ...@@ -72,8 +72,8 @@ enum KFD_MQD_TYPE get_mqd_type_from_queue_type(enum kfd_queue_type type)
static bool is_pipe_enabled(struct device_queue_manager *dqm, int mec, int pipe) static bool is_pipe_enabled(struct device_queue_manager *dqm, int mec, int pipe)
{ {
int i; int i;
int pipe_offset = mec * dqm->dev->shared_resources.num_pipe_per_mec int pipe_offset = (mec * dqm->dev->shared_resources.num_pipe_per_mec
+ pipe * dqm->dev->shared_resources.num_queue_per_pipe; + pipe) * dqm->dev->shared_resources.num_queue_per_pipe;
/* queue is available for KFD usage if bit is 1 */ /* queue is available for KFD usage if bit is 1 */
for (i = 0; i < dqm->dev->shared_resources.num_queue_per_pipe; ++i) for (i = 0; i < dqm->dev->shared_resources.num_queue_per_pipe; ++i)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment