diff mbox series

[4/5] drm/client: Remove unused drm_client_framebuffer_flush

Message ID 20241022232934.238124-5-linux@treblig.org (mailing list archive)
State New
Headers show
Series DRM deadcode | expand

Commit Message

Dr. David Alan Gilbert Oct. 22, 2024, 11:29 p.m. UTC
From: "Dr. David Alan Gilbert" <linux@treblig.org>

drm_client_framebuffer_flush() was explicitly added in 2020
by
commit c9c03e3cf072 ("drm/client: Add drm_client_framebuffer_flush()")
but has never been used.

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/gpu/drm/drm_client.c | 33 ---------------------------------
 include/drm/drm_client.h     |  1 -
 2 files changed, 34 deletions(-)

Comments

Thomas Zimmermann Oct. 23, 2024, 6:46 a.m. UTC | #1
Hi

Am 23.10.24 um 01:29 schrieb linux@treblig.org:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> drm_client_framebuffer_flush() was explicitly added in 2020
> by
> commit c9c03e3cf072 ("drm/client: Add drm_client_framebuffer_flush()")
> but has never been used.
>
> Remove it.

I had a patchset to use this helper for fbdev emulation. It just needs 
preparation in a number of drivers.

Best regards
Thomas

>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> ---
>   drivers/gpu/drm/drm_client.c | 33 ---------------------------------
>   include/drm/drm_client.h     |  1 -
>   2 files changed, 34 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c
> index bfedcbf516db..5d10ad3c2ca5 100644
> --- a/drivers/gpu/drm/drm_client.c
> +++ b/drivers/gpu/drm/drm_client.c
> @@ -552,39 +552,6 @@ void drm_client_framebuffer_delete(struct drm_client_buffer *buffer)
>   }
>   EXPORT_SYMBOL(drm_client_framebuffer_delete);
>   
> -/**
> - * drm_client_framebuffer_flush - Manually flush client framebuffer
> - * @buffer: DRM client buffer (can be NULL)
> - * @rect: Damage rectangle (if NULL flushes all)
> - *
> - * This calls &drm_framebuffer_funcs->dirty (if present) to flush buffer changes
> - * for drivers that need it.
> - *
> - * Returns:
> - * Zero on success or negative error code on failure.
> - */
> -int drm_client_framebuffer_flush(struct drm_client_buffer *buffer, struct drm_rect *rect)
> -{
> -	if (!buffer || !buffer->fb || !buffer->fb->funcs->dirty)
> -		return 0;
> -
> -	if (rect) {
> -		struct drm_clip_rect clip = {
> -			.x1 = rect->x1,
> -			.y1 = rect->y1,
> -			.x2 = rect->x2,
> -			.y2 = rect->y2,
> -		};
> -
> -		return buffer->fb->funcs->dirty(buffer->fb, buffer->client->file,
> -						0, 0, &clip, 1);
> -	}
> -
> -	return buffer->fb->funcs->dirty(buffer->fb, buffer->client->file,
> -					0, 0, NULL, 0);
> -}
> -EXPORT_SYMBOL(drm_client_framebuffer_flush);
> -
>   #ifdef CONFIG_DEBUG_FS
>   static int drm_client_debugfs_internal_clients(struct seq_file *m, void *data)
>   {
> diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h
> index bc0e66f9c425..560aae47e06d 100644
> --- a/include/drm/drm_client.h
> +++ b/include/drm/drm_client.h
> @@ -165,7 +165,6 @@ struct drm_client_buffer {
>   struct drm_client_buffer *
>   drm_client_framebuffer_create(struct drm_client_dev *client, u32 width, u32 height, u32 format);
>   void drm_client_framebuffer_delete(struct drm_client_buffer *buffer);
> -int drm_client_framebuffer_flush(struct drm_client_buffer *buffer, struct drm_rect *rect);
>   int drm_client_buffer_vmap_local(struct drm_client_buffer *buffer,
>   				 struct iosys_map *map_copy);
>   void drm_client_buffer_vunmap_local(struct drm_client_buffer *buffer);
Jocelyn Falempe Oct. 23, 2024, 8:04 a.m. UTC | #2
On 23/10/2024 08:46, Thomas Zimmermann wrote:
> Hi
> 
> Am 23.10.24 um 01:29 schrieb linux@treblig.org:
>> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>>
>> drm_client_framebuffer_flush() was explicitly added in 2020
>> by
>> commit c9c03e3cf072 ("drm/client: Add drm_client_framebuffer_flush()")
>> but has never been used.
>>
>> Remove it.
> 
> I had a patchset to use this helper for fbdev emulation. It just needs 
> preparation in a number of drivers.

It is used by drm_log, which is under review.
Please don't remove it.

https://patchwork.freedesktop.org/series/136789/
Dr. David Alan Gilbert Oct. 23, 2024, 11:03 a.m. UTC | #3
* Jocelyn Falempe (jfalempe@redhat.com) wrote:
> On 23/10/2024 08:46, Thomas Zimmermann wrote:
> > Hi
> > 
> > Am 23.10.24 um 01:29 schrieb linux@treblig.org:
> > > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> > > 
> > > drm_client_framebuffer_flush() was explicitly added in 2020
> > > by
> > > commit c9c03e3cf072 ("drm/client: Add drm_client_framebuffer_flush()")
> > > but has never been used.
> > > 
> > > Remove it.
> > 
> > I had a patchset to use this helper for fbdev emulation. It just needs
> > preparation in a number of drivers.
> 
> It is used by drm_log, which is under review.
> Please don't remove it.

OK, no problem.

Reviews on the rest of the series would be great.

Dave

> https://patchwork.freedesktop.org/series/136789/
> 
> -- 
> 
> Jocelyn
> 
> 
> > 
> > Best regards
> > Thomas
> > 
> > > 
> > > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> > > ---
> > >   drivers/gpu/drm/drm_client.c | 33 ---------------------------------
> > >   include/drm/drm_client.h     |  1 -
> > >   2 files changed, 34 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c
> > > index bfedcbf516db..5d10ad3c2ca5 100644
> > > --- a/drivers/gpu/drm/drm_client.c
> > > +++ b/drivers/gpu/drm/drm_client.c
> > > @@ -552,39 +552,6 @@ void drm_client_framebuffer_delete(struct
> > > drm_client_buffer *buffer)
> > >   }
> > >   EXPORT_SYMBOL(drm_client_framebuffer_delete);
> > > -/**
> > > - * drm_client_framebuffer_flush - Manually flush client framebuffer
> > > - * @buffer: DRM client buffer (can be NULL)
> > > - * @rect: Damage rectangle (if NULL flushes all)
> > > - *
> > > - * This calls &drm_framebuffer_funcs->dirty (if present) to flush
> > > buffer changes
> > > - * for drivers that need it.
> > > - *
> > > - * Returns:
> > > - * Zero on success or negative error code on failure.
> > > - */
> > > -int drm_client_framebuffer_flush(struct drm_client_buffer *buffer,
> > > struct drm_rect *rect)
> > > -{
> > > -    if (!buffer || !buffer->fb || !buffer->fb->funcs->dirty)
> > > -        return 0;
> > > -
> > > -    if (rect) {
> > > -        struct drm_clip_rect clip = {
> > > -            .x1 = rect->x1,
> > > -            .y1 = rect->y1,
> > > -            .x2 = rect->x2,
> > > -            .y2 = rect->y2,
> > > -        };
> > > -
> > > -        return buffer->fb->funcs->dirty(buffer->fb, buffer->client-
> > > >file,
> > > -                        0, 0, &clip, 1);
> > > -    }
> > > -
> > > -    return buffer->fb->funcs->dirty(buffer->fb, buffer->client->file,
> > > -                    0, 0, NULL, 0);
> > > -}
> > > -EXPORT_SYMBOL(drm_client_framebuffer_flush);
> > > -
> > >   #ifdef CONFIG_DEBUG_FS
> > >   static int drm_client_debugfs_internal_clients(struct seq_file *m,
> > > void *data)
> > >   {
> > > diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h
> > > index bc0e66f9c425..560aae47e06d 100644
> > > --- a/include/drm/drm_client.h
> > > +++ b/include/drm/drm_client.h
> > > @@ -165,7 +165,6 @@ struct drm_client_buffer {
> > >   struct drm_client_buffer *
> > >   drm_client_framebuffer_create(struct drm_client_dev *client, u32
> > > width, u32 height, u32 format);
> > >   void drm_client_framebuffer_delete(struct drm_client_buffer *buffer);
> > > -int drm_client_framebuffer_flush(struct drm_client_buffer *buffer,
> > > struct drm_rect *rect);
> > >   int drm_client_buffer_vmap_local(struct drm_client_buffer *buffer,
> > >                    struct iosys_map *map_copy);
> > >   void drm_client_buffer_vunmap_local(struct drm_client_buffer *buffer);
> > 
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c
index bfedcbf516db..5d10ad3c2ca5 100644
--- a/drivers/gpu/drm/drm_client.c
+++ b/drivers/gpu/drm/drm_client.c
@@ -552,39 +552,6 @@  void drm_client_framebuffer_delete(struct drm_client_buffer *buffer)
 }
 EXPORT_SYMBOL(drm_client_framebuffer_delete);
 
-/**
- * drm_client_framebuffer_flush - Manually flush client framebuffer
- * @buffer: DRM client buffer (can be NULL)
- * @rect: Damage rectangle (if NULL flushes all)
- *
- * This calls &drm_framebuffer_funcs->dirty (if present) to flush buffer changes
- * for drivers that need it.
- *
- * Returns:
- * Zero on success or negative error code on failure.
- */
-int drm_client_framebuffer_flush(struct drm_client_buffer *buffer, struct drm_rect *rect)
-{
-	if (!buffer || !buffer->fb || !buffer->fb->funcs->dirty)
-		return 0;
-
-	if (rect) {
-		struct drm_clip_rect clip = {
-			.x1 = rect->x1,
-			.y1 = rect->y1,
-			.x2 = rect->x2,
-			.y2 = rect->y2,
-		};
-
-		return buffer->fb->funcs->dirty(buffer->fb, buffer->client->file,
-						0, 0, &clip, 1);
-	}
-
-	return buffer->fb->funcs->dirty(buffer->fb, buffer->client->file,
-					0, 0, NULL, 0);
-}
-EXPORT_SYMBOL(drm_client_framebuffer_flush);
-
 #ifdef CONFIG_DEBUG_FS
 static int drm_client_debugfs_internal_clients(struct seq_file *m, void *data)
 {
diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h
index bc0e66f9c425..560aae47e06d 100644
--- a/include/drm/drm_client.h
+++ b/include/drm/drm_client.h
@@ -165,7 +165,6 @@  struct drm_client_buffer {
 struct drm_client_buffer *
 drm_client_framebuffer_create(struct drm_client_dev *client, u32 width, u32 height, u32 format);
 void drm_client_framebuffer_delete(struct drm_client_buffer *buffer);
-int drm_client_framebuffer_flush(struct drm_client_buffer *buffer, struct drm_rect *rect);
 int drm_client_buffer_vmap_local(struct drm_client_buffer *buffer,
 				 struct iosys_map *map_copy);
 void drm_client_buffer_vunmap_local(struct drm_client_buffer *buffer);