Re: [Intel-gfx] [PATCH] drm/core: Remove drm_dev_unref() and it's uses
On Thu, Apr 26, 2018 at 6:15 PM, Laurent Pinchart <laurent.pinch...@ideasonboard.com> wrote: > Hi Daniel, > > On Thursday, 26 April 2018 15:36:15 EEST Daniel Vetter wrote: >> On Thu, Apr 26, 2018 at 03:58:19PM +0530, Vaishali Thakkar wrote: >> > It's been a while since we introduced drm_dev{get/put} functions >> > to replace reference/unreference in drm subsystem for the >> > consistency purpose. So, with this patch, let's just replace >> > all current use cases of drm_dev_unref() with drm_dev_put and remove >> > the function itself. >> > >> > Coccinelle was used for mass-patching. >> > >> > Signed-off-by: Vaishali Thakkar <vthakkar1...@gmail.com> >> >> Thanks for doing this. Unfortunately drm moves pretty fast, so already a >> conflict when I tried to apply this. Some drivers are also in their own >> trees, so this might lead to more fun :-/ >> >> Can you pls split it up per-driver (just the directories under >> drivers/gpu/drm/ is enough)? Final patch to remove the function might then >> get stalled a bit ofc. > > I requested a single patch instead of splitting it per driver, you might want > to blame me for that. > >> Also can you pls update ./scripts/coccinelle/api/drm-get-put.cocci and >> remove that spatch hunk in the final patch, since we no longer need it? > > How about just rerunning the coccinelle patch when it's time to apply this ? > There's precedent for performing such automated changes, and it would ensure > that no driver is left out. I was planning to send patches to remove all remaining reference/unreference functions by the weekend [as there aren't much remaining now and I see that new drivers keeps adding them instead of new API]. So, wanted to delete whole cocci file after that. I thought of dividing a patch per function because Laurent requested to send a single patch for all files. But if we are going to split it per driver under gpu/drm, would it work if per driver patch contains all function cases? Also, would you be fine with taking a patch for removal of coccinelle file via your tree? Then I can include that in the same patchset as well. Thanks! >> > --- >> > >> > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c| 4 ++-- >> > drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++-- >> > drivers/gpu/drm/armada/armada_drv.c| 6 +++--- >> > drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++-- >> > drivers/gpu/drm/drm_drv.c | 13 - >> > drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 ++-- >> > drivers/gpu/drm/exynos/exynos_drm_drv.c| 4 ++-- >> > drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 ++-- >> > drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c| 4 ++-- >> > drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c| 8 >> > drivers/gpu/drm/i915/selftests/huge_pages.c| 2 +- >> > drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c | 2 +- >> > drivers/gpu/drm/i915/selftests/i915_gem_evict.c| 2 +- >> > drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +- >> > drivers/gpu/drm/i915/selftests/i915_gem_object.c | 2 +- >> > drivers/gpu/drm/i915/selftests/i915_request.c | 2 +- >> > drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +- >> > drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c | 2 +- >> > drivers/gpu/drm/imx/imx-drm-core.c | 4 ++-- >> > drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++--- >> > drivers/gpu/drm/msm/msm_drv.c | 8 >> > drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 ++-- >> > drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +- >> > drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++-- >> > drivers/gpu/drm/pl111/pl111_drv.c | 4 ++-- >> > drivers/gpu/drm/qxl/qxl_drv.c | 2 +- >> > drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +- >> > drivers/gpu/drm/rockchip/rockchip_drm_drv.c| 4 ++-- >> > drivers/gpu/drm/shmobile/shmob_drm_drv.c | 4 ++-- >> > drivers/gpu/drm/sti/sti_drv.c | 8 >> > drivers/gpu/drm/stm/drv.c | 4 ++-- >> > drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++-- >> > drivers/gpu/drm/tegra/drm.c| 4 ++-- >> > drivers/gpu/drm/tinydrm/core/tinydrm-core.c| 6 +++--- >> > drivers/gpu/drm/tve200/tve200_drv.c|
[PATCH] drm/core: Remove drm_dev_unref() and it's uses
It's been a while since we introduced drm_dev{get/put} functions to replace reference/unreference in drm subsystem for the consistency purpose. So, with this patch, let's just replace all current use cases of drm_dev_unref() with drm_dev_put and remove the function itself. Coccinelle was used for mass-patching. Signed-off-by: Vaishali Thakkar <vthakkar1...@gmail.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c| 4 ++-- drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++-- drivers/gpu/drm/armada/armada_drv.c| 6 +++--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 4 ++-- drivers/gpu/drm/drm_drv.c | 13 - drivers/gpu/drm/etnaviv/etnaviv_drv.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_drv.c| 4 ++-- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 4 ++-- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c| 4 ++-- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c| 8 drivers/gpu/drm/i915/selftests/huge_pages.c| 2 +- drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c | 2 +- drivers/gpu/drm/i915/selftests/i915_gem_evict.c| 2 +- drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 +- drivers/gpu/drm/i915/selftests/i915_gem_object.c | 2 +- drivers/gpu/drm/i915/selftests/i915_request.c | 2 +- drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +- drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c | 2 +- drivers/gpu/drm/imx/imx-drm-core.c | 4 ++-- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 6 +++--- drivers/gpu/drm/msm/msm_drv.c | 8 drivers/gpu/drm/mxsfb/mxsfb_drv.c | 4 ++-- drivers/gpu/drm/nouveau/nouveau_platform.c | 2 +- drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++-- drivers/gpu/drm/pl111/pl111_drv.c | 4 ++-- drivers/gpu/drm/qxl/qxl_drv.c | 2 +- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_drv.c| 4 ++-- drivers/gpu/drm/shmobile/shmob_drm_drv.c | 4 ++-- drivers/gpu/drm/sti/sti_drv.c | 8 drivers/gpu/drm/stm/drv.c | 4 ++-- drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++-- drivers/gpu/drm/tegra/drm.c| 4 ++-- drivers/gpu/drm/tinydrm/core/tinydrm-core.c| 6 +++--- drivers/gpu/drm/tve200/tve200_drv.c| 4 ++-- drivers/gpu/drm/udl/udl_drv.c | 2 +- drivers/gpu/drm/vc4/vc4_drv.c | 4 ++-- drivers/gpu/drm/vgem/vgem_drv.c| 2 +- drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 2 +- drivers/gpu/drm/zte/zx_drm_drv.c | 4 ++-- include/drm/drm_drv.h | 1 - 41 files changed, 73 insertions(+), 87 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 0b19482b36b8..5fb455febeba 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -647,7 +647,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, err_pci: pci_disable_device(pdev); err_free: - drm_dev_unref(dev); + drm_dev_put(dev); return ret; } @@ -657,7 +657,7 @@ amdgpu_pci_remove(struct pci_dev *pdev) struct drm_device *dev = pci_get_drvdata(pdev); drm_dev_unregister(dev); - drm_dev_unref(dev); + drm_dev_put(dev); pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); } 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/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c index 4b11b6b52f1d..d1705d298a39 100644 --- a/drivers/gpu/drm/armada/armada_drv.c +++ b/drivers/gpu/drm/armada/armada_drv.c @@ -109,7 +109,7 @@ static int armada_drm_bind(struct device *dev) /* * The drm_device structure must be at the start of -* armada_private for drm_dev_unref() to work correctly. +* armada_private for drm_dev_put() to work correctly. */ BUILD_BUG_ON(offsetof(struct armada_private, drm) != 0); @@ -180,7 +180,7 @@ static int armada_drm_bind(struct device *dev) drm_mode_config_cleanup(>drm); drm_mm_takedow
Re: [PATCH] drm: rcar-du: Use drm_dev_put
On Wed, Apr 25, 2018 at 7:02 PM, Laurent Pinchart <laurent.pinch...@ideasonboard.com> wrote: > Hi Vaishali, > > Thank you for the patch. > > On Wednesday, 25 April 2018 15:10:36 EEST Vaishali Thakkar wrote: >> As specified in drm_drv.c, drm_dev_unref is a compatibility alias >> for drm_dev_put and shouldn't be used in new code. So, use >> drm_dev_put instead. > > This looks good to me. However, how about taking it one step further and mass- > patching all drivers to use drm_dev_put() ? We could then remove > drm_dev_unref() completely. Sure thing! Do you want me to fold this patch in that patchset or will you be fine with applying this separately? >> Signed-off-by: Vaishali Thakkar <vthakkar1...@gmail.com> >> --- >> drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c >> b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 05745e86d73e..418a80e6b2f4 >> 100644 >> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c >> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c >> @@ -378,7 +378,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; >> } > > -- > Regards, > > Laurent Pinchart > > > -- Vaishali http://vaishalithakkar.in/
[PATCH] drm: rcar-du: Use drm_dev_put
As specified in drm_drv.c, drm_dev_unref is a compatibility alias for drm_dev_put and shouldn't be used in new code. So, use drm_dev_put instead. Signed-off-by: Vaishali Thakkar <vthakkar1...@gmail.com> --- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 05745e86d73e..418a80e6b2f4 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -378,7 +378,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; } -- 2.14.1
Re: [PATCH] drm: rcar-du: of: Include header to define prototypes
On Tue, Apr 24, 2018 at 9:09 PM, Kieran Bingham <kieran.bingham+rene...@ideasonboard.com> wrote: > The symbol 'rcar_du_of_init' is defined by the rcar_du_of module header, > but it is not included by the C implementation. > > Include the header to correctly define the function prototypes. > > Fixes the following warning: > > linux/drivers/gpu/drm/rcar-du/rcar_du_of.c:319:13: >warning: symbol 'rcar_du_of_init' was not declared. Should it be static? > CC drivers/gpu/drm/rcar-du/rcar_du_of.o > > Fixes: 81c0e3dd8292 ("drm: rcar-du: Fix legacy DT to create LVDS encoder > nodes") > Signed-off-by: Kieran Bingham <kieran.bingham+rene...@ideasonboard.com> Reviewed-by: Vaishali Thakkar <vthak...@vaishalithakkar.in> > --- > drivers/gpu/drm/rcar-du/rcar_du_of.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_of.c > b/drivers/gpu/drm/rcar-du/rcar_du_of.c > index 68a0b82cb17e..afef69669bb4 100644 > --- a/drivers/gpu/drm/rcar-du/rcar_du_of.c > +++ b/drivers/gpu/drm/rcar-du/rcar_du_of.c > @@ -18,6 +18,7 @@ > > #include "rcar_du_crtc.h" > #include "rcar_du_drv.h" > +#include "rcar_du_of.h" > > /* > - > * Generic Overlay Handling > -- > 2.17.0 >
Re: [PATCH] drm: rcar-du: Use NULL for table initialisation
On Tue, Apr 24, 2018 at 9:10 PM, Kieran Bingham <kieran.bingham+rene...@ideasonboard.com> wrote: > Replace the initialisation of the vsps table with a NULL specifier. > > Fixes the following warning: > linux/drivers/gpu/drm/rcar-du/rcar_du_kms.c:483:40: > warning: Using plain integer as NULL pointer > CC drivers/gpu/drm/rcar-du/rcar_du_kms.o Hi Kieran, Change looks ok to me. > Fixes: 3e81374e2014 ("drm: rcar-du: Support multiple sources from the same > VSP") > Signed-off-by: Kieran Bingham <kieran.bingham+rene...@ideasonboard.com> Reviewed-by: Vaishali Thakkar <vthak...@vaishalithakkar.in> > --- > drivers/gpu/drm/rcar-du/rcar_du_kms.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c > b/drivers/gpu/drm/rcar-du/rcar_du_kms.c > index ef72dff00763..cf5b422fc753 100644 > --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c > +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c > @@ -480,7 +480,7 @@ static int rcar_du_vsps_init(struct rcar_du_device *rcdu) > struct { > struct device_node *np; > unsigned int crtcs_mask; > - } vsps[RCAR_DU_MAX_VSPS] = { { 0, }, }; > + } vsps[RCAR_DU_MAX_VSPS] = { { NULL, }, }; > unsigned int vsps_count = 0; > unsigned int cells; > unsigned int i; > -- > 2.17.0 >
Re: [PATCH v2] watchdog: renesas-wdt: Add support for the R8A77965 WDT
On Tue, Apr 24, 2018 at 2:08 PM, Simon Horman <ho...@verge.net.au> wrote: > On Sat, Apr 14, 2018 at 12:18:58PM +0200, Wolfram Sang wrote: >> Document support for the Watchdog Timer (WDT) Controller in the Renesas >> R-Car M3-N (R8A77965) SoC. No driver update is needed. >> >> Signed-off-by: Takeshi Kihara <takeshi.kihara...@renesas.com> >> [wsa: rebased to top-of-tree] >> Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com> >> Reviewed-by: Geert Uytterhoeven <geert+rene...@glider.be> > > Reviewed-by: Simon Horman <horms+rene...@verge.net.au> Reviewed-by: Vaishali Thakkar <vthak...@vaishalithakkar.in> >> --- >> >> Change since v1: s/M3N/M3-N/ (Thanks, Geert!) >> >> Documentation/devicetree/bindings/watchdog/renesas-wdt.txt | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/Documentation/devicetree/bindings/watchdog/renesas-wdt.txt >> b/Documentation/devicetree/bindings/watchdog/renesas-wdt.txt >> index 123bb1b2654b..613d860f2353 100644 >> --- a/Documentation/devicetree/bindings/watchdog/renesas-wdt.txt >> +++ b/Documentation/devicetree/bindings/watchdog/renesas-wdt.txt >> @@ -15,6 +15,7 @@ Required properties: >>- "renesas,r8a7794-wdt" (R-Car E2) >>- "renesas,r8a7795-wdt" (R-Car H3) >>- "renesas,r8a7796-wdt" (R-Car M3-W) >> + - "renesas,r8a77965-wdt" (R-Car M3-N) >>- "renesas,r8a77970-wdt" (R-Car V3M) >>- "renesas,r8a77995-wdt" (R-Car D3) >> The generic compatible string must be: >> -- >> 2.11.0 >>