diff mbox

[04/10] drm/crtc: add interface to reinitialise the legacy mode group

Message ID 1399877207-15868-5-git-send-email-airlied@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dave Airlie May 12, 2014, 6:46 a.m. UTC
From: Dave Airlie <airlied@redhat.com>

This can be called to update things after dynamic connectors/encoders
are created/deleted.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/drm_crtc.c | 9 +++++++++
 include/drm/drm_crtc.h     | 1 +
 2 files changed, 10 insertions(+)

Comments

Thierry Reding May 13, 2014, 8:26 a.m. UTC | #1
On Mon, May 12, 2014 at 04:46:41PM +1000, Dave Airlie wrote:
> From: Dave Airlie <airlied@redhat.com>
> 
> This can be called to update things after dynamic connectors/encoders
> are created/deleted.
> 
> Signed-off-by: Dave Airlie <airlied@redhat.com>
> ---
>  drivers/gpu/drm/drm_crtc.c | 9 +++++++++
>  include/drm/drm_crtc.h     | 1 +
>  2 files changed, 10 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index f1753e6..8bf87a6 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -1421,6 +1421,15 @@ int drm_mode_group_init_legacy_group(struct drm_device *dev,
>  }
>  EXPORT_SYMBOL(drm_mode_group_init_legacy_group);
>  
> +void drm_reinit_primary_mode_group(struct drm_device *dev)
> +{
> +	drm_modeset_lock_all(dev);
> +	drm_mode_group_destroy(&dev->primary->mode_group);
> +	drm_mode_group_init_legacy_group(dev, &dev->primary->mode_group);
> +	drm_modeset_unlock_all(dev);
> +}
> +EXPORT_SYMBOL(drm_reinit_primary_mode_group);
> +
>  /**
>   * drm_crtc_convert_to_umode - convert a drm_display_mode into a modeinfo
>   * @out: drm_mode_modeinfo struct to return to the user
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index c6b9e8a..55bc523 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -916,6 +916,7 @@ extern const char *drm_get_tv_select_name(int val);
>  extern void drm_fb_release(struct drm_file *file_priv);
>  extern int drm_mode_group_init_legacy_group(struct drm_device *dev, struct drm_mode_group *group);
>  extern void drm_mode_group_destroy(struct drm_mode_group *group);
> +extern void drm_reinit_primary_mode_group(struct drm_device *dev);

There was a patch series once to remove all usage of extern from
prototypes. Was there an official decision against that which I missed,
or did it just fall off the table?

Thierry
Daniel Vetter May 13, 2014, 10:15 a.m. UTC | #2
On Tue, May 13, 2014 at 10:26:56AM +0200, Thierry Reding wrote:
> On Mon, May 12, 2014 at 04:46:41PM +1000, Dave Airlie wrote:
> > From: Dave Airlie <airlied@redhat.com>
> > 
> > This can be called to update things after dynamic connectors/encoders
> > are created/deleted.
> > 
> > Signed-off-by: Dave Airlie <airlied@redhat.com>
> > ---
> >  drivers/gpu/drm/drm_crtc.c | 9 +++++++++
> >  include/drm/drm_crtc.h     | 1 +
> >  2 files changed, 10 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> > index f1753e6..8bf87a6 100644
> > --- a/drivers/gpu/drm/drm_crtc.c
> > +++ b/drivers/gpu/drm/drm_crtc.c
> > @@ -1421,6 +1421,15 @@ int drm_mode_group_init_legacy_group(struct drm_device *dev,
> >  }
> >  EXPORT_SYMBOL(drm_mode_group_init_legacy_group);
> >  
> > +void drm_reinit_primary_mode_group(struct drm_device *dev)
> > +{
> > +	drm_modeset_lock_all(dev);
> > +	drm_mode_group_destroy(&dev->primary->mode_group);
> > +	drm_mode_group_init_legacy_group(dev, &dev->primary->mode_group);
> > +	drm_modeset_unlock_all(dev);
> > +}
> > +EXPORT_SYMBOL(drm_reinit_primary_mode_group);
> > +
> >  /**
> >   * drm_crtc_convert_to_umode - convert a drm_display_mode into a modeinfo
> >   * @out: drm_mode_modeinfo struct to return to the user
> > diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> > index c6b9e8a..55bc523 100644
> > --- a/include/drm/drm_crtc.h
> > +++ b/include/drm/drm_crtc.h
> > @@ -916,6 +916,7 @@ extern const char *drm_get_tv_select_name(int val);
> >  extern void drm_fb_release(struct drm_file *file_priv);
> >  extern int drm_mode_group_init_legacy_group(struct drm_device *dev, struct drm_mode_group *group);
> >  extern void drm_mode_group_destroy(struct drm_mode_group *group);
> > +extern void drm_reinit_primary_mode_group(struct drm_device *dev);
> 
> There was a patch series once to remove all usage of extern from
> prototypes. Was there an official decision against that which I missed,
> or did it just fall off the table?

Iirc I've done that for radeon or so and we decided that it's a bikeshed.
tbh I don't care, but in i915 I tend to rip them out since redundant.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index f1753e6..8bf87a6 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -1421,6 +1421,15 @@  int drm_mode_group_init_legacy_group(struct drm_device *dev,
 }
 EXPORT_SYMBOL(drm_mode_group_init_legacy_group);
 
+void drm_reinit_primary_mode_group(struct drm_device *dev)
+{
+	drm_modeset_lock_all(dev);
+	drm_mode_group_destroy(&dev->primary->mode_group);
+	drm_mode_group_init_legacy_group(dev, &dev->primary->mode_group);
+	drm_modeset_unlock_all(dev);
+}
+EXPORT_SYMBOL(drm_reinit_primary_mode_group);
+
 /**
  * drm_crtc_convert_to_umode - convert a drm_display_mode into a modeinfo
  * @out: drm_mode_modeinfo struct to return to the user
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index c6b9e8a..55bc523 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -916,6 +916,7 @@  extern const char *drm_get_tv_select_name(int val);
 extern void drm_fb_release(struct drm_file *file_priv);
 extern int drm_mode_group_init_legacy_group(struct drm_device *dev, struct drm_mode_group *group);
 extern void drm_mode_group_destroy(struct drm_mode_group *group);
+extern void drm_reinit_primary_mode_group(struct drm_device *dev);
 extern bool drm_probe_ddc(struct i2c_adapter *adapter);
 extern struct edid *drm_get_edid(struct drm_connector *connector,
 				 struct i2c_adapter *adapter);