All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/ttm: Include <linux/vmalloc.h> to fix MIPS build
@ 2023-01-16 12:10 Thomas Zimmermann
  2023-01-16 12:13 ` Thomas Zimmermann
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Zimmermann @ 2023-01-16 12:10 UTC (permalink / raw)
  To: christian.koenig, ray.huang, airlied, daniel; +Cc: Thomas Zimmermann, dri-devel

On MIPS, vmap() and vunmap() are undeclared in ttm_bo_util.c. An
error message is shown below.

  CC      drivers/gpu/drm/ttm/ttm_bo_util.o
  ../drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_kmap_ttm':
  ../drivers/gpu/drm/ttm/ttm_bo_util.c:364:32: error: implicit declaration of function 'vmap'; did you mean 'kmap'? [-Werror=implicit-function-declaration]
    364 |                 map->virtual = vmap(ttm->pages + start_page, num_pages,
	|                                ^~~~
	|                                kmap
  ../drivers/gpu/drm/ttm/ttm_bo_util.c:364:30: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    364 |                 map->virtual = vmap(ttm->pages + start_page, num_pages,
	|                              ^
  ../drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_kunmap':
  ../drivers/gpu/drm/ttm/ttm_bo_util.c:429:17: error: implicit declaration of function 'vunmap'; did you mean 'kunmap'? [-Werror=implicit-function-declaration]
    429 |                 vunmap(map->virtual);
	|                 ^~~~~~
	|                 kunmap
  ../drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_vmap':
  ../drivers/gpu/drm/ttm/ttm_bo_util.c:509:23: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    509 |                 vaddr = vmap(ttm->pages, ttm->num_pages, 0, prot);
	|                       ^

Fix this by including <linux/vmalloc.h>.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/ttm/ttm_bo_util.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 12017ec24d9f..8e19a40cb41d 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -29,6 +29,8 @@
  * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
  */
 
+#include <linux/vmalloc.h>
+
 #include <drm/ttm/ttm_bo.h>
 #include <drm/ttm/ttm_placement.h>
 #include <drm/ttm/ttm_tt.h>
-- 
2.39.0


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

* Re: [PATCH] drm/ttm: Include <linux/vmalloc.h> to fix MIPS build
  2023-01-16 12:10 [PATCH] drm/ttm: Include <linux/vmalloc.h> to fix MIPS build Thomas Zimmermann
@ 2023-01-16 12:13 ` Thomas Zimmermann
  2023-01-16 14:40   ` Christian König
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Zimmermann @ 2023-01-16 12:13 UTC (permalink / raw)
  To: christian.koenig, ray.huang, airlied, daniel; +Cc: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 2496 bytes --]

I'd add a Fixes tag, but don't know the commit when this was introduced.

Am 16.01.23 um 13:10 schrieb Thomas Zimmermann:
> On MIPS, vmap() and vunmap() are undeclared in ttm_bo_util.c. An
> error message is shown below.
> 
>    CC      drivers/gpu/drm/ttm/ttm_bo_util.o
>    ../drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_kmap_ttm':
>    ../drivers/gpu/drm/ttm/ttm_bo_util.c:364:32: error: implicit declaration of function 'vmap'; did you mean 'kmap'? [-Werror=implicit-function-declaration]
>      364 |                 map->virtual = vmap(ttm->pages + start_page, num_pages,
> 	|                                ^~~~
> 	|                                kmap
>    ../drivers/gpu/drm/ttm/ttm_bo_util.c:364:30: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
>      364 |                 map->virtual = vmap(ttm->pages + start_page, num_pages,
> 	|                              ^
>    ../drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_kunmap':
>    ../drivers/gpu/drm/ttm/ttm_bo_util.c:429:17: error: implicit declaration of function 'vunmap'; did you mean 'kunmap'? [-Werror=implicit-function-declaration]
>      429 |                 vunmap(map->virtual);
> 	|                 ^~~~~~
> 	|                 kunmap
>    ../drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_vmap':
>    ../drivers/gpu/drm/ttm/ttm_bo_util.c:509:23: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
>      509 |                 vaddr = vmap(ttm->pages, ttm->num_pages, 0, prot);
> 	|                       ^
> 
> Fix this by including <linux/vmalloc.h>.
> 
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
>   drivers/gpu/drm/ttm/ttm_bo_util.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
> index 12017ec24d9f..8e19a40cb41d 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
> @@ -29,6 +29,8 @@
>    * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
>    */
>   
> +#include <linux/vmalloc.h>
> +
>   #include <drm/ttm/ttm_bo.h>
>   #include <drm/ttm/ttm_placement.h>
>   #include <drm/ttm/ttm_tt.h>

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

* Re: [PATCH] drm/ttm: Include <linux/vmalloc.h> to fix MIPS build
  2023-01-16 12:13 ` Thomas Zimmermann
