Skip to contentSkip to conversation

drm/omapdrm: Replace {un/reference} with {put, get} functions

PATCH In review Thomas Zimmermann 3 participants 8 messages Jun 18, 2018 – Sep 26, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover drm/omapdrm: Replace {un/reference} with {put, get} functions

This patch set replaces functions named {un,reference} by their {put,get} counterparts. Affected data types are struct drm_gem_object, and struct drm_device.

With the reference-counting functions being named {put,get}, the DRM interface is more aligned to Linux kernel nameing standard. The patch set does not change driver-internal interfaces.

Thomas Zimmermann (3):
drm/omapdrm: Replace drm_gem_object_{un/reference} with put,get
functions
drm/omapdrm: Replace drm_gem_object_unreference_unlocked with put
function
drm/omapdrm: Replace drm_dev_unref with drm_dev_put

 drivers/gpu/drm/omapdrm/omap_drv.c        | 6 +++---
 drivers/gpu/drm/omapdrm/omap_fb.c         | 2 +-
 drivers/gpu/drm/omapdrm/omap_fbdev.c      | 2 +-
 drivers/gpu/drm/omapdrm/omap_gem.c        | 4 ++--
 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

--
2.14.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

PATCH 1/3 drm/omapdrm: Replace drm_gem_object_{un/reference} with put, get functions

This patch unifies the naming of DRM functions for reference counting of struct drm_gem_object. The resulting code is more aligned with the rest of the Linux kernel interfaces.

---
 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c +1 -1
index 8e41d649e248..1a73c9887cd3 100644
@@ -187,7 +187,7 @@ struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev,
 			 * Importing dmabuf exported from out own gem increases
 			 * refcount on gem itself instead of f_count of dmabuf.
 			 */
-			drm_gem_object_reference(obj);
+			drm_gem_object_get(obj);
 			return obj;
 		}
 	}
Signature · 6 lines
2.14.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

PATCH 2/3 drm/omapdrm: Replace drm_gem_object_unreference_unlocked with put function

In reply to Thomas Zimmermann

This patch unifies the naming of DRM functions for reference counting of struct drm_gem_object. The resulting code is more aligned with the rest of the Linux kernel interfaces.

---
 drivers/gpu/drm/omapdrm/omap_drv.c   | 2 +-
 drivers/gpu/drm/omapdrm/omap_fb.c    | 2 +-
 drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +-
 drivers/gpu/drm/omapdrm/omap_gem.c   | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/omapdrm/omap_drv.c +1 -1
index ef3b0e3571ec..926b765dde68 100644
@@ -428,7 +428,7 @@ static int ioctl_gem_info(struct drm_device *dev, void *data,
 	args->size = omap_gem_mmap_size(obj);
 	args->offset = omap_gem_mmap_offset(obj);
 
-	drm_gem_object_unreference_unlocked(obj);
+	drm_gem_object_put_unlocked(obj);
 
 	return ret;
 }
drivers/gpu/drm/omapdrm/omap_fb.c +1 -1
index 9f1e3d8f8488..4d264fd554d8 100644
@@ -319,7 +319,7 @@ struct drm_framebuffer *omap_framebuffer_create(struct drm_device *dev,
 
 error:
 	while (--i >= 0)
-		drm_gem_object_unreference_unlocked(bos[i]);
+		drm_gem_object_put_unlocked(bos[i]);
 
 	return fb;
 }
drivers/gpu/drm/omapdrm/omap_fbdev.c +1 -1
index 0f66c74a54b0..853448dbeeca 100644
@@ -150,7 +150,7 @@ static int omap_fbdev_create(struct drm_fb_helper *helper,
 		/* note: if fb creation failed, we can't rely on fb destroy
 		 * to unref the bo:
 		 */
-		drm_gem_object_unreference_unlocked(fbdev->bo);
+		drm_gem_object_put_unlocked(fbdev->bo);
 		ret = PTR_ERR(fb);
 		goto fail;
 	}
drivers/gpu/drm/omapdrm/omap_gem.c +2 -2
index 17a53d207978..d436401e3474 100644
@@ -664,7 +664,7 @@ int omap_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,
 
 	*offset = omap_gem_mmap_offset(obj);
 
-	drm_gem_object_unreference_unlocked(obj);
+	drm_gem_object_put_unlocked(obj);
 
 fail:
 	return ret;
@@ -1298,7 +1298,7 @@ int omap_gem_new_handle(struct drm_device *dev, struct drm_file *file,
 	}
 
 	/* drop reference from allocate - handle holds it now */
-	drm_gem_object_unreference_unlocked(obj);
+	drm_gem_object_put_unlocked(obj);
 
 	return 0;
 }
Signature · 6 lines
2.14.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

PATCH 3/3 drm/omapdrm: Replace drm_dev_unref with drm_dev_put

In reply to Thomas Zimmermann

This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces.

---
 drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/omapdrm/omap_drv.c +2 -2
index 926b765dde68..6042f77450a6 100644
@@ -601,7 +601,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)
 	omap_drm_irq_uninstall(ddev);
 err_free_drm_dev:
 	omap_gem_deinit(ddev);
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 err_destroy_wq:
 	destroy_workqueue(priv->wq);
 	omap_disconnect_dssdevs();
@@ -630,7 +630,7 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)
 	omap_drm_irq_uninstall(ddev);
 	omap_gem_deinit(ddev);
 
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 
 	destroy_workqueue(priv->wq);
 
Signature · 6 lines
2.14.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

Re: [PATCH 0/3] drm/omapdrm: Replace {un/reference} with {put,get} functions

In reply to Thomas Zimmermann

Hi,

Quoted 15 lines · Thomas Zimmermann

This patch set replaces functions named {un,reference} by their {put,get} counterparts. Affected data types are struct drm_gem_object, and struct drm_device.

With the reference-counting functions being named {put,get}, the DRM interface is more aligned to Linux kernel nameing standard. The patch set does not change driver-internal interfaces.

Thomas Zimmermann (3):
drm/omapdrm: Replace drm_gem_object_{un/reference} with put,get
functions
drm/omapdrm: Replace drm_gem_object_unreference_unlocked with put
function
drm/omapdrm: Replace drm_dev_unref with drm_dev_put

Quoted 6 lines
 drivers/gpu/drm/omapdrm/omap_drv.c        | 6 +++---
 drivers/gpu/drm/omapdrm/omap_fb.c         | 2 +-
 drivers/gpu/drm/omapdrm/omap_fbdev.c      | 2 +-
 drivers/gpu/drm/omapdrm/omap_gem.c        | 4 ++--
 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

Thanks, I have picked these up (better later than never... sorry I missed these).

Tomi

Signature · 6 lines
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw

Re: [PATCH 0/3] drm/omapdrm: Replace {un/reference} with {put,get} functions

Hi

Thanks. I rebased just today. Patch 3 is slightly out of date. Do you want me to post an update?

Best regards
Thomas

Am 26.09.18 um 11:47 schrieb Tomi Valkeinen:

Quoted 30 lines

Hi,

Quoted 15 lines · Thomas Zimmermann

This patch set replaces functions named {un,reference} by their {put,get} counterparts. Affected data types are struct drm_gem_object, and struct drm_device.

With the reference-counting functions being named {put,get}, the DRM interface is more aligned to Linux kernel nameing standard. The patch set does not change driver-internal interfaces.

Thomas Zimmermann (3):
drm/omapdrm: Replace drm_gem_object_{un/reference} with put,get
functions
drm/omapdrm: Replace drm_gem_object_unreference_unlocked with put
function
drm/omapdrm: Replace drm_dev_unref with drm_dev_put

Quoted 6 lines
 drivers/gpu/drm/omapdrm/omap_drv.c        | 6 +++---
 drivers/gpu/drm/omapdrm/omap_fb.c         | 2 +-
 drivers/gpu/drm/omapdrm/omap_fbdev.c      | 2 +-
 drivers/gpu/drm/omapdrm/omap_gem.c        | 4 ++--
 drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

Thanks, I have picked these up (better later than never... sorry I missed these).

Tomi

Signature · 6 lines
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)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

Re: [PATCH 0/3] drm/omapdrm: Replace {un/reference} with {put,get} functions

Quoted 4 lines · Thomas Zimmermann

Hi

Thanks. I rebased just today. Patch 3 is slightly out of date. Do you want me to post an update?

Yes, the third one conflicted. I fixed it as follows. If it looks the same as your rebased one, no need to resend:

From 1ebbed291771d486aa25d42d024c9040c1254b3a Mon Sep 17 00:00:00 2001
From: Thomas Zimmermann <[email protected]>
Date: Mon, 18 Jun 2018 15:07:27 +0200
Subject: [PATCH] drm/omap: Replace drm_dev_unref with drm_dev_put

This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces.

---
 drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/omapdrm/omap_drv.c +2 -2
index f14d02ca968c..5e67d58cbc28 100644
@@ -614,7 +614,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)
 	omap_disconnect_pipelines(ddev);
 err_crtc_uninit:
 	omap_crtc_pre_uninit(priv);
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 	return ret;
 }
 
@@ -643,7 +643,7 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)
 	omap_disconnect_pipelines(ddev);
 	omap_crtc_pre_uninit(priv);
 
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 }
 
 static int pdev_probe(struct platform_device *pdev)
Signature · 5 lines
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw

Re: [PATCH 0/3] drm/omapdrm: Replace {un/reference} with {put,get} functions

OK, great. Thanks again for taking the patches.

Am 26.09.18 um 13:02 schrieb Tomi Valkeinen:

Quoted 48 lines · Thomas Zimmermann
Quoted 4 lines

Hi

Thanks. I rebased just today. Patch 3 is slightly out of date. Do you want me to post an update?

Yes, the third one conflicted. I fixed it as follows. If it looks the same as your rebased one, no need to resend:

From 1ebbed291771d486aa25d42d024c9040c1254b3a Mon Sep 17 00:00:00 2001
From: Thomas Zimmermann <[email protected]>
Date: Mon, 18 Jun 2018 15:07:27 +0200
Subject: [PATCH] drm/omap: Replace drm_dev_unref with drm_dev_put

This patch unifies the naming of DRM functions for reference counting of struct drm_device. The resulting code is more aligned with the rest of the Linux kernel interfaces.

---
 drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/omapdrm/omap_drv.c +2 -2
index f14d02ca968c..5e67d58cbc28 100644
@@ -614,7 +614,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)
 	omap_disconnect_pipelines(ddev);
 err_crtc_uninit:
 	omap_crtc_pre_uninit(priv);
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 	return ret;
 }
 
@@ -643,7 +643,7 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)
 	omap_disconnect_pipelines(ddev);
 	omap_crtc_pre_uninit(priv);
 
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 }
 
 static int pdev_probe(struct platform_device *pdev)
Signature · 6 lines
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)

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel