Skip to contentSkip to conversation

drm: remove deprecated functions

PATCH In review Fernando Ramos 12 participants 45 messages Nov 15, 2018 – Nov 29, 2018

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

cover drm: remove deprecated functions

Hi all,

One of the things in the DRM TODO list ("Documentation/gpu/todo.rst") was to "switch from reference/unreference to get/put". That's what this patch series is about.

In the past year or so most of the functions had already been renamed and only a few remained, which are the ones I fix here.

In addition, now that all calls to these deprecated functions are gone, this patch also removes their implementation and the coccinelle script that takes care of them (which is no longer needed).

Anyway, this is my first patch and I'm sure I've done something wrong. Please let me know :)

Fernando Ramos (9):
drm: replace "drm_gem_object_unreference_unlocked" function with

    "*put_unlocked"

drm: remove deprecated "[__]drm_gem_object_[un]reference[_locked]"
functions
drm: replace "drm_dev_unref" function with "drm_dev_put"
drm: remove deprecated "drm_dev_unref" function
drm: replace "drm_connector_unreference" with "drm_connector_put"
drm: remove deprecated "drm_connector_[un]reference" functions
drm: remove deprecated "drm_framebuffer_[un]reference" functions
drm: remove no longer needed drm-get-put coccinelle script
docs: drm: remove no longer relevant TODO entry

 Documentation/gpu/todo.rst                   | 17 -----
 drivers/gpu/drm/arc/arcpgu_drv.c             |  4 +-
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c |  4 +-
 drivers/gpu/drm/bochs/bochs_mm.c             |  4 +-
 drivers/gpu/drm/bridge/tc358764.c            |  2 +-
 drivers/gpu/drm/drm_drv.c                    | 13 ----
 drivers/gpu/drm/etnaviv/etnaviv_drv.c        |  4 +-
 drivers/gpu/drm/mxsfb/mxsfb_drv.c            |  4 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.c        |  2 +-
 drivers/gpu/drm/shmobile/shmob_drm_drv.c     |  4 +-
 drivers/gpu/drm/tve200/tve200_drv.c          |  4 +-
 drivers/gpu/drm/zte/zx_drm_drv.c             |  4 +-
 include/drm/drm_connector.h                  | 24 ------
 include/drm/drm_drv.h                        |  1 -
 include/drm/drm_framebuffer.h                | 24 ------
 include/drm/drm_gem.h                        | 50 -------------
 scripts/coccinelle/api/drm-get-put.cocci     | 78 --------------------
 17 files changed, 18 insertions(+), 225 deletions(-)
 delete mode 100644 scripts/coccinelle/api/drm-get-put.cocci
Signature · 1 line
2.19.1
#1 lore raw

PATCH 1/9 drm: replace "drm_gem_object_unreference_unlocked" function with "*put_unlocked"

This patch unifies the naming of DRM functions for reference counting as requested on Documentation/gpu/todo.rst

---
 drivers/gpu/drm/bochs/bochs_mm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bochs/bochs_mm.c +2 -2
index a61c1ecb2bdc..e6ccf7fa92d4 100644
@@ -414,7 +414,7 @@ int bochs_dumb_create(struct drm_file *file, struct drm_device *dev,
 		return ret;
 
 	ret = drm_gem_handle_create(file, gobj, &handle);
-	drm_gem_object_unreference_unlocked(gobj);
+	drm_gem_object_put_unlocked(gobj);
 	if (ret)
 		return ret;
 
@@ -454,6 +454,6 @@ int bochs_dumb_mmap_offset(struct drm_file *file, struct drm_device *dev,
 	bo = gem_to_bochs_bo(obj);
 	*offset = bochs_bo_mmap_offset(bo);
 
-	drm_gem_object_unreference_unlocked(obj);
+	drm_gem_object_put_unlocked(obj);
 	return 0;
 }
Signature · 1 line
2.19.1
#2 lore raw

Re: [PATCH 1/9] drm: replace "drm_gem_object_unreference_unlocked" function with "*put_unlocked"

Quoted 4 lines · Fernando Ramos

This patch unifies the naming of DRM functions for reference counting as requested on Documentation/gpu/todo.rst

This is already fixed in drm-misc-next as it happens:

commit a0d4d42cb5854400baa47bf63d9aae65fa9f484e

Author: Thomas Zimmermann <[email protected]>
Date:   Wed Sep 26 13:36:23 2018 +0200
    drm/bochs: Replace drm_commit a0d4d42cb5854400baa47bf63d9aae65fa9f484e
Author: Thomas Zimmermann <[email protected]>
Date:   Wed Sep 26 13:36:23 2018 +0200

drm/bochs: Replace drm_gem_object_unreference_unlocked with put function

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.

v2:
* rebase onto fbdev rework

gem_object_unreference_unlocked with put function

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.

v2:
* rebase onto fbdev rework

Going on to try and apply the rest.

Yours,
Linus Walleij

#3 lore raw

PATCH 2/9 drm: remove deprecated "[__]drm_gem_object_[un]reference[_locked]" functions

In reply to Fernando Ramos

There are no more places where these (deprecated) functions are being used from, thus they can now be removed.

---
 include/drm/drm_gem.h | 50 -------------------------------------------
 1 file changed, 50 deletions(-)
include/drm/drm_gem.h +0 -50
index 3583b98a1718..daa34328b5be 100644
@@ -222,56 +222,6 @@ __drm_gem_object_put(struct drm_gem_object *obj)
 void drm_gem_object_put_unlocked(struct drm_gem_object *obj);
 void drm_gem_object_put(struct drm_gem_object *obj);
 
-/**
- * drm_gem_object_reference - acquire a GEM buffer object reference
- * @obj: GEM buffer object
- *
- * This is a compatibility alias for drm_gem_object_get() and should not be
- * used by new code.
- */
-static inline void drm_gem_object_reference(struct drm_gem_object *obj)
-{
-	drm_gem_object_get(obj);
-}
-
-/**
- * __drm_gem_object_unreference - raw function to release a GEM buffer object
- *                                reference
- * @obj: GEM buffer object
- *
- * This is a compatibility alias for __drm_gem_object_put() and should not be
- * used by new code.
- */
-static inline void __drm_gem_object_unreference(struct drm_gem_object *obj)
-{
-	__drm_gem_object_put(obj);
-}
-
-/**
- * drm_gem_object_unreference_unlocked - release a GEM buffer object reference
- * @obj: GEM buffer object
- *
- * This is a compatibility alias for drm_gem_object_put_unlocked() and should
- * not be used by new code.
- */
-static inline void
-drm_gem_object_unreference_unlocked(struct drm_gem_object *obj)
-{
-	drm_gem_object_put_unlocked(obj);
-}
-
-/**
- * drm_gem_object_unreference - release a GEM buffer object reference
- * @obj: GEM buffer object
- *
- * This is a compatibility alias for drm_gem_object_put() and should not be
- * used by new code.
- */
-static inline void drm_gem_object_unreference(struct drm_gem_object *obj)
-{
-	drm_gem_object_put(obj);
-}
-
 int drm_gem_handle_create(struct drm_file *file_priv,
 			  struct drm_gem_object *obj,
 			  u32 *handlep);
Signature · 1 line
2.19.1
#4 lore raw

Re: [PATCH 2/9] drm: remove deprecated "[__]drm_gem_object_[un]reference[_locked]" functions

Quoted 4 lines · Fernando Ramos

There are no more places where these (deprecated) functions are being used from, thus they can now be removed.

Patch applied to drm-misc-next.

Yours,
Linus Walleij

#5 lore raw

PATCH 3/9 drm: replace "drm_dev_unref" function with "drm_dev_put"

In reply to Fernando Ramos

This patch unifies the naming of DRM functions for reference counting as requested on Documentation/gpu/todo.rst

---
 drivers/gpu/drm/arc/arcpgu_drv.c             | 4 ++--
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
 drivers/gpu/drm/etnaviv/etnaviv_drv.c        | 4 ++--
 drivers/gpu/drm/mxsfb/mxsfb_drv.c            | 4 ++--
 drivers/gpu/drm/rcar-du/rcar_du_drv.c        | 2 +-
 drivers/gpu/drm/shmobile/shmob_drm_drv.c     | 4 ++--
 drivers/gpu/drm/tve200/tve200_drv.c          | 4 ++--
 drivers/gpu/drm/zte/zx_drm_drv.c             | 4 ++--
 8 files changed, 15 insertions(+), 15 deletions(-)
drivers/gpu/drm/arc/arcpgu_drv.c +2 -2
index f067de4e1e82..dcb06d4e9135 100644
@@ -216,7 +216,7 @@ static int arcpgu_probe(struct platform_device *pdev)
 	arcpgu_unload(drm);
 
 err_unref:
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return ret;
 }
