Message ID | 1421924350-2484-2-git-send-email-oded.gabbay@amd.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Jan 22, 2015 at 5:59 AM, Oded Gabbay <oded.gabbay@amd.com> wrote: > This patch fixes the behavior of kgd_init_pipeline in that this function > shouldn't automatically increase the pipe_id argument by 1 right at the start > of the function. > > This is because the first_pipe value might not be always 1, and because a > proper interface function should not hide this info inside its implementation. > In other words, the calling function should provide the real pipe_id and not > count on kgd_init_pipeline to "fix" it. > > Signed-off-by: Oded Gabbay <oded.gabbay@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> > --- > drivers/gpu/drm/radeon/radeon_kfd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/radeon/radeon_kfd.c b/drivers/gpu/drm/radeon/radeon_kfd.c > index 8bf87f1..bef9a09 100644 > --- a/drivers/gpu/drm/radeon/radeon_kfd.c > +++ b/drivers/gpu/drm/radeon/radeon_kfd.c > @@ -436,7 +436,7 @@ static int kgd_init_memory(struct kgd_dev *kgd) > static int kgd_init_pipeline(struct kgd_dev *kgd, uint32_t pipe_id, > uint32_t hpd_size, uint64_t hpd_gpu_addr) > { > - uint32_t mec = (++pipe_id / CIK_PIPE_PER_MEC) + 1; > + uint32_t mec = (pipe_id / CIK_PIPE_PER_MEC) + 1; > uint32_t pipe = (pipe_id % CIK_PIPE_PER_MEC); > > lock_srbm(kgd, mec, pipe, 0, 0); > -- > 1.9.1 >
diff --git a/drivers/gpu/drm/radeon/radeon_kfd.c b/drivers/gpu/drm/radeon/radeon_kfd.c index 8bf87f1..bef9a09 100644 --- a/drivers/gpu/drm/radeon/radeon_kfd.c +++ b/drivers/gpu/drm/radeon/radeon_kfd.c @@ -436,7 +436,7 @@ static int kgd_init_memory(struct kgd_dev *kgd) static int kgd_init_pipeline(struct kgd_dev *kgd, uint32_t pipe_id, uint32_t hpd_size, uint64_t hpd_gpu_addr) { - uint32_t mec = (++pipe_id / CIK_PIPE_PER_MEC) + 1; + uint32_t mec = (pipe_id / CIK_PIPE_PER_MEC) + 1; uint32_t pipe = (pipe_id % CIK_PIPE_PER_MEC); lock_srbm(kgd, mec, pipe, 0, 0);
This patch fixes the behavior of kgd_init_pipeline in that this function shouldn't automatically increase the pipe_id argument by 1 right at the start of the function. This is because the first_pipe value might not be always 1, and because a proper interface function should not hide this info inside its implementation. In other words, the calling function should provide the real pipe_id and not count on kgd_init_pipeline to "fix" it. Signed-off-by: Oded Gabbay <oded.gabbay@amd.com> --- drivers/gpu/drm/radeon/radeon_kfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)