All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: DRI Development <dri-devel@lists.freedesktop.org>
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Ben Skeggs <bskeggs@redhat.com>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: [PATCH 10/15] drm/fb-helper: Give up on kgdb for atomic drivers
Date: Mon,  3 Apr 2017 10:32:59 +0200	[thread overview]
Message-ID: <20170403083304.9083-11-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20170403083304.9083-1-daniel.vetter@ffwll.ch>

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>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_fb_helper.c        |  6 ++++++
 drivers/gpu/drm/i915/intel_display.c   | 12 ------------
 drivers/gpu/drm/nouveau/nv50_display.c | 10 ----------
 3 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 673a47445d61..9147abb774e8 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -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);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 779ab46200c2..2bc9f2f609a9 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3412,17 +3412,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;
@@ -11017,7 +11006,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,
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index 418872b493a3..3d381d5c82ce 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -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,
 };
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-04-03  8:32 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03  8:32 [PATCH 00/15] acquire ctx wire-up, part 2 Daniel Vetter
2017-04-03  8:32 ` [PATCH 01/15] drm: Make drm_modeset_lock_crtc internal Daniel Vetter
2017-04-03 22:00   ` kbuild test robot
2017-04-03  8:32 ` [PATCH 02/15] drm: Remove drm_modeset_(un)lock_crtc Daniel Vetter
2017-04-03 22:13   ` kbuild test robot
2017-04-04  5:39     ` [Intel-gfx] " Daniel Vetter
2017-04-14 16:20       ` Mike Lothian
2017-04-18  6:32         ` [Intel-gfx] " Daniel Vetter
2017-04-03  8:32 ` [PATCH 03/15] drm: Remove drm_modeset_legacy_acquire_ctx and crtc->acquire_ctx Daniel Vetter
2017-04-03  8:32 ` [PATCH 04/15] drm/atomic-helper: remove modeset_lock_all from helper_resume Daniel Vetter
2017-04-05 19:31   ` Alex Deucher
2017-04-03  8:32 ` [PATCH 05/15] drm: drop modeset_lock_all from drm_state_info Daniel Vetter
2017-04-03  8:32 ` [PATCH 06/15] drm: Drop modeset_lock_all from the getproperty ioctl Daniel Vetter
2017-04-13 20:03   ` Alex Deucher
2017-04-13 20:18     ` [Intel-gfx] " Chris Wilson
2017-04-03  8:32 ` [PATCH 07/15] drm: Only take crtc lock in get_gamma ioctl Daniel Vetter
2017-04-03  8:32 ` [PATCH 08/15] drm/i915: Nuke intel_atomic_legacy_gamma_set Daniel Vetter
2017-04-04 10:44   ` Maarten Lankhorst
2017-04-05 11:16     ` Daniel Vetter
2017-04-03  8:32 ` [PATCH 09/15] drm/msm: Nerf zpos property Daniel Vetter
2017-04-05 13:24   ` Daniel Vetter
2017-04-03  8:32 ` Daniel Vetter [this message]
2017-04-03  8:33 ` [PATCH 11/15] drm: Add explicit acquire ctx handling around ->gamma_set Daniel Vetter
2017-04-03  8:33 ` [PATCH 12/15] drm: Add acquire ctx to ->gamma_set hook Daniel Vetter
2017-04-03 18:28   ` Sinclair Yeh
2017-04-06 16:51   ` Eric Anholt
2017-04-06 18:00     ` Daniel Vetter
2017-04-03  8:33 ` [PATCH 13/15] drm/atomic-helper: Remove legacy backoff hack from gamma_set Daniel Vetter
2017-04-03  8:33 ` [PATCH 14/15] drm: extract legacy framebuffer remove Daniel Vetter
2017-04-03  8:33 ` [PATCH 15/15] drm/fb-helper: Extract _legacy kms functions Daniel Vetter
2017-04-03  9:28 ` ✓ Fi.CI.BAT: success for acquire ctx wire-up, part 2 Patchwork
2017-04-05 19:45 ` [PATCH 00/15] " Alex Deucher
2017-04-06  8:23   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170403083304.9083-11-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=alexander.deucher@amd.com \
    --cc=bskeggs@redhat.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.