@@ -227,7 +227,7 @@ static int arcpgu_remove(struct platform_device *pdev)
 
 	drm_dev_unregister(drm);
 	arcpgu_unload(drm);
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return 0;
 }
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +2 -2
index 843cac222e60..f8da51a63e2f 100644
@@ -775,7 +775,7 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev)
 	atmel_hlcdc_dc_unload(ddev);
 
 err_unref:
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 
 	return ret;
 }
@@ -786,7 +786,7 @@ static int atmel_hlcdc_dc_drm_remove(struct platform_device *pdev)
 
 	drm_dev_unregister(ddev);
 	atmel_hlcdc_dc_unload(ddev);
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 
 	return 0;
 }
drivers/gpu/drm/etnaviv/etnaviv_drv.c +2 -2
index 83c1f46670bf..52802e6049e0 100644
@@ -550,7 +550,7 @@ static int etnaviv_bind(struct device *dev)
 out_bind:
 	kfree(priv);
 out_unref:
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return ret;
 }
@@ -567,7 +567,7 @@ static void etnaviv_unbind(struct device *dev)
 	drm->dev_private = NULL;
 	kfree(priv);
 
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 }
 
 static const struct component_master_ops etnaviv_master_ops = {
drivers/gpu/drm/mxsfb/mxsfb_drv.c +2 -2
index 2393e6d16ffd..88ba003979e6 100644
@@ -417,7 +417,7 @@ static int mxsfb_probe(struct platform_device *pdev)
 err_unload:
 	mxsfb_unload(drm);
 err_free:
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return ret;
 }
@@ -428,7 +428,7 @@ static int mxsfb_remove(struct platform_device *pdev)
 
 	drm_dev_unregister(drm);
 	mxsfb_unload(drm);
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return 0;
 }
drivers/gpu/drm/rcar-du/rcar_du_drv.c +1 -1
index 084f58df4a8c..c7fe2433ab9e 100644
@@ -454,7 +454,7 @@ static int rcar_du_remove(struct platform_device *pdev)
 	drm_kms_helper_poll_fini(ddev);
 	drm_mode_config_cleanup(ddev);
 
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 
 	return 0;
 }
drivers/gpu/drm/shmobile/shmob_drm_drv.c +2 -2
index 6ececad6f845..8554102a6ead 100644
@@ -194,7 +194,7 @@ static int shmob_drm_remove(struct platform_device *pdev)
 	drm_kms_helper_poll_fini(ddev);
 	drm_mode_config_cleanup(ddev);
 	drm_irq_uninstall(ddev);
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 
 	return 0;
 }
@@ -290,7 +290,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
 	drm_kms_helper_poll_fini(ddev);
 	drm_mode_config_cleanup(ddev);
 err_free_drm_dev:
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 
 	return ret;
 }
drivers/gpu/drm/tve200/tve200_drv.c +2 -2
index 72efcecb44f7..28e2d03c0ccf 100644
@@ -249,7 +249,7 @@ static int tve200_probe(struct platform_device *pdev)
 clk_disable:
 	clk_disable_unprepare(priv->pclk);
 dev_unref:
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 	return ret;
 }
 
@@ -263,7 +263,7 @@ static int tve200_remove(struct platform_device *pdev)
 		drm_panel_bridge_remove(priv->bridge);
 	drm_mode_config_cleanup(drm);
 	clk_disable_unprepare(priv->pclk);
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return 0;
 }
drivers/gpu/drm/zte/zx_drm_drv.c +2 -2
index 11ef17c2d1c1..5b6f1eda52e0 100644
@@ -114,7 +114,7 @@ static int zx_drm_bind(struct device *dev)
 	component_unbind_all(dev, drm);
 out_unregister:
 	dev_set_drvdata(dev, NULL);
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 	return ret;
 }
 
@@ -127,7 +127,7 @@ static void zx_drm_unbind(struct device *dev)
 	drm_mode_config_cleanup(drm);
 	component_unbind_all(dev, drm);
 	dev_set_drvdata(dev, NULL);
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 }
 
 static const struct component_master_ops zx_drm_master_ops = {
Signature · 1 line
2.19.1
Acked-by on v1 3/9
#6 lore raw

Re: [PATCH 3/9] drm: replace "drm_dev_unref" function with "drm_dev_put"

Quoted 7 lines · On Thu, 15 Nov 2018 23:16:23 +0100 Fernando Ramos <[email protected]>…

This patch unifies the naming of DRM functions for reference counting as requested on Documentation/gpu/todo.rst

---
 drivers/gpu/drm/arc/arcpgu_drv.c             | 4 ++--
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--

For the Atmel HLCDC driver

Quoted 167 lines
 drivers/gpu/drm/etnaviv/etnaviv_drv.c        | 4 ++--
 drivers/gpu/drm/mxsfb/mxsfb_drv.c            | 4 ++--
 drivers/gpu/drm/rcar-du/rcar_du_drv.c        | 2 +-
 drivers/gpu/drm/shmobile/shmob_drm_drv.c     | 4 ++--
 drivers/gpu/drm/tve200/tve200_drv.c          | 4 ++--
 drivers/gpu/drm/zte/zx_drm_drv.c             | 4 ++--
 8 files changed, 15 insertions(+), 15 deletions(-)
drivers/gpu/drm/arc/arcpgu_drv.c +2 -2
index f067de4e1e82..dcb06d4e9135 100644
@@ -216,7 +216,7 @@ static int arcpgu_probe(struct platform_device *pdev)
 	arcpgu_unload(drm);
 
 err_unref:
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return ret;
 }
@@ -227,7 +227,7 @@ static int arcpgu_remove(struct platform_device *pdev)
 
 	drm_dev_unregister(drm);
 	arcpgu_unload(drm);
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return 0;
 }
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +2 -2
index 843cac222e60..f8da51a63e2f 100644
@@ -775,7 +775,7 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev)
 	atmel_hlcdc_dc_unload(ddev);
 
 err_unref:
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 
 	return ret;
 }
@@ -786,7 +786,7 @@ static int atmel_hlcdc_dc_drm_remove(struct platform_device *pdev)
 
 	drm_dev_unregister(ddev);
 	atmel_hlcdc_dc_unload(ddev);
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 
 	return 0;
 }
drivers/gpu/drm/etnaviv/etnaviv_drv.c +2 -2
index 83c1f46670bf..52802e6049e0 100644
@@ -550,7 +550,7 @@ static int etnaviv_bind(struct device *dev)
 out_bind:
 	kfree(priv);
 out_unref:
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return ret;
 }
@@ -567,7 +567,7 @@ static void etnaviv_unbind(struct device *dev)
 	drm->dev_private = NULL;
 	kfree(priv);
 
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 }
 
 static const struct component_master_ops etnaviv_master_ops = {
drivers/gpu/drm/mxsfb/mxsfb_drv.c +2 -2
index 2393e6d16ffd..88ba003979e6 100644
@@ -417,7 +417,7 @@ static int mxsfb_probe(struct platform_device *pdev)
 err_unload:
 	mxsfb_unload(drm);
 err_free:
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return ret;
 }
@@ -428,7 +428,7 @@ static int mxsfb_remove(struct platform_device *pdev)
 
 	drm_dev_unregister(drm);
 	mxsfb_unload(drm);
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return 0;
 }
