All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put()
@ 2017-10-09 12:06 Harsha Sharma
  2017-10-09 14:01 ` ✗ Fi.CI.BAT: warning for drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() (rev3) Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Harsha Sharma @ 2017-10-09 12:06 UTC (permalink / raw)
  To: daniel.vetter, seanpaul, jani.nikula
  Cc: intel-gfx, dri-devel, linux-kernel, outreachy-kernel, Harsha Sharma

Replace instances of drm_framebuffer_reference/unreference() with
*_get/put() suffixes and drm_dev_unref with *_put() suffix
because get/put is shorter and consistent with the
kernel use of *_get/put suffixes.
Done with following coccinelle semantic patch

@@
expression ex;
@@

(
-drm_framebuffer_unreference(ex);
+drm_framebuffer_put(ex);
|
-drm_dev_unref(ex);
+drm_dev_put(ex);
|
-drm_framebuffer_reference(ex);
+drm_framebuffer_get(ex);
)

Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
---
Changes in v4:
 -change one instance of *_put to *_get
Changes in v3:
 -Removed changes in selftests
Changes in v2:
 -Added cocinelle patch in log message
 -cc to all driver-specific mailing lists

 drivers/gpu/drm/i915/i915_pci.c      |  2 +-
 drivers/gpu/drm/i915/intel_display.c | 10 +++++-----
 drivers/gpu/drm/i915/intel_fbdev.c   |  4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 09d97e0990b7..2f106cca46b4 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -510,7 +510,7 @@ static void i915_pci_remove(struct pci_dev *pdev)
 	struct drm_device *dev = pci_get_drvdata(pdev);
 
 	i915_driver_unload(dev);
-	drm_dev_unref(dev);
+	drm_dev_put(dev);
 }
 
 static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 64f7b51ed97c..cb62f7e5d59a 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -2856,7 +2856,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
 
 		if (intel_plane_ggtt_offset(state) == plane_config->base) {
 			fb = c->primary->fb;
-			drm_framebuffer_reference(fb);
+			drm_framebuffer_get(fb);
 			goto valid_fb;
 		}
 	}
@@ -2887,7 +2887,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
 			  intel_crtc->pipe, PTR_ERR(intel_state->vma));
 
 		intel_state->vma = NULL;
-		drm_framebuffer_unreference(fb);
+		drm_framebuffer_put(fb);
 		return;
 	}
 
@@ -2908,7 +2908,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
 	if (i915_gem_object_is_tiled(obj))
 		dev_priv->preserve_bios_swizzle = true;
 
-	drm_framebuffer_reference(fb);
+	drm_framebuffer_get(fb);
 	primary->fb = primary->state->fb = fb;
 	primary->crtc = primary->state->crtc = &intel_crtc->base;
 
@@ -9847,7 +9847,7 @@ mode_fits_in_fbdev(struct drm_device *dev,
 	if (obj->base.size < mode->vdisplay * fb->pitches[0])
 		return NULL;
 
-	drm_framebuffer_reference(fb);
+	drm_framebuffer_get(fb);
 	return fb;
 #else
 	return NULL;
@@ -10028,7 +10028,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
 	if (ret)
 		goto fail;
 
-	drm_framebuffer_unreference(fb);
+	drm_framebuffer_put(fb);
 
 	ret = drm_atomic_set_mode_for_crtc(&crtc_state->base, mode);
 	if (ret)
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
index 262e75c00dd2..e34334a1fbf9 100644
--- a/drivers/gpu/drm/i915/intel_fbdev.c
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
@@ -189,7 +189,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
 			      " releasing it\n",
 			      intel_fb->base.width, intel_fb->base.height,
 			      sizes->fb_width, sizes->fb_height);
-		drm_framebuffer_unreference(&intel_fb->base);
+		drm_framebuffer_put(&intel_fb->base);
 		intel_fb = ifbdev->fb = NULL;
 	}
 	if (!intel_fb || WARN_ON(!intel_fb->obj)) {
@@ -624,7 +624,7 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
 	ifbdev->preferred_bpp = fb->base.format->cpp[0] * 8;
 	ifbdev->fb = fb;
 
-	drm_framebuffer_reference(&ifbdev->fb->base);
+	drm_framebuffer_get(&ifbdev->fb->base);
 
 	/* Final pass to check if any active pipes don't have fbs */
 	for_each_crtc(dev, crtc) {
-- 
2.11.0



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

* ✗ Fi.CI.BAT: warning for drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() (rev3)
  2017-10-09 12:06 [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() Harsha Sharma
@ 2017-10-09 14:01 ` Patchwork
  2017-10-09 17:19 ` ✓ Fi.CI.BAT: success " Patchwork
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2017-10-09 14:01 UTC (permalink / raw)
  To: Harsha Sharma; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() (rev3)
URL   : https://patchwork.freedesktop.org/series/31283/
State : warning

== Summary ==

Series 31283v3 drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put()
https://patchwork.freedesktop.org/api/1.0/series/31283/revisions/3/mbox/

Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> DMESG-WARN (fi-byt-n2820) fdo#101705
Test prime_vgem:
        Subgroup basic-fence-flip:
                pass       -> DMESG-WARN (fi-skl-6770hq)

fdo#101705 https://bugs.freedesktop.org/show_bug.cgi?id=101705

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:451s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:468s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:396s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:561s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:284s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:522s
fi-byt-j1900     total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  time:530s
fi-byt-n2820     total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  time:525s
fi-cfl-s         total:289  pass:256  dwarn:1   dfail:0   fail:0   skip:32  time:558s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:429s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:603s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:433s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:415s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:511s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:472s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:501s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:580s
fi-kbl-7567u     total:289  pass:265  dwarn:4   dfail:0   fail:0   skip:20  time:488s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:594s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:655s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:464s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:657s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:533s
fi-skl-6770hq    total:289  pass:268  dwarn:1   dfail:0   fail:0   skip:20  time:504s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:472s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:577s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:429s
fi-ilk-650 failed to connect after reboot

7579653b5bfdee2b6a20aab20c36c516cbe3812f drm-tip: 2017y-10m-09d-12h-55m-47s UTC integration manifest
f16cb175d6ad drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put()

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5952/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() (rev3)
  2017-10-09 12:06 [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() Harsha Sharma
  2017-10-09 14:01 ` ✗ Fi.CI.BAT: warning for drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() (rev3) Patchwork
@ 2017-10-09 17:19 ` Patchwork
  2017-10-09 19:12 ` ✓ Fi.CI.IGT: " Patchwork
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2017-10-09 17:19 UTC (permalink / raw)
  To: Harsha Sharma; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() (rev3)
URL   : https://patchwork.freedesktop.org/series/31283/
State : success

== Summary ==

Series 31283v3 drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put()
https://patchwork.freedesktop.org/api/1.0/series/31283/revisions/3/mbox/

Test kms_cursor_legacy:
        Subgroup basic-flip-after-cursor-legacy:
                incomplete -> PASS       (fi-glk-1)
Test kms_pipe_crc_basic:
        Subgroup read-crc-pipe-b:
                dmesg-warn -> PASS       (fi-skl-6700k)
        Subgroup suspend-read-crc-pipe-b:
                dmesg-warn -> PASS       (fi-byt-n2820) fdo#101705

fdo#101705 https://bugs.freedesktop.org/show_bug.cgi?id=101705

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:449s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:472s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:564s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:284s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:523s
fi-byt-j1900     total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  time:536s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:519s
fi-cfl-s         total:289  pass:256  dwarn:1   dfail:0   fail:0   skip:32  time:557s
fi-cnl-y         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:613s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:436s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:603s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:438s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:422s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:460s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:507s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:475s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:502s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:580s
fi-kbl-7567u     total:289  pass:265  dwarn:4   dfail:0   fail:0   skip:20  time:487s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:597s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:663s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:477s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:654s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:532s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:519s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:474s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:579s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:426s
fi-blb-e6850 failed to connect after reboot

080df4bff8208a891f31629d6415ff29f6d7931a drm-tip: 2017y-10m-09d-15h-14m-40s UTC integration manifest
d960990eea56 drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put()

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5958/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.IGT: success for drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() (rev3)
  2017-10-09 12:06 [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() Harsha Sharma
  2017-10-09 14:01 ` ✗ Fi.CI.BAT: warning for drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() (rev3) Patchwork
  2017-10-09 17:19 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2017-10-09 19:12 ` Patchwork
  2017-10-09 22:28 ` Patchwork
  2017-10-13 14:33 ` [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() Harsha Sharma
  4 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2017-10-09 19:12 UTC (permalink / raw)
  To: Harsha Sharma; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() (rev3)
URL   : https://patchwork.freedesktop.org/series/31283/
State : success

== Summary ==

shard-hsw        total:2446 pass:1329 dwarn:6   dfail:0   fail:8   skip:1103 time:10077s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5952/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.IGT: success for drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() (rev3)
  2017-10-09 12:06 [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() Harsha Sharma
                   ` (2 preceding siblings ...)
  2017-10-09 19:12 ` ✓ Fi.CI.IGT: " Patchwork
@ 2017-10-09 22:28 ` Patchwork
  2017-10-13 14:33 ` [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() Harsha Sharma
  4 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2017-10-09 22:28 UTC (permalink / raw)
  To: Harsha Sharma; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() (rev3)
URL   : https://patchwork.freedesktop.org/series/31283/
State : success

== Summary ==

Test kms_setmode:
        Subgroup basic:
                pass       -> FAIL       (shard-hsw) fdo#99912
Test kms_flip:
        Subgroup flip-vs-rmfb-interruptible:
                pass       -> DMESG-WARN (shard-hsw) fdo#102614

fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614

shard-hsw        total:2433 pass:1319 dwarn:23  dfail:0   fail:9   skip:1082 time:9681s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5958/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put()
  2017-10-09 12:06 [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() Harsha Sharma
                   ` (3 preceding siblings ...)
  2017-10-09 22:28 ` Patchwork
@ 2017-10-13 14:33 ` Harsha Sharma
  2017-10-13 14:51     ` Daniel Vetter
  4 siblings, 1 reply; 10+ messages in thread
From: Harsha Sharma @ 2017-10-13 14:33 UTC (permalink / raw)
  To: Daniel Vetter, Sean Paul, jani.nikula
  Cc: intel-gfx, dri-devel, linux-kernel, outreachy-kernel, Harsha Sharma

On Mon, Oct 9, 2017 at 5:36 PM, Harsha Sharma
<harshasharmaiitr@gmail.com> wrote:
> Replace instances of drm_framebuffer_reference/unreference() with
> *_get/put() suffixes and drm_dev_unref with *_put() suffix
> because get/put is shorter and consistent with the
> kernel use of *_get/put suffixes.
> Done with following coccinelle semantic patch
>
> @@
> expression ex;
> @@
>
> (
> -drm_framebuffer_unreference(ex);
> +drm_framebuffer_put(ex);
> |
> -drm_dev_unref(ex);
> +drm_dev_put(ex);
> |
> -drm_framebuffer_reference(ex);
> +drm_framebuffer_get(ex);
> )
>
> Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
> ---
> Changes in v4:
>  -change one instance of *_put to *_get
> Changes in v3:
>  -Removed changes in selftests
> Changes in v2:
>  -Added cocinelle patch in log message
>  -cc to all driver-specific mailing lists
>
>  drivers/gpu/drm/i915/i915_pci.c      |  2 +-
>  drivers/gpu/drm/i915/intel_display.c | 10 +++++-----
>  drivers/gpu/drm/i915/intel_fbdev.c   |  4 ++--
>  3 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 09d97e0990b7..2f106cca46b4 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -510,7 +510,7 @@ static void i915_pci_remove(struct pci_dev *pdev)
>         struct drm_device *dev = pci_get_drvdata(pdev);
>
>         i915_driver_unload(dev);
> -       drm_dev_unref(dev);
> +       drm_dev_put(dev);
>  }
>
>  static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 64f7b51ed97c..cb62f7e5d59a 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -2856,7 +2856,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
>
>                 if (intel_plane_ggtt_offset(state) == plane_config->base) {
>                         fb = c->primary->fb;
> -                       drm_framebuffer_reference(fb);
> +                       drm_framebuffer_get(fb);
>                         goto valid_fb;
>                 }
>         }
> @@ -2887,7 +2887,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
>                           intel_crtc->pipe, PTR_ERR(intel_state->vma));
>
>                 intel_state->vma = NULL;
> -               drm_framebuffer_unreference(fb);
> +               drm_framebuffer_put(fb);
>                 return;
>         }
>
> @@ -2908,7 +2908,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
>         if (i915_gem_object_is_tiled(obj))
>                 dev_priv->preserve_bios_swizzle = true;
>
> -       drm_framebuffer_reference(fb);
> +       drm_framebuffer_get(fb);
>         primary->fb = primary->state->fb = fb;
>         primary->crtc = primary->state->crtc = &intel_crtc->base;
>
> @@ -9847,7 +9847,7 @@ mode_fits_in_fbdev(struct drm_device *dev,
>         if (obj->base.size < mode->vdisplay * fb->pitches[0])
>                 return NULL;
>
> -       drm_framebuffer_reference(fb);
> +       drm_framebuffer_get(fb);
>         return fb;
>  #else
>         return NULL;
> @@ -10028,7 +10028,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
>         if (ret)
>                 goto fail;
>
> -       drm_framebuffer_unreference(fb);
> +       drm_framebuffer_put(fb);
>
>         ret = drm_atomic_set_mode_for_crtc(&crtc_state->base, mode);
>         if (ret)
> diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
> index 262e75c00dd2..e34334a1fbf9 100644
> --- a/drivers/gpu/drm/i915/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> @@ -189,7 +189,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
>                               " releasing it\n",
>                               intel_fb->base.width, intel_fb->base.height,
>                               sizes->fb_width, sizes->fb_height);
> -               drm_framebuffer_unreference(&intel_fb->base);
> +               drm_framebuffer_put(&intel_fb->base);
>                 intel_fb = ifbdev->fb = NULL;
>         }
>         if (!intel_fb || WARN_ON(!intel_fb->obj)) {
> @@ -624,7 +624,7 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
>         ifbdev->preferred_bpp = fb->base.format->cpp[0] * 8;
>         ifbdev->fb = fb;
>
> -       drm_framebuffer_reference(&ifbdev->fb->base);
> +       drm_framebuffer_get(&ifbdev->fb->base);
>
>         /* Final pass to check if any active pipes don't have fbs */
>         for_each_crtc(dev, crtc) {
>
I hope that this one can be merged.
Please let me know if any change is required.
Thanks for your time.

Regards,
Harsha Sharma

--
> 2.11.0
>


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

* Re: [Outreachy kernel] Re: [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put()
  2017-10-13 14:33 ` [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() Harsha Sharma
@ 2017-10-13 14:51     ` Daniel Vetter
  0 siblings, 0 replies; 10+ messages in thread
From: Daniel Vetter @ 2017-10-13 14:51 UTC (permalink / raw)
  To: Harsha Sharma
  Cc: Daniel Vetter, Sean Paul, jani.nikula, intel-gfx, dri-devel,
	linux-kernel, outreachy-kernel

On Fri, Oct 13, 2017 at 08:03:59PM +0530, Harsha Sharma wrote:
> On Mon, Oct 9, 2017 at 5:36 PM, Harsha Sharma
> <harshasharmaiitr@gmail.com> wrote:
> > Replace instances of drm_framebuffer_reference/unreference() with
> > *_get/put() suffixes and drm_dev_unref with *_put() suffix
> > because get/put is shorter and consistent with the
> > kernel use of *_get/put suffixes.
> > Done with following coccinelle semantic patch
> >
> > @@
> > expression ex;
> > @@
> >
> > (
> > -drm_framebuffer_unreference(ex);
> > +drm_framebuffer_put(ex);
> > |
> > -drm_dev_unref(ex);
> > +drm_dev_put(ex);
> > |
> > -drm_framebuffer_reference(ex);
> > +drm_framebuffer_get(ex);
> > )
> >
> > Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
> > ---
> > Changes in v4:
> >  -change one instance of *_put to *_get
> > Changes in v3:
> >  -Removed changes in selftests
> > Changes in v2:
> >  -Added cocinelle patch in log message
> >  -cc to all driver-specific mailing lists
> >
> >  drivers/gpu/drm/i915/i915_pci.c      |  2 +-
> >  drivers/gpu/drm/i915/intel_display.c | 10 +++++-----
> >  drivers/gpu/drm/i915/intel_fbdev.c   |  4 ++--
> >  3 files changed, 8 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> > index 09d97e0990b7..2f106cca46b4 100644
> > --- a/drivers/gpu/drm/i915/i915_pci.c
> > +++ b/drivers/gpu/drm/i915/i915_pci.c
> > @@ -510,7 +510,7 @@ static void i915_pci_remove(struct pci_dev *pdev)
> >         struct drm_device *dev = pci_get_drvdata(pdev);
> >
> >         i915_driver_unload(dev);
> > -       drm_dev_unref(dev);
> > +       drm_dev_put(dev);
> >  }
> >
> >  static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 64f7b51ed97c..cb62f7e5d59a 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -2856,7 +2856,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> >
> >                 if (intel_plane_ggtt_offset(state) == plane_config->base) {
> >                         fb = c->primary->fb;
> > -                       drm_framebuffer_reference(fb);
> > +                       drm_framebuffer_get(fb);
> >                         goto valid_fb;
> >                 }
> >         }
> > @@ -2887,7 +2887,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> >                           intel_crtc->pipe, PTR_ERR(intel_state->vma));
> >
> >                 intel_state->vma = NULL;
> > -               drm_framebuffer_unreference(fb);
> > +               drm_framebuffer_put(fb);
> >                 return;
> >         }
> >
> > @@ -2908,7 +2908,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> >         if (i915_gem_object_is_tiled(obj))
> >                 dev_priv->preserve_bios_swizzle = true;
> >
> > -       drm_framebuffer_reference(fb);
> > +       drm_framebuffer_get(fb);
> >         primary->fb = primary->state->fb = fb;
> >         primary->crtc = primary->state->crtc = &intel_crtc->base;
> >
> > @@ -9847,7 +9847,7 @@ mode_fits_in_fbdev(struct drm_device *dev,
> >         if (obj->base.size < mode->vdisplay * fb->pitches[0])
> >                 return NULL;
> >
> > -       drm_framebuffer_reference(fb);
> > +       drm_framebuffer_get(fb);
> >         return fb;
> >  #else
> >         return NULL;
> > @@ -10028,7 +10028,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
> >         if (ret)
> >                 goto fail;
> >
> > -       drm_framebuffer_unreference(fb);
> > +       drm_framebuffer_put(fb);
> >
> >         ret = drm_atomic_set_mode_for_crtc(&crtc_state->base, mode);
> >         if (ret)
> > diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
> > index 262e75c00dd2..e34334a1fbf9 100644
> > --- a/drivers/gpu/drm/i915/intel_fbdev.c
> > +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> > @@ -189,7 +189,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
> >                               " releasing it\n",
> >                               intel_fb->base.width, intel_fb->base.height,
> >                               sizes->fb_width, sizes->fb_height);
> > -               drm_framebuffer_unreference(&intel_fb->base);
> > +               drm_framebuffer_put(&intel_fb->base);
> >                 intel_fb = ifbdev->fb = NULL;
> >         }
> >         if (!intel_fb || WARN_ON(!intel_fb->obj)) {
> > @@ -624,7 +624,7 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
> >         ifbdev->preferred_bpp = fb->base.format->cpp[0] * 8;
> >         ifbdev->fb = fb;
> >
> > -       drm_framebuffer_reference(&ifbdev->fb->base);
> > +       drm_framebuffer_get(&ifbdev->fb->base);
> >
> >         /* Final pass to check if any active pipes don't have fbs */
> >         for_each_crtc(dev, crtc) {
> >
> I hope that this one can be merged.
> Please let me know if any change is required.
> Thanks for your time.

Sorry, fell through the cracks.

Applied now to drm-intel-next-queued, thanks for your patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


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

* Re: [Outreachy kernel] Re: [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put()
@ 2017-10-13 14:51     ` Daniel Vetter
  0 siblings, 0 replies; 10+ messages in thread
From: Daniel Vetter @ 2017-10-13 14:51 UTC (permalink / raw)
  To: Harsha Sharma
  Cc: Daniel Vetter, intel-gfx, linux-kernel, dri-devel, outreachy-kernel

On Fri, Oct 13, 2017 at 08:03:59PM +0530, Harsha Sharma wrote:
> On Mon, Oct 9, 2017 at 5:36 PM, Harsha Sharma
> <harshasharmaiitr@gmail.com> wrote:
> > Replace instances of drm_framebuffer_reference/unreference() with
> > *_get/put() suffixes and drm_dev_unref with *_put() suffix
> > because get/put is shorter and consistent with the
> > kernel use of *_get/put suffixes.
> > Done with following coccinelle semantic patch
> >
> > @@
> > expression ex;
> > @@
> >
> > (
> > -drm_framebuffer_unreference(ex);
> > +drm_framebuffer_put(ex);
> > |
> > -drm_dev_unref(ex);
> > +drm_dev_put(ex);
> > |
> > -drm_framebuffer_reference(ex);
> > +drm_framebuffer_get(ex);
> > )
> >
> > Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
> > ---
> > Changes in v4:
> >  -change one instance of *_put to *_get
> > Changes in v3:
> >  -Removed changes in selftests
> > Changes in v2:
> >  -Added cocinelle patch in log message
> >  -cc to all driver-specific mailing lists
> >
> >  drivers/gpu/drm/i915/i915_pci.c      |  2 +-
> >  drivers/gpu/drm/i915/intel_display.c | 10 +++++-----
> >  drivers/gpu/drm/i915/intel_fbdev.c   |  4 ++--
> >  3 files changed, 8 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> > index 09d97e0990b7..2f106cca46b4 100644
> > --- a/drivers/gpu/drm/i915/i915_pci.c
> > +++ b/drivers/gpu/drm/i915/i915_pci.c
> > @@ -510,7 +510,7 @@ static void i915_pci_remove(struct pci_dev *pdev)
> >         struct drm_device *dev = pci_get_drvdata(pdev);
> >
> >         i915_driver_unload(dev);
> > -       drm_dev_unref(dev);
> > +       drm_dev_put(dev);
> >  }
> >
> >  static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 64f7b51ed97c..cb62f7e5d59a 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -2856,7 +2856,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> >
> >                 if (intel_plane_ggtt_offset(state) == plane_config->base) {
> >                         fb = c->primary->fb;
> > -                       drm_framebuffer_reference(fb);
> > +                       drm_framebuffer_get(fb);
> >                         goto valid_fb;
> >                 }
> >         }
> > @@ -2887,7 +2887,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> >                           intel_crtc->pipe, PTR_ERR(intel_state->vma));
> >
> >                 intel_state->vma = NULL;
> > -               drm_framebuffer_unreference(fb);
> > +               drm_framebuffer_put(fb);
> >                 return;
> >         }
> >
> > @@ -2908,7 +2908,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> >         if (i915_gem_object_is_tiled(obj))
> >                 dev_priv->preserve_bios_swizzle = true;
> >
> > -       drm_framebuffer_reference(fb);
> > +       drm_framebuffer_get(fb);
> >         primary->fb = primary->state->fb = fb;
> >         primary->crtc = primary->state->crtc = &intel_crtc->base;
> >
> > @@ -9847,7 +9847,7 @@ mode_fits_in_fbdev(struct drm_device *dev,
> >         if (obj->base.size < mode->vdisplay * fb->pitches[0])
> >                 return NULL;
> >
> > -       drm_framebuffer_reference(fb);
> > +       drm_framebuffer_get(fb);
> >         return fb;
> >  #else
> >         return NULL;
> > @@ -10028,7 +10028,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
> >         if (ret)
> >                 goto fail;
> >
> > -       drm_framebuffer_unreference(fb);
> > +       drm_framebuffer_put(fb);
> >
> >         ret = drm_atomic_set_mode_for_crtc(&crtc_state->base, mode);
> >         if (ret)
> > diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
> > index 262e75c00dd2..e34334a1fbf9 100644
> > --- a/drivers/gpu/drm/i915/intel_fbdev.c
> > +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> > @@ -189,7 +189,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
> >                               " releasing it\n",
> >                               intel_fb->base.width, intel_fb->base.height,
> >                               sizes->fb_width, sizes->fb_height);
> > -               drm_framebuffer_unreference(&intel_fb->base);
> > +               drm_framebuffer_put(&intel_fb->base);
> >                 intel_fb = ifbdev->fb = NULL;
> >         }
> >         if (!intel_fb || WARN_ON(!intel_fb->obj)) {
> > @@ -624,7 +624,7 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
> >         ifbdev->preferred_bpp = fb->base.format->cpp[0] * 8;
> >         ifbdev->fb = fb;
> >
> > -       drm_framebuffer_reference(&ifbdev->fb->base);
> > +       drm_framebuffer_get(&ifbdev->fb->base);
> >
> >         /* Final pass to check if any active pipes don't have fbs */
> >         for_each_crtc(dev, crtc) {
> >
> I hope that this one can be merged.
> Please let me know if any change is required.
> Thanks for your time.

Sorry, fell through the cracks.

Applied now to drm-intel-next-queued, thanks for your patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Outreachy kernel] Re: [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put()
  2017-10-13 14:51     ` Daniel Vetter
@ 2017-10-13 14:57       ` Daniel Vetter
  -1 siblings, 0 replies; 10+ messages in thread
From: Daniel Vetter @ 2017-10-13 14:57 UTC (permalink / raw)
  To: Harsha Sharma
  Cc: Daniel Vetter, Sean Paul, jani.nikula, intel-gfx, dri-devel,
	linux-kernel, outreachy-kernel

On Fri, Oct 13, 2017 at 04:51:38PM +0200, Daniel Vetter wrote:
> On Fri, Oct 13, 2017 at 08:03:59PM +0530, Harsha Sharma wrote:
> > On Mon, Oct 9, 2017 at 5:36 PM, Harsha Sharma
> > <harshasharmaiitr@gmail.com> wrote:
> > > Replace instances of drm_framebuffer_reference/unreference() with
> > > *_get/put() suffixes and drm_dev_unref with *_put() suffix
> > > because get/put is shorter and consistent with the
> > > kernel use of *_get/put suffixes.
> > > Done with following coccinelle semantic patch
> > >
> > > @@
> > > expression ex;
> > > @@
> > >
> > > (
> > > -drm_framebuffer_unreference(ex);
> > > +drm_framebuffer_put(ex);
> > > |
> > > -drm_dev_unref(ex);
> > > +drm_dev_put(ex);
> > > |
> > > -drm_framebuffer_reference(ex);
> > > +drm_framebuffer_get(ex);
> > > )
> > >
> > > Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
> > > ---
> > > Changes in v4:
> > >  -change one instance of *_put to *_get
> > > Changes in v3:
> > >  -Removed changes in selftests
> > > Changes in v2:
> > >  -Added cocinelle patch in log message
> > >  -cc to all driver-specific mailing lists
> > >
> > >  drivers/gpu/drm/i915/i915_pci.c      |  2 +-
> > >  drivers/gpu/drm/i915/intel_display.c | 10 +++++-----
> > >  drivers/gpu/drm/i915/intel_fbdev.c   |  4 ++--
> > >  3 files changed, 8 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> > > index 09d97e0990b7..2f106cca46b4 100644
> > > --- a/drivers/gpu/drm/i915/i915_pci.c
> > > +++ b/drivers/gpu/drm/i915/i915_pci.c
> > > @@ -510,7 +510,7 @@ static void i915_pci_remove(struct pci_dev *pdev)
> > >         struct drm_device *dev = pci_get_drvdata(pdev);
> > >
> > >         i915_driver_unload(dev);
> > > -       drm_dev_unref(dev);
> > > +       drm_dev_put(dev);
> > >  }
> > >
> > >  static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > > index 64f7b51ed97c..cb62f7e5d59a 100644
> > > --- a/drivers/gpu/drm/i915/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/intel_display.c
> > > @@ -2856,7 +2856,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> > >
> > >                 if (intel_plane_ggtt_offset(state) == plane_config->base) {
> > >                         fb = c->primary->fb;
> > > -                       drm_framebuffer_reference(fb);
> > > +                       drm_framebuffer_get(fb);
> > >                         goto valid_fb;
> > >                 }
> > >         }
> > > @@ -2887,7 +2887,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> > >                           intel_crtc->pipe, PTR_ERR(intel_state->vma));
> > >
> > >                 intel_state->vma = NULL;
> > > -               drm_framebuffer_unreference(fb);
> > > +               drm_framebuffer_put(fb);
> > >                 return;
> > >         }
> > >
> > > @@ -2908,7 +2908,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> > >         if (i915_gem_object_is_tiled(obj))
> > >                 dev_priv->preserve_bios_swizzle = true;
> > >
> > > -       drm_framebuffer_reference(fb);
> > > +       drm_framebuffer_get(fb);
> > >         primary->fb = primary->state->fb = fb;
> > >         primary->crtc = primary->state->crtc = &intel_crtc->base;
> > >
> > > @@ -9847,7 +9847,7 @@ mode_fits_in_fbdev(struct drm_device *dev,
> > >         if (obj->base.size < mode->vdisplay * fb->pitches[0])
> > >                 return NULL;
> > >
> > > -       drm_framebuffer_reference(fb);
> > > +       drm_framebuffer_get(fb);
> > >         return fb;
> > >  #else
> > >         return NULL;
> > > @@ -10028,7 +10028,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
> > >         if (ret)
> > >                 goto fail;
> > >
> > > -       drm_framebuffer_unreference(fb);
> > > +       drm_framebuffer_put(fb);
> > >
> > >         ret = drm_atomic_set_mode_for_crtc(&crtc_state->base, mode);
> > >         if (ret)
> > > diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
> > > index 262e75c00dd2..e34334a1fbf9 100644
> > > --- a/drivers/gpu/drm/i915/intel_fbdev.c
> > > +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> > > @@ -189,7 +189,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
> > >                               " releasing it\n",
> > >                               intel_fb->base.width, intel_fb->base.height,
> > >                               sizes->fb_width, sizes->fb_height);
> > > -               drm_framebuffer_unreference(&intel_fb->base);
> > > +               drm_framebuffer_put(&intel_fb->base);
> > >                 intel_fb = ifbdev->fb = NULL;
> > >         }
> > >         if (!intel_fb || WARN_ON(!intel_fb->obj)) {
> > > @@ -624,7 +624,7 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
> > >         ifbdev->preferred_bpp = fb->base.format->cpp[0] * 8;
> > >         ifbdev->fb = fb;
> > >
> > > -       drm_framebuffer_reference(&ifbdev->fb->base);
> > > +       drm_framebuffer_get(&ifbdev->fb->base);
> > >
> > >         /* Final pass to check if any active pipes don't have fbs */
> > >         for_each_crtc(dev, crtc) {
> > >
> > I hope that this one can be merged.
> > Please let me know if any change is required.
> > Thanks for your time.
> 
> Sorry, fell through the cracks.
> 
> Applied now to drm-intel-next-queued, thanks for your patch.

Ok just realized that it doesn't apply on plain drm-intel-next-queued
since that tree doesn't yet have the drm_dev_put function. I've taken that
part out of your patch to unblock it.

Can you pls rebase the remaining parts onto drm-tip from

https://cgit.freedesktop.org/drm/drm-tip

and send a new patch for just the drm_dev_put change? I asked the
drm-intel maintainers to do the backmerge to make sure I can apply this
next week.

Thanks, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


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

* Re: [Outreachy kernel] Re: [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put()
@ 2017-10-13 14:57       ` Daniel Vetter
  0 siblings, 0 replies; 10+ messages in thread
From: Daniel Vetter @ 2017-10-13 14:57 UTC (permalink / raw)
  To: Harsha Sharma
  Cc: Daniel Vetter, intel-gfx, linux-kernel, dri-devel, outreachy-kernel

On Fri, Oct 13, 2017 at 04:51:38PM +0200, Daniel Vetter wrote:
> On Fri, Oct 13, 2017 at 08:03:59PM +0530, Harsha Sharma wrote:
> > On Mon, Oct 9, 2017 at 5:36 PM, Harsha Sharma
> > <harshasharmaiitr@gmail.com> wrote:
> > > Replace instances of drm_framebuffer_reference/unreference() with
> > > *_get/put() suffixes and drm_dev_unref with *_put() suffix
> > > because get/put is shorter and consistent with the
> > > kernel use of *_get/put suffixes.
> > > Done with following coccinelle semantic patch
> > >
> > > @@
> > > expression ex;
> > > @@
> > >
> > > (
> > > -drm_framebuffer_unreference(ex);
> > > +drm_framebuffer_put(ex);
> > > |
> > > -drm_dev_unref(ex);
> > > +drm_dev_put(ex);
> > > |
> > > -drm_framebuffer_reference(ex);
> > > +drm_framebuffer_get(ex);
> > > )
> > >
> > > Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
> > > ---
> > > Changes in v4:
> > >  -change one instance of *_put to *_get
> > > Changes in v3:
> > >  -Removed changes in selftests
> > > Changes in v2:
> > >  -Added cocinelle patch in log message
> > >  -cc to all driver-specific mailing lists
> > >
> > >  drivers/gpu/drm/i915/i915_pci.c      |  2 +-
> > >  drivers/gpu/drm/i915/intel_display.c | 10 +++++-----
> > >  drivers/gpu/drm/i915/intel_fbdev.c   |  4 ++--
> > >  3 files changed, 8 insertions(+), 8 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> > > index 09d97e0990b7..2f106cca46b4 100644
> > > --- a/drivers/gpu/drm/i915/i915_pci.c
> > > +++ b/drivers/gpu/drm/i915/i915_pci.c
> > > @@ -510,7 +510,7 @@ static void i915_pci_remove(struct pci_dev *pdev)
> > >         struct drm_device *dev = pci_get_drvdata(pdev);
> > >
> > >         i915_driver_unload(dev);
> > > -       drm_dev_unref(dev);
> > > +       drm_dev_put(dev);
> > >  }
> > >
> > >  static int i915_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > > index 64f7b51ed97c..cb62f7e5d59a 100644
> > > --- a/drivers/gpu/drm/i915/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/intel_display.c
> > > @@ -2856,7 +2856,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> > >
> > >                 if (intel_plane_ggtt_offset(state) == plane_config->base) {
> > >                         fb = c->primary->fb;
> > > -                       drm_framebuffer_reference(fb);
> > > +                       drm_framebuffer_get(fb);
> > >                         goto valid_fb;
> > >                 }
> > >         }
> > > @@ -2887,7 +2887,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> > >                           intel_crtc->pipe, PTR_ERR(intel_state->vma));
> > >
> > >                 intel_state->vma = NULL;
> > > -               drm_framebuffer_unreference(fb);
> > > +               drm_framebuffer_put(fb);
> > >                 return;
> > >         }
> > >
> > > @@ -2908,7 +2908,7 @@ intel_find_initial_plane_obj(struct intel_crtc *intel_crtc,
> > >         if (i915_gem_object_is_tiled(obj))
> > >                 dev_priv->preserve_bios_swizzle = true;
> > >
> > > -       drm_framebuffer_reference(fb);
> > > +       drm_framebuffer_get(fb);
> > >         primary->fb = primary->state->fb = fb;
> > >         primary->crtc = primary->state->crtc = &intel_crtc->base;
> > >
> > > @@ -9847,7 +9847,7 @@ mode_fits_in_fbdev(struct drm_device *dev,
> > >         if (obj->base.size < mode->vdisplay * fb->pitches[0])
> > >                 return NULL;
> > >
> > > -       drm_framebuffer_reference(fb);
> > > +       drm_framebuffer_get(fb);
> > >         return fb;
> > >  #else
> > >         return NULL;
> > > @@ -10028,7 +10028,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
> > >         if (ret)
> > >                 goto fail;
> > >
> > > -       drm_framebuffer_unreference(fb);
> > > +       drm_framebuffer_put(fb);
> > >
> > >         ret = drm_atomic_set_mode_for_crtc(&crtc_state->base, mode);
> > >         if (ret)
> > > diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
> > > index 262e75c00dd2..e34334a1fbf9 100644
> > > --- a/drivers/gpu/drm/i915/intel_fbdev.c
> > > +++ b/drivers/gpu/drm/i915/intel_fbdev.c
> > > @@ -189,7 +189,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
> > >                               " releasing it\n",
> > >                               intel_fb->base.width, intel_fb->base.height,
> > >                               sizes->fb_width, sizes->fb_height);
> > > -               drm_framebuffer_unreference(&intel_fb->base);
> > > +               drm_framebuffer_put(&intel_fb->base);
> > >                 intel_fb = ifbdev->fb = NULL;
> > >         }
> > >         if (!intel_fb || WARN_ON(!intel_fb->obj)) {
> > > @@ -624,7 +624,7 @@ static bool intel_fbdev_init_bios(struct drm_device *dev,
> > >         ifbdev->preferred_bpp = fb->base.format->cpp[0] * 8;
> > >         ifbdev->fb = fb;
> > >
> > > -       drm_framebuffer_reference(&ifbdev->fb->base);
> > > +       drm_framebuffer_get(&ifbdev->fb->base);
> > >
> > >         /* Final pass to check if any active pipes don't have fbs */
> > >         for_each_crtc(dev, crtc) {
> > >
> > I hope that this one can be merged.
> > Please let me know if any change is required.
> > Thanks for your time.
> 
> Sorry, fell through the cracks.
> 
> Applied now to drm-intel-next-queued, thanks for your patch.

Ok just realized that it doesn't apply on plain drm-intel-next-queued
since that tree doesn't yet have the drm_dev_put function. I've taken that
part out of your patch to unblock it.

Can you pls rebase the remaining parts onto drm-tip from

https://cgit.freedesktop.org/drm/drm-tip

and send a new patch for just the drm_dev_put change? I asked the
drm-intel maintainers to do the backmerge to make sure I can apply this
next week.

Thanks, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-10-13 14:57 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-09 12:06 [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() Harsha Sharma
2017-10-09 14:01 ` ✗ Fi.CI.BAT: warning for drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() (rev3) Patchwork
2017-10-09 17:19 ` ✓ Fi.CI.BAT: success " Patchwork
2017-10-09 19:12 ` ✓ Fi.CI.IGT: " Patchwork
2017-10-09 22:28 ` Patchwork
2017-10-13 14:33 ` [PATCH v4] drm/i915: Replace *_reference/unreference() or *_ref/unref with _get/put() Harsha Sharma
2017-10-13 14:51   ` [Outreachy kernel] " Daniel Vetter
2017-10-13 14:51     ` Daniel Vetter
2017-10-13 14:57     ` Daniel Vetter
2017-10-13 14:57       ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.