From patchwork Mon Apr 3 08:32:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9658985 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DCC4160352 for ; Mon, 3 Apr 2017 08:34:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFED028450 for ; Mon, 3 Apr 2017 08:34:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4EBE2845B; Mon, 3 Apr 2017 08:34:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7B91528450 for ; Mon, 3 Apr 2017 08:34:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 51E136E31A; Mon, 3 Apr 2017 08:33:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0B4D96E30B for ; Mon, 3 Apr 2017 08:33:24 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id w43so31336786wrb.1 for ; Mon, 03 Apr 2017 01:33:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ajiNd93gO4PyXFSPlD8ZmEODDOTmS33Jg3S0ld3CNE8=; b=kgPJERMGFCBb5gEy/N5KlDBe+jsWiVsdsmsibHz1hFBNDCXTiWXl9tV6VfM7iloZTb xZ0ges90/LjnFJYiiLU9XP90zZ4G68cFE3RtA97uj7XYmcDjMe/cDavHvM6EeJxpBYps oxLZH40gEpsseJbLyniXTbZYrXfrOSHSXFjO8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ajiNd93gO4PyXFSPlD8ZmEODDOTmS33Jg3S0ld3CNE8=; b=SQ2hQx9YLJ732ioAjTG0zDHM1VA4WXyIdJ+4rDg2cQD8r1n/usw2BZZNXDNd2oQjMn Fj1vDZ9xUALkqzNwRi/t7HVAaD0IDMDa2KJCAZ5vsE4XPa8jaCLNZPhnV1g/HSEqmHaY iHYk3E9hz4j4g0UaUzu+4V9V2iqcRSKS0RoM0jU1zjjpE9+1KK+zK4YgkuxBlQ9rkCS4 3AzTiTgiUhoPBX3rg6ClBfaJb3bc2WlyWn9cz/TCtaAF8IcYmWHp6lxMVp578MRv9l4W w6vNMwJgF5nWuVdYFb36erAx4TcjtwEMdlmV3ufGM/kPi6SVFixZGR2KWX9pB4FNFE1V vJbA== X-Gm-Message-State: AFeK/H0pKywudtkpym4Xrlg0ttbQVX7RU6En1G1gQrBknJZGoCE9uxw70s++0WpN5JVOFg== X-Received: by 10.223.169.113 with SMTP id u104mr13173299wrc.168.1491208402418; Mon, 03 Apr 2017 01:33:22 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:56b5:0:3dcb:681a:5b6e:8025]) by smtp.gmail.com with ESMTPSA id w10sm13326590wmw.14.2017.04.03.01.33.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 01:33:21 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 10/15] drm/fb-helper: Give up on kgdb for atomic drivers Date: Mon, 3 Apr 2017 10:32:59 +0200 Message-Id: <20170403083304.9083-11-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170403083304.9083-1-daniel.vetter@ffwll.ch> References: <20170403083304.9083-1-daniel.vetter@ffwll.ch> Cc: Alex Deucher , Daniel Vetter , Intel Graphics Development , Ben Skeggs , Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Alex Deucher Signed-off-by: Daniel Vetter --- 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, };