All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/bochs: Replace ttm_bo_unref with ttm_bo_put
@ 2018-07-31  6:28 Thomas Zimmermann
  2018-08-09 15:27 ` Gerd Hoffmann
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Zimmermann @ 2018-07-31  6:28 UTC (permalink / raw)
  To: kraxel, virtualization, dri-devel; +Cc: Thomas Zimmermann

The function ttm_bo_put releases a reference to a TTM buffer object. The
function's name is more aligned to the Linux kernel convention of naming
ref-counting function _get and _put.

A call to ttm_bo_unref takes the address of the TTM BO object's pointer and
clears the pointer's value to NULL. This is not necessary in most cases and
sometimes even worked around by the calling code. A call to ttm_bo_put only
releases the reference without clearing the pointer.

The current behaviour of cleaning the pointer is kept in the calling code,
but should be removed if not required in a later patch.

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

diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
index 39cd08416773..c9c7097030ca 100644
--- a/drivers/gpu/drm/bochs/bochs_mm.c
+++ b/drivers/gpu/drm/bochs/bochs_mm.c
@@ -430,7 +430,7 @@ static void bochs_bo_unref(struct bochs_bo **bo)
 		return;
 
 	tbo = &((*bo)->bo);
-	ttm_bo_unref(&tbo);
+	ttm_bo_put(tbo);
 	*bo = NULL;
 }
 
-- 
2.18.0

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

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

* Re: [PATCH] drm/bochs: Replace ttm_bo_unref with ttm_bo_put
  2018-07-31  6:28 [PATCH] drm/bochs: Replace ttm_bo_unref with ttm_bo_put Thomas Zimmermann
@ 2018-08-09 15:27 ` Gerd Hoffmann
  2018-08-09 15:42   ` Thomas Zimmermann
  2018-08-30  6:14   ` Thomas Zimmermann
  0 siblings, 2 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2018-08-09 15:27 UTC (permalink / raw)
  To: Thomas Zimmermann; +Cc: dri-devel, virtualization

> diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
> index 39cd08416773..c9c7097030ca 100644
> --- a/drivers/gpu/drm/bochs/bochs_mm.c
> +++ b/drivers/gpu/drm/bochs/bochs_mm.c
> @@ -430,7 +430,7 @@ static void bochs_bo_unref(struct bochs_bo **bo)
>  		return;
>  
>  	tbo = &((*bo)->bo);
> -	ttm_bo_unref(&tbo);
> +	ttm_bo_put(tbo);

fails to build:

  CC [M]  drivers/gpu/drm/bochs/bochs_mm.o
/home/kraxel/projects/linux/drivers/gpu/drm/bochs/bochs_mm.c: In function ‘bochs_bo_unref’:
/home/kraxel/projects/linux/drivers/gpu/drm/bochs/bochs_mm.c:433:2: error: implicit declaration of function ‘ttm_bo_put’ [-Werror=implicit-function-declaration]
  ttm_bo_put(tbo);
  ^
cc1: some warnings being treated as errors

cheers,
  Gerd

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

* Re: [PATCH] drm/bochs: Replace ttm_bo_unref with ttm_bo_put
  2018-08-09 15:27 ` Gerd Hoffmann
@ 2018-08-09 15:42   ` Thomas Zimmermann
  2018-08-30  6:14   ` Thomas Zimmermann
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Zimmermann @ 2018-08-09 15:42 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: dri-devel, virtualization


[-- Attachment #1.1.1: Type: text/plain, Size: 1547 bytes --]

Hi

Am 09.08.2018 um 17:27 schrieb Gerd Hoffmann:
>> diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
>> index 39cd08416773..c9c7097030ca 100644
>> --- a/drivers/gpu/drm/bochs/bochs_mm.c
>> +++ b/drivers/gpu/drm/bochs/bochs_mm.c
>> @@ -430,7 +430,7 @@ static void bochs_bo_unref(struct bochs_bo **bo)
>>  		return;
>>  
>>  	tbo = &((*bo)->bo);
>> -	ttm_bo_unref(&tbo);
>> +	ttm_bo_put(tbo);
> 
> fails to build:
> 
>   CC [M]  drivers/gpu/drm/bochs/bochs_mm.o
> /home/kraxel/projects/linux/drivers/gpu/drm/bochs/bochs_mm.c: In function ‘bochs_bo_unref’:
> /home/kraxel/projects/linux/drivers/gpu/drm/bochs/bochs_mm.c:433:2: error: implicit declaration of function ‘ttm_bo_put’ [-Werror=implicit-function-declaration]
>   ttm_bo_put(tbo);
>   ^

Oh, sorry. These interface are in drm-next, [1] but apparently haven't
made it upstream yet.

Best regards
Thomas

[1]https://cgit.freedesktop.org/drm/drm/commit/?id=89c815ef07a1db0ac2cc09d06cb2d5c3d86d6322

> cc1: some warnings being treated as errors
> 
> cheers,
>   Gerd
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstr. 5, D-90409 Nürnberg
Tel: +49-911-74053-0; Fax: +49-911-7417755;  https://www.suse.com/
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard,
Graham Norton, HRB 21284 (AG Nürnberg)


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

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

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

* Re: [PATCH] drm/bochs: Replace ttm_bo_unref with ttm_bo_put
  2018-08-09 15:27 ` Gerd Hoffmann
  2018-08-09 15:42   ` Thomas Zimmermann
@ 2018-08-30  6:14   ` Thomas Zimmermann
  2018-08-30  7:18     ` Gerd Hoffmann
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Zimmermann @ 2018-08-30  6:14 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: dri-devel, virtualization


[-- Attachment #1.1.1: Type: text/plain, Size: 2159 bytes --]

Hi Gerd

Am 09.08.2018 um 17:27 schrieb Gerd Hoffmann:
>> diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
>> index 39cd08416773..c9c7097030ca 100644
>> --- a/drivers/gpu/drm/bochs/bochs_mm.c
>> +++ b/drivers/gpu/drm/bochs/bochs_mm.c
>> @@ -430,7 +430,7 @@ static void bochs_bo_unref(struct bochs_bo **bo)
>>  		return;
>>  
>>  	tbo = &((*bo)->bo);
>> -	ttm_bo_unref(&tbo);
>> +	ttm_bo_put(tbo);
> 
> fails to build:
> 
>   CC [M]  drivers/gpu/drm/bochs/bochs_mm.o
> /home/kraxel/projects/linux/drivers/gpu/drm/bochs/bochs_mm.c: In function ‘bochs_bo_unref’:
> /home/kraxel/projects/linux/drivers/gpu/drm/bochs/bochs_mm.c:433:2: error: implicit declaration of function ‘ttm_bo_put’ [-Werror=implicit-function-declaration]
>   ttm_bo_put(tbo);
>   ^
> cc1: some warnings being treated as errors

The required interfaces are now available in mainline. [1] I rebuilt to
make sure it compiles.

Besides bochs, [2] the patches for qxl, [3] cirrus, [4] vmwgfx, [5][6]
and virtio [7][8] should now build as well. They still apply cleanly
AFAICT. Let me know if you prefer a new patch set instead.

Best regards
Thomas

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=89c815ef07a1db0ac2cc09d06cb2d5c3d86d6322
[2] https://patchwork.freedesktop.org/patch/241728/
[3] https://patchwork.freedesktop.org/patch/241732/
[4] https://patchwork.freedesktop.org/patch/241729/
[5] https://patchwork.freedesktop.org/patch/241726/
[6] https://patchwork.freedesktop.org/patch/241727/
[7] https://patchwork.freedesktop.org/patch/241724/
[8] https://patchwork.freedesktop.org/patch/241725/


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

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Linux GmbH, Maxfeldstr. 5, D-90409 Nürnberg
Tel: +49-911-74053-0; Fax: +49-911-7417755;  https://www.suse.com/
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard,
Graham Norton, HRB 21284 (AG Nürnberg)


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

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

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

* Re: [PATCH] drm/bochs: Replace ttm_bo_unref with ttm_bo_put
  2018-08-30  6:14   ` Thomas Zimmermann
@ 2018-08-30  7:18     ` Gerd Hoffmann
  0 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2018-08-30  7:18 UTC (permalink / raw)
  To: Thomas Zimmermann; +Cc: dri-devel, virtualization

On Thu, Aug 30, 2018 at 08:14:02AM +0200, Thomas Zimmermann wrote:
> Hi Gerd
> 
> Am 09.08.2018 um 17:27 schrieb Gerd Hoffmann:
> >> diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
> >> index 39cd08416773..c9c7097030ca 100644
> >> --- a/drivers/gpu/drm/bochs/bochs_mm.c
> >> +++ b/drivers/gpu/drm/bochs/bochs_mm.c
> >> @@ -430,7 +430,7 @@ static void bochs_bo_unref(struct bochs_bo **bo)
> >>  		return;
> >>  
> >>  	tbo = &((*bo)->bo);
> >> -	ttm_bo_unref(&tbo);
> >> +	ttm_bo_put(tbo);
> > 
> > fails to build:
> > 
> >   CC [M]  drivers/gpu/drm/bochs/bochs_mm.o
> > /home/kraxel/projects/linux/drivers/gpu/drm/bochs/bochs_mm.c: In function ‘bochs_bo_unref’:
> > /home/kraxel/projects/linux/drivers/gpu/drm/bochs/bochs_mm.c:433:2: error: implicit declaration of function ‘ttm_bo_put’ [-Werror=implicit-function-declaration]
> >   ttm_bo_put(tbo);
> >   ^
> > cc1: some warnings being treated as errors
> 
> The required interfaces are now available in mainline. [1] I rebuilt to
> make sure it compiles.
> 
> Besides bochs, [2] the patches for qxl, [3] cirrus, [4] vmwgfx, [5][6]
> and virtio [7][8] should now build as well. They still apply cleanly
> AFAICT. Let me know if you prefer a new patch set instead.

Yes. builds now.  vmwgfx is not my cup of tea, but I'll pick up the
other ones (and can finally remove them from my patches mailbox) and let
you know in case I run into trouble.

cheers,
  Gerd

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

end of thread, other threads:[~2018-08-30  7:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-31  6:28 [PATCH] drm/bochs: Replace ttm_bo_unref with ttm_bo_put Thomas Zimmermann
2018-08-09 15:27 ` Gerd Hoffmann
2018-08-09 15:42   ` Thomas Zimmermann
2018-08-30  6:14   ` Thomas Zimmermann
2018-08-30  7:18     ` Gerd Hoffmann

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.