From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 EF70FC433DF for ; Mon, 3 Aug 2020 11:22:43 +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 CCC7A20738 for ; Mon, 3 Aug 2020 11:22:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CCC7A20738 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com 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 E30986E25D; Mon, 3 Aug 2020 11:22:41 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0D8BB6E11A; Mon, 3 Aug 2020 11:22:39 +0000 (UTC) IronPort-SDR: ER62CD0G/ZnQleT5mxNrR+j9jggTLEyfMZyN66QdEmcQNTBrOATz/VIEFnpSj1soxoWsHZXe4x i5fQk77QVA0g== X-IronPort-AV: E=McAfee;i="6000,8403,9701"; a="132141217" X-IronPort-AV: E=Sophos;i="5.75,429,1589266800"; d="scan'208";a="132141217" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2020 04:22:39 -0700 IronPort-SDR: zd2GDu6ioj2xMQsk6W93hfl/90HuulrIaLTlPZ5gCdBQOLmL+O9jPauybMvBeRtqLQ1mM0+pvF LLXs3JDXq9NA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,429,1589266800"; d="scan'208";a="331859687" Received: from unknown (HELO [10.252.62.131]) ([10.252.62.131]) by orsmga007.jf.intel.com with ESMTP; 03 Aug 2020 04:22:37 -0700 Subject: Re: [PATCH] drm/nouveau: Drop mutex_lock_nested for atomic To: Daniel Vetter , DRI Development References: <20200802181849.1586281-1-daniel.vetter@ffwll.ch> From: Maarten Lankhorst Message-ID: <579702ca-4b4e-0b05-1b93-25b99554d464@linux.intel.com> Date: Mon, 3 Aug 2020 13:22:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200802181849.1586281-1-daniel.vetter@ffwll.ch> Content-Language: en-US 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: nouveau@lists.freedesktop.org, Daniel Vetter , Ben Skeggs , Maarten Lankhorst Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Op 02-08-2020 om 20:18 schreef Daniel Vetter: > 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 > > Signed-off-by: Daniel Vetter > Cc: Maarten Lankhorst > Cc: Ben Skeggs > Cc: Dave Airlie > Cc: nouveau@lists.freedesktop.org > --- > I might be totally wrong, so this definitely needs testing :-) > > Cheers, Daniel > --- > drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c > index 7806278dce57..a7b2a9bb0ffe 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_bo.c > +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c > @@ -776,7 +776,11 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, > 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, intr); > if (ret == 0) { > ret = drm->ttm.move(chan, bo, &bo->mem, new_reg); Well if you're certain it works now. :) Reviewed-by: Maarten Lankhorst _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel