drm/amdgpu: use first uvd instance to avoid clang build error
Subsystems (2)
PATCH 1/1 drm/amdgpu: use first uvd instance to avoid clang build error
Explicitly use the first uvd instance to avoid a build error when using clang 6:drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:1148:52: error: expected ')'
container_of(work, struct amdgpu_device, uvd.inst->idle_work.work);
^
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:1148:3: note: to match this '('
container_of(work, struct amdgpu_device, uvd.inst->idle_work.work);
^
./include/linux/kernel.h:967:21: note: expanded from macro 'container_of'
((type *)(__mptr - offsetof(type, member))); })
^
./include/linux/stddef.h:17:32: note: expanded from macro 'offsetof'
^
./include/linux/compiler-gcc.h:170:20: note: expanded from macro
'__compiler_offsetof'
__builtin_offsetof(a, b)
^drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:1147:24: error: initializing
'struct amdgpu_device *' with an expression of incompatible type 'void'
struct amdgpu_device *adev =
^
2 errors generated.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +1 -1
@@ -1145,7 +1145,7 @@ int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,static void amdgpu_uvd_idle_work_handler (struct work_struct *work) {struct amdgpu_device *adev = - container_of(work, struct amdgpu_device, uvd.inst->idle_work.work); + container_of(work, struct amdgpu_device, uvd.inst[0].idle_work.work);unsigned fences =0 , i, j;for (i =0 ; i < adev->uvd.num_uvd_inst; ++i) {
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 35 lines · Stefan Agner
Explicitly use the first uvd instance to avoid a build error when using clang 6:
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:1148:52: error: expected ')'container_of(work, struct amdgpu_device, uvd.inst->idle_work.work); ^ drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:1148:3: note: to match this '(' container_of(work, struct amdgpu_device, uvd.inst->idle_work.work); ^ ./include/linux/kernel.h:967:21: note: expanded from macro 'container_of' ((type *)(__mptr - offsetof(type, member))); }) ^ ./include/linux/stddef.h:17:32: note: expanded from macro 'offsetof' ^ ./include/linux/compiler-gcc.h:170:20: note: expanded from macro '__compiler_offsetof' __builtin_offsetof(a, b) ^
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:1147:24: error: initializing
'structamdgpu_device*' with an expression of incompatible type 'void'
structamdgpu_device*adev =
^
2 errors generated.Fixes 10dd74eac4db ("drm/amdgpu/vg20:Restruct uvd.inst to support multiple instances")Cc James Zhu <[email protected]>Signed-off-by Stefan Agner <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle, · line 1148
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +1
-1@@ -1145,7 +1145,7 @@ int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle,static void amdgpu_uvd_idle_work_handler (struct work_struct *work) {struct amdgpu_device *adev = - container_of(work, struct amdgpu_device, uvd.inst->idle_work.work); + container_of(work, struct amdgpu_device, uvd.inst[0].idle_work.work);
Hi Alex,
If all instances share one idle work from hardware view currently and in the future , should we move struct delayed_work idle_work from struct amdgpu_uvd_inst to struct amdgpu_uvd? James
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle, · line 1151
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-0unsigned fences =0 , i, j;for (i =0 ; i < adev->uvd.num_uvd_inst; ++i) {
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 50 lines · James Zhu
Quoted 47 lines · Stefan Agner
Explicitly use the first uvd instance to avoid a build error when using clang 6:
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:1148:52: error: expected ')'
container_of(work, structamdgpu_device,uvd.inst->idle_work.work); ^ drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:1148:3: note: to match this '(' container_of(work, struct amdgpu_device, uvd.inst->idle_work.work); ^ ./include/linux/kernel.h:967:21: note: expanded from macro 'container_of' ((type *)(__mptr - offsetof(type, member))); }) ^ ./include/linux/stddef.h:17:32: note: expanded from macro 'offsetof' ^ ./include/linux/compiler-gcc.h:170:20: note: expanded from macro '__compiler_offsetof' __builtin_offsetof(a, b) ^
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:1147:24: error: initializing
'structamdgpu_device*' with an expression of incompatible type
'void'
structamdgpu_device*adev =
^
2 errors generated.Fixes 10dd74eac4db ("drm/amdgpu/vg20:Restruct uvd.inst to supportmultiple instances")
Cc James Zhu <[email protected]>Signed-off-by Stefan Agner <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-1@@ -1145,7 +1145,7 @@ int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle, static void amdgpu_uvd_idle_work_handler(struct work_struct *work) {struct amdgpu_device *adev = - container_of(work, struct amdgpu_device, uvd.inst->idle_work.work);
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring · line 1151
Quoted 2 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +1
-0+ container_of(work, struct amdgpu_device, uvd.inst[0 ].idle_work.work);Hi Alex,
If all instances share one idle work from hardware view currently and in the future ,
should we move structdelayed_workidle_workfrom structamdgpu_uvd_instto structamdgpu_uvd?
Yes, please do.
Alex
Quoted 10 lines
James
Quoted 3 lines
unsigned fences = 0, i, j; for (i = 0; i < adev->uvd.num_uvd_inst; ++i) {_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx