drm/fb-helper: Give up on kgdb for atomic drivers
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 3 Apr 2017 08:32:59 +0000 (10:32 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 6 Apr 2017 08:21:03 +0000 (10:21 +0200)
It just doesn't work. It probably stopped working way, way before that
(e.g. i915 grabbed random mutexes all over in modeset code at least
since gen6), but with atomic and all the ww_mutex stuff it's indeed
hopeless.

Remove ->mode_set_base_atomic from the 2 atomic drivers (i915 and
nouveau) that still had one (both had dummy implementations already
anyway), and shunt atomic drivers in the helpers debug_enter/leave
functions.

I'll leave the code in for radeon and amdgpu, but I think as soon as
amdgpu is atomic we should think about just ripping it out. Only
having it around for radeon and pre-nv50 is rather pointless. This
would also allow us to nuke all that code from fbdev.

Funny part is that _all_ kms drivers set this hook, despite that no
one else provides the required ->mode_set_base_atomic implementation.

The reason I'm jumping on this is that I want to wire up a full
acquire ctx for the benefit of atomic drivers, everywhere. And the
debug_enter/leave implementations call ->gamma_set. And there's just
no way ever we can create an acquire_ctx in the nmi context of kgdb.

Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170403083304.9083-11-daniel.vetter@ffwll.ch
drivers/gpu/drm/drm_fb_helper.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/nouveau/nv50_display.c

index 673a47445d61b5a494b0dbd92a34f95b402294f1..9147abb774e802c86c5baba7d8474096c99765bd 100644 (file)
@@ -281,6 +281,9 @@ int drm_fb_helper_debug_enter(struct fb_info *info)
                        if (funcs->mode_set_base_atomic == NULL)
                                continue;
 
+                       if (drm_drv_uses_atomic_modeset(mode_set->crtc->dev))
+                               continue;
+
                        drm_fb_helper_save_lut_atomic(mode_set->crtc, helper);
                        funcs->mode_set_base_atomic(mode_set->crtc,
                                                    mode_set->fb,
@@ -338,6 +341,9 @@ int drm_fb_helper_debug_leave(struct fb_info *info)
                if (funcs->mode_set_base_atomic == NULL)
                        continue;
 
+               if (drm_drv_uses_atomic_modeset(crtc->dev))
+                       continue;
+
                drm_fb_helper_restore_lut_atomic(mode_set->crtc);
                funcs->mode_set_base_atomic(mode_set->crtc, fb, crtc->x,
                                            crtc->y, LEAVE_ATOMIC_MODE_SET);
index f41a1f8b296b926684e24ee0779b4d59623a479d..602fd479dd30b0918140a6dc36927a3c65c35441 100644 (file)
@@ -3439,17 +3439,6 @@ static void skylake_disable_primary_plane(struct drm_plane *primary,
        spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
 }
 
-/* Assume fb object is pinned & idle & fenced and just update base pointers */
-static int
-intel_pipe_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb,
-                          int x, int y, enum mode_set_atomic state)
-{
-       /* Support for kgdboc is disabled, this needs a major rework. */
-       DRM_ERROR("legacy panic handler not supported any more.\n");
-
-       return -ENODEV;
-}
-
 static void intel_complete_page_flips(struct drm_i915_private *dev_priv)
 {
        struct intel_crtc *crtc;
@@ -11005,7 +10994,6 @@ static int intel_crtc_atomic_check(struct drm_crtc *crtc,
 }
 
 static const struct drm_crtc_helper_funcs intel_helper_funcs = {
-       .mode_set_base_atomic = intel_pipe_set_base_atomic,
        .atomic_begin = intel_begin_crtc_commit,
        .atomic_flush = intel_finish_crtc_commit,
        .atomic_check = intel_crtc_atomic_check,
index 418872b493a396221927f33ab7bd299586421607..3d381d5c82ce45d2bf19bdf7b0afcbbbf792ec38 100644 (file)
@@ -2210,18 +2210,8 @@ nv50_head_lut_load(struct drm_crtc *crtc)
        }
 }
 
-static int
-nv50_head_mode_set_base_atomic(struct drm_crtc *crtc,
-                              struct drm_framebuffer *fb, int x, int y,
-                              enum mode_set_atomic state)
-{
-       WARN_ON(1);
-       return 0;
-}
-
 static const struct drm_crtc_helper_funcs
 nv50_head_help = {
-       .mode_set_base_atomic = nv50_head_mode_set_base_atomic,
        .load_lut = nv50_head_lut_load,
        .atomic_check = nv50_head_atomic_check,
 };