Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp426343rdh; Thu, 23 Nov 2023 07:38:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmAxBgxWa1awOLsoEXHKBe8sF/h0KDjFRdfBdFey5RMmn+dIssDhljh5XqJgQdNKdWl428 X-Received: by 2002:a05:6a21:8cc6:b0:187:3765:1795 with SMTP id ta6-20020a056a218cc600b0018737651795mr5669954pzb.40.1700753884986; Thu, 23 Nov 2023 07:38:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700753884; cv=none; d=google.com; s=arc-20160816; b=R2b9Vt9Z9SuRCJbujWioRsEceELIhclKheXOi84KduxJfaEPCv8+PKaEBNppCZCify 5DD9/1t3yJ5mfW4E6YZDdxQ/KFAj3vg9ppgrmEpJYn44ZlE3pK5PBPimuPNCU496Kb6x /yJ1NGnWkUb5dFW/6L+mH6YBBXCuCQ5/PycnfCCLmvURhoMLij0LAeTuHMNGYSlSvA86 pPjR82tz4Q71DsWpn0yC+TWlAQvN0azPLzkTtd5wz8HH3zwTU9TeciItBmS5ZMO9ofO+ y2/KqJQGgEPuANJPzGd8wErnHeVHY3XZ5zQdeUYznTm4/bojA/5LWrc6Ge1q7dMM8UwP g0HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:references :in-reply-to:subject:cc:to:from:date:mime-version:dkim-signature; bh=zKRgb2z78RZx09YsB4iQfRlxkBipqBscSGNjxPS+MLA=; fh=RBIamWMghbmW7Akuyv0KhrctbCLAi+ubyXKiMeCE8SQ=; b=LtEG33W2/kD3yDp3+Tl8CA+lgDXPDMfI97VBKYauGkhqS73B37OcaLYWx8W7qu1+ya yBAt37TfK4jrPSJNSoLPEQRNoR1g81UjPqpnozcJFnWR5XEz1exNTTEyANd7/B18Ahiz BjOjznUtor35NSszIV/07Z95apNUzlH0MkihGpTLuMByK4se4MejpXaPrhwPNAdxrIay g9T5kUswj6ltHXpa0HJRee48VcEQMyTeeYAAgNzfF4cfJBc8V4CThCes0wZR0O3lYLLB 9tFU52L3QSAivegKqDPViYLuyg76R9TwFax9I4CVJ2fQTlbea3nMH6z9KI5T4sGxqh78 eLaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MNbX5XYo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id ij25-20020a170902ab5900b001cf6b01068csi1272739plb.67.2023.11.23.07.38.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:38:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MNbX5XYo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 48AD18068E01; Thu, 23 Nov 2023 07:38:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346143AbjKWPhp (ORCPT + 99 others); Thu, 23 Nov 2023 10:37:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346206AbjKWPhj (ORCPT ); Thu, 23 Nov 2023 10:37:39 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F33A110FA for ; Thu, 23 Nov 2023 07:37:41 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FEA5C433C7; Thu, 23 Nov 2023 15:37:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700753861; bh=uQXiq96nO9VqagRTVjE4tsnRbIa5zMx/56VxvD4vqmc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MNbX5XYoqyBOdgPdCyGzkWB4YkNNJx6Bb6oX+qx8Q66cZfm3KBHY+aafog/SV6IFL +rsfrj+JI8rU872TJebCWAvHnhKhkpFt92dlQlKtgkB6ulGXBgBmgNkte9YwWzYnWh 6Wh/0gBvUrnet0wg1xSvGqMNlYpZ2NxE54kxpzMTpqx3hczB1PiNI3SsxxOdaa3rkn RpTmcDL98KGaLcTavywN1D6rp7FipD/6ygRWtUilwXJ3KMnl3c20hEVQjraOopyvY8 9eD/yuTL8K+rqNLTS/xGb6pQiueDvG51NyX4i03cDGd7VfqQik9mczivvqVTV+vWvK maaAzVZrWWQxg== MIME-Version: 1.0 Date: Thu, 23 Nov 2023 16:37:36 +0100 From: Michael Walle To: Chun-Kuang Hu Cc: =?UTF-8?Q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , AngeloGioacchino Del Regno , "Nancy . Lin" , Frank Wunderlich , Jitao Shi , Stu Hsieh , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "Jason-JH.Lin" Subject: Re: [PATCH v4 2/2] drm/mediatek: dpi/dsi: fix possible_crtcs calculation In-Reply-To: References: <20230905084922.3908121-1-mwalle@kernel.org> <20230905084922.3908121-2-mwalle@kernel.org> <93576c3b04c8378c5c9296ec7a6585d9@kernel.org> Message-ID: <27e0368bb6dd44cd8d176c824cbfe464@kernel.org> X-Sender: mwalle@kernel.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:38:02 -0800 (PST) Hi, >> > mtk_drm_find_possible_crtc_by_comp() assumed that the main path will >> > always have the CRTC with id 0, the ext id 1 and the third id 2. This >> > is only true if the paths are all available. But paths are optional >> > (see >> > also comment in mtk_drm_kms_init()), e.g. the main path might not be >> > enabled or available at all. Then the CRTC IDs will shift one up, e.g. >> > ext will be 0 and the third path will be 1. >> > >> > To fix that, dynamically calculate the IDs by the presence of the >> > paths. >> > >> > While at it, make the return code a signed one and return -ENOENT if no >> > path is found and handle the error in the callers. >> > >> > Fixes: 5aa8e7647676 ("drm/mediatek: dpi/dsi: Change the getting >> > possible_crtc way") >> > Suggested-by: Nícolas F. R. A. Prado >> > Signed-off-by: Michael Walle >> > Reviewed-by: Nícolas F. R. A. Prado >> > Tested-by: Nícolas F. R. A. Prado >> >> Is there anything wrong with these two patches? They are now lingering >> around for more than two months. >> >> Unfortunately, patch 2/2 won't apply anymore because of commit >> 01389b324c97 ("drm/mediatek: Add connector dynamic selection >> capability). And I'm a bit puzzled for what the crtc_id is used >> there because I guess it will have the same problem this patch >> fixes. > > Please base on the latest kernel version to fix. Of course, but the question is how to fix it. Maybe Jason-JH.Lin can help here. In any case, please pick patch 1/2, it's independent of the second patch and should still apply. -michael