drivers/gpu/drm/rcar-du/rcar_du_drv.c +1 -1
index 084f58df4a8c..c7fe2433ab9e 100644
@@ -454,7 +454,7 @@ static int rcar_du_remove(struct platform_device *pdev)
 	drm_kms_helper_poll_fini(ddev);
 	drm_mode_config_cleanup(ddev);
 
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 
 	return 0;
 }
drivers/gpu/drm/shmobile/shmob_drm_drv.c +2 -2
index 6ececad6f845..8554102a6ead 100644
@@ -194,7 +194,7 @@ static int shmob_drm_remove(struct platform_device *pdev)
 	drm_kms_helper_poll_fini(ddev);
 	drm_mode_config_cleanup(ddev);
 	drm_irq_uninstall(ddev);
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 
 	return 0;
 }
@@ -290,7 +290,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
 	drm_kms_helper_poll_fini(ddev);
 	drm_mode_config_cleanup(ddev);
 err_free_drm_dev:
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 
 	return ret;
 }
drivers/gpu/drm/tve200/tve200_drv.c +2 -2
index 72efcecb44f7..28e2d03c0ccf 100644
@@ -249,7 +249,7 @@ static int tve200_probe(struct platform_device *pdev)
 clk_disable:
 	clk_disable_unprepare(priv->pclk);
 dev_unref:
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 	return ret;
 }
 
@@ -263,7 +263,7 @@ static int tve200_remove(struct platform_device *pdev)
 		drm_panel_bridge_remove(priv->bridge);
 	drm_mode_config_cleanup(drm);
 	clk_disable_unprepare(priv->pclk);
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return 0;
 }
drivers/gpu/drm/zte/zx_drm_drv.c +1 -1
index 11ef17c2d1c1..5b6f1eda52e0 100644
@@ -114,7 +114,7 @@ static int zx_drm_bind(struct device *dev)
 	component_unbind_all(dev, drm);
 out_unregister:
 	dev_set_drvdata(dev, NULL);
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 	return ret;
 }
 

drivers/gpu/drm/zte/zx_drm_drv.c static void zx_drm_unbind(struct device *dev) · line 133

Quoted 8 lines
drivers/gpu/drm/zte/zx_drm_drv.c +1 -1
@@ -127,7 +127,7 @@ static void zx_drm_unbind(struct device *dev)
 	drm_mode_config_cleanup(drm);
 	component_unbind_all(dev, drm);
 	dev_set_drvdata(dev, NULL);
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 }
 
 static const struct component_master_ops zx_drm_master_ops = {

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

maintainer
#7 lore raw

Re: [PATCH 3/9] drm: replace "drm_dev_unref" function with "drm_dev_put"

In reply to Fernando Ramos

Am Donnerstag, den 15.11.2018, 23:16 +0100 schrieb Fernando Ramos:

Quoted 8 lines

This patch unifies the naming of DRM functions for reference counting as requested on Documentation/gpu/todo.rst

Quoted 1 line

---

?drivers/gpu/drm/arc/arcpgu_drv.c?????????????| 4 ++--
?drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
?drivers/gpu/drm/etnaviv/etnaviv_drv.c????????| 4 ++--

At least the etnaviv part of the patch is already fixed in linux-next.

Regards,
Lucas

Quoted 174 lines
?drivers/gpu/drm/mxsfb/mxsfb_drv.c????????????| 4 ++--
?drivers/gpu/drm/rcar-du/rcar_du_drv.c????????| 2 +-
?drivers/gpu/drm/shmobile/shmob_drm_drv.c?????| 4 ++--
?drivers/gpu/drm/tve200/tve200_drv.c??????????| 4 ++--
?drivers/gpu/drm/zte/zx_drm_drv.c?????????????| 4 ++--

?8 files changed, 15 insertions(+), 15 deletions(-)

drivers/gpu/drm/arc/arcpgu_drv.c +0 -0
index f067de4e1e82..dcb06d4e9135 100644
@@ -216,7 +216,7 @@ static int arcpgu_probe(struct platform_device *pdev)
 > ?	arcpgu_unload(drm);

?
?err_unref:

Review

Quoted 2 lines
(quoted diff) +1 -1
-	drm_dev_unref(drm);
+	drm_dev_put(drm);

?

Quoted 1 line

? return ret;

?}

drivers/gpu/drm/arc/arcpgu_drv.c +0 -0
@@ -227,7 +227,7 @@ static int arcpgu_remove(struct platform_device *pdev)

?

Review

Quoted 4 lines

? drm_dev_unregister(drm);
? arcpgu_unload(drm);

(quoted diff) +1 -1
-	drm_dev_unref(drm);
+	drm_dev_put(drm);

?

Quoted 1 line

? return 0;

?}

drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0 -0
index 843cac222e60..f8da51a63e2f 100644
@@ -775,7 +775,7 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev)
 > ?	atmel_hlcdc_dc_unload(ddev);

?
?err_unref:

Review

Quoted 2 lines
(quoted diff) +1 -1
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);

?

Quoted 1 line

? return ret;

?}

drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +0 -0
@@ -786,7 +786,7 @@ static int atmel_hlcdc_dc_drm_remove(struct platform_device *pdev)

?

Review

Quoted 4 lines

? drm_dev_unregister(ddev);
? atmel_hlcdc_dc_unload(ddev);

(quoted diff) +1 -1
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);

?

Quoted 1 line

? return 0;

?}

drivers/gpu/drm/etnaviv/etnaviv_drv.c +0 -0
index 83c1f46670bf..52802e6049e0 100644
@@ -550,7 +550,7 @@ static int etnaviv_bind(struct device *dev)

?out_bind:

Quoted 1 line

? kfree(priv);

?out_unref:

Review

Quoted 2 lines
(quoted diff) +1 -1
-	drm_dev_unref(drm);
+	drm_dev_put(drm);

?

Quoted 1 line

? return ret;

?}

drivers/gpu/drm/etnaviv/etnaviv_drv.c +0 -0
@@ -567,7 +567,7 @@ static void etnaviv_unbind(struct device *dev)
 > ?	drm->dev_private = NULL;
 > ?	kfree(priv);

?

Review

Quoted 2 lines
(quoted diff) +1 -1
-	drm_dev_unref(drm);
+	drm_dev_put(drm);

?}
?
?static const struct component_master_ops etnaviv_master_ops = {

drivers/gpu/drm/mxsfb/mxsfb_drv.c +0 -0
index 2393e6d16ffd..88ba003979e6 100644
@@ -417,7 +417,7 @@ static int mxsfb_probe(struct platform_device *pdev)

?err_unload:

Quoted 1 line

? mxsfb_unload(drm);

?err_free:

Review

Quoted 2 lines
(quoted diff) +1 -1
-	drm_dev_unref(drm);
+	drm_dev_put(drm);

?

Quoted 1 line

? return ret;

?}

drivers/gpu/drm/mxsfb/mxsfb_drv.c +0 -0
@@ -428,7 +428,7 @@ static int mxsfb_remove(struct platform_device *pdev)

?

Review

Quoted 4 lines

? drm_dev_unregister(drm);
? mxsfb_unload(drm);

(quoted diff) +1 -1
-	drm_dev_unref(drm);
+	drm_dev_put(drm);

?

Quoted 1 line

? return 0;

?}

drivers/gpu/drm/rcar-du/rcar_du_drv.c +0 -0
index 084f58df4a8c..c7fe2433ab9e 100644
@@ -454,7 +454,7 @@ static int rcar_du_remove(struct platform_device *pdev)
 > ?	drm_kms_helper_poll_fini(ddev);
 > ?	drm_mode_config_cleanup(ddev);

?

Review

Quoted 2 lines
(quoted diff) +1 -1
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);

?

Quoted 1 line

? return 0;

?}

