All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: "Noralf Trønnes" <noralf@tronnes.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 9/9] drm/cma-helper: Remove unused fbdev code
Date: Wed, 28 Nov 2018 21:45:30 +0200	[thread overview]
Message-ID: <2787654.qN1ahS477L@avalon> (raw)
In-Reply-To: <20181025201340.34227-10-noralf@tronnes.org>

Hi Noralf,

Thank you for the patch.

On Thursday, 25 October 2018 23:13:40 EET Noralf Trønnes wrote:
> CMA helper drivers have been converted to drm_fbdev_generic_setup()
> so the fbdev code can be removed.
> 
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
> ---
> 
> Changes since version 1:
> - Rebased
> 
>  drivers/gpu/drm/Kconfig             |   4 --
>  drivers/gpu/drm/drm_fb_cma_helper.c | 130 ---------------------------------
>  include/drm/drm_fb_cma_helper.h     |  22 ------
>  3 files changed, 156 deletions(-)
> 
> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> index 4385f00e1d05..bd943a71756c 100644
> --- a/drivers/gpu/drm/Kconfig
> +++ b/drivers/gpu/drm/Kconfig
> @@ -170,10 +170,6 @@ config DRM_KMS_CMA_HELPER
>  	bool
>  	depends on DRM
>  	select DRM_GEM_CMA_HELPER
> -	select DRM_KMS_FB_HELPER
> -	select FB_SYS_FILLRECT
> -	select FB_SYS_COPYAREA
> -	select FB_SYS_IMAGEBLIT
>  	help
>  	  Choose this if you need the KMS CMA helper functions
> 
> diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c
> b/drivers/gpu/drm/drm_fb_cma_helper.c index fc2b42dd3dc6..0ddf9c65e5ab
> 100644
> --- a/drivers/gpu/drm/drm_fb_cma_helper.c
> +++ b/drivers/gpu/drm/drm_fb_cma_helper.c
> @@ -18,8 +18,6 @@
>   */
> 
>  #include <drm/drmP.h>
> -#include <drm/drm_client.h>
> -#include <drm/drm_fb_helper.h>
>  #include <drm/drm_framebuffer.h>
>  #include <drm/drm_gem_cma_helper.h>
>  #include <drm/drm_gem_framebuffer_helper.h>
> @@ -27,10 +25,6 @@
>  #include <drm/drm_print.h>

As far as I can tell, you can also drop drm/drm_fb_cma_helper.h and drm/
drm_print.h. If you include drm/drm_fourcc.h and drm/drm_plane.h, you can also 
drop drm/drmP.h.

