Re: [PATCH 1/3] drm: Add callbacks for late registering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 20, 2016 at 05:22:55PM +0200, Benjamin Gaignard wrote:
> Like what has been done for connectors add callbacks on encoder,
> crtc and plane to let driver do actions after drm device registration.
> 
> Correspondingly, add callbacks called before unregister drm device.
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@xxxxxxxxxx>
> ---
>  drivers/gpu/drm/drm_drv.c | 42 ++++++++++++++++++++++++++
>  include/drm/drm_crtc.h    | 77 +++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 119 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index c7101c0..b4f7f62 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -666,6 +666,9 @@ EXPORT_SYMBOL(drm_dev_unref);
>  int drm_dev_register(struct drm_device *dev, unsigned long flags)
>  {
>  	int ret;
> +	struct drm_crtc *crtc;
> +	struct drm_plane *plane;
> +	struct drm_encoder *encoder;
>  
>  	mutex_lock(&drm_global_mutex);
>  
> @@ -690,6 +693,27 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags)
>  	if (drm_core_check_feature(dev, DRIVER_MODESET))
>  		drm_connector_register_all(dev);

Look above for the ouch.

>  
> +	drm_for_each_crtc(crtc, dev) {
> +		if (crtc->funcs->late_register)
> +			ret = crtc->funcs->late_register(crtc);
> +		if (ret)
> +			goto err_minors;
> +	}

For the sake of conformity, is it worth adding drm_crtc_register_all()
et all?

Then a drm_modeset_register_all ? (i.e.
if (drm_core_check_feature(dev, DRIVER_MODESET))
	drm_modeset_register_all(dev);
	  -> { connector, encoder, plane, crtc )

Also, is the logical order 

drm_connector_register_all();
drm_encoder_register_all();
drm_plane_register_all();
drm_crtc_register_all();

or the other way around (basically working from output back to input, or
input to output)?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux