diff mbox

[1/2] drm/armada: Replace drm_framebuffer_{un/reference} with put, get functions

Message ID 20180618132100.16863-2-tdz@users.sourceforge.net (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Zimmermann June 18, 2018, 1:20 p.m. UTC
This patch unifies the naming of DRM functions for reference counting
of struct drm_framebuffer. The resulting code is more aligned with the
rest of the Linux kernel interfaces.

Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
---
 drivers/gpu/drm/armada/armada_crtc.c    | 8 ++++----
 drivers/gpu/drm/armada/armada_overlay.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

Russell King (Oracle) June 26, 2018, 3:01 p.m. UTC | #1
This will conflict badly with patches to convert armada-drm to atomic
modeset.  Is there any rush for this change?

On Mon, Jun 18, 2018 at 03:20:59PM +0200, Thomas Zimmermann wrote:
> This patch unifies the naming of DRM functions for reference counting
> of struct drm_framebuffer. The resulting code is more aligned with the
> rest of the Linux kernel interfaces.
> 
> Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
> ---
>  drivers/gpu/drm/armada/armada_crtc.c    | 8 ++++----
>  drivers/gpu/drm/armada/armada_overlay.c | 2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c
> index 03eeee11dd5b..38724b554a54 100644
> --- a/drivers/gpu/drm/armada/armada_crtc.c
> +++ b/drivers/gpu/drm/armada/armada_crtc.c
> @@ -1220,7 +1220,7 @@ static int armada_drm_primary_update(struct drm_plane *plane,
>  		 * Take a reference on the new framebuffer - we want to
>  		 * hold on to it while the hardware is displaying it.
>  		 */
> -		drm_framebuffer_reference(fb);
> +		drm_framebuffer_get(fb);
>  
>  		work->old_fb = plane->fb;
>  	} else {
> @@ -1239,7 +1239,7 @@ static int armada_drm_primary_update(struct drm_plane *plane,
>  	if (!dplane->state.vsync_update) {
>  		work->fn(dcrtc, work);
>  		if (work->old_fb)
> -			drm_framebuffer_unreference(work->old_fb);
> +			drm_framebuffer_put(work->old_fb);
>  		return 0;
>  	}
>  
> @@ -1248,7 +1248,7 @@ static int armada_drm_primary_update(struct drm_plane *plane,
>  	if (ret) {
>  		work->fn(dcrtc, work);
>  		if (work->old_fb)
> -			drm_framebuffer_unreference(work->old_fb);
> +			drm_framebuffer_put(work->old_fb);
>  	}
>  
>  	dplane->next_work = !dplane->next_work;
> @@ -1308,7 +1308,7 @@ int armada_drm_plane_disable(struct drm_plane *plane,
>  	if (armada_drm_plane_work_queue(dcrtc, work)) {
>  		work->fn(dcrtc, work);
>  		if (work->old_fb)
> -			drm_framebuffer_unreference(work->old_fb);
> +			drm_framebuffer_put(work->old_fb);
>  	}
>  
>  	dplane->next_work = !dplane->next_work;
> diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c
> index c391955009d6..bb2874d84d74 100644
> --- a/drivers/gpu/drm/armada/armada_overlay.c
> +++ b/drivers/gpu/drm/armada/armada_overlay.c
> @@ -228,7 +228,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,
>  		 * Take a reference on the new framebuffer - we want to
>  		 * hold on to it while the hardware is displaying it.
>  		 */
> -		drm_framebuffer_reference(fb);
> +		drm_framebuffer_get(fb);
>  
>  		work->old_fb = plane->fb;
>  	} else {
> -- 
> 2.14.4
>
Thomas Zimmermann June 26, 2018, 3:37 p.m. UTC | #2
Hi

Am 26.06.2018 um 17:01 schrieb Russell King - ARM Linux:
> This will conflict badly with patches to convert armada-drm to atomic
> modeset.  Is there any rush for this change?

Not really. If you point me to the atomic-modeset changes, I'd send you
a port of the patches.


> 
> On Mon, Jun 18, 2018 at 03:20:59PM +0200, Thomas Zimmermann wrote:
>> This patch unifies the naming of DRM functions for reference counting
>> of struct drm_framebuffer. The resulting code is more aligned with the
>> rest of the Linux kernel interfaces.
>>
>> Signed-off-by: Thomas Zimmermann <tdz@users.sourceforge.net>
>> ---
>>  drivers/gpu/drm/armada/armada_crtc.c    | 8 ++++----
>>  drivers/gpu/drm/armada/armada_overlay.c | 2 +-
>>  2 files changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c
>> index 03eeee11dd5b..38724b554a54 100644
>> --- a/drivers/gpu/drm/armada/armada_crtc.c
>> +++ b/drivers/gpu/drm/armada/armada_crtc.c
>> @@ -1220,7 +1220,7 @@ static int armada_drm_primary_update(struct drm_plane *plane,
>>  		 * Take a reference on the new framebuffer - we want to
>>  		 * hold on to it while the hardware is displaying it.
>>  		 */
>> -		drm_framebuffer_reference(fb);
>> +		drm_framebuffer_get(fb);
>>  
>>  		work->old_fb = plane->fb;
>>  	} else {
>> @@ -1239,7 +1239,7 @@ static int armada_drm_primary_update(struct drm_plane *plane,
>>  	if (!dplane->state.vsync_update) {
>>  		work->fn(dcrtc, work);
>>  		if (work->old_fb)
>> -			drm_framebuffer_unreference(work->old_fb);
>> +			drm_framebuffer_put(work->old_fb);
>>  		return 0;
>>  	}
>>  
>> @@ -1248,7 +1248,7 @@ static int armada_drm_primary_update(struct drm_plane *plane,
>>  	if (ret) {
>>  		work->fn(dcrtc, work);
>>  		if (work->old_fb)
>> -			drm_framebuffer_unreference(work->old_fb);
>> +			drm_framebuffer_put(work->old_fb);
>>  	}
>>  
>>  	dplane->next_work = !dplane->next_work;
>> @@ -1308,7 +1308,7 @@ int armada_drm_plane_disable(struct drm_plane *plane,
>>  	if (armada_drm_plane_work_queue(dcrtc, work)) {
>>  		work->fn(dcrtc, work);
>>  		if (work->old_fb)
>> -			drm_framebuffer_unreference(work->old_fb);
>> +			drm_framebuffer_put(work->old_fb);
>>  	}
>>  
>>  	dplane->next_work = !dplane->next_work;
>> diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c
>> index c391955009d6..bb2874d84d74 100644
>> --- a/drivers/gpu/drm/armada/armada_overlay.c
>> +++ b/drivers/gpu/drm/armada/armada_overlay.c
>> @@ -228,7 +228,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,
>>  		 * Take a reference on the new framebuffer - we want to
>>  		 * hold on to it while the hardware is displaying it.
>>  		 */
>> -		drm_framebuffer_reference(fb);
>> +		drm_framebuffer_get(fb);
>>  
>>  		work->old_fb = plane->fb;
>>  	} else {
>> -- 
>> 2.14.4
>>
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c
index 03eeee11dd5b..38724b554a54 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -1220,7 +1220,7 @@  static int armada_drm_primary_update(struct drm_plane *plane,
 		 * Take a reference on the new framebuffer - we want to
 		 * hold on to it while the hardware is displaying it.
 		 */
-		drm_framebuffer_reference(fb);
+		drm_framebuffer_get(fb);
 
 		work->old_fb = plane->fb;
 	} else {
@@ -1239,7 +1239,7 @@  static int armada_drm_primary_update(struct drm_plane *plane,
 	if (!dplane->state.vsync_update) {
 		work->fn(dcrtc, work);
 		if (work->old_fb)
-			drm_framebuffer_unreference(work->old_fb);
+			drm_framebuffer_put(work->old_fb);
 		return 0;
 	}
 
@@ -1248,7 +1248,7 @@  static int armada_drm_primary_update(struct drm_plane *plane,
 	if (ret) {
 		work->fn(dcrtc, work);
 		if (work->old_fb)
-			drm_framebuffer_unreference(work->old_fb);
+			drm_framebuffer_put(work->old_fb);
 	}
 
 	dplane->next_work = !dplane->next_work;
@@ -1308,7 +1308,7 @@  int armada_drm_plane_disable(struct drm_plane *plane,
 	if (armada_drm_plane_work_queue(dcrtc, work)) {
 		work->fn(dcrtc, work);
 		if (work->old_fb)
-			drm_framebuffer_unreference(work->old_fb);
+			drm_framebuffer_put(work->old_fb);
 	}
 
 	dplane->next_work = !dplane->next_work;
diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c
index c391955009d6..bb2874d84d74 100644
--- a/drivers/gpu/drm/armada/armada_overlay.c
+++ b/drivers/gpu/drm/armada/armada_overlay.c
@@ -228,7 +228,7 @@  armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,
 		 * Take a reference on the new framebuffer - we want to
 		 * hold on to it while the hardware is displaying it.
 		 */
-		drm_framebuffer_reference(fb);
+		drm_framebuffer_get(fb);
 
 		work->old_fb = plane->fb;
 	} else {