@ 2023-01-16 14:40   ` Christian König
  2023-01-17  8:08     ` Thomas Zimmermann
  0 siblings, 1 reply; 4+ messages in thread
From: Christian König @ 2023-01-16 14:40 UTC (permalink / raw)
  To: Thomas Zimmermann, ray.huang, airlied, daniel; +Cc: dri-devel

Am 16.01.23 um 13:13 schrieb Thomas Zimmermann:
> I'd add a Fixes tag, but don't know the commit when this was introduced.

Mhm, that code is 10+ years old. My educated guess is that we somehow 
pulled in vmap/vunmap through a header which was now cleaned up.

Anyway your patch looks good to me, feel free to add my rb.

Christian.

>
> Am 16.01.23 um 13:10 schrieb Thomas Zimmermann:
>> On MIPS, vmap() and vunmap() are undeclared in ttm_bo_util.c. An
>> error message is shown below.
>>
>>    CC      drivers/gpu/drm/ttm/ttm_bo_util.o
>>    ../drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_kmap_ttm':
>>    ../drivers/gpu/drm/ttm/ttm_bo_util.c:364:32: error: implicit 
>> declaration of function 'vmap'; did you mean 'kmap'? 
>> [-Werror=implicit-function-declaration]
>>      364 |                 map->virtual = vmap(ttm->pages + 
>> start_page, num_pages,
>>     |                                ^~~~
>>     |                                kmap
>>    ../drivers/gpu/drm/ttm/ttm_bo_util.c:364:30: warning: assignment 
>> to 'void *' from 'int' makes pointer from integer without a cast 
>> [-Wint-conversion]
>>      364 |                 map->virtual = vmap(ttm->pages + 
>> start_page, num_pages,
>>     |                              ^
>>    ../drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_kunmap':
>>    ../drivers/gpu/drm/ttm/ttm_bo_util.c:429:17: error: implicit 
>> declaration of function 'vunmap'; did you mean 'kunmap'? 
>> [-Werror=implicit-function-declaration]
>>      429 |                 vunmap(map->virtual);
>>     |                 ^~~~~~
>>     |                 kunmap
>>    ../drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_vmap':
>>    ../drivers/gpu/drm/ttm/ttm_bo_util.c:509:23: warning: assignment 
>> to 'void *' from 'int' makes pointer from integer without a cast 
>> [-Wint-conversion]
>>      509 |                 vaddr = vmap(ttm->pages, ttm->num_pages, 
>> 0, prot);
>>     |                       ^
>>
>> Fix this by including <linux/vmalloc.h>.
>>
>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>> ---
>>   drivers/gpu/drm/ttm/ttm_bo_util.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c 
>> b/drivers/gpu/drm/ttm/ttm_bo_util.c
>> index 12017ec24d9f..8e19a40cb41d 100644
>> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
>> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
>> @@ -29,6 +29,8 @@
>>    * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
>>    */
>>   +#include <linux/vmalloc.h>
>> +
>>   #include <drm/ttm/ttm_bo.h>
>>   #include <drm/ttm/ttm_placement.h>
>>   #include <drm/ttm/ttm_tt.h>
>


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

* Re: [PATCH] drm/ttm: Include <linux/vmalloc.h> to fix MIPS build
  2023-01-16 14:40   ` Christian König
@ 2023-01-17  8:08     ` Thomas Zimmermann
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Zimmermann @ 2023-01-17  8:08 UTC (permalink / raw)
  To: Christian König, ray.huang, airlied, daniel; +Cc: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 3478 bytes --]

Hi

Am 16.01.23 um 15:40 schrieb Christian König:
> Am 16.01.23 um 13:13 schrieb Thomas Zimmermann:
>> I'd add a Fixes tag, but don't know the commit when this was introduced.
> 
> Mhm, that code is 10+ years old. My educated guess is that we somehow 
> pulled in vmap/vunmap through a header which was now cleaned up.

Yeah, I assume it was introduced by a3185f91d057 ("drm/ttm: merge 
ttm_bo_api.h and ttm_bo_driver.h v2")

> 
> Anyway your patch looks good to me, feel free to add my rb.

Thank you. Merged into drm-misc-next now.

Best regards
Thomas

> 
> Christian.
> 
>>
>> Am 16.01.23 um 13:10 schrieb Thomas Zimmermann:
>>> On MIPS, vmap() and vunmap() are undeclared in ttm_bo_util.c. An
>>> error message is shown below.
>>>
>>>    CC      drivers/gpu/drm/ttm/ttm_bo_util.o
>>>    ../drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_kmap_ttm':
>>>    ../drivers/gpu/drm/ttm/ttm_bo_util.c:364:32: error: implicit 
>>> declaration of function 'vmap'; did you mean 'kmap'? 
>>> [-Werror=implicit-function-declaration]
>>>      364 |                 map->virtual = vmap(ttm->pages + 
>>> start_page, num_pages,
>>>     |                                ^~~~
>>>     |                                kmap
>>>    ../drivers/gpu/drm/ttm/ttm_bo_util.c:364:30: warning: assignment 
>>> to 'void *' from 'int' makes pointer from integer without a cast 
>>> [-Wint-conversion]
>>>      364 |                 map->virtual = vmap(ttm->pages + 
>>> start_page, num_pages,
>>>     |                              ^
>>>    ../drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_kunmap':
>>>    ../drivers/gpu/drm/ttm/ttm_bo_util.c:429:17: error: implicit 
>>> declaration of function 'vunmap'; did you mean 'kunmap'? 
>>> [-Werror=implicit-function-declaration]
>>>      429 |                 vunmap(map->virtual);
>>>     |                 ^~~~~~
>>>     |                 kunmap
>>>    ../drivers/gpu/drm/ttm/ttm_bo_util.c: In function 'ttm_bo_vmap':
>>>    ../drivers/gpu/drm/ttm/ttm_bo_util.c:509:23: warning: assignment 
>>> to 'void *' from 'int' makes pointer from integer without a cast 
>>> [-Wint-conversion]
>>>      509 |                 vaddr = vmap(ttm->pages, ttm->num_pages, 
>>> 0, prot);
>>>     |                       ^
>>>
>>> Fix this by including <linux/vmalloc.h>.
>>>
>>> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
>>> ---
>>>   drivers/gpu/drm/ttm/ttm_bo_util.c | 2 ++
>>>   1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c 
>>> b/drivers/gpu/drm/ttm/ttm_bo_util.c
>>> index 12017ec24d9f..8e19a40cb41d 100644
>>> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
>>> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
>>> @@ -29,6 +29,8 @@
>>>    * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
>>>    */
>>>   +#include <linux/vmalloc.h>
>>> +
>>>   #include <drm/ttm/ttm_bo.h>
>>>   #include <drm/ttm/ttm_placement.h>
>>>   #include <drm/ttm/ttm_tt.h>
>>
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

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

end of thread, other threads:[~2023-01-17  8:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-16 12:10 [PATCH] drm/ttm: Include <linux/vmalloc.h> to fix MIPS build Thomas Zimmermann
2023-01-16 12:13 ` Thomas Zimmermann
2023-01-16 14:40   ` Christian König
2023-01-17  8:08     ` Thomas Zimmermann

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.