From patchwork Fri Nov 27 16:35:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11936641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 529E2C3E8C5 for ; Fri, 27 Nov 2020 16:35:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4688922228 for ; Fri, 27 Nov 2020 16:35:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="hFlyhkgv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4688922228 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 066466EE55; Fri, 27 Nov 2020 16:35:37 +0000 (UTC) Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id C4F436EE48 for ; Fri, 27 Nov 2020 16:35:35 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id 3so3328132wmg.4 for ; Fri, 27 Nov 2020 08:35:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wbQDpsnNx6iEwLidL6DLURUpC2nhApCFYPCzt297AgQ=; b=hFlyhkgv/UKsp4jlIgNmlznoycZBXcZxFaAqGtjanshomvy+4uEKcgesEDVLcrT8vk QA7Ys8FVro7udTMJFSQ7y8MrprQ/5J2RNE9soMnSMnBeDQ8JhNieIvbYxZ6uLyP7wkiL QGUMXd7RqYb/1c3Pj9OB00M9h8AQQpPxxTgjg= 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:mime-version :content-transfer-encoding; bh=wbQDpsnNx6iEwLidL6DLURUpC2nhApCFYPCzt297AgQ=; b=fb+vkR6AZwbSAvmKGkDQOJy6mINrO8yDaWFen1iG6IUrbbUqWfhaUfG+pXRUdtizJo cv9jOr5iZIOxxRW9Fa7d3QyuY4ZL4Ch8caelWxZO+ZL17EtI/X0FoIhzh4aNsuGKnW/n bUvNqGKY+SLHOA9UDZPyfs1/+UW1wHh845OPwwB7aL2KvdIsOLH4jGUQOgYHudcW3XzF PlggMB4vneV7sy3XmNEX4VP1R6EGQsQDisdUxq5D9TMWpH1Q7AjZrmWIqDEK5TvvUEdp ynI6YVdxdRtDiY8c6ipRWnPByZ+1ZgcC/5uIG+5rqPxtOxjDsnyVtYty3I62Xoe0DlQw hRKg== X-Gm-Message-State: AOAM530VtVPERn+HKK0eUHTRtWcs7GyeX6Itj4EWaE1ipz5Zu6o8bZof UdzPvC67xoZzuTZKJBZr2+zO53DGvN0TpQ== X-Google-Smtp-Source: ABdhPJzuLNM9EYTuTTLHSlGr2ozd09/eD3swjm8ptEHwhzLx5xhiHGzaF/RRUMAGf05+lO76W32ZhA== X-Received: by 2002:a05:600c:2110:: with SMTP id u16mr10268028wml.4.1606494934178; Fri, 27 Nov 2020 08:35:34 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id q81sm14711898wme.34.2020.11.27.08.35.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Nov 2020 08:35:33 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH RESEND] drm/nouveau: Drop mutex_lock_nested for atomic Date: Fri, 27 Nov 2020 17:35:28 +0100 Message-Id: <20201127163528.2221671-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maarten Lankhorst , Daniel Vetter , Ben Skeggs , nouveau@lists.freedesktop.org, Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Purely conjecture, but I think the original locking inversion with the legacy page flip code between flipping and ttm's bo move function shoudn't exist anymore with atomic: With atomic the bo pinning and actual modeset commit is completely separated in the code patsh. This annotation was originally added in commit 060810d7abaabcab282e062c595871d661561400 Author: Ben Skeggs Date: Mon Jul 8 14:15:51 2013 +1000 drm/nouveau: fix locking issues in page flipping paths due to commit b580c9e2b7ba5030a795aa2fb73b796523d65a78 Author: Maarten Lankhorst Date: Thu Jun 27 13:48:18 2013 +0200 drm/nouveau: make flipping lockdep safe Acked-by: Ben Skeggs Reviewed-by: Maarten Lankhorst Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Ben Skeggs Cc: Dave Airlie Cc: nouveau@lists.freedesktop.org --- drivers/gpu/drm/nouveau/nouveau_bo.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 1386b0fc1640..43069dd8b027 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -774,7 +774,10 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, return ret; } - mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING); + if (drm_drv_uses_atomic_modeset(drm->dev)) + mutex_lock(&cli->mutex); + else + mutex_lock_nested(&cli->mutex, SINGLE_DEPTH_NESTING); ret = nouveau_fence_sync(nouveau_bo(bo), chan, true, ctx->interruptible); if (ret == 0) { ret = drm->ttm.move(chan, bo, &bo->mem, new_reg);