Apart from that,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>  #include <linux/module.h>
> 
> -struct drm_fbdev_cma {
> -	struct drm_fb_helper	fb_helper;
> -};
> -
>  /**
>   * DOC: framebuffer cma helper functions
>   *
> @@ -39,16 +33,8 @@ struct drm_fbdev_cma {
>   *
>   * drm_gem_fb_create() is used in the &drm_mode_config_funcs.fb_create
>   * callback function to create a cma backed framebuffer.
> - *
> - * An fbdev framebuffer backed by cma is also available by calling
> - * drm_fb_cma_fbdev_init(). drm_fb_cma_fbdev_fini() tears it down.
>   */
> 
> -static inline struct drm_fbdev_cma *to_fbdev_cma(struct drm_fb_helper
> *helper) -{
> -	return container_of(helper, struct drm_fbdev_cma, fb_helper);
> -}
> -
>  /**
>   * drm_fb_cma_get_gem_obj() - Get CMA GEM object for framebuffer
>   * @fb: The framebuffer
> @@ -105,119 +91,3 @@ dma_addr_t drm_fb_cma_get_gem_addr(struct
> drm_framebuffer *fb, return paddr;
>  }
>  EXPORT_SYMBOL_GPL(drm_fb_cma_get_gem_addr);
> -
> -/**
> - * drm_fb_cma_fbdev_init() - Allocate and initialize fbdev emulation
> - * @dev: DRM device
> - * @preferred_bpp: Preferred bits per pixel for the device.
> - *                 @dev->mode_config.preferred_depth is used if this is
> zero. - * @max_conn_count: Maximum number of connectors.
> - *                  @dev->mode_config.num_connector is used if this is
> zero. - *
> - * Returns:
> - * Zero on success or negative error code on failure.
> - */
> -int drm_fb_cma_fbdev_init(struct drm_device *dev, unsigned int
> preferred_bpp, -			  unsigned int max_conn_count)
> -{
> -	struct drm_fbdev_cma *fbdev_cma;
> -
> -	/* dev->fb_helper will indirectly point to fbdev_cma after this call */
> -	fbdev_cma = drm_fbdev_cma_init(dev, preferred_bpp, max_conn_count);
> -	return PTR_ERR_OR_ZERO(fbdev_cma);
> -}
> -EXPORT_SYMBOL_GPL(drm_fb_cma_fbdev_init);
> -
> -/**
> - * drm_fb_cma_fbdev_fini() - Teardown fbdev emulation
> - * @dev: DRM device
> - */
> -void drm_fb_cma_fbdev_fini(struct drm_device *dev)
> -{
> -	if (dev->fb_helper)
> -		drm_fbdev_cma_fini(to_fbdev_cma(dev->fb_helper));
> -}
> -EXPORT_SYMBOL_GPL(drm_fb_cma_fbdev_fini);
> -
> -static const struct drm_fb_helper_funcs drm_fb_cma_helper_funcs = {
> -	.fb_probe = drm_fb_helper_generic_probe,
> -};
> -
> -/**
> - * drm_fbdev_cma_init() - Allocate and initializes a drm_fbdev_cma struct
> - * @dev: DRM device
> - * @preferred_bpp: Preferred bits per pixel for the device
> - * @max_conn_count: Maximum number of connectors
> - *
> - * Returns a newly allocated drm_fbdev_cma struct or a ERR_PTR.
> - */
> -struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev,
> -	unsigned int preferred_bpp, unsigned int max_conn_count)
> -{
> -	struct drm_fbdev_cma *fbdev_cma;
> -	struct drm_fb_helper *fb_helper;
> -	int ret;
> -
> -	fbdev_cma = kzalloc(sizeof(*fbdev_cma), GFP_KERNEL);
> -	if (!fbdev_cma)
> -		return ERR_PTR(-ENOMEM);
> -
> -	fb_helper = &fbdev_cma->fb_helper;
> -
> -	ret = drm_client_new(dev, &fb_helper->client, "fbdev", NULL);
> -	if (ret)
> -		goto err_free;
> -
> -	ret = drm_fb_helper_fbdev_setup(dev, fb_helper, &drm_fb_cma_helper_funcs,
> -					preferred_bpp, max_conn_count);
> -	if (ret)
> -		goto err_client_put;
> -
> -	return fbdev_cma;
> -
> -err_client_put:
> -	drm_client_release(&fb_helper->client);
> -err_free:
> -	kfree(fbdev_cma);
> -
> -	return ERR_PTR(ret);
> -}
> -EXPORT_SYMBOL_GPL(drm_fbdev_cma_init);
> -
> -/**
> - * drm_fbdev_cma_fini() - Free drm_fbdev_cma struct
> - * @fbdev_cma: The drm_fbdev_cma struct
> - */
> -void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma)
> -{
> -	drm_fb_helper_unregister_fbi(&fbdev_cma->fb_helper);
> -	/* All resources have now been freed by drm_fbdev_fb_destroy() */
> -}
> -EXPORT_SYMBOL_GPL(drm_fbdev_cma_fini);
> -
> -/**
> - * drm_fbdev_cma_restore_mode() - Restores initial framebuffer mode
> - * @fbdev_cma: The drm_fbdev_cma struct, may be NULL
> - *
> - * This function is usually called from the &drm_driver.lastclose callback.
> - */
> -void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma)
> -{
> -	if (fbdev_cma)
> -		drm_fb_helper_restore_fbdev_mode_unlocked(&fbdev_cma->fb_helper);
> -}
> -EXPORT_SYMBOL_GPL(drm_fbdev_cma_restore_mode);
> -
> -/**
> - * drm_fbdev_cma_hotplug_event() - Poll for hotpulug events
> - * @fbdev_cma: The drm_fbdev_cma struct, may be NULL
> - *
> - * This function is usually called from the
> &drm_mode_config.output_poll_changed - * callback.
> - */
> -void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma)
> -{
> -	if (fbdev_cma)
> -		drm_fb_helper_hotplug_event(&fbdev_cma->fb_helper);
> -}
> -EXPORT_SYMBOL_GPL(drm_fbdev_cma_hotplug_event);
> diff --git a/include/drm/drm_fb_cma_helper.h
> b/include/drm/drm_fb_cma_helper.h index 8dbbe1eece1b..4becb09975a4 100644
> --- a/include/drm/drm_fb_cma_helper.h
> +++ b/include/drm/drm_fb_cma_helper.h
> @@ -2,31 +2,9 @@
>  #ifndef __DRM_FB_CMA_HELPER_H__
>  #define __DRM_FB_CMA_HELPER_H__
> 
> -struct drm_fbdev_cma;
> -struct drm_gem_cma_object;
> -
> -struct drm_fb_helper_surface_size;
> -struct drm_framebuffer_funcs;
> -struct drm_fb_helper_funcs;
>  struct drm_framebuffer;
> -struct drm_fb_helper;
> -struct drm_device;
> -struct drm_file;
> -struct drm_mode_fb_cmd2;
> -struct drm_plane;
>  struct drm_plane_state;
> 
> -int drm_fb_cma_fbdev_init(struct drm_device *dev, unsigned int
> preferred_bpp, -			  unsigned int max_conn_count);
> -void drm_fb_cma_fbdev_fini(struct drm_device *dev);
> -
> -struct drm_fbdev_cma *drm_fbdev_cma_init(struct drm_device *dev,
> -	unsigned int preferred_bpp, unsigned int max_conn_count);
> -void drm_fbdev_cma_fini(struct drm_fbdev_cma *fbdev_cma);
> -
> -void drm_fbdev_cma_restore_mode(struct drm_fbdev_cma *fbdev_cma);
> -void drm_fbdev_cma_hotplug_event(struct drm_fbdev_cma *fbdev_cma);
> -
>  struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer
> *fb, unsigned int plane);


