Skip to contentSkip to conversation

drm/vmwgfx: replace drm_*_unreference with drm_*_put

PATCH Applied Haneen Mohammed 3 participants 4 messages Mar 11, 2018 – Mar 13, 2018

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

PATCH 1/1 drm/vmwgfx: replace drm_*_unreference with drm_*_put

This patch replace instances of drm_framebuffer_unreference with _put() suffix, because it is shorter and consistent with the kernel use of *_get/put() suffixes.
This was done with the following Coccinelle script:

@r@
expression e;
@@

(
-drm_framebuffer_reference(e);
+drm_framebuffer_get(e);
|
-drm_framebuffer_unreference(e);
+drm_framebuffer_put(e);
)

---
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c    | 2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +1 -1
index d23a18a..be7d7fb 100644
@@ -500,7 +500,7 @@ static int vmw_fb_kms_detach(struct vmw_fb_par *par,
 	}
 
 	if (cur_fb) {
-		drm_framebuffer_unreference(cur_fb);
+		drm_framebuffer_put(cur_fb);
 		par->set_fb = NULL;
 	}
 
drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +2 -2
index 67f8446..c5e8eae 100644
@@ -316,7 +316,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data,
 out_no_surface:
 	ttm_read_unlock(&dev_priv->reservation_sem);
 out_no_ttm_lock:
-	drm_framebuffer_unreference(fb);
+	drm_framebuffer_put(fb);
 out_no_fb:
 	drm_modeset_unlock_all(dev);
 out_no_copy:
@@ -393,7 +393,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data,
 
 	ttm_read_unlock(&dev_priv->reservation_sem);
 out_no_ttm_lock:
-	drm_framebuffer_unreference(fb);
+	drm_framebuffer_put(fb);
 out_no_fb:
 	drm_modeset_unlock_all(dev);
 out_no_copy:
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Haneen Mohammed

This patch replace instances of drm_framebuffer_unreference with _put() suffix, because it is shorter and consistent with the kernel use of *_get/put() suffixes.
This was done with the following Coccinelle script:

@r@
expression e;
@@

(

(quoted diff) +1 -1
-drm_framebuffer_reference(e);
+drm_framebuffer_get(e);

|

(quoted diff) +1 -1
-drm_framebuffer_unreference(e);
+drm_framebuffer_put(e);

)

Quoted 1 line

Sinclair/Thomas: Ok if I pull this in through drm-misc? Makes outreachy applicant book-keeping easier since iirc the vmwgfx tree isn't in linux-next. But ok if you want to merge it too.
-Daniel

Quoted 43 lines
---
 drivers/gpu/drm/vmwgfx/vmwgfx_fb.c    | 2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +1 -1
index d23a18a..be7d7fb 100644
@@ -500,7 +500,7 @@ static int vmw_fb_kms_detach(struct vmw_fb_par *par,
 	}
 
 	if (cur_fb) {
-		drm_framebuffer_unreference(cur_fb);
+		drm_framebuffer_put(cur_fb);
 		par->set_fb = NULL;
 	}
 
drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +2 -2
index 67f8446..c5e8eae 100644
@@ -316,7 +316,7 @@ int vmw_present_ioctl(struct drm_device *dev, void *data,
 out_no_surface:
 	ttm_read_unlock(&dev_priv->reservation_sem);
 out_no_ttm_lock:
-	drm_framebuffer_unreference(fb);
+	drm_framebuffer_put(fb);
 out_no_fb:
 	drm_modeset_unlock_all(dev);
 out_no_copy:
@@ -393,7 +393,7 @@ int vmw_present_readback_ioctl(struct drm_device *dev, void *data,
 
 	ttm_read_unlock(&dev_priv->reservation_sem);
 out_no_ttm_lock:
-	drm_framebuffer_unreference(fb);
+	drm_framebuffer_put(fb);
 out_no_fb:
 	drm_modeset_unlock_all(dev);
 out_no_copy:
Signature · 1 line
2.7.4
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

Hi Daniel,

Quoted 18 lines · Daniel Vetter
Quoted 17 lines · Haneen Mohammed

This patch replace instances of drm_framebuffer_unreference with _put() suffix, because it is shorter and consistent with the kernel use of *_get/put() suffixes.
This was done with the following Coccinelle script:

@r@
expression e;
@@

(

(quoted diff) +1 -1
-drm_framebuffer_reference(e);
+drm_framebuffer_get(e);

|

(quoted diff) +1 -1
-drm_framebuffer_unreference(e);
+drm_framebuffer_put(e);

)

Quoted 7 lines
Quoted 1 line

Sinclair/Thomas: Ok if I pull this in through drm-misc? Makes outreachy applicant book-keeping easier since iirc the vmwgfx tree isn't in linux-next. But ok if you want to merge it too.

Yes, drm-misc is fine.

Thanks!

Sinclair

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

#3 lore raw
Quoted 26 lines · Sinclair Yeh

Hi Daniel,

Quoted 22 lines · Daniel Vetter
Quoted 17 lines · Haneen Mohammed

This patch replace instances of drm_framebuffer_unreference with _put() suffix, because it is shorter and consistent with the kernel use of *_get/put() suffixes.
This was done with the following Coccinelle script:

@r@
expression e;
@@

(

(quoted diff) +1 -1
-drm_framebuffer_reference(e);
+drm_framebuffer_get(e);

|

(quoted diff) +1 -1
-drm_framebuffer_unreference(e);
+drm_framebuffer_put(e);

)

Quoted 1 line
Quoted 5 lines
Quoted 3 lines

Sinclair/Thomas: Ok if I pull this in through drm-misc? Makes outreachy applicant book-keeping easier since iirc the vmwgfx tree isn't in linux-next. But ok if you want to merge it too.

Yes, drm-misc is fine.

Thanks, applied.
-Daniel

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