All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: use first uvd instance to avoid clang build error
@ 2018-06-17  8:52 ` Stefan Agner
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Agner @ 2018-06-17  8:52 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Stefan Agner, James Zhu, Christian König,
	David (ChunMing) Zhou, David Airlie, amd-gfx, dri-devel,
	linux-kernel

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.

Fixes: 10dd74eac4db ("drm/amdgpu/vg20:Restruct uvd.inst to support multiple instances")
Cc: James Zhu <James.Zhu@amd.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index bcf68f80bbf0..6666a5888c44 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -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) {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] drm/amdgpu: use first uvd instance to avoid clang build error
@ 2018-06-17  8:52 ` Stefan Agner
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Agner @ 2018-06-17  8:52 UTC (permalink / raw)
  To: Alex Deucher
  Cc: David Airlie, dri-devel, linux-kernel, amd-gfx, James Zhu,
	Christian König

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.

Fixes: 10dd74eac4db ("drm/amdgpu/vg20:Restruct uvd.inst to support multiple instances")
Cc: James Zhu <James.Zhu@amd.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index bcf68f80bbf0..6666a5888c44 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -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) {
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/amdgpu: use first uvd instance to avoid clang build error
@ 2018-06-18  2:03   ` James Zhu
  0 siblings, 0 replies; 6+ messages in thread
From: James Zhu @ 2018-06-18  2:03 UTC (permalink / raw)
  To: Stefan Agner, Alex Deucher
  Cc: James Zhu, Christian König, David (ChunMing) Zhou,
	David Airlie, amd-gfx, dri-devel, linux-kernel



On 2018-06-17 04:52 AM, Stefan Agner wrote:
> 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.
>
> Fixes: 10dd74eac4db ("drm/amdgpu/vg20:Restruct uvd.inst to support multiple instances")
> Cc: James Zhu <James.Zhu@amd.com>
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> index bcf68f80bbf0..6666a5888c44 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> @@ -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
>   	unsigned fences = 0, i, j;
>   
>   	for (i = 0; i < adev->uvd.num_uvd_inst; ++i) {


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/amdgpu: use first uvd instance to avoid clang build error
@ 2018-06-18  2:03   ` James Zhu
  0 siblings, 0 replies; 6+ messages in thread
From: James Zhu @ 2018-06-18  2:03 UTC (permalink / raw)
  To: Stefan Agner, Alex Deucher
  Cc: David (ChunMing) Zhou, David Airlie,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, James Zhu,
	Christian König



On 2018-06-17 04:52 AM, Stefan Agner wrote:
> 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.
>
> Fixes: 10dd74eac4db ("drm/amdgpu/vg20:Restruct uvd.inst to support multiple instances")
> Cc: James Zhu <James.Zhu@amd.com>
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> index bcf68f80bbf0..6666a5888c44 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> @@ -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
>   	unsigned fences = 0, i, j;
>   
>   	for (i = 0; i < adev->uvd.num_uvd_inst; ++i) {

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/amdgpu: use first uvd instance to avoid clang build error
@ 2018-06-18 14:37     ` Alex Deucher
  0 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2018-06-18 14:37 UTC (permalink / raw)
  To: James Zhu
  Cc: Stefan Agner, Alex Deucher, David Airlie, LKML,
	Maling list - DRI developers, amd-gfx list, James Zhu,
	Christian König

On Sun, Jun 17, 2018 at 10:03 PM, James Zhu <jamesz@amd.com> wrote:
>
>
> On 2018-06-17 04:52 AM, Stefan Agner wrote:
>>
>> 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.
>>
>> Fixes: 10dd74eac4db ("drm/amdgpu/vg20:Restruct uvd.inst to support
>> multiple instances")
>> Cc: James Zhu <James.Zhu@amd.com>
>> Signed-off-by: Stefan Agner <stefan@agner.ch>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
>> index bcf68f80bbf0..6666a5888c44 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
>> @@ -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?

Yes, please do.

Alex

> James
>>
>>         unsigned fences = 0, i, j;
>>         for (i = 0; i < adev->uvd.num_uvd_inst; ++i) {
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/amdgpu: use first uvd instance to avoid clang build error
@ 2018-06-18 14:37     ` Alex Deucher
  0 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2018-06-18 14:37 UTC (permalink / raw)
  To: James Zhu
  Cc: Stefan Agner, David Airlie, LKML, Maling list - DRI developers,
	amd-gfx list, Alex Deucher, James Zhu, Christian König

On Sun, Jun 17, 2018 at 10:03 PM, James Zhu <jamesz@amd.com> wrote:
>
>
> On 2018-06-17 04:52 AM, Stefan Agner wrote:
>>
>> 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.
>>
>> Fixes: 10dd74eac4db ("drm/amdgpu/vg20:Restruct uvd.inst to support
>> multiple instances")
>> Cc: James Zhu <James.Zhu@amd.com>
>> Signed-off-by: Stefan Agner <stefan@agner.ch>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
>> index bcf68f80bbf0..6666a5888c44 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
>> @@ -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?

Yes, please do.

Alex

> James
>>
>>         unsigned fences = 0, i, j;
>>         for (i = 0; i < adev->uvd.num_uvd_inst; ++i) {
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-06-18 14:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-17  8:52 [PATCH] drm/amdgpu: use first uvd instance to avoid clang build error Stefan Agner
2018-06-17  8:52 ` Stefan Agner
2018-06-18  2:03 ` James Zhu
2018-06-18  2:03   ` James Zhu
2018-06-18 14:37   ` Alex Deucher
2018-06-18 14:37     ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.