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 5/9] drm/rcar-du: Use drm_fbdev_generic_setup()
Date: Wed, 28 Nov 2018 20:56:55 +0200	[thread overview]
Message-ID: <29123019.QYAEDBMEp0@avalon> (raw)
In-Reply-To: <4ff6704b-d8f2-a8d1-496c-603193a09ea0@tronnes.org>

Hi Noralf,

Thank you for the patch.

On Wednesday, 28 November 2018 19:03:39 EET Noralf Trønnes wrote:
> Den 25.10.2018 22.13, skrev Noralf Trønnes:
> > The CMA helper is already using the drm_fb_helper_generic_probe part of
> > the generic fbdev emulation. This patch makes full use of the generic
> > fbdev emulation by using its drm_client callbacks. This means that
> > drm_mode_config_funcs->output_poll_changed and drm_driver->lastclose are
> > now handled by the emulation code. Additionally fbdev unregister happens
> > automatically on drm_dev_unregister().
> > 
> > The drm_fbdev_generic_setup() call is put after drm_dev_register() in the
> > driver. This is done to highlight the fact that fbdev emulation is an
> > internal client that makes use of the driver, it is not part of the
> > driver as such. If fbdev setup fails, an error is printed, but the driver
> > succeeds probing.
> > 
> > drm_fbdev_generic_setup() handles mode_config.num_connector being zero.
> > In that case it retries fbdev setup on the next .output_poll_changed.
> > 
> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> > Acked-by: Sam Ravnborg <sam@ravnborg.org>
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> > 
> > Changes since version 1:
> > - Rebased on: drm/rcar-du: Convert drm_atomic_helper_suspend/resume()
> > 
> > Laurent, do you want to take this through your tree, or do you want me to
> > apply it to drm-misc-next?
> > 
> >   drivers/gpu/drm/rcar-du/rcar_du_drv.c | 15 ++++-----------
> >   drivers/gpu/drm/rcar-du/rcar_du_drv.h |  2 --
> >   drivers/gpu/drm/rcar-du/rcar_du_kms.c | 21 ---------------------
> >   3 files changed, 4 insertions(+), 34 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> > b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 7015974c247a..27bfccd5b136
> > 100644
> > --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> > +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> > @@ -21,7 +21,9 @@
> >  #include <drm/drm_atomic_helper.h>
> >  #include <drm/drm_crtc_helper.h>
> >  #include <drm/drm_fb_cma_helper.h>
> > +#include <drm/drm_fb_helper.h>
> >  #include <drm/drm_gem_cma_helper.h>
> > +#include <drm/drm_modeset_helper.h>
> 
> I see that I forgot to remove this include when rebasing.
> 
> Will send a new version together with the other remaining patches.

Looks good to me, you can keep my Reviewed-by line. I'm fine with the patch 
being merged through the drm-misc tree.

