drm/vmwgfx: Drop drm_vblank_cleanup
Subsystems (3)
PATCH 1/2 drm/vmwgfx: Drop drm_vblank_cleanup
Again stopping the vblank before uninstalling the irq handler is kinda the wrong way round, but the fb_off stuff should take care of disabling the dsiplay at least in most cases. So drop the drm_vblank_cleanup code since it's not really doing anything, it looks all cargo-culted.
v2: Appease gcc better.
v3: Simplify code (Sean Paul)
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 ++------ drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 2 -- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 4 ---- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 9 --------- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 27 +-------------------------- 5 files changed, 3 insertions(+), 47 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +2 -6
@@ -1658,7 +1658,7 @@ int vmw_kms_init(struct vmw_private *dev_priv)int vmw_kms_close (struct vmw_private *dev_priv) { -int ret; +int ret =0 ;/* * Docs says we should take the lock before calling this function
@@ -1666,11 +1666,7 @@ int vmw_kms_close(struct vmw_private *dev_priv)* drm_encoder_cleanup which takes the lock we deadlock. */ drm_mode_config_cleanup (dev_priv->dev); -if (dev_priv->active_display_unit == vmw_du_screen_object) - ret =vmw_kms_sou_close_display (dev_priv); -else if (dev_priv->active_display_unit == vmw_du_screen_target) - ret =vmw_kms_stdu_close_display (dev_priv); -else +if (dev_priv->active_display_unit == vmw_du_legacy) ret =vmw_kms_ldu_close_display (dev_priv);return ret;
drivers/gpu/drm/vmwgfx/vmwgfx_kms.h +0 -2
@@ -390,7 +390,6 @@ int vmw_kms_update_proxy(struct vmw_resource *res,* Screen Objects display functions - vmwgfx_scrn.c */ int vmw_kms_sou_init_display (struct vmw_private *dev_priv); -int vmw_kms_sou_close_display (struct vmw_private *dev_priv); int vmw_kms_sou_do_surface_dirty(struct vmw_private *dev_priv, struct vmw_framebuffer *framebuffer, struct drm_clip_rect *clips,
@@ -418,7 +417,6 @@ int vmw_kms_sou_readback(struct vmw_private *dev_priv,* Screen Target Display Unit functions - vmwgfx_stdu.c */ int vmw_kms_stdu_init_display (struct vmw_private *dev_priv); -int vmw_kms_stdu_close_display (struct vmw_private *dev_priv); int vmw_kms_stdu_surface_dirty(struct vmw_private *dev_priv, struct vmw_framebuffer *framebuffer, struct drm_clip_rect *clips,
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +0 -4
@@ -582,13 +582,9 @@ int vmw_kms_ldu_init_display(struct vmw_private *dev_priv)int vmw_kms_ldu_close_display (struct vmw_private *dev_priv) { -struct drm_device *dev = dev_priv->dev; -if (!dev_priv->ldu_priv)return -ENOSYS ; -drm_vblank_cleanup (dev); -BUG_ON (!list_empty (&dev_priv->ldu_priv->active));kfree (dev_priv->ldu_priv);
drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +0 -9
@@ -746,15 +746,6 @@ int vmw_kms_sou_init_display(struct vmw_private *dev_priv)return 0 ; } -int vmw_kms_sou_close_display (struct vmw_private *dev_priv) -{ -struct drm_device *dev = dev_priv->dev; - -drm_vblank_cleanup (dev); - -return 0 ; -} -static int do_dmabuf_define_gmrfb (struct vmw_private *dev_priv,struct vmw_framebuffer *framebuffer) {
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +1 -26
@@ -1651,36 +1651,11 @@ int vmw_kms_stdu_init_display(struct vmw_private *dev_priv)if (unlikely (ret !=0 )) {DRM_ERROR ("Failed to initialize STDU %d" , i); - goto err_vblank_cleanup; +return ret; } }DRM_INFO ("Screen Target Display device initialized\n" );return 0 ; - -err_vblank_cleanup: -drm_vblank_cleanup (dev); -return ret; -} - - - -/** -* vmw_kms_stdu_close_display - Cleans up after vmw_kms_stdu_init_display -* -* @dev_priv: VMW DRM device -* -* Frees up any resources allocated by vmw_kms_stdu_init_display -* -* RETURNS: -* 0 on success -*/ -int vmw_kms_stdu_close_display (struct vmw_private *dev_priv) -{ -struct drm_device *dev = dev_priv->dev; - -drm_vblank_cleanup (dev); - -return 0 ; }
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/2 drm/vblank: Unexport drm_vblank_cleanup
There's no reason for drivers to call this, and all the ones I've removed looked very fishy:
- Proper quiescenting of the vblank machinery should be done by calling drm_crtc_vblank_off(), which is best done by shutting down the entire display engine with drm_atomic_helper_shutdown.
- Releasing of allocated memory is done by the core already, it calls drm_vblank_cleanup as a fallback.
- drm_vblank_cleanup also has checks for drivers which forget to clean up vblank interrupts.
This essentially reverts
commit e77cef9c2d87db835ad9d70cde4a9b00b0ca2262
Author: Jerome Glisse <[email protected]> Date: Thu Jan 7 15:39:13 2010 +0100
drm: Avoid calling vblank function is vblank wasn't initialized
which was done to fix a bug in radeon code with msi interrupts:
commit 003e69f9862bcda89a75c27750efdbc17ac02945
Author: Jerome Glisse <[email protected]> Date: Thu Jan 7 15:39:14 2010 +0100
drm/radeon/kms: Don't try to enable IRQ if we have no handler installed
Afaict from digging around in old code, this was needed to avoid blowing up in the ums fallback, and has stopped serving it's purpose long ago - if irq init fails, the driver fails to load, and there's really no way to blow up anymore.
Long story short, this was most likely a small ums compat/fallback hack that became a thing of it's own and got cargo-cult duplicated all over the drm codebase for essentially no gain at all.
v2: Mention that for drivers with a ->release callback cleanup is handled by drm_dev_fini() (Thierry).
--- drivers/gpu/drm/drm_internal.h | 1 + drivers/gpu/drm/drm_vblank.c | 19 ++----------------- include/drm/drm_vblank.h | 1 - 3 files changed, 3 insertions(+), 18 deletions(-)
drivers/gpu/drm/drm_internal.h +1 -0
@@ -57,6 +57,7 @@ int drm_gem_name_info(struct seq_file *m, void *data);/* drm_vblank.c */ extern unsigned int drm_timestamp_monotonic;void drm_vblank_disable_and_save (struct drm_device *dev,unsigned int pipe); +void drm_vblank_cleanup (struct drm_device *dev);/* IOCTLS */ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
drivers/gpu/drm/drm_vblank.c +2 -17
@@ -394,19 +394,6 @@ static void vblank_disable_fn(unsigned long arg)spin_unlock_irqrestore (&dev->vbl_lock, irqflags); } -/** -* drm_vblank_cleanup - cleanup vblank support -* @dev: DRM device -* -* This function cleans up any resources allocated in drm_vblank_init(). It is -* called by the DRM core when @dev is finalized. -* -* Drivers can call drm_vblank_cleanup() if they need to quiescent the vblank -* interrupt in their unload code. But in general this should be handled by -* disabling all active &drm_crtc through e.g. drm_atomic_helper_shutdown, which -* should end up calling drm_crtc_vblank_off(). -* -*/ void drm_vblank_cleanup (struct drm_device *dev) {unsigned int pipe;
@@ -428,7 +415,6 @@ void drm_vblank_cleanup(struct drm_device *dev) dev->num_crtcs =0 ; } -EXPORT_SYMBOL (drm_vblank_cleanup);/** * drm_vblank_init - initialize vblank support
@@ -436,9 +422,8 @@ EXPORT_SYMBOL(drm_vblank_cleanup);* @num_crtcs: number of CRTCs supported by @dev * * This function initializes vblank support for @num_crtcs display pipelines. -* Drivers do not need to call drm_vblank_cleanup(), cleanup is already handled -* by the DRM core, or through calling drm_dev_fini() for drivers with a -* &drm_driver.release callback. +* Cleanup is handled by the DRM core, or through calling drm_dev_fini() for +* drivers with a &drm_driver.release callback. * * Returns: * Zero on success or a negative error code on failure.
include/drm/drm_vblank.h +0 -1
@@ -168,7 +168,6 @@ void drm_crtc_wait_one_vblank(struct drm_crtc *crtc);void drm_crtc_vblank_off (struct drm_crtc *crtc);void drm_crtc_vblank_reset (struct drm_crtc *crtc);void drm_crtc_vblank_on (struct drm_crtc *crtc); -void drm_vblank_cleanup (struct drm_device *dev);u32 drm_crtc_accurate_vblank_count (struct drm_crtc *crtc); bool drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
Signature · 6 lines
2.11.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/2] drm/vblank: Unexport drm_vblank_cleanup
Quoted 40 lines · Daniel Vetter
There's no reason for drivers to call this, and all the ones I've removed looked very fishy:
- Proper quiescenting of the vblank machinery should be done by callingdrm_crtc_vblank_off(), which is best done by shutting down the entire display engine withdrm_atomic_helper_shutdown.- Releasing of allocated memory is done by the core already, it calls
drm_vblank_cleanupas a fallback.-
drm_vblank_cleanupalso has checks for drivers which forget to clean up vblank interrupts.This essentially reverts
commit
e77cef9c2d87db835ad9d70cde4a9b00b0ca2262Author: Jerome Glisse <[email protected]> Date: Thu Jan 7 15:39:13 2010 +0100drm: Avoid calling vblank function is vblank wasn't initialized
which was done to fix a bug in radeon code with msi interrupts:
commit
003e69f9862bcda89a75c27750efdbc17ac02945Author: Jerome Glisse <[email protected]> Date: Thu Jan 7 15:39:14 2010 +0100drm/radeon/kms: Don't try to enable IRQ if we have no handler installed
Afaict from digging around in old code, this was needed to avoid blowing up in the ums fallback, and has stopped serving it's purpose long ago - if irq init fails, the driver fails to load, and there's really no way to blow up anymore.
Long story short, this was most likely a small ums compat/fallback hack that became a thing of it's own and got cargo-cult duplicated all over the drm codebase for essentially no gain at all.
v2: Mention that for drivers with a ->release callback cleanup is handled by
drm_dev_fini()(Thierry).
Quoted 6 lines
Cc Thierry Reding <[email protected]>Acked-by Thierry Reding <[email protected]>Cc Jerome Glisse <[email protected]>Reviewed-by Sean Paul <[email protected]>Acked-by Alex Deucher <[email protected]>Signed-off-by Daniel Vetter <[email protected]>
Vacuumed up all the remaining patches here, thx to everyon who helped with the reviews.
-Daniel
Quoted 77 lines
--- drivers/gpu/drm/drm_internal.h | 1 + drivers/gpu/drm/drm_vblank.c | 19 ++----------------- include/drm/drm_vblank.h | 1 - 3 files changed, 3 insertions(+), 18 deletions(-)drivers/gpu/drm/drm_internal.h +1
-0@@ -57,6 +57,7 @@ int drm_gem_name_info(struct seq_file *m, void *data);/* drm_vblank.c */ extern unsigned int drm_timestamp_monotonic;void drm_vblank_disable_and_save (struct drm_device *dev,unsigned int pipe); +void drm_vblank_cleanup (struct drm_device *dev);/* IOCTLS */ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,drivers/gpu/drm/drm_vblank.c +2
-17@@ -394,19 +394,6 @@ static void vblank_disable_fn(unsigned long arg)spin_unlock_irqrestore (&dev->vbl_lock, irqflags); } -/** -* drm_vblank_cleanup - cleanup vblank support -* @dev: DRM device -* -* This function cleans up any resources allocated in drm_vblank_init(). It is -* called by the DRM core when @dev is finalized. -* -* Drivers can call drm_vblank_cleanup() if they need to quiescent the vblank -* interrupt in their unload code. But in general this should be handled by -* disabling all active &drm_crtc through e.g. drm_atomic_helper_shutdown, which -* should end up calling drm_crtc_vblank_off(). -* -*/ void drm_vblank_cleanup (struct drm_device *dev) {unsigned int pipe;@@ -428,7 +415,6 @@ void drm_vblank_cleanup(struct drm_device *dev) dev->num_crtcs =0 ; } -EXPORT_SYMBOL (drm_vblank_cleanup);/** * drm_vblank_init - initialize vblank support @@ -436,9 +422,8 @@ EXPORT_SYMBOL(drm_vblank_cleanup);* @num_crtcs: number of CRTCs supported by @dev * * This function initializes vblank support for @num_crtcs display pipelines. -* Drivers do not need to call drm_vblank_cleanup(), cleanup is already handled -* by the DRM core, or through calling drm_dev_fini() for drivers with a -* &drm_driver.release callback. +* Cleanup is handled by the DRM core, or through calling drm_dev_fini() for +* drivers with a &drm_driver.release callback. * * Returns: * Zero on success or a negative error code on failure. include/drm/drm_vblank.h +0
-1@@ -168,7 +168,6 @@ void drm_crtc_wait_one_vblank(struct drm_crtc *crtc);void drm_crtc_vblank_off (struct drm_crtc *crtc);void drm_crtc_vblank_reset (struct drm_crtc *crtc);void drm_crtc_vblank_on (struct drm_crtc *crtc); -void drm_vblank_cleanup (struct drm_device *dev);u32 drm_crtc_accurate_vblank_count (struct drm_crtc *crtc); bool drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,Signature · 1 line
2.11.0
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for series starting with [1/2] drm/vmwgfx: Drop drm_vblank_cleanup
In reply to Daniel Vetter== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm/vmwgfx: Drop drm_vblank_cleanup
URL : https://patchwork.freedesktop.org/series/26379/
State : success
== Summary ==
Series 26379v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/26379/revisions/1/mbox/
Test gem_exec_suspend:
Subgroup basic-s4-devices:
dmesg-warn -> PASS (fi-kbl-7560u) fdo#100125
Test kms_flip:
Subgroup basic-flip-vs-wf_vblank:
fail -> PASS (fi-blb-e6850) fdo#101599
Test kms_pipe_crc_basic:
Subgroup hang-read-crc-pipe-b:
dmesg-warn -> PASS (fi-pnv-d510) fdo#101597
Subgroup suspend-read-crc-pipe-b:
dmesg-warn -> PASS (fi-byt-n2820) fdo#101516fdo#100125 https://bugs.freedesktop.org/show_bug.cgi?id=100125
fdo#101599 https://bugs.freedesktop.org/show_bug.cgi?id=101599
fdo#101597 https://bugs.freedesktop.org/show_bug.cgi?id=101597
fdo#101516 https://bugs.freedesktop.org/show_bug.cgi?id=101516
fi-bdw-5557u total:279 pass:268 dwarn:0 dfail:0 fail:0 skip:11 time:439s fi-bdw-gvtdvm total:279 pass:257 dwarn:8 dfail:0 fail:0 skip:14 time:429s fi-blb-e6850 total:279 pass:224 dwarn:1 dfail:0 fail:0 skip:54 time:355s fi-bsw-n3050 total:279 pass:242 dwarn:1 dfail:0 fail:0 skip:36 time:536s fi-bxt-j4205 total:279 pass:260 dwarn:0 dfail:0 fail:0 skip:19 time:506s fi-byt-j1900 total:279 pass:253 dwarn:2 dfail:0 fail:0 skip:24 time:489s fi-byt-n2820 total:279 pass:250 dwarn:1 dfail:0 fail:0 skip:28 time:482s fi-glk-2a total:279 pass:260 dwarn:0 dfail:0 fail:0 skip:19 time:587s fi-hsw-4770 total:279 pass:263 dwarn:0 dfail:0 fail:0 skip:16 time:436s fi-hsw-4770r total:279 pass:263 dwarn:0 dfail:0 fail:0 skip:16 time:415s fi-ilk-650 total:279 pass:229 dwarn:0 dfail:0 fail:0 skip:50 time:416s fi-ivb-3520m total:279 pass:261 dwarn:0 dfail:0 fail:0 skip:18 time:490s fi-ivb-3770 total:279 pass:261 dwarn:0 dfail:0 fail:0 skip:18 time:474s fi-kbl-7500u total:279 pass:261 dwarn:0 dfail:0 fail:0 skip:18 time:465s fi-kbl-7560u total:279 pass:269 dwarn:0 dfail:0 fail:0 skip:10 time:572s fi-kbl-r total:279 pass:260 dwarn:1 dfail:0 fail:0 skip:18 time:577s fi-pnv-d510 total:279 pass:222 dwarn:2 dfail:0 fail:0 skip:55 time:557s fi-skl-6260u total:279 pass:269 dwarn:0 dfail:0 fail:0 skip:10 time:466s fi-skl-6700k total:279 pass:257 dwarn:4 dfail:0 fail:0 skip:18 time:466s fi-skl-6770hq total:279 pass:269 dwarn:0 dfail:0 fail:0 skip:10 time:474s fi-skl-gvtdvm total:279 pass:266 dwarn:0 dfail:0 fail:0 skip:13 time:437s fi-snb-2520m total:279 pass:251 dwarn:0 dfail:0 fail:0 skip:28 time:542s fi-snb-2600 total:279 pass:250 dwarn:0 dfail:0 fail:0 skip:29 time:408s
21d74e215ad650f0e8e30de609bd65601f0aa11d drm-tip: 2017y-06m-26d-09h-12m-14s UTC integration manifest f02de13 drm/vblank: Unexport drm_vblank_cleanup
337d139 drm/vmwgfx: Drop drm_vblank_cleanup
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_5044/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Thanks!
Minor typo "dsiplay", otherwise: Reviewed-by: Sinclair Yeh <[email protected]>
Quoted 152 lines · Daniel Vetter
Again stopping the vblank before uninstalling the irq handler is kinda the wrong way round, but the
fb_offstuff should take care of disabling the dsiplay at least in most cases. So drop thedrm_vblank_cleanupcode since it's not really doing anything, it looks all cargo-culted.v2: Appease gcc better.
v3: Simplify code (Sean Paul)
Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>Reviewed-by Sean Paul <[email protected]>Reviewed-by Thomas Hellstrom <[email protected]>Signed-off-by Daniel Vetter <[email protected]>--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 ++------ drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 2 -- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 4 ---- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 9 --------- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 27 +-------------------------- 5 files changed, 3 insertions(+), 47 deletions(-)drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +2
-6@@ -1658,7 +1658,7 @@ int vmw_kms_init(struct vmw_private *dev_priv)int vmw_kms_close (struct vmw_private *dev_priv) { -int ret; +int ret =0 ;/* * Docs says we should take the lock before calling this function @@ -1666,11 +1666,7 @@ int vmw_kms_close(struct vmw_private *dev_priv)* drm_encoder_cleanup which takes the lock we deadlock. */ drm_mode_config_cleanup (dev_priv->dev); -if (dev_priv->active_display_unit == vmw_du_screen_object) - ret =vmw_kms_sou_close_display (dev_priv); -else if (dev_priv->active_display_unit == vmw_du_screen_target) - ret =vmw_kms_stdu_close_display (dev_priv); -else +if (dev_priv->active_display_unit == vmw_du_legacy) ret =vmw_kms_ldu_close_display (dev_priv);return ret;drivers/gpu/drm/vmwgfx/vmwgfx_kms.h +0
-2@@ -390,7 +390,6 @@ int vmw_kms_update_proxy(struct vmw_resource *res,* Screen Objects display functions - vmwgfx_scrn.c */ int vmw_kms_sou_init_display (struct vmw_private *dev_priv); -int vmw_kms_sou_close_display (struct vmw_private *dev_priv); int vmw_kms_sou_do_surface_dirty(struct vmw_private *dev_priv, struct vmw_framebuffer *framebuffer, struct drm_clip_rect *clips,@@ -418,7 +417,6 @@ int vmw_kms_sou_readback(struct vmw_private *dev_priv,* Screen Target Display Unit functions - vmwgfx_stdu.c */ int vmw_kms_stdu_init_display (struct vmw_private *dev_priv); -int vmw_kms_stdu_close_display (struct vmw_private *dev_priv); int vmw_kms_stdu_surface_dirty(struct vmw_private *dev_priv, struct vmw_framebuffer *framebuffer, struct drm_clip_rect *clips,drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +0
-4@@ -582,13 +582,9 @@ int vmw_kms_ldu_init_display(struct vmw_private *dev_priv)int vmw_kms_ldu_close_display (struct vmw_private *dev_priv) { -struct drm_device *dev = dev_priv->dev; -if (!dev_priv->ldu_priv)return -ENOSYS ; -drm_vblank_cleanup (dev); -BUG_ON (!list_empty (&dev_priv->ldu_priv->active));kfree (dev_priv->ldu_priv);drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +0
-9@@ -746,15 +746,6 @@ int vmw_kms_sou_init_display(struct vmw_private *dev_priv)return 0 ; } -int vmw_kms_sou_close_display (struct vmw_private *dev_priv) -{ -struct drm_device *dev = dev_priv->dev; - -drm_vblank_cleanup (dev); - -return 0 ; -} -static int do_dmabuf_define_gmrfb (struct vmw_private *dev_priv,struct vmw_framebuffer *framebuffer) {drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +1
-26@@ -1651,36 +1651,11 @@ int vmw_kms_stdu_init_display(struct vmw_private *dev_priv)if (unlikely (ret !=0 )) {DRM_ERROR ("Failed to initialize STDU %d" , i); - goto err_vblank_cleanup; +return ret; } }DRM_INFO ("Screen Target Display device initialized\n" );return 0 ; - -err_vblank_cleanup: -drm_vblank_cleanup (dev); -return ret; -} - - - -/** -* vmw_kms_stdu_close_display - Cleans up after vmw_kms_stdu_init_display -* -* @dev_priv: VMW DRM device -* -* Frees up any resources allocated by vmw_kms_stdu_init_display -* -* RETURNS: -* 0 on success -*/ -int vmw_kms_stdu_close_display (struct vmw_private *dev_priv) -{ -struct drm_device *dev = dev_priv->dev; - -drm_vblank_cleanup (dev); - -return 0 ; }Signature · 1 line
2.11.0
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx