* [PATCH 1/2] drm/sun4i: Remove redundant call to drm_connector_unregister_all()
@ 2016-07-13 16:39 Chris Wilson
2016-07-13 16:39 ` [PATCH 2/2] drm: Unexport drm_connector_unregister_all() Chris Wilson
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Chris Wilson @ 2016-07-13 16:39 UTC (permalink / raw)
To: dri-devel; +Cc: Daniel Vetter, Chen-Yu Tsai, Maxime Ripard, linux-arm-kernel
drm_connector_unregister_all() is automatically called by
drm_dev_unregister() and so the manual call can be dropped.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Chen-Yu Tsai <wens@csie.org>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org
---
drivers/gpu/drm/sun4i/sun4i_drv.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
index 4dc543e1db10..7092daaf6c43 100644
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
@@ -185,7 +185,6 @@ static void sun4i_drv_unbind(struct device *dev)
{
struct drm_device *drm = dev_get_drvdata(dev);
- drm_connector_unregister_all(drm);
drm_dev_unregister(drm);
drm_kms_helper_poll_fini(drm);
sun4i_framebuffer_free(drm);
--
2.8.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 2/2] drm: Unexport drm_connector_unregister_all() 2016-07-13 16:39 [PATCH 1/2] drm/sun4i: Remove redundant call to drm_connector_unregister_all() Chris Wilson @ 2016-07-13 16:39 ` Chris Wilson 2016-07-13 18:23 ` Sean Paul 2016-07-13 17:56 ` [PATCH 1/2] drm/sun4i: Remove redundant call to drm_connector_unregister_all() Sean Paul 2016-07-13 18:23 ` Sean Paul 2 siblings, 1 reply; 7+ messages in thread From: Chris Wilson @ 2016-07-13 16:39 UTC (permalink / raw) To: dri-devel; +Cc: Daniel Vetter This has now been removed from all drivers as it is performed centrally as a part of device unregistration for modesetting drivers. With the last user gone, we can unexport it from the DRM module. That requires us to move the code slightly to avoid the need for a forward declaration. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/drm_crtc.c | 29 +++++++++-------------------- include/drm/drm_crtc.h | 3 --- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index c85963f4f1dc..f65b75949c20 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -1115,6 +1115,15 @@ void drm_connector_unregister(struct drm_connector *connector) } EXPORT_SYMBOL(drm_connector_unregister); +static void drm_connector_unregister_all(struct drm_device *dev) +{ + struct drm_connector *connector; + + /* FIXME: taking the mode config mutex ends up in a clash with sysfs */ + list_for_each_entry(connector, &dev->mode_config.connector_list, head) + drm_connector_unregister(connector); +} + static int drm_connector_register_all(struct drm_device *dev) { struct drm_connector *connector; @@ -1138,26 +1147,6 @@ err: return ret; } -/** - * drm_connector_unregister_all - unregister connector userspace interfaces - * @dev: drm device - * - * This functions unregisters all connectors from sysfs and other places so - * that userspace can no longer access them. Drivers should call this as the - * first step tearing down the device instace, or when the underlying - * physical device disappeared (e.g. USB unplug), right before calling - * drm_dev_unregister(). - */ -void drm_connector_unregister_all(struct drm_device *dev) -{ - struct drm_connector *connector; - - /* FIXME: taking the mode config mutex ends up in a clash with sysfs */ - list_for_each_entry(connector, &dev->mode_config.connector_list, head) - drm_connector_unregister(connector); -} -EXPORT_SYMBOL(drm_connector_unregister_all); - static int drm_encoder_register_all(struct drm_device *dev) { struct drm_encoder *encoder; diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index ddaa7243af55..b1e72322ebd6 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -2588,9 +2588,6 @@ static inline unsigned drm_connector_index(struct drm_connector *connector) return connector->connector_id; } -/* helpers to {un}register all connectors from sysfs for device */ -extern void drm_connector_unregister_all(struct drm_device *dev); - extern __printf(5, 6) int drm_encoder_init(struct drm_device *dev, struct drm_encoder *encoder, -- 2.8.1 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] drm: Unexport drm_connector_unregister_all() 2016-07-13 16:39 ` [PATCH 2/2] drm: Unexport drm_connector_unregister_all() Chris Wilson @ 2016-07-13 18:23 ` Sean Paul 0 siblings, 0 replies; 7+ messages in thread From: Sean Paul @ 2016-07-13 18:23 UTC (permalink / raw) To: Chris Wilson; +Cc: Daniel Vetter, dri-devel On Wed, Jul 13, 2016 at 9:39 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote: > This has now been removed from all drivers as it is performed centrally > as a part of device unregistration for modesetting drivers. With the last > user gone, we can unexport it from the DRM module. That requires us to > move the code slightly to avoid the need for a forward declaration. > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> > Cc: David Airlie <airlied@linux.ie> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > Cc: dri-devel@lists.freedesktop.org Reviewed-by: Sean Paul <seanpaul@chromium.org> > --- > drivers/gpu/drm/drm_crtc.c | 29 +++++++++-------------------- > include/drm/drm_crtc.h | 3 --- > 2 files changed, 9 insertions(+), 23 deletions(-) > > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c > index c85963f4f1dc..f65b75949c20 100644 > --- a/drivers/gpu/drm/drm_crtc.c > +++ b/drivers/gpu/drm/drm_crtc.c > @@ -1115,6 +1115,15 @@ void drm_connector_unregister(struct drm_connector *connector) > } > EXPORT_SYMBOL(drm_connector_unregister); > > +static void drm_connector_unregister_all(struct drm_device *dev) > +{ > + struct drm_connector *connector; > + > + /* FIXME: taking the mode config mutex ends up in a clash with sysfs */ > + list_for_each_entry(connector, &dev->mode_config.connector_list, head) > + drm_connector_unregister(connector); > +} > + > static int drm_connector_register_all(struct drm_device *dev) > { > struct drm_connector *connector; > @@ -1138,26 +1147,6 @@ err: > return ret; > } > > -/** > - * drm_connector_unregister_all - unregister connector userspace interfaces > - * @dev: drm device > - * > - * This functions unregisters all connectors from sysfs and other places so > - * that userspace can no longer access them. Drivers should call this as the > - * first step tearing down the device instace, or when the underlying > - * physical device disappeared (e.g. USB unplug), right before calling > - * drm_dev_unregister(). > - */ > -void drm_connector_unregister_all(struct drm_device *dev) > -{ > - struct drm_connector *connector; > - > - /* FIXME: taking the mode config mutex ends up in a clash with sysfs */ > - list_for_each_entry(connector, &dev->mode_config.connector_list, head) > - drm_connector_unregister(connector); > -} > -EXPORT_SYMBOL(drm_connector_unregister_all); > - > static int drm_encoder_register_all(struct drm_device *dev) > { > struct drm_encoder *encoder; > diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h > index ddaa7243af55..b1e72322ebd6 100644 > --- a/include/drm/drm_crtc.h > +++ b/include/drm/drm_crtc.h > @@ -2588,9 +2588,6 @@ static inline unsigned drm_connector_index(struct drm_connector *connector) > return connector->connector_id; > } > > -/* helpers to {un}register all connectors from sysfs for device */ > -extern void drm_connector_unregister_all(struct drm_device *dev); > - > extern __printf(5, 6) > int drm_encoder_init(struct drm_device *dev, > struct drm_encoder *encoder, > -- > 2.8.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] drm/sun4i: Remove redundant call to drm_connector_unregister_all() 2016-07-13 16:39 [PATCH 1/2] drm/sun4i: Remove redundant call to drm_connector_unregister_all() Chris Wilson 2016-07-13 16:39 ` [PATCH 2/2] drm: Unexport drm_connector_unregister_all() Chris Wilson @ 2016-07-13 17:56 ` Sean Paul 2016-07-13 18:05 ` Chris Wilson 2016-07-13 18:23 ` Sean Paul 2 siblings, 1 reply; 7+ messages in thread From: Sean Paul @ 2016-07-13 17:56 UTC (permalink / raw) To: Chris Wilson Cc: Linux ARM Kernel, Daniel Vetter, Chen-Yu Tsai, Maxime Ripard, dri-devel On Wed, Jul 13, 2016 at 9:39 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote: > drm_connector_unregister_all() is automatically called by > drm_dev_unregister() and so the manual call can be dropped. > The documentation for drm_connector_unregister_all says "Drivers should call this [...] right before calling drm_dev_unregister()". If this is no longer true, could you update that comment as part of this series? Sean > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > Cc: Maxime Ripard <maxime.ripard@free-electrons.com> > Cc: David Airlie <airlied@linux.ie> > Cc: Chen-Yu Tsai <wens@csie.org> > Cc: dri-devel@lists.freedesktop.org > Cc: linux-arm-kernel@lists.infradead.org > --- > drivers/gpu/drm/sun4i/sun4i_drv.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c > index 4dc543e1db10..7092daaf6c43 100644 > --- a/drivers/gpu/drm/sun4i/sun4i_drv.c > +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c > @@ -185,7 +185,6 @@ static void sun4i_drv_unbind(struct device *dev) > { > struct drm_device *drm = dev_get_drvdata(dev); > > - drm_connector_unregister_all(drm); > drm_dev_unregister(drm); > drm_kms_helper_poll_fini(drm); > sun4i_framebuffer_free(drm); > -- > 2.8.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] drm/sun4i: Remove redundant call to drm_connector_unregister_all() 2016-07-13 17:56 ` [PATCH 1/2] drm/sun4i: Remove redundant call to drm_connector_unregister_all() Sean Paul @ 2016-07-13 18:05 ` Chris Wilson 0 siblings, 0 replies; 7+ messages in thread From: Chris Wilson @ 2016-07-13 18:05 UTC (permalink / raw) To: Sean Paul Cc: Linux ARM Kernel, Daniel Vetter, Chen-Yu Tsai, Maxime Ripard, dri-devel On Wed, Jul 13, 2016 at 10:56:58AM -0700, Sean Paul wrote: > On Wed, Jul 13, 2016 at 9:39 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote: > > drm_connector_unregister_all() is automatically called by > > drm_dev_unregister() and so the manual call can be dropped. > > > > The documentation for drm_connector_unregister_all says "Drivers > should call this [...] right before calling drm_dev_unregister()". If > this is no longer true, could you update that comment as part of this > series? That is done. (The comment block is entirely removed so that we don't distract authors with superfluous functions that they cannot call themselves, i.e. Daniel wanted only the DRM interfaces documented.) -Chris -- Chris Wilson, Intel Open Source Technology Centre _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] drm/sun4i: Remove redundant call to drm_connector_unregister_all() 2016-07-13 16:39 [PATCH 1/2] drm/sun4i: Remove redundant call to drm_connector_unregister_all() Chris Wilson 2016-07-13 16:39 ` [PATCH 2/2] drm: Unexport drm_connector_unregister_all() Chris Wilson 2016-07-13 17:56 ` [PATCH 1/2] drm/sun4i: Remove redundant call to drm_connector_unregister_all() Sean Paul @ 2016-07-13 18:23 ` Sean Paul 2016-07-19 8:05 ` Daniel Vetter 2 siblings, 1 reply; 7+ messages in thread From: Sean Paul @ 2016-07-13 18:23 UTC (permalink / raw) To: Chris Wilson Cc: Linux ARM Kernel, Daniel Vetter, Chen-Yu Tsai, Maxime Ripard, dri-devel On Wed, Jul 13, 2016 at 9:39 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote: > drm_connector_unregister_all() is automatically called by > drm_dev_unregister() and so the manual call can be dropped. > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > Cc: Maxime Ripard <maxime.ripard@free-electrons.com> > Cc: David Airlie <airlied@linux.ie> > Cc: Chen-Yu Tsai <wens@csie.org> > Cc: dri-devel@lists.freedesktop.org > Cc: linux-arm-kernel@lists.infradead.org Reviewed-by: Sean Paul <seanpaul@chromium.org> > --- > drivers/gpu/drm/sun4i/sun4i_drv.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c > index 4dc543e1db10..7092daaf6c43 100644 > --- a/drivers/gpu/drm/sun4i/sun4i_drv.c > +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c > @@ -185,7 +185,6 @@ static void sun4i_drv_unbind(struct device *dev) > { > struct drm_device *drm = dev_get_drvdata(dev); > > - drm_connector_unregister_all(drm); > drm_dev_unregister(drm); > drm_kms_helper_poll_fini(drm); > sun4i_framebuffer_free(drm); > -- > 2.8.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] drm/sun4i: Remove redundant call to drm_connector_unregister_all() 2016-07-13 18:23 ` Sean Paul @ 2016-07-19 8:05 ` Daniel Vetter 0 siblings, 0 replies; 7+ messages in thread From: Daniel Vetter @ 2016-07-19 8:05 UTC (permalink / raw) To: Sean Paul Cc: Daniel Vetter, dri-devel, Chen-Yu Tsai, Maxime Ripard, Linux ARM Kernel On Wed, Jul 13, 2016 at 11:23:29AM -0700, Sean Paul wrote: > On Wed, Jul 13, 2016 at 9:39 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote: > > drm_connector_unregister_all() is automatically called by > > drm_dev_unregister() and so the manual call can be dropped. > > > > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> > > Cc: Daniel Vetter <daniel.vetter@ffwll.ch> > > Cc: Maxime Ripard <maxime.ripard@free-electrons.com> > > Cc: David Airlie <airlied@linux.ie> > > Cc: Chen-Yu Tsai <wens@csie.org> > > Cc: dri-devel@lists.freedesktop.org > > Cc: linux-arm-kernel@lists.infradead.org > > > > Reviewed-by: Sean Paul <seanpaul@chromium.org> Done a backmerge and applied these two, thanks. -Daniel > > > --- > > drivers/gpu/drm/sun4i/sun4i_drv.c | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c > > index 4dc543e1db10..7092daaf6c43 100644 > > --- a/drivers/gpu/drm/sun4i/sun4i_drv.c > > +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c > > @@ -185,7 +185,6 @@ static void sun4i_drv_unbind(struct device *dev) > > { > > struct drm_device *drm = dev_get_drvdata(dev); > > > > - drm_connector_unregister_all(drm); > > drm_dev_unregister(drm); > > drm_kms_helper_poll_fini(drm); > > sun4i_framebuffer_free(drm); > > -- > > 2.8.1 > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-07-19 8:05 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-07-13 16:39 [PATCH 1/2] drm/sun4i: Remove redundant call to drm_connector_unregister_all() Chris Wilson 2016-07-13 16:39 ` [PATCH 2/2] drm: Unexport drm_connector_unregister_all() Chris Wilson 2016-07-13 18:23 ` Sean Paul 2016-07-13 17:56 ` [PATCH 1/2] drm/sun4i: Remove redundant call to drm_connector_unregister_all() Sean Paul 2016-07-13 18:05 ` Chris Wilson 2016-07-13 18:23 ` Sean Paul 2016-07-19 8:05 ` Daniel Vetter
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox