Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3005950pxx; Sun, 1 Nov 2020 19:01:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJx95dtpbBH7mT+vNLOYUtteTUixT2Jxo7CXEO7G97sVWRi0lUit+7kGu5xQLEfgJSpoFcHa X-Received: by 2002:a17:906:c315:: with SMTP id s21mr13128609ejz.285.1604286106090; Sun, 01 Nov 2020 19:01:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604286106; cv=none; d=google.com; s=arc-20160816; b=epKcj9x6jsV3WxPqSzat/tV5L+WuSkPz8gOOQQIl+smKNFQoKWn4+7e/ivGREfKheQ WQ8IsebZF/D2VX+8Eu6Dwd8RaIT5/z4UYa8XnACNQ+Tzvdpm47RyTNJCYRDxc3CYHokY /6VRxE+I12WiFQOFx9Z2PH1EGUxqbqyEXxJCpIPMAF7GfZGD/6k24QNd51cRbLXE63Mf 097jfQgkYFxAB3UC4PMJi+y7BFsHN4sgEYSpnYvyX3q5C2sh7bk+FN1vv/1WvPXCbqBf PWcNOqErzAVcFlt0r0GJe2ugQfdR0yvPBTM/O5XZ667e6U2pTLZU6XYNFEsWk9G1YqRk lepg== 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=ieY0Zbw06jZcXGQPek3eESvMIMpSs+t7aDGDjMW49BE=; b=Z8vAauiPI+fQld9wY9G1iO/91hRJDcQbUYjAfhFbS0PJnZ1gA53qSlW2rKA+ihj3zu 0TUQTprOK3tYKHkxFHv8g4JgeuTYG7j+zyyYaXvygGLF3pJZ1zPzb/VEHhsH0hoRW+eg faT6b3NL+ELnNo+Et6sH1z8dtSoqTjQ0qfoG5EdPFVLjUhs4oySvDpkf5EOZqTYoXZeH O/mCBJbeObvyaQdTApn+4mplaFjiK4Ib2UygN4mZ/Ec1pI1gPp+VqSBdGeVPIsxhdvb9 W87XEHFMwBk/YEViQh6xUdAQMqf9kwmmVlVWj+FNxFBqcl/mt+G3HVQ2bsyscstAWfdd P2WA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g16si10039465edq.312.2020.11.01.19.01.20; Sun, 01 Nov 2020 19:01:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727561AbgKBC7A (ORCPT + 99 others); Sun, 1 Nov 2020 21:59:00 -0500 Received: from mail-m17613.qiye.163.com ([59.111.176.13]:47548 "EHLO mail-m17613.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727450AbgKBC7A (ORCPT ); Sun, 1 Nov 2020 21:59:00 -0500 Received: from ubuntu.localdomain (unknown [58.213.83.156]) by mail-m17613.qiye.163.com (Hmail) with ESMTPA id D17FA482B85; Mon, 2 Nov 2020 10:58:56 +0800 (CST) From: Bernard Zhao To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Bernard Zhao Subject: [PATCH] gpu/drm: make crtc check before new_connector circle Date: Sun, 1 Nov 2020 18:58:51 -0800 Message-Id: <20201102025851.3613-1-bernard@vivo.com> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZShhOTE1PGBpOHR9KVkpNS09JQ05CSExLTUlVEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS09ISFVLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Ngg6SRw4Tj8pLyEOMzgxCDNN NjhPCzlVSlVKTUtPSUNOQkhMTU5CVTMWGhIXVRkeCRUaCR87DRINFFUYFBZFWVdZEgtZQVlOQ1VJ SkhVQ0hVSk5NWVdZCAFZQUlOQ0o3Bg++ X-HM-Tid: 0a7586e4b56793bakuwsd17fa482b85 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In function prepare_signaling, crtc check (c==0) is not related with the next new_connector circle, maybe we can put the crtc check just after the crtc circle and before new_connector circle. This change is to make the code to run a bit first. Signed-off-by: Bernard Zhao --- drivers/gpu/drm/drm_atomic_uapi.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index 25c269bc4681..566110996474 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -1182,6 +1182,12 @@ static int prepare_signaling(struct drm_device *dev, c++; } + /* + * Having this flag means user mode pends on event which will never + * reach due to lack of at least one CRTC for signaling + */ + if (c == 0 && (arg->flags & DRM_MODE_PAGE_FLIP_EVENT)) + return -EINVAL; for_each_new_connector_in_state(state, conn, conn_state, i) { struct drm_writeback_connector *wb_conn; @@ -1220,13 +1226,6 @@ static int prepare_signaling(struct drm_device *dev, conn_state->writeback_job->out_fence = fence; } - /* - * Having this flag means user mode pends on event which will never - * reach due to lack of at least one CRTC for signaling - */ - if (c == 0 && (arg->flags & DRM_MODE_PAGE_FLIP_EVENT)) - return -EINVAL; - return 0; } -- 2.29.0