drivers/gpu/drm/shmobile/shmob_drm_drv.c +0 -0
index 6ececad6f845..8554102a6ead 100644
@@ -194,7 +194,7 @@ static int shmob_drm_remove(struct platform_device *pdev)
 > ?	drm_kms_helper_poll_fini(ddev);
 > ?	drm_mode_config_cleanup(ddev);
 > ?	drm_irq_uninstall(ddev);
 > -	drm_dev_unref(ddev);
 > +	drm_dev_put(ddev);

?

Quoted 1 line

? return 0;

?}

drivers/gpu/drm/shmobile/shmob_drm_drv.c +0 -0
@@ -290,7 +290,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
 > ?	drm_kms_helper_poll_fini(ddev);
 > ?	drm_mode_config_cleanup(ddev);

?err_free_drm_dev:

Review

Quoted 2 lines
(quoted diff) +1 -1
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);

?

Quoted 1 line

? return ret;

?}

drivers/gpu/drm/tve200/tve200_drv.c +0 -0
index 72efcecb44f7..28e2d03c0ccf 100644
@@ -249,7 +249,7 @@ static int tve200_probe(struct platform_device *pdev)

?clk_disable:

Quoted 1 line

? clk_disable_unprepare(priv->pclk);

?dev_unref:

Quoted 3 lines
(quoted diff) +1 -1
-	drm_dev_unref(drm);
+	drm_dev_put(drm);

? return ret;

?}
?

drivers/gpu/drm/tve200/tve200_drv.c +0 -0
@@ -263,7 +263,7 @@ static int tve200_remove(struct platform_device *pdev)
 > ?		drm_panel_bridge_remove(priv->bridge);
 > ?	drm_mode_config_cleanup(drm);
 > ?	clk_disable_unprepare(priv->pclk);
 > -	drm_dev_unref(drm);
 > +	drm_dev_put(drm);

?

Quoted 1 line

? return 0;

?}

drivers/gpu/drm/zte/zx_drm_drv.c +0 -0
index 11ef17c2d1c1..5b6f1eda52e0 100644
@@ -114,7 +114,7 @@ static int zx_drm_bind(struct device *dev)
 > ?	component_unbind_all(dev, drm);

?out_unregister:

Quoted 4 lines

? dev_set_drvdata(dev, NULL);

(quoted diff) +1 -1
-	drm_dev_unref(drm);
+	drm_dev_put(drm);

? return ret;

?}
?

drivers/gpu/drm/zte/zx_drm_drv.c +0 -0
@@ -127,7 +127,7 @@ static void zx_drm_unbind(struct device *dev)
 > ?	drm_mode_config_cleanup(drm);
 > ?	component_unbind_all(dev, drm);
 > ?	dev_set_drvdata(dev, NULL);
 > -	drm_dev_unref(drm);
 > +	drm_dev_put(drm);
 ?}

?
?static const struct component_master_ops zx_drm_master_ops = {

author
#8 lore raw

Re: [PATCH 3/9] drm: replace "drm_dev_unref" function with "drm_dev_put"

Quoted 10 lines · Lucas Stach

Am Donnerstag, den 15.11.2018, 23:16 +0100 schrieb Fernando Ramos:

Quoted 8 lines

This patch unifies the naming of DRM functions for reference counting as requested on Documentation/gpu/todo.rst

Quoted 1 line

---
 drivers/gpu/drm/arc/arcpgu_drv.c             | 4 ++-- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++-- drivers/gpu/drm/etnaviv/etnaviv_drv.c        | 4 ++--

Quoted 4 lines

At least the etnaviv part of the patch is already fixed in linux-next.

Regards,
Lucas

Thanks for the notice.

I'm new on this, how should I proceed? Should I create a new (V2) patch series with these changes reverted? Or will the maintainer automatically take care of this when merging?

And, related to this, what is the "good" branch to start developing new drm patches? Is is "drm-next" or "linux-next"? Or does it change depending on how much time until the merge window closes?

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

#9 lore raw

Re: [PATCH 3/9] drm: replace "drm_dev_unref" function with "drm_dev_put"

Quoted 3 lines · Fernando

And, related to this, what is the "good" branch to start developing new drm patches? Is is "drm-next" or "linux-next"? Or does it change depending on how much time until the merge window closes?

I advise most of our developers to work on drm-tip because it contains the latest stuff in drm core, i915, amd, most of the small drivers, as well as sound. It's a bit like "linux-next for graphics". And you don't really have to care about the merge cycles with that.

But YMMV, it probably doesn't work for everyone.

BR,
Jani.

Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
#10 lore raw

Re: [PATCH 3/9] drm: replace "drm_dev_unref" function with "drm_dev_put"

In reply to Fernando
Quoted 3 lines · Fernando

And, related to this, what is the "good" branch to start developing new drm patches? Is is "drm-next" or "linux-next"? Or does it change depending on how much time until the merge window closes?

I advise most of our developers to work on drm-tip because it contains the latest stuff in drm core, i915, amd, most of the small drivers, as well as sound. It's a bit like "linux-next for graphics". And you don't really have to care about the merge cycles with that.

But YMMV, it probably doesn't work for everyone.

BR,
Jani.

Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
#11 lore raw

Re: [PATCH 3/9] drm: replace "drm_dev_unref" function with "drm_dev_put"

In reply to Fernando
Quoted 3 lines · Fernando

I'm new on this, how should I proceed? Should I create a new (V2) patch series with these changes reverted? Or will the maintainer automatically take care of this when merging?

I fixed it :) I think. At least I hope I didn't do something bad.

Yours,
Linus Walleij

maintainer Acked-by on v1 3/9
#13 lore raw

Re: [PATCH 3/9] drm: replace "drm_dev_unref" function with "drm_dev_put"

In reply to Fernando Ramos
Quoted 9 lines · Fernando Ramos

This patch unifies the naming of DRM functions for reference counting as requested on Documentation/gpu/todo.rst

---
 drivers/gpu/drm/arc/arcpgu_drv.c             | 4 ++--
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
 drivers/gpu/drm/etnaviv/etnaviv_drv.c        | 4 ++--
 drivers/gpu/drm/mxsfb/mxsfb_drv.c            | 4 ++--

For mxsfb:

--
Stefan

Quoted 181 lines
 drivers/gpu/drm/rcar-du/rcar_du_drv.c        | 2 +-
 drivers/gpu/drm/shmobile/shmob_drm_drv.c     | 4 ++--
 drivers/gpu/drm/tve200/tve200_drv.c          | 4 ++--
 drivers/gpu/drm/zte/zx_drm_drv.c             | 4 ++--
 8 files changed, 15 insertions(+), 15 deletions(-)
drivers/gpu/drm/arc/arcpgu_drv.c +2 -2
index f067de4e1e82..dcb06d4e9135 100644
@@ -216,7 +216,7 @@ static int arcpgu_probe(struct platform_device *pdev)
 	arcpgu_unload(drm);
 
 err_unref:
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return ret;
 }
@@ -227,7 +227,7 @@ static int arcpgu_remove(struct platform_device *pdev)
 
 	drm_dev_unregister(drm);
 	arcpgu_unload(drm);
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return 0;
 }
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +1 -1
index 843cac222e60..f8da51a63e2f 100644
@@ -775,7 +775,7 @@ static int atmel_hlcdc_dc_drm_probe(struct
 platform_device *pdev)
 	atmel_hlcdc_dc_unload(ddev);
 
 err_unref:
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 
 	return ret;

}

drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +1 -1
@@ -786,7 +786,7 @@ static int atmel_hlcdc_dc_drm_remove(struct
 platform_device *pdev)
 
 	drm_dev_unregister(ddev);
 	atmel_hlcdc_dc_unload(ddev);
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 
 	return 0;

}

drivers/gpu/drm/etnaviv/etnaviv_drv.c +2 -2
index 83c1f46670bf..52802e6049e0 100644
@@ -550,7 +550,7 @@ static int etnaviv_bind(struct device *dev)
 out_bind:
 	kfree(priv);
 out_unref:
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return ret;
 }
