From 0dcac5008fcf57cce66ef091204efbde86956c7a Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Thu, 14 Jul 2016 15:16:34 +0200 Subject: [PATCH] Revert "drm: Resurrect atomic rmfb code" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This reverts commit 11c21e73f848844d439cbccb42a1018b8c560e5c. For reasons totally unclear this manages to wreak havoc with the audio rpm refcount: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 215 at drivers/gpu/drm/i915/intel_runtime_pm.c:1729 intel_display_power_put+0xe8/0x100 [i915] Use count on domain AUDIO is already zero Modules linked in: i915 ax88179_178a usbnet mii snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_hda_codec x86_pkg_temp_thermal snd_hwdep intel_powerclamp snd_hda_core co f_pclmul crc32_pclmul snd_pcm ghash_clmulni_intel mei_me mei e1000e ptp pps_core i2c_hid [last unloaded: i915] CPU: 0 PID: 215 Comm: kworker/0:2 Not tainted 4.7.0-rc6+ #44 Hardware name: Intel Corporation Skylake Client platform/Skylake Halo DDR4 RVP11, BIOS SKLSE2R1.R00.X106.B00.1601180206 01/18/2016 Workqueue: events output_poll_execute 0000000000000000 ffff88045573fa38 ffffffff813a2d6b ffff88045573fa88 0000000000000000 ffff88045573fa78 ffffffff81075db6 000006c15a590000 ffff88045a59a238 ffff88045a590054 ffff88045a590000 ffff88045a590000 Call Trace: [] dump_stack+0x4d/0x72 [] __warn+0xc6/0xe0 [] warn_slowpath_fmt+0x4a/0x50 [] ? hsw_audio_codec_disable+0xdd/0x110 [i915] [] intel_display_power_put+0xe8/0x100 [i915] [] intel_disable_ddi+0x46/0x80 [i915] [] haswell_crtc_disable+0x16f/0x290 [i915] [] intel_atomic_commit_tail+0x153/0x10e0 [i915] [] ? drm_atomic_helper_swap_state+0x140/0x2d0 [] intel_atomic_commit+0x3fd/0x520 [i915] [] ? drm_atomic_add_affected_connectors+0x22/0xf0 [] drm_atomic_commit+0x32/0x50 [] restore_fbdev_mode+0x147/0x260 [] drm_fb_helper_restore_fbdev_mode_unlocked+0x2e/0x70 [] drm_fb_helper_set_par+0x28/0x50 [] drm_fb_helper_hotplug_event+0x143/0x180 [] intel_fbdev_output_poll_changed+0x15/0x20 [i915] [] drm_kms_helper_hotplug_event+0x22/0x30 [] output_poll_execute+0x192/0x1e0 [] process_one_work+0x14c/0x480 [] worker_thread+0x24a/0x4e0 [] ? process_one_work+0x480/0x480 [] ? process_one_work+0x480/0x480 [] kthread+0xc4/0xe0 [] ret_from_fork+0x1f/0x40 [] ? kthread_worker_fn+0x180/0x180 ---[ end trace 2d440da5f0c053e4 ]--- Instead of scratching heads too much while CI is down, let's revert before more trouble is caused. Cc: Maarten Lankhorst Cc: Mika Kuoppala Cc: Ville Syrjälä Reported-by: Mika Kuoppala Reported-by: Ville Syrjälä Acked-by: Mika Kuoppala Acked-by: Ville Syrjälä Signed-off-by: Daniel Vetter Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/1468502194-17029-1-git-send-email-daniel.vetter@ffwll.ch --- drivers/gpu/drm/drm_atomic.c | 66 ----------------------------- drivers/gpu/drm/drm_crtc.c | 6 --- drivers/gpu/drm/drm_crtc_internal.h | 1 - 3 files changed, 73 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index dac0875e669c..d99ab2f6663f 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -1564,72 +1564,6 @@ void drm_atomic_clean_old_fb(struct drm_device *dev, } EXPORT_SYMBOL(drm_atomic_clean_old_fb); -int drm_atomic_remove_fb(struct drm_framebuffer *fb) -{ - struct drm_modeset_acquire_ctx ctx; - struct drm_device *dev = fb->dev; - struct drm_atomic_state *state; - struct drm_plane *plane; - int ret = 0; - unsigned plane_mask; - - state = drm_atomic_state_alloc(dev); - if (!state) - return -ENOMEM; - - drm_modeset_acquire_init(&ctx, 0); - state->acquire_ctx = &ctx; - -retry: - plane_mask = 0; - ret = drm_modeset_lock_all_ctx(dev, &ctx); - if (ret) - goto unlock; - - drm_for_each_plane(plane, dev) { - struct drm_plane_state *plane_state; - - if (plane->state->fb != fb) - continue; - - plane_state = drm_atomic_get_plane_state(state, plane); - if (IS_ERR(plane_state)) { - ret = PTR_ERR(plane_state); - goto unlock; - } - - drm_atomic_set_fb_for_plane(plane_state, NULL); - ret = drm_atomic_set_crtc_for_plane(plane_state, NULL); - if (ret) - goto unlock; - - plane_mask |= BIT(drm_plane_index(plane)); - - plane->old_fb = plane->fb; - plane->fb = NULL; - } - - if (plane_mask) - ret = drm_atomic_commit(state); - -unlock: - if (plane_mask) - drm_atomic_clean_old_fb(dev, plane_mask, ret); - - if (ret == -EDEADLK) { - drm_modeset_backoff(&ctx); - goto retry; - } - - if (ret || !plane_mask) - drm_atomic_state_free(state); - - drm_modeset_drop_locks(&ctx); - drm_modeset_acquire_fini(&ctx); - - return ret; -} - int drm_mode_atomic_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 9d3f80efc9cc..578bd6f5ce83 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -613,11 +613,6 @@ void drm_framebuffer_remove(struct drm_framebuffer *fb) * in this manner. */ if (drm_framebuffer_read_refcount(fb) > 1) { - if (dev->mode_config.funcs->atomic_commit) { - drm_atomic_remove_fb(fb); - goto out; - } - drm_modeset_lock_all(dev); /* remove from any CRTC */ drm_for_each_crtc(crtc, dev) { @@ -635,7 +630,6 @@ void drm_framebuffer_remove(struct drm_framebuffer *fb) drm_modeset_unlock_all(dev); } -out: drm_framebuffer_unreference(fb); } EXPORT_SYMBOL(drm_framebuffer_remove); diff --git a/drivers/gpu/drm/drm_crtc_internal.h b/drivers/gpu/drm/drm_crtc_internal.h index b248e2238a05..47a500b90fd7 100644 --- a/drivers/gpu/drm/drm_crtc_internal.h +++ b/drivers/gpu/drm/drm_crtc_internal.h @@ -125,7 +125,6 @@ int drm_atomic_get_property(struct drm_mode_object *obj, struct drm_property *property, uint64_t *val); int drm_mode_atomic_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); -int drm_atomic_remove_fb(struct drm_framebuffer *fb); int drm_modeset_register_all(struct drm_device *dev); void drm_modeset_unregister_all(struct drm_device *dev); -- 2.20.1