LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] drm: rockchip: remove rockchip_drm_framebuffer_init() function
@ 2022-10-19 21:35 Johan Jonker
  2022-10-20  9:30 ` John Keeping
  2022-10-29 22:08 ` Heiko Stuebner
  0 siblings, 2 replies; 3+ messages in thread
From: Johan Jonker @ 2022-10-19 21:35 UTC (permalink / raw)
  To: john
  Cc: heiko, hjc, airlied, daniel, dri-devel, linux-arm-kernel,
	linux-rockchip, linux-kernel

The function rockchip_drm_framebuffer_init() was in use
in the rockchip_drm_fbdev.c file, but that is now replaced
by a generic fbdev setup. Reduce the image size by
removing the rockchip_drm_framebuffer_init() and sub function
rockchip_fb_alloc() and cleanup the rockchip_drm_fb.h header file.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 43 ----------------------
 drivers/gpu/drm/rockchip/rockchip_drm_fb.h |  6 ---
 2 files changed, 49 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
index 092bf863110b..409eaa1bf092 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
@@ -25,35 +25,6 @@ static const struct drm_framebuffer_funcs rockchip_drm_fb_funcs = {
 	.dirty	       = drm_atomic_helper_dirtyfb,
 };
 
-static struct drm_framebuffer *
-rockchip_fb_alloc(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd,
-		  struct drm_gem_object **obj, unsigned int num_planes)
-{
-	struct drm_framebuffer *fb;
-	int ret;
-	int i;
-
-	fb = kzalloc(sizeof(*fb), GFP_KERNEL);
-	if (!fb)
-		return ERR_PTR(-ENOMEM);
-
-	drm_helper_mode_fill_fb_struct(dev, fb, mode_cmd);
-
-	for (i = 0; i < num_planes; i++)
-		fb->obj[i] = obj[i];
-
-	ret = drm_framebuffer_init(dev, fb, &rockchip_drm_fb_funcs);
-	if (ret) {
-		DRM_DEV_ERROR(dev->dev,
-			      "Failed to initialize framebuffer: %d\n",
-			      ret);
-		kfree(fb);
-		return ERR_PTR(ret);
-	}
-
-	return fb;
-}
-
 static const struct drm_mode_config_helper_funcs rockchip_mode_config_helpers = {
 	.atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
 };
@@ -106,20 +77,6 @@ static const struct drm_mode_config_funcs rockchip_drm_mode_config_funcs = {
 	.atomic_commit = drm_atomic_helper_commit,
 };
 
-struct drm_framebuffer *
-rockchip_drm_framebuffer_init(struct drm_device *dev,
-			      const struct drm_mode_fb_cmd2 *mode_cmd,
-			      struct drm_gem_object *obj)
-{
-	struct drm_framebuffer *fb;
-
-	fb = rockchip_fb_alloc(dev, mode_cmd, &obj, 1);
-	if (IS_ERR(fb))
-		return ERR_CAST(fb);
-
-	return fb;
-}
-
 void rockchip_drm_mode_config_init(struct drm_device *dev)
 {
 	dev->mode_config.min_width = 0;
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.h b/drivers/gpu/drm/rockchip/rockchip_drm_fb.h
index 1a696521096d..bae4e079dfb1 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.h
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.h
@@ -7,11 +7,5 @@
 #ifndef _ROCKCHIP_DRM_FB_H
 #define _ROCKCHIP_DRM_FB_H
 
-struct drm_framebuffer *
-rockchip_drm_framebuffer_init(struct drm_device *dev,
-			      const struct drm_mode_fb_cmd2 *mode_cmd,
-			      struct drm_gem_object *obj);
-void rockchip_drm_framebuffer_fini(struct drm_framebuffer *fb);
-
 void rockchip_drm_mode_config_init(struct drm_device *dev);
 #endif /* _ROCKCHIP_DRM_FB_H */
-- 
2.20.1


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

* Re: [PATCH v1] drm: rockchip: remove rockchip_drm_framebuffer_init() function
  2022-10-19 21:35 [PATCH v1] drm: rockchip: remove rockchip_drm_framebuffer_init() function Johan Jonker
@ 2022-10-20  9:30 ` John Keeping
  2022-10-29 22:08 ` Heiko Stuebner
  1 sibling, 0 replies; 3+ messages in thread
From: John Keeping @ 2022-10-20  9:30 UTC (permalink / raw)
  To: Johan Jonker
  Cc: heiko, hjc, airlied, daniel, dri-devel, linux-arm-kernel,
	linux-rockchip, linux-kernel

On Wed, Oct 19, 2022 at 11:35:03PM +0200, Johan Jonker wrote:
> The function rockchip_drm_framebuffer_init() was in use
> in the rockchip_drm_fbdev.c file, but that is now replaced
> by a generic fbdev setup. Reduce the image size by
> removing the rockchip_drm_framebuffer_init() and sub function
> rockchip_fb_alloc() and cleanup the rockchip_drm_fb.h header file.
> 
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>

Reviewed-by: John Keeping <john@metanate.com>

> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 43 ----------------------
>  drivers/gpu/drm/rockchip/rockchip_drm_fb.h |  6 ---
>  2 files changed, 49 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> index 092bf863110b..409eaa1bf092 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> @@ -25,35 +25,6 @@ static const struct drm_framebuffer_funcs rockchip_drm_fb_funcs = {
>  	.dirty	       = drm_atomic_helper_dirtyfb,
>  };
>  
> -static struct drm_framebuffer *
> -rockchip_fb_alloc(struct drm_device *dev, const struct drm_mode_fb_cmd2 *mode_cmd,
> -		  struct drm_gem_object **obj, unsigned int num_planes)
> -{
> -	struct drm_framebuffer *fb;
> -	int ret;
> -	int i;
> -
> -	fb = kzalloc(sizeof(*fb), GFP_KERNEL);
> -	if (!fb)
> -		return ERR_PTR(-ENOMEM);
> -
> -	drm_helper_mode_fill_fb_struct(dev, fb, mode_cmd);
> -
> -	for (i = 0; i < num_planes; i++)
> -		fb->obj[i] = obj[i];
> -
> -	ret = drm_framebuffer_init(dev, fb, &rockchip_drm_fb_funcs);
> -	if (ret) {
> -		DRM_DEV_ERROR(dev->dev,
> -			      "Failed to initialize framebuffer: %d\n",
> -			      ret);
> -		kfree(fb);
> -		return ERR_PTR(ret);
> -	}
> -
> -	return fb;
> -}
> -
>  static const struct drm_mode_config_helper_funcs rockchip_mode_config_helpers = {
>  	.atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
>  };
> @@ -106,20 +77,6 @@ static const struct drm_mode_config_funcs rockchip_drm_mode_config_funcs = {
>  	.atomic_commit = drm_atomic_helper_commit,
>  };
>  
> -struct drm_framebuffer *
> -rockchip_drm_framebuffer_init(struct drm_device *dev,
> -			      const struct drm_mode_fb_cmd2 *mode_cmd,
> -			      struct drm_gem_object *obj)
> -{
> -	struct drm_framebuffer *fb;
> -
> -	fb = rockchip_fb_alloc(dev, mode_cmd, &obj, 1);
> -	if (IS_ERR(fb))
> -		return ERR_CAST(fb);
> -
> -	return fb;
> -}
> -
>  void rockchip_drm_mode_config_init(struct drm_device *dev)
>  {
>  	dev->mode_config.min_width = 0;
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.h b/drivers/gpu/drm/rockchip/rockchip_drm_fb.h
> index 1a696521096d..bae4e079dfb1 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.h
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.h
> @@ -7,11 +7,5 @@
>  #ifndef _ROCKCHIP_DRM_FB_H
>  #define _ROCKCHIP_DRM_FB_H
>  
> -struct drm_framebuffer *
> -rockchip_drm_framebuffer_init(struct drm_device *dev,
> -			      const struct drm_mode_fb_cmd2 *mode_cmd,
> -			      struct drm_gem_object *obj);
> -void rockchip_drm_framebuffer_fini(struct drm_framebuffer *fb);
> -
>  void rockchip_drm_mode_config_init(struct drm_device *dev);
>  #endif /* _ROCKCHIP_DRM_FB_H */
> -- 
> 2.20.1
> 

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

* Re: [PATCH v1] drm: rockchip: remove rockchip_drm_framebuffer_init() function
  2022-10-19 21:35 [PATCH v1] drm: rockchip: remove rockchip_drm_framebuffer_init() function Johan Jonker
  2022-10-20  9:30 ` John Keeping
@ 2022-10-29 22:08 ` Heiko Stuebner
  1 sibling, 0 replies; 3+ messages in thread
From: Heiko Stuebner @ 2022-10-29 22:08 UTC (permalink / raw)
  To: john, Johan Jonker
  Cc: Heiko Stuebner, daniel, linux-arm-kernel, linux-rockchip,
	linux-kernel, dri-devel, hjc, airlied

On Wed, 19 Oct 2022 23:35:03 +0200, Johan Jonker wrote:
> The function rockchip_drm_framebuffer_init() was in use
> in the rockchip_drm_fbdev.c file, but that is now replaced
> by a generic fbdev setup. Reduce the image size by
> removing the rockchip_drm_framebuffer_init() and sub function
> rockchip_fb_alloc() and cleanup the rockchip_drm_fb.h header file.
> 
> 
> [...]

Applied, thanks!

[1/1] drm: rockchip: remove rockchip_drm_framebuffer_init() function
      commit: 4016379301a33e8bd0c2ef5c02f5d7f6a4afece4

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

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

end of thread, other threads:[~2022-10-29 22:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-19 21:35 [PATCH v1] drm: rockchip: remove rockchip_drm_framebuffer_init() function Johan Jonker
2022-10-20  9:30 ` John Keeping
2022-10-29 22:08 ` Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).