@@ -567,7 +567,7 @@ static void etnaviv_unbind(struct device *dev)
 	drm->dev_private = NULL;
 	kfree(priv);
 
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 }
 
 static const struct component_master_ops etnaviv_master_ops = {
drivers/gpu/drm/mxsfb/mxsfb_drv.c +2 -2
index 2393e6d16ffd..88ba003979e6 100644
@@ -417,7 +417,7 @@ static int mxsfb_probe(struct platform_device *pdev)
 err_unload:
 	mxsfb_unload(drm);
 err_free:
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return ret;
 }
@@ -428,7 +428,7 @@ static int mxsfb_remove(struct platform_device *pdev)
 
 	drm_dev_unregister(drm);
 	mxsfb_unload(drm);
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return 0;
 }
drivers/gpu/drm/rcar-du/rcar_du_drv.c +1 -1
index 084f58df4a8c..c7fe2433ab9e 100644
@@ -454,7 +454,7 @@ static int rcar_du_remove(struct platform_device *pdev)
 	drm_kms_helper_poll_fini(ddev);
 	drm_mode_config_cleanup(ddev);
 
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 
 	return 0;
 }
drivers/gpu/drm/shmobile/shmob_drm_drv.c +2 -2
index 6ececad6f845..8554102a6ead 100644
@@ -194,7 +194,7 @@ static int shmob_drm_remove(struct platform_device *pdev)
 	drm_kms_helper_poll_fini(ddev);
 	drm_mode_config_cleanup(ddev);
 	drm_irq_uninstall(ddev);
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 
 	return 0;
 }
@@ -290,7 +290,7 @@ static int shmob_drm_probe(struct platform_device *pdev)
 	drm_kms_helper_poll_fini(ddev);
 	drm_mode_config_cleanup(ddev);
 err_free_drm_dev:
-	drm_dev_unref(ddev);
+	drm_dev_put(ddev);
 
 	return ret;
 }
drivers/gpu/drm/tve200/tve200_drv.c +2 -2
index 72efcecb44f7..28e2d03c0ccf 100644
@@ -249,7 +249,7 @@ static int tve200_probe(struct platform_device *pdev)
 clk_disable:
 	clk_disable_unprepare(priv->pclk);
 dev_unref:
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 	return ret;
 }
 
@@ -263,7 +263,7 @@ static int tve200_remove(struct platform_device *pdev)
 		drm_panel_bridge_remove(priv->bridge);
 	drm_mode_config_cleanup(drm);
 	clk_disable_unprepare(priv->pclk);
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 
 	return 0;
 }
drivers/gpu/drm/zte/zx_drm_drv.c +2 -2
index 11ef17c2d1c1..5b6f1eda52e0 100644
@@ -114,7 +114,7 @@ static int zx_drm_bind(struct device *dev)
 	component_unbind_all(dev, drm);
 out_unregister:
 	dev_set_drvdata(dev, NULL);
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 	return ret;
 }
 
@@ -127,7 +127,7 @@ static void zx_drm_unbind(struct device *dev)
 	drm_mode_config_cleanup(drm);
 	component_unbind_all(dev, drm);
 	dev_set_drvdata(dev, NULL);
-	drm_dev_unref(drm);
+	drm_dev_put(drm);
 }
 
 static const struct component_master_ops zx_drm_master_ops = {
#14 lore raw

Re: [PATCH 3/9] drm: replace "drm_dev_unref" function with "drm_dev_put"

In reply to Fernando Ramos
Quoted 4 lines · Fernando Ramos

This patch unifies the naming of DRM functions for reference counting as requested on Documentation/gpu/todo.rst

Quoted 9 lines
---
 drivers/gpu/drm/arc/arcpgu_drv.c             | 4 ++--
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
 drivers/gpu/drm/etnaviv/etnaviv_drv.c        | 4 ++--
 drivers/gpu/drm/mxsfb/mxsfb_drv.c            | 4 ++--
 drivers/gpu/drm/rcar-du/rcar_du_drv.c        | 2 +-
 drivers/gpu/drm/shmobile/shmob_drm_drv.c     | 4 ++--
 drivers/gpu/drm/tve200/tve200_drv.c          | 4 ++--
 drivers/gpu/drm/zte/zx_drm_drv.c             | 4 ++--

We have already queued a patch [1] from Thomas Zimmermann for zx_drm_drv.

Shawn

[1] https://patchwork.kernel.org/patch/10615837/
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#15 lore raw

Re: [PATCH 3/9] drm: replace "drm_dev_unref" function with "drm_dev_put"

In reply to Fernando Ramos
Quoted 4 lines · Fernando Ramos

This patch unifies the naming of DRM functions for reference counting as requested on Documentation/gpu/todo.rst

Quoted 9 lines
---
 drivers/gpu/drm/arc/arcpgu_drv.c             | 4 ++--
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
 drivers/gpu/drm/etnaviv/etnaviv_drv.c        | 4 ++--
 drivers/gpu/drm/mxsfb/mxsfb_drv.c            | 4 ++--
 drivers/gpu/drm/rcar-du/rcar_du_drv.c        | 2 +-
 drivers/gpu/drm/shmobile/shmob_drm_drv.c     | 4 ++--
 drivers/gpu/drm/tve200/tve200_drv.c          | 4 ++--
 drivers/gpu/drm/zte/zx_drm_drv.c             | 4 ++--

We have already queued a patch [1] from Thomas Zimmermann for zx_drm_drv.

Shawn

[1] https://patchwork.kernel.org/patch/10615837/

#17 lore raw

PATCH 4/9 drm: remove deprecated "drm_dev_unref" function

In reply to Fernando Ramos

There are no more places where this (deprecated) function is being used from, thus it can now be removed.

---
 drivers/gpu/drm/drm_drv.c | 13 -------------
 include/drm/drm_drv.h     |  1 -
 2 files changed, 14 deletions(-)
drivers/gpu/drm/drm_drv.c +0 -13
index 36e8e9cbec52..22c8f8252207 100644
@@ -706,19 +706,6 @@ void drm_dev_put(struct drm_device *dev)
 }
 EXPORT_SYMBOL(drm_dev_put);
 
-/**
- * drm_dev_unref - Drop reference of a DRM device
- * @dev: device to drop reference of or NULL
- *
- * This is a compatibility alias for drm_dev_put() and should not be used by new
- * code.
- */
-void drm_dev_unref(struct drm_device *dev)
-{
-	drm_dev_put(dev);
-}
-EXPORT_SYMBOL(drm_dev_unref);
-
 static int create_compat_control_link(struct drm_device *dev)
 {
 	struct drm_minor *minor;
include/drm/drm_drv.h +0 -1
index 3199ef70c007..abac47c10f1d 100644
@@ -621,7 +621,6 @@ void drm_dev_unregister(struct drm_device *dev);
 
 void drm_dev_get(struct drm_device *dev);
 void drm_dev_put(struct drm_device *dev);
-void drm_dev_unref(struct drm_device *dev);
 void drm_put_dev(struct drm_device *dev);
 bool drm_dev_enter(struct drm_device *dev, int *idx);
 void drm_dev_exit(int idx);
Signature · 1 line
2.19.1
#18 lore raw

Re: [PATCH 4/9] drm: remove deprecated "drm_dev_unref" function

Quoted 4 lines · Fernando Ramos

There are no more places where this (deprecated) function is being used from, thus it can now be removed.

Patch applied.

Yours,
Linus Walleij

#19 lore raw

PATCH 5/9 drm: replace "drm_connector_unreference" with "drm_connector_put"

In reply to Fernando Ramos

This patch unifies the naming of DRM functions for reference counting as requested on Documentation/gpu/todo.rst

---
 drivers/gpu/drm/bridge/tc358764.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/tc358764.c +1 -1
index ee6b98efa9c2..afd491018bfc 100644
@@ -379,7 +379,7 @@ static void tc358764_detach(struct drm_bridge *bridge)
 	drm_fb_helper_remove_one_connector(drm->fb_helper, &ctx->connector);
 	drm_panel_detach(ctx->panel);
 	ctx->panel = NULL;
-	drm_connector_unreference(&ctx->connector);
+	drm_connector_put(&ctx->connector);
 }
 
 static const struct drm_bridge_funcs tc358764_bridge_funcs = {
Signature · 1 line
2.19.1
#20 lore raw

Re: [PATCH 5/9] drm: replace "drm_connector_unreference" with "drm_connector_put"

Quoted 4 lines · Fernando Ramos

This patch unifies the naming of DRM functions for reference counting as requested on Documentation/gpu/todo.rst

Patch applied.

Yours,
Linus Walleij

#21 lore raw

PATCH 6/9 drm: remove deprecated "drm_connector_[un]reference" functions

In reply to Fernando Ramos

There are no more places where this (deprecated) function is being used from, thus it can now be removed.

---
 include/drm/drm_connector.h | 24 ------------------------
 1 file changed, 24 deletions(-)
include/drm/drm_connector.h +0 -24
index 9ccad6b062f2..b91b206f1665 100644
@@ -1191,30 +1191,6 @@ static inline void drm_connector_put(struct drm_connector *connector)
 	drm_mode_object_put(&connector->base);
 }
 
