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
--
2.19.1
This patch unifies the naming of DRM functions for reference counting as
requested on Documentation/gpu/todo.rst
Signed-off-by: Fernando Ramos <[email protected]>
---
drivers/gpu/drm/bochs/bochs_mm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c
index a61c1ecb2bdc..e6ccf7fa92d4 100644
--- a/drivers/gpu/drm/bochs/bochs_mm.c
+++ b/drivers/gpu/drm/bochs/bochs_mm.c
@@ -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;
}
--
2.19.1
There are no more places where these (deprecated) functions are being
used from, thus they can now be removed.
Signed-off-by: Fernando Ramos <[email protected]>
---
include/drm/drm_gem.h | 50 -------------------------------------------
1 file changed, 50 deletions(-)
diff --git a/include/drm/drm_gem.h b/include/drm/drm_gem.h
index 3583b98a1718..daa34328b5be 100644
--- a/include/drm/drm_gem.h
+++ b/include/drm/drm_gem.h
@@ -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);
--
2.19.1
There are no more places where this (deprecated) function is being
used from, thus it can now be removed.
Signed-off-by: Fernando Ramos <[email protected]>
---
include/drm/drm_connector.h | 24 ------------------------
1 file changed, 24 deletions(-)
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 9ccad6b062f2..b91b206f1665 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -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?
--
2.19.1
There are no more places where this (deprecated) function is being used
from, thus it can now be removed.
Signed-off-by: Fernando Ramos <[email protected]>
---
include/drm/drm_framebuffer.h | 24 ------------------------
1 file changed, 24 deletions(-)
diff --git a/include/drm/drm_framebuffer.h b/include/drm/drm_framebuffer.h
index c50502c656e5..c94acedfb08e 100644
--- a/include/drm/drm_framebuffer.h
+++ b/include/drm/drm_framebuffer.h
@@ -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
--
2.19.1
The coccinelle script was used to rename some (deprecated) functions
which no longer exist now.
Signed-off-by: Fernando Ramos <[email protected]>
---
scripts/coccinelle/api/drm-get-put.cocci | 78 ------------------------
1 file changed, 78 deletions(-)
delete mode 100644 scripts/coccinelle/api/drm-get-put.cocci
diff --git a/scripts/coccinelle/api/drm-get-put.cocci b/scripts/coccinelle/api/drm-get-put.cocci
deleted file mode 100644
index 3a09c97ad87d..000000000000
--- a/scripts/coccinelle/api/drm-get-put.cocci
+++ /dev/null
@@ -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
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.
Signed-off-by: Fernando Ramos <[email protected]>
---
Documentation/gpu/todo.rst | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 77c2b3c25565..85433af65442 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -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
--------------------------------------------------
--
2.19.1
This patch unifies the naming of DRM functions for reference counting as
requested on Documentation/gpu/todo.rst
Signed-off-by: Fernando Ramos <[email protected]>
---
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(-)
diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
index f067de4e1e82..dcb06d4e9135 100644
--- a/drivers/gpu/drm/arc/arcpgu_drv.c
+++ b/drivers/gpu/drm/arc/arcpgu_drv.c
@@ -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;
}
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
index 843cac222e60..f8da51a63e2f 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
@@ -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;
}
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index 83c1f46670bf..52802e6049e0 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -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 = {
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index 2393e6d16ffd..88ba003979e6 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -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;
}
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
index 084f58df4a8c..c7fe2433ab9e 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
@@ -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;
}
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
index 6ececad6f845..8554102a6ead 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
@@ -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;
}
diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c
index 72efcecb44f7..28e2d03c0ccf 100644
--- a/drivers/gpu/drm/tve200/tve200_drv.c
+++ b/drivers/gpu/drm/tve200/tve200_drv.c
@@ -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;
}
diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c
index 11ef17c2d1c1..5b6f1eda52e0 100644
--- a/drivers/gpu/drm/zte/zx_drm_drv.c
+++ b/drivers/gpu/drm/zte/zx_drm_drv.c
@@ -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 = {
--
2.19.1
There are no more places where this (deprecated) function is being used
from, thus it can now be removed.
Signed-off-by: Fernando Ramos <[email protected]>
---
drivers/gpu/drm/drm_drv.c | 13 -------------
include/drm/drm_drv.h | 1 -
2 files changed, 14 deletions(-)
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 36e8e9cbec52..22c8f8252207 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -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;
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index 3199ef70c007..abac47c10f1d 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -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);
--
2.19.1
This patch unifies the naming of DRM functions for reference counting as
requested on Documentation/gpu/todo.rst
Signed-off-by: Fernando Ramos <[email protected]>
---
drivers/gpu/drm/bridge/tc358764.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/tc358764.c b/drivers/gpu/drm/bridge/tc358764.c
index ee6b98efa9c2..afd491018bfc 100644
--- a/drivers/gpu/drm/bridge/tc358764.c
+++ b/drivers/gpu/drm/bridge/tc358764.c
@@ -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 = {
--
2.19.1
On Thu, Nov 15, 2018 at 11:17 PM Fernando Ramos <[email protected]> wrote:
> 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:
Reviewed-by: Linus Walleij <[email protected]>
Yours,
Linus Walleij
On Thu, 15 Nov 2018 23:16:23 +0100
Fernando Ramos <[email protected]> wrote:
> This patch unifies the naming of DRM functions for reference counting as
> requested on Documentation/gpu/todo.rst
>
> Signed-off-by: Fernando Ramos <[email protected]>
> ---
> drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++--
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++--
For the Atmel HLCDC driver
Acked-by: Boris Brezillon <[email protected]>
> 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(-)
>
> diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
> index f067de4e1e82..dcb06d4e9135 100644
> --- a/drivers/gpu/drm/arc/arcpgu_drv.c
> +++ b/drivers/gpu/drm/arc/arcpgu_drv.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> index 843cac222e60..f8da51a63e2f 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> index 83c1f46670bf..52802e6049e0 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> @@ -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 = {
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> index 2393e6d16ffd..88ba003979e6 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> index 084f58df4a8c..c7fe2433ab9e 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> index 6ececad6f845..8554102a6ead 100644
> --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c
> index 72efcecb44f7..28e2d03c0ccf 100644
> --- a/drivers/gpu/drm/tve200/tve200_drv.c
> +++ b/drivers/gpu/drm/tve200/tve200_drv.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c
> index 11ef17c2d1c1..5b6f1eda52e0 100644
> --- a/drivers/gpu/drm/zte/zx_drm_drv.c
> +++ b/drivers/gpu/drm/zte/zx_drm_drv.c
> @@ -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 = {
Am Donnerstag, den 15.11.2018, 23:16 +0100 schrieb Fernando Ramos:
> This patch unifies the naming of DRM functions for reference counting as
> requested on Documentation/gpu/todo.rst
>
> > Signed-off-by: Fernando Ramos <[email protected]>
> ---
> 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
> 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(-)
>
> diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
> index f067de4e1e82..dcb06d4e9135 100644
> --- a/drivers/gpu/drm/arc/arcpgu_drv.c
> +++ b/drivers/gpu/drm/arc/arcpgu_drv.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> index 843cac222e60..f8da51a63e2f 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> index 83c1f46670bf..52802e6049e0 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> @@ -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 = {
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> index 2393e6d16ffd..88ba003979e6 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> index 084f58df4a8c..c7fe2433ab9e 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> index 6ececad6f845..8554102a6ead 100644
> --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c
> index 72efcecb44f7..28e2d03c0ccf 100644
> --- a/drivers/gpu/drm/tve200/tve200_drv.c
> +++ b/drivers/gpu/drm/tve200/tve200_drv.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c
> index 11ef17c2d1c1..5b6f1eda52e0 100644
> --- a/drivers/gpu/drm/zte/zx_drm_drv.c
> +++ b/drivers/gpu/drm/zte/zx_drm_drv.c
> @@ -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 = {
On Fri, Nov 16, 2018, at 11:15 AM, Lucas Stach wrote:
> Am Donnerstag, den 15.11.2018, 23:16 +0100 schrieb Fernando Ramos:
> > This patch unifies the naming of DRM functions for reference counting as
> > requested on Documentation/gpu/todo.rst
> >
> > > Signed-off-by: Fernando Ramos <[email protected]>
> > ---
> > 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
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!
On Thu, 15 Nov 2018, Fernando Ramos wrote:
> The coccinelle script was used to rename some (deprecated) functions
> which no longer exist now.
>
> Signed-off-by: Fernando Ramos <[email protected]>
Acked-by: Julia Lawall <[email protected]>
> ---
> scripts/coccinelle/api/drm-get-put.cocci | 78 ------------------------
> 1 file changed, 78 deletions(-)
> delete mode 100644 scripts/coccinelle/api/drm-get-put.cocci
>
> diff --git a/scripts/coccinelle/api/drm-get-put.cocci b/scripts/coccinelle/api/drm-get-put.cocci
> deleted file mode 100644
> index 3a09c97ad87d..000000000000
> --- a/scripts/coccinelle/api/drm-get-put.cocci
> +++ /dev/null
> @@ -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
>
>
On 15.11.2018 23:16, Fernando Ramos wrote:
> This patch unifies the naming of DRM functions for reference counting as
> requested on Documentation/gpu/todo.rst
>
> Signed-off-by: Fernando Ramos <[email protected]>
> ---
> 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:
Acked-by: Stefan Agner <[email protected]>
--
Stefan
> 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(-)
>
> diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c
> index f067de4e1e82..dcb06d4e9135 100644
> --- a/drivers/gpu/drm/arc/arcpgu_drv.c
> +++ b/drivers/gpu/drm/arc/arcpgu_drv.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> index 843cac222e60..f8da51a63e2f 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> index 83c1f46670bf..52802e6049e0 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> @@ -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 = {
> diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> index 2393e6d16ffd..88ba003979e6 100644
> --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> index 084f58df4a8c..c7fe2433ab9e 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> index 6ececad6f845..8554102a6ead 100644
> --- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> +++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/tve200/tve200_drv.c
> b/drivers/gpu/drm/tve200/tve200_drv.c
> index 72efcecb44f7..28e2d03c0ccf 100644
> --- a/drivers/gpu/drm/tve200/tve200_drv.c
> +++ b/drivers/gpu/drm/tve200/tve200_drv.c
> @@ -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;
> }
> diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c
> index 11ef17c2d1c1..5b6f1eda52e0 100644
> --- a/drivers/gpu/drm/zte/zx_drm_drv.c
> +++ b/drivers/gpu/drm/zte/zx_drm_drv.c
> @@ -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 = {
On Thu, Nov 15, 2018 at 11:16:23PM +0100, Fernando Ramos wrote:
> This patch unifies the naming of DRM functions for reference counting as
> requested on Documentation/gpu/todo.rst
>
> Signed-off-by: Fernando Ramos <[email protected]>
> ---
> 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/
On Fri, 16 Nov 2018, Fernando <[email protected]> wrote:
> 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.
--
Jani Nikula, Intel Open Source Graphics Center
On Thu, Nov 15, 2018 at 11:38:35PM +0100, Linus Walleij wrote:
> On Thu, Nov 15, 2018 at 11:17 PM Fernando Ramos <[email protected]> wrote:
>
> > 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:
> Reviewed-by: Linus Walleij <[email protected]>
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
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
Reviewed-by: Lyude Paul <[email protected]>
On Thu, 2018-11-15 at 23:16 +0100, Fernando Ramos wrote:
> There are no more places where this (deprecated) function is being
> used from, thus it can now be removed.
>
> Signed-off-by: Fernando Ramos <[email protected]>
> ---
> include/drm/drm_connector.h | 24 ------------------------
> 1 file changed, 24 deletions(-)
>
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 9ccad6b062f2..b91b206f1665 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -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?
--
Cheers,
Lyude Paul
On Wed, Nov 21, 2018 at 08:21:29PM +0200, Laurent Pinchart wrote:
> Hi Daniel,
>
> On Wednesday, 21 November 2018 11:42:33 EET Daniel Vetter wrote:
> > On Thu, Nov 15, 2018 at 11:38:35PM +0100, Linus Walleij wrote:
> > > On Thu, Nov 15, 2018 at 11:17 PM Fernando Ramos wrote:
> > >> 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:
> > > Reviewed-by: Linus Walleij <[email protected]>
> >
> > 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
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
On Thu, Nov 15, 2018 at 11:17 PM Fernando Ramos <[email protected]> wrote:
> This patch unifies the naming of DRM functions for reference counting as
> requested on Documentation/gpu/todo.rst
>
> Signed-off-by: Fernando Ramos <[email protected]>
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
Signed-off-by: Thomas Zimmermann <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
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
Signed-off-by: Thomas Zimmermann <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
Going on to try and apply the rest.
Yours,
Linus Walleij
On Thu, Nov 15, 2018 at 11:17 PM Fernando Ramos <[email protected]> wrote:
> There are no more places where these (deprecated) functions are being
> used from, thus they can now be removed.
>
> Signed-off-by: Fernando Ramos <[email protected]>
Patch applied to drm-misc-next.
Yours,
Linus Walleij
On Fri, Nov 16, 2018 at 6:04 PM Fernando <[email protected]> wrote:
> 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
On Thu, Nov 15, 2018 at 11:17 PM Fernando Ramos <[email protected]> wrote:
> There are no more places where this (deprecated) function is being used
> from, thus it can now be removed.
>
> Signed-off-by: Fernando Ramos <[email protected]>
Patch applied.
Yours,
Linus Walleij
On Thu, Nov 15, 2018 at 11:17 PM Fernando Ramos <[email protected]> wrote:
> This patch unifies the naming of DRM functions for reference counting as
> requested on Documentation/gpu/todo.rst
>
> Signed-off-by: Fernando Ramos <[email protected]>
Patch applied after some collecting ACKs and tweaking.
Yours,
Linus Walleij
On Thu, Nov 15, 2018 at 11:17 PM Fernando Ramos <[email protected]> wrote:
> This patch unifies the naming of DRM functions for reference counting as
> requested on Documentation/gpu/todo.rst
>
> Signed-off-by: Fernando Ramos <[email protected]>
Patch applied.
Yours,
Linus Walleij
On Thu, Nov 15, 2018 at 11:17 PM Fernando Ramos <[email protected]> wrote:
> There are no more places where this (deprecated) function is being
> used from, thus it can now be removed.
>
> Signed-off-by: Fernando Ramos <[email protected]>
Patch applied collecting Paul's review tag.
Yours,
Linus Walleij
On Thu, Nov 15, 2018 at 11:17 PM Fernando Ramos <[email protected]> wrote:
> There are no more places where this (deprecated) function is being used
> from, thus it can now be removed.
>
> Signed-off-by: Fernando Ramos <[email protected]>
Patch applied.
Yours,
Linus Walleij
On Thu, Nov 15, 2018 at 11:18 PM Fernando Ramos <[email protected]> wrote:
> The coccinelle script was used to rename some (deprecated) functions
> which no longer exist now.
>
> Signed-off-by: Fernando Ramos <[email protected]>
Patch applied with Julia's ACK.
Yours,
Linus Walleij
On Thu, Nov 15, 2018 at 11:18 PM Fernando Ramos <[email protected]> wrote:
> 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.
>
> Signed-off-by: Fernando Ramos <[email protected]>
Patch applied.
Yours,
Linus Walleij
On Wed, Nov 21, 2018 at 10:42 AM Daniel Vetter <[email protected]> wrote:
> On Thu, Nov 15, 2018 at 11:38:35PM +0100, Linus Walleij wrote:
> > On Thu, Nov 15, 2018 at 11:17 PM Fernando Ramos <[email protected]> wrote:
> >
> > > 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:
> > Reviewed-by: Linus Walleij <[email protected]>
>
> 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
On Sat, Nov 24, 2018 at 10:17:13PM +0100, Linus Walleij wrote:
> On Wed, Nov 21, 2018 at 10:42 AM Daniel Vetter <[email protected]> wrote:
> > On Thu, Nov 15, 2018 at 11:38:35PM +0100, Linus Walleij wrote:
> > > On Thu, Nov 15, 2018 at 11:17 PM Fernando Ramos <[email protected]> wrote:
> > >
> > > > 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:
> > > Reviewed-by: Linus Walleij <[email protected]>
> >
> > 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.
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
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
On Mon, Nov 26, 2018 at 3:12 PM Daniel Vetter <[email protected]> wrote:
> On Sat, Nov 24, 2018 at 10:17:13PM +0100, Linus Walleij wrote:
> > 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
On Thu, Nov 29, 2018 at 3:45 PM Linus Walleij <[email protected]> wrote:
>
> On Mon, Nov 26, 2018 at 3:12 PM Daniel Vetter <[email protected]> wrote:
> > On Sat, Nov 24, 2018 at 10:17:13PM +0100, Linus Walleij wrote:
>
> > > 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.
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
> 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
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch