Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1961607rdf; Sun, 5 Nov 2023 23:38:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEiSXoLIA0ks+UHdannVL3tu87xxCszM/Ixoo8CLzUPRHVghy7EgwiUg4HlDkAIjzip29It X-Received: by 2002:a05:6358:60ce:b0:168:ec61:c26 with SMTP id i14-20020a05635860ce00b00168ec610c26mr20933076rwi.21.1699256289152; Sun, 05 Nov 2023 23:38:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699256289; cv=none; d=google.com; s=arc-20160816; b=D1nO68zc02HsVWyyFv/BMGw425IfAQTqq6qeCU8cjWkwGJzp72ERDrdEG6WHfpb/af NfZyWpt6ADJcXFF4FPXt/jwfQSuwiJBU171IFepFXgBov/z41pegicKpcPTH9ZYx66p5 ZdV4wCEUEHX2zPHIj4Zz/OZBmBh0u7LelvbjJgCgEvCrT+UNFwRiG7d8/0G5hEdvS9az b51rtotGp8uBqKnLLyTK/GkLY6c4+Ykg+NxuseaNN+6alzS+7SOo88h8hImo5MMFeyNb IuK0kLl3SAcDki2Uu3iqYaXR3mUl545WBqLobWFMDTDvp1+M+SS1dBCLkXmVh9e0uFu8 QNPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=pw15X5nE0X5oCFd9TOaWy/97dYSd84Mry+6q0RvNf3Y=; fh=iqBncDSqJNJjf6yrVTiC31xUXowzCoNhZDjpgC9Cf6o=; b=clOa6S1MwO8RM2wc0QVbi01YRgKUs/Z78yuLQxZW4K+tFZPquR+QGcNdYhcF1dLbc/ p9DUoGoWOiVbPIr/pu4163AMDYT7azrFC52zV5EdH9Q1/Za5Zg4JdWI2/PLsSGc+ObV2 gtKVHH2nv3w8YlT32sN8/hFKr8QBEt6qJAv7iyhWjCzSn1xPIMYoW79kFz51nih4gRYs XMfjfuIKSXFMgqjBh4ePFw83/nkyPimcih2XN2qQpTmsQtIySG0ZEdwTGUb6Wek+I2sr hw8mT1a1mwA1LkidDvdCdyuPWMkZ3c193w9kS8CJfXN5cX5kpWpaIE1cvvJOpVkbw63A P2nw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id g189-20020a636bc6000000b005b422bf48a4si7349360pgc.89.2023.11.05.23.38.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 23:38:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 00CAB802D520; Sun, 5 Nov 2023 23:38:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231205AbjKFHiG (ORCPT + 99 others); Mon, 6 Nov 2023 02:38:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231190AbjKFHiE (ORCPT ); Mon, 6 Nov 2023 02:38:04 -0500 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DEE3112 for ; Sun, 5 Nov 2023 23:37:56 -0800 (PST) X-UUID: 272ee5e3370f4af59d4d6569884386e7-20231106 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.32,REQID:650d6552-cc29-407a-8975-6d33b1b6e4b1,IP:5,U RL:0,TC:0,Content:0,EDM:25,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:15 X-CID-INFO: VERSION:1.1.32,REQID:650d6552-cc29-407a-8975-6d33b1b6e4b1,IP:5,URL :0,TC:0,Content:0,EDM:25,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:15 X-CID-META: VersionHash:5f78ec9,CLOUDID:6a6332fc-4a48-46e2-b946-12f04f20af8c,B ulkID:231106153745CC6A3BO8,BulkQuantity:0,Recheck:0,SF:66|24|17|19|44|102, TC:nil,Content:0,EDM:5,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0, OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: 272ee5e3370f4af59d4d6569884386e7-20231106 X-User: oushixiong@kylinos.cn Received: from localhost.localdomain [(116.128.244.169)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 364484791; Mon, 06 Nov 2023 15:37:44 +0800 From: oushixiong To: Maarten Lankhorst Cc: Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Shixiong Ou Subject: [PATCH] drm/atomic-helper: Call stall_checks() before allocate drm_crtc_commit Date: Mon, 6 Nov 2023 15:37:42 +0800 Message-Id: <20231106073742.158905-1-oushixiong@kylinos.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sun, 05 Nov 2023 23:38:08 -0800 (PST) From: Shixiong Ou Calling stall_checks() before allocating drm_crtc_commit not after that. Signed-off-by: Shixiong Ou --- drivers/gpu/drm/drm_atomic_helper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 2444fc33dd7c..94ea878b240d 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -2283,6 +2283,10 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state, funcs = state->dev->mode_config.helper_private; for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { + ret = stall_checks(crtc, nonblock); + if (ret) + return ret; + commit = kzalloc(sizeof(*commit), GFP_KERNEL); if (!commit) return -ENOMEM; @@ -2291,10 +2295,6 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state, new_crtc_state->commit = commit; - ret = stall_checks(crtc, nonblock); - if (ret) - return ret; - /* * Drivers only send out events when at least either current or * new CRTC state is active. Complete right away if everything -- 2.25.1