-- 
Regards,

Laurent Pinchart



_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2018-11-28 19:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-25 20:13 [PATCH v2 0/9] drm/cma-helper drivers: Use drm_fbdev_generic_setup() Noralf Trønnes
2018-10-25 20:13 ` [PATCH v2 1/9] drm/arc: " Noralf Trønnes
2018-11-01 14:34   ` Noralf Trønnes
2018-10-25 20:13 ` [PATCH v2 2/9] drm/fsl-dcu: " Noralf Trønnes
2018-11-01 14:34   ` Noralf Trønnes
2018-10-25 20:13 ` [PATCH v2 3/9] drm/hisilicon/kirin: " Noralf Trønnes
2018-10-25 20:13 ` [PATCH v2 4/9] drm/mxsfb: " Noralf Trønnes
2018-10-25 20:13 ` [PATCH v2 5/9] drm/rcar-du: " Noralf Trønnes
2018-11-20 14:21   ` Noralf Trønnes
2018-11-28 17:03   ` Noralf Trønnes
2018-11-28 18:56     ` Laurent Pinchart
2018-10-25 20:13 ` [PATCH v2 6/9] drm/atmel-hlcdc: " Noralf Trønnes
2018-10-25 20:25   ` Boris Brezillon
2018-11-01 14:35     ` Noralf Trønnes
2018-10-25 20:13 ` [PATCH v2 7/9] drm/sun4i: " Noralf Trønnes
2018-10-26  8:27   ` Maxime Ripard
2018-11-01 14:35     ` Noralf Trønnes
2018-10-25 20:13 ` [PATCH v2 8/9] drm/tilcdc: " Noralf Trønnes
2018-10-29 15:55   ` Jyri Sarha
2018-11-01 14:35     ` Noralf Trønnes
2018-10-25 20:13 ` [PATCH v2 9/9] drm/cma-helper: Remove unused fbdev code Noralf Trønnes
2018-11-28 19:45   ` Laurent Pinchart [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2787654.qN1ahS477L@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=noralf@tronnes.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.