> >   #include "rcar_du_drv.h"
> >   #include "rcar_du_kms.h"
> > 
> > @@ -363,19 +365,11 @@ MODULE_DEVICE_TABLE(of, rcar_du_of_table);
> >    * DRM operations
> >    */
> > 
> > -static void rcar_du_lastclose(struct drm_device *dev)
> > -{
> > -	struct rcar_du_device *rcdu = dev->dev_private;
> > -
> > -	drm_fbdev_cma_restore_mode(rcdu->fbdev);
> > -}
> > -
> >   DEFINE_DRM_GEM_CMA_FOPS(rcar_du_fops);
> >   
> >   static struct drm_driver rcar_du_driver = {
> >   	.driver_features	= DRIVER_GEM | DRIVER_MODESET | DRIVER_PRIME
> >   				| DRIVER_ATOMIC,
> > -	.lastclose		= rcar_du_lastclose,
> >   	.gem_free_object_unlocked = drm_gem_cma_free_object,
> >   	.gem_vm_ops		= &drm_gem_cma_vm_ops,
> >   	.prime_handle_to_fd	= drm_gem_prime_handle_to_fd,
> > @@ -431,9 +425,6 @@ static int rcar_du_remove(struct platform_device
> > *pdev)
> > 
> >   	drm_dev_unregister(ddev);
> > 
> > -	if (rcdu->fbdev)
> > -		drm_fbdev_cma_fini(rcdu->fbdev);
> > -
> >   	drm_kms_helper_poll_fini(ddev);
> >   	drm_mode_config_cleanup(ddev);
> > 
> > @@ -493,6 +484,8 @@ static int rcar_du_probe(struct platform_device *pdev)
> > 
> >   	DRM_INFO("Device %s probed\n", dev_name(&pdev->dev));
> > 
> > +	drm_fbdev_generic_setup(ddev, 32);
> > +
> >   	return 0;
> >   
> >   error:
> > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.h
> > b/drivers/gpu/drm/rcar-du/rcar_du_drv.h index 9f5563296c5a..a68da79b424e
> > 100644
> > --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.h
> > +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.h
> > @@ -20,7 +20,6 @@
> >   struct clk;
> >   struct device;
> >   struct drm_device;
> > -struct drm_fbdev_cma;
> >   struct rcar_du_device;
> >   
> >   #define RCAR_DU_FEATURE_CRTC_IRQ_CLOCK	BIT(0)	/* Per-CRTC IRQ and clock
> >   */
> > @@ -78,7 +77,6 @@ struct rcar_du_device {
> >   	void __iomem *mmio;
> >   	
> >   	struct drm_device *ddev;
> > -	struct drm_fbdev_cma *fbdev;
> >   	struct rcar_du_crtc crtcs[RCAR_DU_MAX_CRTCS];
> >   	unsigned int num_crtcs;
> > 
> > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
> > b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index 4ebd61ecbee1..6562871aa706
> > 100644
> > --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
> > +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
> > @@ -255,13 +255,6 @@ rcar_du_fb_create(struct drm_device *dev, struct
> > drm_file *file_priv,
> >   	return drm_gem_fb_create(dev, file_priv, mode_cmd);
> >   }
> > 
> > -static void rcar_du_output_poll_changed(struct drm_device *dev)
> > -{
> > -	struct rcar_du_device *rcdu = dev->dev_private;
> > -
> > -	drm_fbdev_cma_hotplug_event(rcdu->fbdev);
> > -}
> > -
> >   /* ---------------------------------------------------------------------
> >    * Atomic Check and Update
> >    */
> > @@ -308,7 +301,6 @@ static const struct drm_mode_config_helper_funcs
> > rcar_du_mode_config_helper = {
> >   static const struct drm_mode_config_funcs rcar_du_mode_config_funcs = {
> >   	.fb_create = rcar_du_fb_create,
> > -	.output_poll_changed = rcar_du_output_poll_changed,
> >   	.atomic_check = rcar_du_atomic_check,
> >   	.atomic_commit = drm_atomic_helper_commit,
> >   };
> > @@ -543,7 +535,6 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
> > 
> >   	struct drm_device *dev = rcdu->ddev;
> >   	struct drm_encoder *encoder;
> > -	struct drm_fbdev_cma *fbdev;
> >   	unsigned int dpad0_sources;
> >   	unsigned int num_encoders;
> >   	unsigned int num_groups;
> > @@ -682,17 +673,5 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
> > 
> >   	drm_kms_helper_poll_init(dev);
> > 
> > -	if (dev->mode_config.num_connector) {
> > -		fbdev = drm_fbdev_cma_init(dev, 32,
> > -					   dev->mode_config.num_connector);
> > -		if (IS_ERR(fbdev))
> > -			return PTR_ERR(fbdev);
> > -
> > -		rcdu->fbdev = fbdev;
> > -	} else {
> > -		dev_info(rcdu->dev,
> > -			 "no connector found, disabling fbdev emulation\n");
> > -	}
> > -
> >   	return 0;
> >   }

-- 
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 18:56 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 [this message]
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

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=29123019.QYAEDBMEp0@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.