-/**
- * drm_connector_reference - acquire a connector reference
- * @connector: DRM connector
- *
- * This is a compatibility alias for drm_connector_get() and should not be
- * used by new code.
- */
-static inline void drm_connector_reference(struct drm_connector *connector)
-{
-	drm_connector_get(connector);
-}
-
-/**
- * drm_connector_unreference - release a connector reference
- * @connector: DRM connector
- *
- * This is a compatibility alias for drm_connector_put() and should not be
- * used by new code.
- */
-static inline void drm_connector_unreference(struct drm_connector *connector)
-{
-	drm_connector_put(connector);
-}
-
 /**
  * drm_connector_is_unregistered - has the connector been unregistered from
  * userspace?
Signature · 1 line
2.19.1
Reviewed-by on v1 6/9
#22 lore raw

Re: [PATCH 6/9] drm: remove deprecated "drm_connector_[un]reference" functions

Quoted 45 lines · Fernando Ramos

There are no more places where this (deprecated) function is being used from, thus it can now be removed.

---
 include/drm/drm_connector.h | 24 ------------------------
 1 file changed, 24 deletions(-)
include/drm/drm_connector.h +0 -24
index 9ccad6b062f2..b91b206f1665 100644
@@ -1191,30 +1191,6 @@ static inline void drm_connector_put(struct
 drm_connector *connector)
 	drm_mode_object_put(&connector->base);
 }
 
-/**
- * drm_connector_reference - acquire a connector reference
- * @connector: DRM connector
- *
- * This is a compatibility alias for drm_connector_get() and should not be
- * used by new code.
- */
-static inline void drm_connector_reference(struct drm_connector *connector)
-{
-	drm_connector_get(connector);
-}
-
-/**
- * drm_connector_unreference - release a connector reference
- * @connector: DRM connector
- *
- * This is a compatibility alias for drm_connector_put() and should not be
- * used by new code.
- */
-static inline void drm_connector_unreference(struct drm_connector
 *connector)
-{
-	drm_connector_put(connector);
-}
-
 /**

* drm_connector_is_unregistered - has the connector been unregistered from
* userspace?

Signature · 2 lines
Cheers,
	Lyude Paul
#24 lore raw

PATCH 7/9 drm: remove deprecated "drm_framebuffer_[un]reference" functions

In reply to Fernando Ramos

There are no more places where this (deprecated) function is being used from, thus it can now be removed.

---
 include/drm/drm_framebuffer.h | 24 ------------------------
 1 file changed, 24 deletions(-)
include/drm/drm_framebuffer.h +0 -24
index c50502c656e5..c94acedfb08e 100644
@@ -240,30 +240,6 @@ static inline void drm_framebuffer_put(struct drm_framebuffer *fb)
 	drm_mode_object_put(&fb->base);
 }
 
-/**
- * drm_framebuffer_reference - acquire a framebuffer reference
- * @fb: DRM framebuffer
- *
- * This is a compatibility alias for drm_framebuffer_get() and should not be
- * used by new code.
- */
-static inline void drm_framebuffer_reference(struct drm_framebuffer *fb)
-{
-	drm_framebuffer_get(fb);
-}
-
-/**
- * drm_framebuffer_unreference - release a framebuffer reference
- * @fb: DRM framebuffer
- *
- * This is a compatibility alias for drm_framebuffer_put() and should not be
- * used by new code.
- */
-static inline void drm_framebuffer_unreference(struct drm_framebuffer *fb)
-{
-	drm_framebuffer_put(fb);
-}
-
 /**
  * drm_framebuffer_read_refcount - read the framebuffer reference count.
  * @fb: framebuffer
Signature · 1 line
2.19.1
#25 lore raw

Re: [PATCH 7/9] drm: remove deprecated "drm_framebuffer_[un]reference" functions

Quoted 4 lines · Fernando Ramos

There are no more places where this (deprecated) function is being used from, thus it can now be removed.

Patch applied.

Yours,
Linus Walleij

#26 lore raw

PATCH 8/9 drm: remove no longer needed drm-get-put coccinelle script

In reply to Fernando Ramos

The coccinelle script was used to rename some (deprecated) functions which no longer exist now.

---
 scripts/coccinelle/api/drm-get-put.cocci | 78 ------------------------
 1 file changed, 78 deletions(-)
 delete mode 100644 scripts/coccinelle/api/drm-get-put.cocci
scripts/coccinelle/api/drm-get-put.cocci deleted +0 -78
deleted file mode 100644
index 3a09c97ad87d..000000000000
@@ -1,78 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-///
-/// Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference() and
-/// drm_*_unreference() helpers.
-///
-// Confidence: High
-// Copyright: (C) 2017 NVIDIA Corporation
-// Options: --no-includes --include-headers
-//
-
-virtual patch
-virtual report
-
-@depends on patch@
-expression object;
-@@
-
-(
-- drm_connector_reference(object)
-+ drm_connector_get(object)
-|
-- drm_connector_unreference(object)
-+ drm_connector_put(object)
-|
-- drm_framebuffer_reference(object)
-+ drm_framebuffer_get(object)
-|
-- drm_framebuffer_unreference(object)
-+ drm_framebuffer_put(object)
-|
-- drm_gem_object_reference(object)
-+ drm_gem_object_get(object)
-|
-- drm_gem_object_unreference(object)
-+ drm_gem_object_put(object)
-|
-- __drm_gem_object_unreference(object)
-+ __drm_gem_object_put(object)
-|
-- drm_gem_object_unreference_unlocked(object)
-+ drm_gem_object_put_unlocked(object)
-|
-- drm_dev_unref(object)
-+ drm_dev_put(object)
-)
-
-@r depends on report@
-expression object;
-position p;
-@@
-
-(
-drm_connector_unreference@p(object)
-|
-drm_connector_reference@p(object)
-|
-drm_framebuffer_unreference@p(object)
-|
-drm_framebuffer_reference@p(object)
-|
-drm_gem_object_unreference@p(object)
-|
-drm_gem_object_reference@p(object)
-|
-__drm_gem_object_unreference(object)
-|
-drm_gem_object_unreference_unlocked(object)
-|
-drm_dev_unref@p(object)
-)
-
-@script:python depends on report@
-object << r.object;
-p << r.p;
-@@
-
-msg="WARNING: use get/put helpers to reference and dereference %s" % (object)
-coccilib.report.print_report(p[0], msg)
Signature · 1 line
2.19.1
Acked-by on v1 8/9
#27 lore raw

Re: [PATCH 8/9] drm: remove no longer needed drm-get-put coccinelle script

Quoted 4 lines · Fernando Ramos

The coccinelle script was used to rename some (deprecated) functions which no longer exist now.

Quoted 93 lines
---
 scripts/coccinelle/api/drm-get-put.cocci | 78 ------------------------
 1 file changed, 78 deletions(-)
 delete mode 100644 scripts/coccinelle/api/drm-get-put.cocci
scripts/coccinelle/api/drm-get-put.cocci deleted +0 -79
deleted file mode 100644
index 3a09c97ad87d..000000000000
@@ -1,78 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-///
-/// Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference() and
-/// drm_*_unreference() helpers.
-///
-// Confidence: High
-// Copyright: (C) 2017 NVIDIA Corporation
-// Options: --no-includes --include-headers
-//
-
-virtual patch
-virtual report
-
- at depends on patch@
-expression object;
-@@
-
-(
-- drm_connector_reference(object)
-+ drm_connector_get(object)
-|
-- drm_connector_unreference(object)
-+ drm_connector_put(object)
-|
-- drm_framebuffer_reference(object)
-+ drm_framebuffer_get(object)
-|
-- drm_framebuffer_unreference(object)
-+ drm_framebuffer_put(object)
-|
-- drm_gem_object_reference(object)
-+ drm_gem_object_get(object)
-|
-- drm_gem_object_unreference(object)
-+ drm_gem_object_put(object)
-|
-- __drm_gem_object_unreference(object)
-+ __drm_gem_object_put(object)
-|
-- drm_gem_object_unreference_unlocked(object)
-+ drm_gem_object_put_unlocked(object)
-|
-- drm_dev_unref(object)
-+ drm_dev_put(object)
-)
-
- at r depends on report@
-expression object;
-position p;
-@@
-
-(
-drm_connector_unreference at p(object)
-|
-drm_connector_reference at p(object)
-|
-drm_framebuffer_unreference at p(object)
-|
-drm_framebuffer_reference at p(object)
-|
-drm_gem_object_unreference at p(object)
-|
-drm_gem_object_reference at p(object)
-|
-__drm_gem_object_unreference(object)
-|
-drm_gem_object_unreference_unlocked(object)
-|
-drm_dev_unref at p(object)
-)
-
- at script:python depends on report@
-object << r.object;
-p << r.p;
-@@
-
-msg="WARNING: use get/put helpers to reference and dereference %s" % (object)
-coccilib.report.print_report(p[0], msg)
--

2.19.1

Acked-by on v1 8/9
#28 lore raw

Re: [PATCH 8/9] drm: remove no longer needed drm-get-put coccinelle script

In reply to Fernando Ramos
Quoted 4 lines · Fernando Ramos

The coccinelle script was used to rename some (deprecated) functions which no longer exist now.

Quoted 93 lines
---
 scripts/coccinelle/api/drm-get-put.cocci | 78 ------------------------
 1 file changed, 78 deletions(-)
 delete mode 100644 scripts/coccinelle/api/drm-get-put.cocci
scripts/coccinelle/api/drm-get-put.cocci deleted +0 -79
deleted file mode 100644
index 3a09c97ad87d..000000000000
@@ -1,78 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-///
-/// Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference() and
-/// drm_*_unreference() helpers.
-///
-// Confidence: High
-// Copyright: (C) 2017 NVIDIA Corporation
-// Options: --no-includes --include-headers
-//
-
-virtual patch
-virtual report
-
-@depends on patch@
-expression object;
-@@
-
-(
-- drm_connector_reference(object)
-+ drm_connector_get(object)
-|
-- drm_connector_unreference(object)
-+ drm_connector_put(object)
-|
-- drm_framebuffer_reference(object)
-+ drm_framebuffer_get(object)
-|
-- drm_framebuffer_unreference(object)
-+ drm_framebuffer_put(object)
-|
-- drm_gem_object_reference(object)
-+ drm_gem_object_get(object)
-|
-- drm_gem_object_unreference(object)
-+ drm_gem_object_put(object)
-|
-- __drm_gem_object_unreference(object)
-+ __drm_gem_object_put(object)
-|
-- drm_gem_object_unreference_unlocked(object)
-+ drm_gem_object_put_unlocked(object)
-|
-- drm_dev_unref(object)
-+ drm_dev_put(object)
-)
-
-@r depends on report@
-expression object;
-position p;
-@@
-
-(
-drm_connector_unreference@p(object)
-|
-drm_connector_reference@p(object)
-|
-drm_framebuffer_unreference@p(object)
-|
-drm_framebuffer_reference@p(object)
-|
-drm_gem_object_unreference@p(object)
-|
-drm_gem_object_reference@p(object)
-|
-__drm_gem_object_unreference(object)
-|
-drm_gem_object_unreference_unlocked(object)
-|
-drm_dev_unref@p(object)
-)
-
-@script:python depends on report@
-object << r.object;
-p << r.p;
-@@
-
-msg="WARNING: use get/put helpers to reference and dereference %s" % (object)
-coccilib.report.print_report(p[0], msg)
--

2.19.1

#30 lore raw

PATCH 9/9 docs: drm: remove no longer relevant TODO entry

In reply to Fernando Ramos

This entry asked to rename all drm core "*_reference/_unrefence" functions to "*_get/_put".

Now that this task is complete, we can remove this entry from the TODO list.

---
 Documentation/gpu/todo.rst | 17 -----------------
 1 file changed, 17 deletions(-)
Documentation/gpu/todo.rst +0 -17
index 77c2b3c25565..85433af65442 100644
@@ -28,23 +28,6 @@ them, but also all the virtual ones used by KVM, so everyone qualifies).
 
 Contact: Daniel Vetter, Thierry Reding, respective driver maintainers
 
-Switch from reference/unreference to get/put
---------------------------------------------
-
-For some reason DRM core uses ``reference``/``unreference`` suffixes for
-refcounting functions, but kernel uses ``get``/``put`` (e.g.
-``kref_get``/``put()``). It would be good to switch over for consistency, and
-it's shorter. Needs to be done in 3 steps for each pair of functions:
-
-* Create new ``get``/``put`` functions, define the old names as compatibility
-  wrappers
-* Switch over each file/driver using a cocci-generated spatch.
-* Once all users of the old names are gone, remove them.
-
-This way drivers/patches in the progress of getting merged won't break.
-
-Contact: Daniel Vetter
-
 Convert existing KMS drivers to atomic modesetting
 --------------------------------------------------
 
Signature · 1 line
2.19.1
#31 lore raw

Re: [PATCH 9/9] docs: drm: remove no longer relevant TODO entry

Quoted 7 lines · Fernando Ramos

This entry asked to rename all drm core "*_reference/_unrefence" functions to "*_get/_put".

Now that this task is complete, we can remove this entry from the TODO list.

Patch applied.

Yours,
Linus Walleij

#33 lore raw
Quoted 8 lines · Linus Walleij
Quoted 3 lines · Fernando Ramos

One of the things in the DRM TODO list ("Documentation/gpu/todo.rst") was to "switch from reference/unreference to get/put". That's what this patch series is about.

The series:

Since your reviewed it all, and there's a pile of acks for the driver parts too: Want to go ahead and apply it too?

Thanks, Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#34 lore raw

Hi Daniel,

Quoted 11 lines · On Wednesday, 21 November 2018 11:42:33 EET Daniel Vetter wrote:
Quoted 7 lines · Linus Walleij
Quoted 3 lines · Fernando Ramos

One of the things in the DRM TODO list ("Documentation/gpu/todo.rst") was to "switch from reference/unreference to get/put". That's what this patch series is about.

The series:

Since your reviewed it all, and there's a pile of acks for the driver parts too: Want to go ahead and apply it too?

Please remember to give at least a week to reviewers, especially with LPC last week.

Signature · 10 lines
Regards,

Laurent Pinchart



_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#35 lore raw
Quoted 9 lines · Laurent Pinchart

Hi Daniel,

Quoted 6 lines · On Wednesday, 21 November 2018 11:42:33 EET Daniel Vetter wrote:
Quoted 5 lines · Linus Walleij
Quoted 3 lines · Fernando Ramos

One of the things in the DRM TODO list ("Documentation/gpu/todo.rst") was to "switch from reference/unreference to get/put". That's what this patch series is about.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

The series:

Since your reviewed it all, and there's a pile of acks for the driver parts too: Want to go ahead and apply it too?

Please remember to give at least a week to reviewers, especially with LPC last week.

I think for this undisputed cocci series waiting for everyone is not needed. There's really not much the driver-specific reviewer perspective would help here.

In general I do agree though, if there's something driver maintainers can have better insight on.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#36 lore raw
In reply to Laurent Pinchart
Quoted 9 lines · Laurent Pinchart

Hi Daniel,

Quoted 6 lines · On Wednesday, 21 November 2018 11:42:33 EET Daniel Vetter wrote:
Quoted 5 lines · Linus Walleij
Quoted 3 lines · Fernando Ramos

One of the things in the DRM TODO list ("Documentation/gpu/todo.rst") was to "switch from reference/unreference to get/put". That's what this patch series is about.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

The series:

Since your reviewed it all, and there's a pile of acks for the driver parts too: Want to go ahead and apply it too?

Please remember to give at least a week to reviewers, especially with LPC last week.

I think for this undisputed cocci series waiting for everyone is not needed. There's really not much the driver-specific reviewer perspective would help here.

In general I do agree though, if there's something driver maintainers can have better insight on.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#37 lore raw
In reply to Daniel Vetter

Hi Daniel,

Quoted 11 lines · On Wednesday, 21 November 2018 11:42:33 EET Daniel Vetter wrote:
Quoted 7 lines · Linus Walleij
Quoted 3 lines · Fernando Ramos

One of the things in the DRM TODO list ("Documentation/gpu/todo.rst") was to "switch from reference/unreference to get/put". That's what this patch series is about.

The series:

Since your reviewed it all, and there's a pile of acks for the driver parts too: Want to go ahead and apply it too?

Please remember to give at least a week to reviewers, especially with LPC last week.

Signature · 3 lines
Regards,

Laurent Pinchart
#38 lore raw
In reply to Daniel Vetter
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Linus Walleij
Quoted 3 lines · Fernando Ramos

One of the things in the DRM TODO list ("Documentation/gpu/todo.rst") was to "switch from reference/unreference to get/put". That's what this patch series is about.

Quoted 5 lines
Quoted 2 lines

The series:

Since your reviewed it all, and there's a pile of acks for the driver parts too: Want to go ahead and apply it too?

OK I did... the git was quirky, patches changes around under my feet and dim started to complain about problems with commits that weren't even mine.

It was especially scary.

But I think I managed to apply the patches and push the branch now.

Yours,
Linus Walleij

#39 lore raw
Quoted 14 lines · Linus Walleij
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Linus Walleij
Quoted 3 lines · Fernando Ramos

One of the things in the DRM TODO list ("Documentation/gpu/todo.rst") was to "switch from reference/unreference to get/put". That's what this patch series is about.

Quoted 5 lines
Quoted 2 lines

The series:

Since your reviewed it all, and there's a pile of acks for the driver parts too: Want to go ahead and apply it too?

Quoted 8 lines

OK I did... the git was quirky, patches changes around under my feet and dim started to complain about problems with commits that weren't even mine.

It was especially scary.

But I think I managed to apply the patches and push the branch now.

Except when you're racing with someone else you should only see conflicts with stuff you've just pushed. Or if someone forgot to fix up their mess. What was the conflict? Looking at the git-rerere log I'm not exactly sure what happened ... Looks like only one of the patches didn't apply cleanly anymore because it was somewhat outdated. Otherwise nothing from you. -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#40 lore raw
Quoted 10 lines · Daniel Vetter
Quoted 4 lines · Linus Walleij

It was especially scary.

But I think I managed to apply the patches and push the branch now.

Except when you're racing with someone else you should only see conflicts with stuff you've just pushed. Or if someone forgot to fix up their mess. What was the conflict?

dim push-branches was complaining that one of the commits was missing the proper committer sign-off, it was the bottom commit under mine (IIRC "drm/atomic-helper: WARN if fake_commit->hw_done is not completed as expected")
and dim update-branches seemed to rebase and fix up my patches and then everything was fine.

I just felt slightly out of control :D

Yours,
Linus Walleij

#41 lore raw
Quoted 13 lines · Linus Walleij
Quoted 10 lines · Daniel Vetter
Quoted 4 lines · Linus Walleij

It was especially scary.

But I think I managed to apply the patches and push the branch now.

Except when you're racing with someone else you should only see conflicts with stuff you've just pushed. Or if someone forgot to fix up their mess. What was the conflict?

Quoted 6 lines

dim push-branches was complaining that one of the commits was missing the proper committer sign-off, it was the bottom commit under mine (IIRC "drm/atomic-helper: WARN if fake_commit->hw_done is not completed as expected")
and dim update-branches seemed to rebase and fix up my patches and then everything was fine.

This sounds like you (or dim?) accidentaly amended that commit (which changes the committer and results in the warning), and a rebase would indeed have fixed that. If the first patch conflicts this can happen because dim apply-branch doesn't bail out correctly. Or at least did in the past, I recently fixed that in

commit ee299e510ae468aab27610bcbc4fdd4de932f74b

Author: Daniel Vetter <[email protected]>
Date:   Wed Oct 17 08:53:00 2018 +0200

dim: make apply-patch fail again

Quoted 1 line

I just felt slightly out of control :D

If your dim didn't have the above commit and you had a conflict it's all explained. Otherwise I'm not sure what's been going on ... -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#42 lore raw
In reply to Linus Walleij
Quoted 13 lines · Linus Walleij
Quoted 10 lines · Daniel Vetter
Quoted 4 lines · Linus Walleij

It was especially scary.

But I think I managed to apply the patches and push the branch now.

Except when you're racing with someone else you should only see conflicts with stuff you've just pushed. Or if someone forgot to fix up their mess. What was the conflict?

Quoted 6 lines

dim push-branches was complaining that one of the commits was missing the proper committer sign-off, it was the bottom commit under mine (IIRC "drm/atomic-helper: WARN if fake_commit->hw_done is not completed as expected")
and dim update-branches seemed to rebase and fix up my patches and then everything was fine.

This sounds like you (or dim?) accidentaly amended that commit (which changes the committer and results in the warning), and a rebase would indeed have fixed that. If the first patch conflicts this can happen because dim apply-branch doesn't bail out correctly. Or at least did in the past, I recently fixed that in

commit ee299e510ae468aab27610bcbc4fdd4de932f74b

Author: Daniel Vetter <[email protected]>
Date:   Wed Oct 17 08:53:00 2018 +0200

dim: make apply-patch fail again

Quoted 1 line

I just felt slightly out of control :D

If your dim didn't have the above commit and you had a conflict it's all explained. Otherwise I'm not sure what's been going on ... -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#43 lore raw
In reply to Linus Walleij
Quoted 14 lines · Linus Walleij
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Linus Walleij
Quoted 3 lines · Fernando Ramos

One of the things in the DRM TODO list ("Documentation/gpu/todo.rst") was to "switch from reference/unreference to get/put". That's what this patch series is about.

Quoted 5 lines
Quoted 2 lines

The series:

Since your reviewed it all, and there's a pile of acks for the driver parts too: Want to go ahead and apply it too?

Quoted 8 lines

OK I did... the git was quirky, patches changes around under my feet and dim started to complain about problems with commits that weren't even mine.

It was especially scary.

But I think I managed to apply the patches and push the branch now.

Except when you're racing with someone else you should only see conflicts with stuff you've just pushed. Or if someone forgot to fix up their mess. What was the conflict? Looking at the git-rerere log I'm not exactly sure what happened ... Looks like only one of the patches didn't apply cleanly anymore because it was somewhat outdated. Otherwise nothing from you. -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#44 lore raw
In reply to Linus Walleij
Quoted 8 lines · Linus Walleij
Quoted 3 lines · Fernando Ramos

One of the things in the DRM TODO list ("Documentation/gpu/todo.rst") was to "switch from reference/unreference to get/put". That's what this patch series is about.

The series:

Since your reviewed it all, and there's a pile of acks for the driver parts too: Want to go ahead and apply it too?

Thanks, Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch