From patchwork Thu Nov 9 07:37:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163267 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp274575vqs; Wed, 8 Nov 2023 23:39:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5oqp+FQfaZzLugr7Sw8cPtNfe0fh5T887eWKYmKlv3Z8qnXQPYj8uTFcS2/SkIiXSOVA/ X-Received: by 2002:a17:902:e848:b0:1cc:42d0:dbc5 with SMTP id t8-20020a170902e84800b001cc42d0dbc5mr6558648plg.13.1699515564342; Wed, 08 Nov 2023 23:39:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699515564; cv=none; d=google.com; s=arc-20160816; b=SGqW50l1EQMtc3Sban+LrbfEGrJZI+4fXjD++7HQ0qKEbsGx8khJ/qbRNwTCP4gg1z 3cNMxkscazuXKxnrykzjiYUehduzjvPY7R5E3qQiUXwQuxr62PODiPCY5ueGfqGC/pol x1ATl7uk/kNeeOoz6fRQXa5nSzbyFw6FKQdlAZxTn2h/Mh2bGMnZeGXmYwlwG37jt8LL NFJLCnTAp5DynEGn/+QX1H0CnPkYiL9grmtqHNwDTRPaXTGWLlSgm+rTetugMPpZm5rD zxxoSMRNKwjrJvRFKMbr9WUnjRDrI2v3tuuhbNVUzdTIr12Q/UmBRJq2DDBUaaQ+oNoP Jerg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=7ATsJEFIulozajNgbJDjGqClRnQeHyvCfEio6WH5NIY=; fh=ar9Kuonru+6un71Fc3+cR+miWSr4t5vPPiuWh6IeKvI=; b=PRXR/18PuxJ/d/acDjqjDuP5S9L5voVUizeC75EBh4O7g+VmyGNjjVbMyH3+rctNHd GaYJuao61VxSU0cCpnzFI+bD4NYHT3eazyzfv+zd5uuwvJb2OF29tDLkN8SBfJ5R6GU0 KiofH62mbN7vE2QyNIWP+P78tzNRWVExh6EcwI5jPlY1CL1hjsnxDYnkwxQFsCTz5Bsb 7hiKtyQvpe0dz99jxY5Z5p5/5QefwdOpSLPIocQQIcOMY557xAH+s+EDLwfImnMdVord 9OEUd2MF+ZyDcCDHojIOPzG/WVxoGMTpdMfRe9f6GqKzw9AJtB4eKv1qa2ENH2VgNUU1 QB+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=j6xyRaDM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id f14-20020a170902ce8e00b001b222cd9826si4764293plg.349.2023.11.08.23.39.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:39:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=j6xyRaDM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id B5CFE832DCCE; Wed, 8 Nov 2023 23:39:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232781AbjKIHiv (ORCPT + 32 others); Thu, 9 Nov 2023 02:38:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbjKIHit (ORCPT ); Thu, 9 Nov 2023 02:38:49 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54662A4 for ; Wed, 8 Nov 2023 23:38:47 -0800 (PST) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DE89AAF2; Thu, 9 Nov 2023 08:38:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699515501; bh=4QrpN0remY7a+J6VizLfc7b4s63ZI1p2RwGVH+9cdlM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=j6xyRaDMQbKBte9nBDiQPWjV74ioRWP+2nYnkXnh0FyrLDk6z5Dwt1H8FkwhS5UDh 4vuENT8g05YNbMb+USR045s6/6vr/A9NVr7u6+tGweleGYMqw/NIQvilVmITgslWmb ALH+6g51eyeS0rhTxZhLU3yJiqM4FWRH8abF+GKo= From: Tomi Valkeinen Date: Thu, 09 Nov 2023 09:37:54 +0200 Subject: [PATCH v2 01/11] drm/tidss: Use pm_runtime_resume_and_get() MIME-Version: 1.0 Message-Id: <20231109-tidss-probe-v2-1-ac91b5ea35c0@ideasonboard.com> References: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> In-Reply-To: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> To: Aradhya Bhatia , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Francesco Dolcini , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=972; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=4QrpN0remY7a+J6VizLfc7b4s63ZI1p2RwGVH+9cdlM=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlTIx9R3Be7juvu3cbDA4igiN84v7BvPT0aVvXJ zJeuTmjDzGJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUyMfQAKCRD6PaqMvJYe 9SCJEACbeJnBxXR6wHkmfYPIYYjCWXulM6Bgr1xIQQcuZqr9vzIk86dR6KFM0z7rReRsDtdluOz EXtzLew+5jM9R9JvwI5DU/uZrmseigA4DZRkIFQolWs5mJGVFdgCIO/ImVhw6yIBl3DhirYxuXr mG+oCx2v/frd5X9ImjvfVZ+M8thl+7Lti5rePnMIDtGue4nx2Lc/LqA3FxsKLxQOTznbtVFMYSJ OmZofiG2kBjrJ3Inniym+UZryapoVvOr8OSuU6ZIvX2oJMQV32Sk34jQIQ6ULPj86rgUKJKaCZ+ UAxE/j8h9Izf0RkHsLFJlF4wGzWLHicWgySc1YVSnZPvPAPfuZASgWuNmcWlNxIdNxf7AXlaMUy mCvA9qbYtRwyES8B8cQ6PNnzmcKkGM2ppr6pzSmkVJIgQCxbSrMXpk8fD+RTDjAYXqAevuII7MC /x46ucTVzxQwf5e/nrHgX88hrcROe0aC0gor33ZSTOrScGdC9KJSDV4M9ebhpgYDtyX/gmJO9Ud pHXlftVl8yspfdjbn8oUTUYkSXsGZIRTCWROHD77upuxNoAgdfskSQWxQi8FsHgiGTaT4utINXa 1iVTusW5wGQkLyikemMAO9/TQaF9yjasglOh71knN/vRpOggltHZ9KAVp5cKLtArlINTZSzucHC Cks8sZJRK+20Pgw== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 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 (groat.vger.email [0.0.0.0]); Wed, 08 Nov 2023 23:39:13 -0800 (PST) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 groat.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782071232583565025 X-GMAIL-MSGID: 1782071232583565025 Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync(), which will handle error situations better. Also fix the return, as there should be no reason for the current complex return. Reviewed-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c index 4d063eb9cd0b..f403db11b846 100644 --- a/drivers/gpu/drm/tidss/tidss_drv.c +++ b/drivers/gpu/drm/tidss/tidss_drv.c @@ -32,9 +32,9 @@ int tidss_runtime_get(struct tidss_device *tidss) dev_dbg(tidss->dev, "%s\n", __func__); - r = pm_runtime_get_sync(tidss->dev); + r = pm_runtime_resume_and_get(tidss->dev); WARN_ON(r < 0); - return r < 0 ? r : 0; + return r; } void tidss_runtime_put(struct tidss_device *tidss) From patchwork Thu Nov 9 07:37:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163268 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp274582vqs; Wed, 8 Nov 2023 23:39:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkTZLG/58TJruuK+7vI5CgfsFgfsMbJnOX4JggsGltv52PujHrjNYgnTcLD3Dpo//nRHhR X-Received: by 2002:a17:90b:1e46:b0:274:755b:63b8 with SMTP id pi6-20020a17090b1e4600b00274755b63b8mr885472pjb.43.1699515565234; Wed, 08 Nov 2023 23:39:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699515565; cv=none; d=google.com; s=arc-20160816; b=uGac8eTQ86nZ9CiJ+4AsKr9ieHNYT3IABt5jzsB58r4YWwwqO3t9/do2kKTVSvn8y5 2+VnXE/pGp+o3bM3a+wx6J/UlLcmXHgi3SWi4UTs3zgxaiPppCYMUptCm+LM1si/K+E1 Y72WjueKfaYnxfWAsf4iZrsYwWmaiyUlTe1oMTPXMSA0VnoSCM/gIbTF66QQw5l3xRSj NmIVfBBNxPBEtlJLVbv0AWnOYdVIaPf/kbt6uR7H0ArHJnxf+5n8nuLCxQj8os13bb7I vLqTq5CXPiMo1CGH0x8z6VdaPn/uPmceOrjeATUb+23JaN7gEnStyAqGehsoDIBjWFvA 7eLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=nhmBTojk3HIddif6WX3S3K8Ro5F5Rhk2ZogB9yM9GEw=; fh=ar9Kuonru+6un71Fc3+cR+miWSr4t5vPPiuWh6IeKvI=; b=0clzx3GmvMduWq6TRQ8Ph+fHtR4NYxkn71LtPMLesYT+d8ps9+qaw/VQwZKbUDY81f 1zFz7tECaFkBtrR8XpWF8PmqpSvn252TepllJPpgh4BAyhEHmVejviuizrsjXkw6wJu6 ER+UnpRWrTvT7RlvfytmFT5foftEnRDstH1EQhE+Zi/WJnVBrKEaYWjjG2Kc2OdID3NB 1mUE68VORNQbkx+yO5EceRNcuP5tom0xVSmgJVWQPnSQn0k5Vu022mFx4oxv7+WN61BM bSPFlUchyb9iujkmgkNNqcrBmSdBo5C+9/RQGeJdn3N5UEOtGS4tt3kAPmuOOHZoNkoc uCKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=sajfIXcH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id o13-20020a17090a744d00b00280feff8f0fsi1060728pjk.127.2023.11.08.23.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:39:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=sajfIXcH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 21FF08316EF3; Wed, 8 Nov 2023 23:39:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232875AbjKIHix (ORCPT + 32 others); Thu, 9 Nov 2023 02:38:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232613AbjKIHit (ORCPT ); Thu, 9 Nov 2023 02:38:49 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 548C7173E for ; Wed, 8 Nov 2023 23:38:47 -0800 (PST) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BA643E0C; Thu, 9 Nov 2023 08:38:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699515502; bh=xt5MBUgnI/jgAIonK42bagqQqpKSKcbUYBa+PmKHG8E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sajfIXcHt8KHj1UJYdggbsMVkUc6GHdsfbn+OLXb9IHJBnAWQVnY6PaJLtcpqKlEG 47lGzk9Hc5c4naZLFuOvXLQNqEfUHHeJm+V77Ae2ex8xhUY8BMzyex+sgAEBrAXt1E tkDEo8g7o1jEhD472nfGt8vg9um6lrTQkb0FZdyU= From: Tomi Valkeinen Date: Thu, 09 Nov 2023 09:37:55 +0200 Subject: [PATCH v2 02/11] drm/tidss: Use PM autosuspend MIME-Version: 1.0 Message-Id: <20231109-tidss-probe-v2-2-ac91b5ea35c0@ideasonboard.com> References: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> In-Reply-To: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> To: Aradhya Bhatia , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Francesco Dolcini , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1731; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=xt5MBUgnI/jgAIonK42bagqQqpKSKcbUYBa+PmKHG8E=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlTIx+fN+ubO5HJG9gxPYBA5D9PTIkfRNffzkxn gQ0MtheLoeJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUyMfgAKCRD6PaqMvJYe 9f5lD/97VxLqRK0F2PM6yui/5XVHYoti9Upp/CtctMV6KxkJ3rdFISUaPcTNRa6PRxwl1PKqZT0 8NO9huwa0ImfdO4dINDszCfjKOzDl1UpnEpW5zfymJWrBd2dy2Bx5OUdG65UxhVzL0MZ7G0/j57 PR0gocj56G/msXDxhTxars+m8ZY5C9LzM6UZftzETmNoGDJgbz1QhTbj3ne6EkUV8ThJmpxFmkU hBctuObo/1j6qYrBBODTfjb9iStzmkvRgh88psTUzHqe+C6jpZ039HGrTYM5iSrhazWXeV3B5ad ndJctMhkjh6e0sRLozWFxDUzdCC4NdpAk05T6+s/A9ZueVBdyPA1BTdGi1h4WL83zlswLNjoG66 lqPLRlmqkr0r2JJho16EHb4kk12ietXWyIh0oadAmDCwZnyk5OZOgkglwArGTV7/To3wL0RRthg tzgUpOxSVjttychgvCunCnfyFeRwM/YTBZEyk7LpNkajGkxT10sDlaX6Hpi6nNPIOHlVXverLM2 9Zfs7sS7FVG/modDQYXZjsBRPbEtW6zOsk9igZFVKscbVEO4V0W/OVMfIwyAChY8YZ2vnYB/FaO GmWAtAJBZ+G3LGjYRktzVuYLRDTd6HazMu5dTIKpv47RJEloY4nsVqzTaJjqEWYFTsFK/9aUOX2 +1NBEbm4t0KWDqg== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 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 (groat.vger.email [0.0.0.0]); Wed, 08 Nov 2023 23:39:14 -0800 (PST) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 groat.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782071233290277009 X-GMAIL-MSGID: 1782071233290277009 Use runtime PM autosuspend feature, with 1s timeout, to avoid unnecessary suspend-resume cycles when, e.g. the userspace temporarily turns off the crtcs when configuring the outputs. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_drv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c index f403db11b846..f51c87e26e10 100644 --- a/drivers/gpu/drm/tidss/tidss_drv.c +++ b/drivers/gpu/drm/tidss/tidss_drv.c @@ -43,7 +43,9 @@ void tidss_runtime_put(struct tidss_device *tidss) dev_dbg(tidss->dev, "%s\n", __func__); - r = pm_runtime_put_sync(tidss->dev); + pm_runtime_mark_last_busy(tidss->dev); + + r = pm_runtime_put_autosuspend(tidss->dev); WARN_ON(r < 0); } @@ -144,6 +146,9 @@ static int tidss_probe(struct platform_device *pdev) pm_runtime_enable(dev); + pm_runtime_set_autosuspend_delay(dev, 1000); + pm_runtime_use_autosuspend(dev); + #ifndef CONFIG_PM /* If we don't have PM, we need to call resume manually */ dispc_runtime_resume(tidss->dispc); @@ -192,6 +197,7 @@ static int tidss_probe(struct platform_device *pdev) #ifndef CONFIG_PM dispc_runtime_suspend(tidss->dispc); #endif + pm_runtime_dont_use_autosuspend(dev); pm_runtime_disable(dev); return ret; @@ -215,6 +221,7 @@ static void tidss_remove(struct platform_device *pdev) /* If we don't have PM, we need to call suspend manually */ dispc_runtime_suspend(tidss->dispc); #endif + pm_runtime_dont_use_autosuspend(dev); pm_runtime_disable(dev); /* devm allocated dispc goes away with the dev so mark it NULL */ From patchwork Thu Nov 9 07:37:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163262 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp274448vqs; Wed, 8 Nov 2023 23:39:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IGed/5O2VecgD64IufSkdvIdkeTaLxvBeqhA+luzvdtATSIEPz/9DNfMTncMb3knzjQl+SE X-Received: by 2002:a05:6a00:1587:b0:6bb:4360:159e with SMTP id u7-20020a056a00158700b006bb4360159emr4891459pfk.17.1699515541721; Wed, 08 Nov 2023 23:39:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699515541; cv=none; d=google.com; s=arc-20160816; b=iKTLRpgm4ZtJQgKRy4hmtJ04E/wcK5v+8ab7+Li68k1nNYcClhC1IWaAfa1XrlpPNX /j/YGveKRz0s/VpgA7k5hWLjSrSbaVfr7bWF5cHii4G7eFsRKETpD0YfD9saTdiiTqfG I5f6UxeVXBIWbl73bCSu03/UHqMwDaHI2Xjch9nbK+C6VGTzGZmWDPkwsiENl3aBnBt0 p9cXie7tU/9uujCujF8mVLHxSrG5aKgGEV57h8tG27LLa0Cg73/nZFCyNih3ETs1Flmv R9YkXVigXa81QangGleMWS4MiDJBoPMW6hvWS8XB6YrKzxRn192+oSWWBh5aKcMDUG8m 8VCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=9C8JuKmplOHgfFyv/kmzf7Dw9YOpE6Rkw/Zz1DXpgO8=; fh=ar9Kuonru+6un71Fc3+cR+miWSr4t5vPPiuWh6IeKvI=; b=nagEP7mIVPpn30FN4idOKXLZ0q6AN9RxF5MwqcHkxiQR7NmoZt+lk+Nwt2UFH2lc/n kMEo51pCuc8qaYxJEg6ql4BAAsyviMRC3dszaAjSSaWDIDWuJMRYzhC9OqBgaIAZrqGw ylTSt0KkDT9Q1eUnhu+BbHjHYP2DUITX8zrI955nftokL9tXbuguAlyVxX5O1vtJi8gi dx7wpTT6SbyQDPiXoq7G5v7pFpTntqKEESQk2f6QgW28pbQVjSdk1s8qUKKF24Js1jHI B5auhOQHZ25HrVyH9wDkmvWwfQfs/WBC2OoGrE5HmJFSQ0B5U5+mFXTuxVaiB7ShDHhD SwgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=tO1y8Hgu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id j9-20020a056a00174900b006bf2ef1717csi15423428pfc.255.2023.11.08.23.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:39:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=tO1y8Hgu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 DAA568325877; Wed, 8 Nov 2023 23:38:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233051AbjKIHiz (ORCPT + 32 others); Thu, 9 Nov 2023 02:38:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232764AbjKIHiu (ORCPT ); Thu, 9 Nov 2023 02:38:50 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9B61A4 for ; Wed, 8 Nov 2023 23:38:48 -0800 (PST) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 954A716F9; Thu, 9 Nov 2023 08:38:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699515503; bh=ADSCf/9TIbVJ44AQQj3UfUMyJW9l+hCXhR2JJRI/apQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=tO1y8Hgu+dyzO0pbinNg/Jk7Uj7+U/jI8pf+9GoCTU2LcQsd6R1rGS9wk+oAofMxf Qqnf0JjyXhSrazYwCdY/1W7bC/UtnA7rp5PQR+GYUv+C3F8JgzxviI7V7ibfKlQ7lF +eWqHJOLl/b6U3h/o3ltf7/fqbhVxKG2ol7RaZ6Y= From: Tomi Valkeinen Date: Thu, 09 Nov 2023 09:37:56 +0200 Subject: [PATCH v2 03/11] drm/tidss: Drop useless variable init MIME-Version: 1.0 Message-Id: <20231109-tidss-probe-v2-3-ac91b5ea35c0@ideasonboard.com> References: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> In-Reply-To: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> To: Aradhya Bhatia , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Francesco Dolcini , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=775; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=ADSCf/9TIbVJ44AQQj3UfUMyJW9l+hCXhR2JJRI/apQ=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlTIx+iCOBgA7JX7ZXqNP8KfAUvhOyV2T+GXVa3 HZFYkogZKuJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUyMfgAKCRD6PaqMvJYe 9aWDD/4vUmxETtGkP4RQBQVk+uVqsAIvqnNIP4L5Royrq09Im4G6XywVcoDKU6tD4cUGkTIIvxA IgHw8S5K6L3Dd5VVEx7TDxi8UABWFCNyO7P6PDdGFWBo7UotCPQ4v/DvYOtA21Hvz8F2fy7z+Nr //mNQHLLt7MqrRgxwJGWuqHqjcpNFW3aQUkt8bViQFGrDeaga/nqx8VrJKOGVmKGq5bxoOn7GQW k+mQ39XaleSByZK//7hDdnQG6qirWHFAGOGZSS7ihw4J4FFy3xTUvE5SXKcdMPIqr3zPWo3o4sW IikqGQE7HPtVM8lHNcMNpn8NuhxIidg+BaGOi6b86pPvoq6sEiQoFvL0EXzngsr3kcFNzecxq9m RZhj1Uh2RKBgb0kKekUHOIQNl1X2XIOpblFQleo+IeZDZBVPXw3jQQHuCl5RKvbrUjY37UxNjdp ldTp2B52ITTcZcFolpa2+hUWP46cD4agoIKVUMh6UXQ5DqsujDBOL71mu2eIQcyMB/dJbYX4+2O OPrVjqxEPzzTEYMSfVtlR75ioTIKcv17sRMXfJuvQvw1RxM6nm4vK30cKEpsc2DFQTigw9RkMKH RjLxwkToQL5U1V1TsRpXnILN3srdKlC2cM6DPY+Z+EOKPFrd1pmkoFIPYbli4N2fPfN2oN1WbJD pi+iLY6qUoq00uw== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 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]); Wed, 08 Nov 2023 23:39:00 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782071208933979771 X-GMAIL-MSGID: 1782071208933979771 No need to initialize the ret to 0 in dispc_softreset(). Reviewed-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_dispc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c index 9d9dee7abaef..ad7999434299 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.c +++ b/drivers/gpu/drm/tidss/tidss_dispc.c @@ -2705,7 +2705,7 @@ static void dispc_init_errata(struct dispc_device *dispc) static void dispc_softreset(struct dispc_device *dispc) { u32 val; - int ret = 0; + int ret; /* Soft reset */ REG_FLD_MOD(dispc, DSS_SYSCONFIG, 1, 1, 1); From patchwork Thu Nov 9 07:37:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163261 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp274450vqs; Wed, 8 Nov 2023 23:39:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeCHMJuxY953ZF2vMy7qnralX4FFcgxm5CIbJVebJJm4SpVhlYI5/B/r8wZ3kDrbXof7OY X-Received: by 2002:a05:6358:590a:b0:168:e876:de46 with SMTP id g10-20020a056358590a00b00168e876de46mr3788007rwf.27.1699515541813; Wed, 08 Nov 2023 23:39:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699515541; cv=none; d=google.com; s=arc-20160816; b=vPFhu6AXUpszTchDFGtwB7HTPfDOZ08+hxdI0h5rwas5Hh0IxTQUj8XjN3f5HKltjI wRJ3pBAAb3FWdeDZpjVG8xGWoE2J+3fF+FnAgfLjgA0kKNvLwY703jeu3T9kPyv5h0/P ckg39YfdY9Pgc35SkRrHr73fkoPCBrEYlvBwlcH4OTnEPltda0gb6EWgdrr0RICCGhAc IH8GgjRSYtZ2xlkKvJYEX5zLgeSpn3FSb7szhvXThx0iNbz2aUmn6F1lRdskAYOONK8x t0cLpwvUge1SHIzSwPOlhg/hOS1w6tbdjRQIgV6khMEYFxv/qWoIVrzv4ffdF25nxvMi cMow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=fV+AkIaUInCV4fkcxdYbI/E22aw+wbiq+HG2RovpUUc=; fh=ar9Kuonru+6un71Fc3+cR+miWSr4t5vPPiuWh6IeKvI=; b=DPIjCBKI/QF3BcJ38cAm1jjZvgQSCSZeAGJGmigncK9MUdTJz5tdwpdfynHiT0VRCi bzzkccClj85OfMAyqGDVxRne1G3OcUqT6z149yHef9kwJOGbZ9LaW2Dzl5RUtZJUeQpn LI/41H+SWiG/NqOb27/5V9jm0tEhs2WnxN3NqBcIuhcuqzRMyxnnT+0Hd9MdcmtNgF0E mPl7sEFcSITRIUzHlCl0b4jnClj+BvGa0gH6eQWRDPbIjxEMRs70dpRTvSixIvDVqrBO JOGEtA3sr9fEG535QWS6S0c6W6pnpOo3xdOxzNoChNobL8pJ+zA/UQpATCVUdV1DWgaj 4tiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=lx6pfWLV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id k190-20020a636fc7000000b005b8ebaa2935si6553258pgc.164.2023.11.08.23.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:39:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=lx6pfWLV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 4BE87831ED9D; Wed, 8 Nov 2023 23:39:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233225AbjKIHi5 (ORCPT + 32 others); Thu, 9 Nov 2023 02:38:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232776AbjKIHiu (ORCPT ); Thu, 9 Nov 2023 02:38:50 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE77A173E for ; Wed, 8 Nov 2023 23:38:48 -0800 (PST) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 73C6817E1; Thu, 9 Nov 2023 08:38:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699515504; bh=1GEKCab8OHb1x6cabABKC9MQy0dJhOUkvWfwR9SFuWU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=lx6pfWLVWCmmHaDeuOyAaaC57VoXbIEoLYr8BDw0U3KVHnD1/6LHIjN3OmgxMMDSC y8iBt0vYIfWg4drQZrTcC3RWuVpOtBqbktQzQn4jsd6KIdv7OfNVRXwdqCJdvJwgCC 6ZE7wRaJ2kbVaQos1sdat+2e81zFgtOS0JcgF+RY= From: Tomi Valkeinen Date: Thu, 09 Nov 2023 09:37:57 +0200 Subject: [PATCH v2 04/11] drm/tidss: Move reset to the end of dispc_init() MIME-Version: 1.0 Message-Id: <20231109-tidss-probe-v2-4-ac91b5ea35c0@ideasonboard.com> References: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> In-Reply-To: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> To: Aradhya Bhatia , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Francesco Dolcini , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1539; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=1GEKCab8OHb1x6cabABKC9MQy0dJhOUkvWfwR9SFuWU=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlTIx+bzzkLDQBAuaUOAtJiZaksLTxdF5B9rdMq LxobCQK80CJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUyMfgAKCRD6PaqMvJYe 9Rc8EACWQUnArZGNglO1/TEwH5VQgmaOPDpDdNQFrSWbEXfHEH5Mhxdb/yzQJAryQqHswgWONS8 zv/voBbUvNC+gHdYUL8s2VywJMRhGhpkrcraLdTCuXb/Y1Zq3W3uAH5rRvUT3JR7tNqkTXbcLVq aYLwe/Vt2ADLLrAqRjOPlh8gx1zQdobVUTpJaRVOG0b5+gjSpbaPlyJYmK5uhigtRkHzRGpC8e1 3nAnCQV8nK0EHAWEIpe+k1MKvSiqPR2vayBxmgmZzodzdjX/QQ5VdjEA13dOflDg7+RS13TDGbG F0Cm0oEZtmZotu7pZvDPPFml7byp3c1jMaEBYMoxTS4IVSPnf9GyhC1vwxM2yKymnKJ4qLuJZvv k7oKCpe/vDSUnEfPzcet1AYNoqBgHQccBJtkKpIN3BErRBnlZKECPH5HL8Wac2ccYxjnObxupe0 1+/yYW5coIxn0sctpwoAX0PcX20xxo32ctL0CSB51sIhfmT7S6d4bzRNFE+b41pUnTA6n+Cih41 CVJEULzPTsVu5NdAdyA+9prHk7TrCK2Sg2ZwlsvO4qnH2doDpe5yYCZXIUxgwfU9HY5ZMRnoDOe Mi206BOCbn0vLkHOm1cRtOUlCYkmqtyihGi756/uR1CKq80fzIFYjNiPaiLYseHyu00ThJaOfFK 0Op0KFDTJ2N6p6A== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 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]); Wed, 08 Nov 2023 23:39:00 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782071208907086910 X-GMAIL-MSGID: 1782071208907086910 We do a DSS reset in the middle of the dispc_init(). While that happens to work now, we should really make sure that e..g the fclk, which is acquired only later in the function, is enabled when doing a reset. This will be handled in a later patch, but for now, let's move the dispc_softreset() call to the end of dispc_init(), which is a sensible place for it anyway. Reviewed-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_dispc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c index ad7999434299..deb665d0ede8 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.c +++ b/drivers/gpu/drm/tidss/tidss_dispc.c @@ -2777,10 +2777,6 @@ int dispc_init(struct tidss_device *tidss) return r; } - /* K2G display controller does not support soft reset */ - if (feat->subrev != DISPC_K2G) - dispc_softreset(dispc); - for (i = 0; i < dispc->feat->num_vps; i++) { u32 gamma_size = dispc->feat->vp_feat.color.gamma_size; u32 *gamma_table; @@ -2829,6 +2825,10 @@ int dispc_init(struct tidss_device *tidss) of_property_read_u32(dispc->dev->of_node, "max-memory-bandwidth", &dispc->memory_bandwidth_limit); + /* K2G display controller does not support soft reset */ + if (feat->subrev != DISPC_K2G) + dispc_softreset(dispc); + tidss->dispc = dispc; return 0; From patchwork Thu Nov 9 07:37:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163263 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp274499vqs; Wed, 8 Nov 2023 23:39:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHueomojgL5n8pvhb2BQNabEv2cWmMU1bXhOdw0tg+3HCXL8oaj+s4IKU5zBAST4qt0pR+w X-Received: by 2002:a05:6a20:a1a0:b0:17b:6ef4:6897 with SMTP id r32-20020a056a20a1a000b0017b6ef46897mr3374250pzk.2.1699515549580; Wed, 08 Nov 2023 23:39:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699515549; cv=none; d=google.com; s=arc-20160816; b=sEKyK2IEOAg3JvyFfoX3EvMprHTJIYzZTJbQy0G/T06eestn+1Xdzyl3TkByK4OpEq VJ1cUAgcUpCRvJrnX1UdTkNKyKDC6rj4+G5BJDhtVm1KeNGpY1mWdSlu7hYLXjPSPxbK PfgIvFn2lqx+Eb8QAPZVAMOwJJMBNodqsKfv41otvxjIheUHeYDfFXiWuvhaaPerO+Y6 lY4A6TAylKA5JqiSeQVA+8f/iWEtprf430YfPAxo8f+lbQ6BckQGRzbofRpAjCTVcmV2 ojGp+y5Sndm1b8fVT2EnZ6U1Yep2xiJHvYyB/hsWvQMNa4U2de8oyR0JsSdc/qzLG1Ez r6fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=uPJvG7exl6tC4mV/Ar9zSrEeCaYrLKutQO210B/nGwE=; fh=ar9Kuonru+6un71Fc3+cR+miWSr4t5vPPiuWh6IeKvI=; b=Jhd07cpiVuJ+24Gk2qtxgtOoElyRDN1aU9ko2y5ET0CiKUzq1dO+5rXvt50lxrSwJY +/wgzZT0I9q8MVr/fqjomusqv/evaFvyuxfbDgFmLiw/Wexv2KkZU0Zkg+LytC7wPjgU 7ldnQ08pkNisv/nqXhOwAyzDj8Kb8dPhFgkPG7gvETPppr5VVRqoev6CLXB/N6tRhumm 1JQWGO1Gx8WQIK+jjV9iO/68CF5I4hS+VIsAfKsMmF/kRdWIbA7hLoE3cHvohOJoMm+Q 25PZZjFTXuaRrmuDQbZBAuCFLC1xF8jRqeo+FMXKd6Qe/bm24sq0tSzS24RkxXMYiOY6 r4CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=qjxCD+ce; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id d2-20020a170902f14200b001cc54202425si3786822plb.409.2023.11.08.23.39.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:39:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=qjxCD+ce; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 E57CB831EDB5; Wed, 8 Nov 2023 23:39:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232761AbjKIHjB (ORCPT + 32 others); Thu, 9 Nov 2023 02:39:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232829AbjKIHiw (ORCPT ); Thu, 9 Nov 2023 02:38:52 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EEA12D4F for ; Wed, 8 Nov 2023 23:38:50 -0800 (PST) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 546FA192B; Thu, 9 Nov 2023 08:38:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699515505; bh=VZv+V3IKNcMeqSjrqpYywcyKWHFI9nt7knJQOXJX0vM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qjxCD+ceAFZq3LYouJotO30GncXvPdnTefzEuEgBDOqHtKVVB+RZgA//m9RKzs2HY FOeWZfBz1kEhwD+5j3z/E49QGoId+fmqGJNWo1OY4V7Ck9VpkACnAQz2NyI6S1wOVR OaX/XlB6S7XUBtX1WDV5/VY+zJ3iuTE4uKB2KCns= From: Tomi Valkeinen Date: Thu, 09 Nov 2023 09:37:58 +0200 Subject: [PATCH v2 05/11] drm/tidss: Return error value from from softreset MIME-Version: 1.0 Message-Id: <20231109-tidss-probe-v2-5-ac91b5ea35c0@ideasonboard.com> References: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> In-Reply-To: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> To: Aradhya Bhatia , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Francesco Dolcini , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1539; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=VZv+V3IKNcMeqSjrqpYywcyKWHFI9nt7knJQOXJX0vM=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlTIx/FF6QxSHj8qkvS1orhbruRNq/l+uSonfZ4 /D5S5+WMyuJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUyMfwAKCRD6PaqMvJYe 9VKrEACnZABVQDSXZM2HMY8KEoDduklNACb3sB5wbNqXx6yhXF6Bfz8V0vXm/3WbnM/uj6Tf0is SkrFyj3F2oNfDrPUOcfRHyfKXg+4j8CDyvT4/ZEzkGeqTT6ZGGlix1sfmTaeWExckRGkaeDXmDc EtA1RTzyMdvaDZlf+iNff4B/tM4BhaE/QnL3zTPpmZhH0A8Vfim/ujER+PkSCQ9tYBMmL4Gz94R i2n0ZaJRIJsqTgKEPH8GQ7mHauo/bZfFyO2akOGfqhPi/e8mzkLSfTOEImKyuDHYNDgBhUCjsX+ /ZuY57fGqk9F5F5WQtGGXiAS6CsD0rhCHzGdoA3rbgF0wXsFKFm/drOPiimrgUsuZxfixi6RQHP cNn+RqTm2R9vJCYESteB95Lv1634KsLUs5jmcMUgscfTBSXezRTfqHA8fkzmRPPdkyjpBH4qhjh 3wEj0eHCFJbxd1vgUZNEcKZvNfYChkRJaft6PQeN1rI7yzdn4/ng4PWUfF/UIhjfCgLJd10Ac0n Muwt47+7rRL/ZaJVXICXQFha3/+O0DWfmlwahE8aKlhvDC0x2CFEHH3aTr7m9FjAAKuqgsi2tsT d1YCwr1a+Hj5cZR+/hiuLJk1MbSnx+go7uGYXIUaTqA5wiy0Xx+Y1ezj82iic7ERIAqm6I/LgVS 2uvjhCVpj1JzUNQ== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 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]); Wed, 08 Nov 2023 23:39:06 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782071216883704603 X-GMAIL-MSGID: 1782071216883704603 Return an error value from dispc_softreset() so that the caller can handle the errors. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_dispc.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c index deb665d0ede8..50b475b285d9 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.c +++ b/drivers/gpu/drm/tidss/tidss_dispc.c @@ -2702,7 +2702,7 @@ static void dispc_init_errata(struct dispc_device *dispc) } } -static void dispc_softreset(struct dispc_device *dispc) +static int dispc_softreset(struct dispc_device *dispc) { u32 val; int ret; @@ -2712,8 +2712,12 @@ static void dispc_softreset(struct dispc_device *dispc) /* Wait for reset to complete */ ret = readl_poll_timeout(dispc->base_common + DSS_SYSSTATUS, val, val & 1, 100, 5000); - if (ret) - dev_warn(dispc->dev, "failed to reset dispc\n"); + if (ret) { + dev_err(dispc->dev, "failed to reset dispc\n"); + return ret; + } + + return 0; } int dispc_init(struct tidss_device *tidss) @@ -2826,8 +2830,11 @@ int dispc_init(struct tidss_device *tidss) &dispc->memory_bandwidth_limit); /* K2G display controller does not support soft reset */ - if (feat->subrev != DISPC_K2G) - dispc_softreset(dispc); + if (feat->subrev != DISPC_K2G) { + r = dispc_softreset(dispc); + if (r) + return r; + } tidss->dispc = dispc; From patchwork Thu Nov 9 07:37:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163264 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp274512vqs; Wed, 8 Nov 2023 23:39:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpQsbYzhWFMM392CbBLAnLcyf+JJNnSfQinW3EqC7ELDgKHVulmSnMIG0R3KDOPoONrreS X-Received: by 2002:a05:6a21:18d:b0:181:1d71:7e27 with SMTP id le13-20020a056a21018d00b001811d717e27mr5160895pzb.43.1699515551477; Wed, 08 Nov 2023 23:39:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699515551; cv=none; d=google.com; s=arc-20160816; b=zkYnj21nB8IUKYCTAEKgo1WVqFZmcf/iKnerBe7bSXQGFZa9CC8E/jI6yLlhScEdoR Ds7qx0fG0p98Kgz1vym5rGT7NdDudNlXtAhh4Yy296cAcAfeHtWUfJ/3CZ8wsfHDLjas M9H45RtKLcnD1rv0H1Tza6IGd8aKhEUCZjhhHiBdjwlv3uj55KxOn0AvH9+9JIto/mUS +KDV1fPHT25sZm2BvfCAK1euVUUtn74OqQJOjq38Zq+V33oaf32CHxYqLaigeWZ3sLvM dabirVNsH9wBdM9VJVAiZrjHi4VEBnoKTWtDN4NTgCcC6OV/Ljg8UeScroxXD4Z5D5hW AyHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=RTfi6dGfxzeF8CieOnBNa+USmcgxkKNuN+hfD6aoDI0=; fh=ar9Kuonru+6un71Fc3+cR+miWSr4t5vPPiuWh6IeKvI=; b=LuVXDjKJA1//Ri9h/UOWD3qOjzgFBV9bDnMrtmZOUiEVR+ixN9ddFtfR/SUcSsvhOn iRkYBMC5l55omYmepzvzhnMAv9DW5Nwl7kIx9qRrDnicOcv+j5VbIQ+UnjvEX7+grdWK hRIwNC2RkzC0GAlZIgILlbVi6/W0hMR5CDHqllq+DbghydUtsjH1EUCItyhRFD3Z5rUX 3zP4BCwmfeVnSWzMQuY2hKRgIeJawc4NawQpO1Hky4oKmZiYDJUY/pQF/Hzk4Fqc+fDj m4W84ww0F+ujZ9UqjFztPbgPn0DtSx/dOgzXKmf4lY6XbiMG7C799o/PR9HYIsdnzY6i kbpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=hLtHiFr7; 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id br8-20020a17090b0f0800b002805aa7b138si1072909pjb.59.2023.11.08.23.39.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:39:11 -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; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=hLtHiFr7; 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 AA686832587C; Wed, 8 Nov 2023 23:39:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233065AbjKIHjF (ORCPT + 32 others); Thu, 9 Nov 2023 02:39:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232808AbjKIHiw (ORCPT ); Thu, 9 Nov 2023 02:38:52 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 348092728 for ; Wed, 8 Nov 2023 23:38:50 -0800 (PST) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 329FF1B44; Thu, 9 Nov 2023 08:38:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699515505; bh=ea9sAgDoBLxTb7N3GvFQ0oKnHf7196fJPgOxmwvSZWc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hLtHiFr71+P5vgrZ+dKQf7om6zS0BgGAJQVg9fK3rq1E4HvoTsJTnmRl3qL0TBtHP E2nTZlx12cWoAHnfLpELkmpUtVlXSVypPbWH63rOxsesdUion/OIfwPLMndqK+IyvY a+tsPd2pDcVigeq7xdjQ9dLSUoaZrnM/2xZviThg= From: Tomi Valkeinen Date: Thu, 09 Nov 2023 09:37:59 +0200 Subject: [PATCH v2 06/11] drm/tidss: Check for K2G in in dispc_softreset() MIME-Version: 1.0 Message-Id: <20231109-tidss-probe-v2-6-ac91b5ea35c0@ideasonboard.com> References: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> In-Reply-To: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> To: Aradhya Bhatia , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Francesco Dolcini , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1429; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=ea9sAgDoBLxTb7N3GvFQ0oKnHf7196fJPgOxmwvSZWc=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlTIx/zx8GTBnJK+j6YOO7FS+lZfIy9XVNj7BaH 60HV9E1MpiJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUyMfwAKCRD6PaqMvJYe 9aoGEACKfzf+D8s4b0/ya3e1Ml+zOzyDtczeaI4kg4X8rD+yP5JMDDWJijlclGiJd57H5JiFhMH qTJkKVMU0HnA7TtYx6DZlJai9nAH6hcn6IxPk8+LWiDlYe0DbBlT/yl2C2FufIsc+q5X1Fn6O0a An/+loDGcSk+8z9fiDa/AiwwUlK0UxLNguhhheHAFRdBNHiIjvtZTrjji6uqwoQu67H+vgx9OTm C2Y1anUYygx4spYEMezC5rpm784DvRF5FEVBqsauHu4mikOO+c2gl6fXt/4Lfm+ht1S/WT6becM VZoTq4IqqW2tDJqlBbn7gtXOx+NvPxFJ+ja03OI2Ta96J0xaJ2zrVxaj19HYSJOSuUMlZVSSgxR UB5EszdFK+e12/P1mfZc8VrqPJu+SwCwYX6wnGGHUgLNgKUmtWh0HDoI5JlicXNlbS0sooEpDaR qrclD2NJ+tM8dzBcNvX28VqPURvUdOCboQsmZu7e72+Eg2BdLJ+hExUYsRCMPxZzFnT/5DmH+6r d/zLi3aYsejHE0h2ni+Tf77eb8mAKPz4gob/rYqAICVJDLgBfK3je+exd8JhoxjnRWVUnkFVYNM 90QelrNnZphKq6ggT6b4b+56GtC/EMuWNGfRV04ixGV3WkWLCNWf1HbP9uY7+onoIKdtPu/EH/W FM2bYzO6C+3GDBg== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 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]); Wed, 08 Nov 2023 23:39:10 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782071218656119922 X-GMAIL-MSGID: 1782071218656119922 K2G doesn't have softreset feature. Instead of having every caller of dispc_softreset() check for K2G, move the check into dispc_softreset(), and make dispc_softreset() return 0 in case of K2G. Reviewed-by: Laurent Pinchart Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_dispc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c index 50b475b285d9..c82fd5bc9be4 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.c +++ b/drivers/gpu/drm/tidss/tidss_dispc.c @@ -2707,6 +2707,10 @@ static int dispc_softreset(struct dispc_device *dispc) u32 val; int ret; + /* K2G display controller does not support soft reset */ + if (dispc->feat->subrev == DISPC_K2G) + return 0; + /* Soft reset */ REG_FLD_MOD(dispc, DSS_SYSCONFIG, 1, 1, 1); /* Wait for reset to complete */ @@ -2829,12 +2833,9 @@ int dispc_init(struct tidss_device *tidss) of_property_read_u32(dispc->dev->of_node, "max-memory-bandwidth", &dispc->memory_bandwidth_limit); - /* K2G display controller does not support soft reset */ - if (feat->subrev != DISPC_K2G) { - r = dispc_softreset(dispc); - if (r) - return r; - } + r = dispc_softreset(dispc); + if (r) + return r; tidss->dispc = dispc; From patchwork Thu Nov 9 07:38:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163269 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp274676vqs; Wed, 8 Nov 2023 23:39:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IH9NEENR1wwLzn7adSXcdqF2CMCXGqmjS608TG5g1A9v79GoUbXaSVnseK6KnNY+UgoLsuI X-Received: by 2002:a05:6358:60c9:b0:169:845b:343d with SMTP id i9-20020a05635860c900b00169845b343dmr4615389rwi.28.1699515583764; Wed, 08 Nov 2023 23:39:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699515583; cv=none; d=google.com; s=arc-20160816; b=y51DiTngZvuZO/AUEbqNTREukYSvvazonf8kfDU6/PIGfh17waxujpzrFjZ3wTZcno 9k8mkuESYvsBX432Oq6FnKQ+MV6Y9jUR3bNW4EENi+S+YQGMUi3ko+yHGYocnOl225W7 rO6zMnzGnJNuCooZ4Z3lu1snwDuFQ9aa+CgO6zECeQqxz1FVANooY3+GOmoZq2q9+zgq 7Ws4Q92mH/tvgbqhargWEQ09GDBp0tk7GctF2ewhgq/UKTRtrvneP5P/QFgJ2S86gCff KjY6RNuS+jhkYVfQ6AfDvy+k6xxUv59tuS1QeEd2X5rZv2j+hED8ywAXGuZCERD0dLGB ENtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=aq0jj9oZxvVEpPoJ0AUvAgO3orx3YHp5d97HA0MM5dw=; fh=ar9Kuonru+6un71Fc3+cR+miWSr4t5vPPiuWh6IeKvI=; b=EZug1uXEhTF/t0JTvQnAU3TWvDVZx2IgHjLJy/2zvjY+zHGiGKKI95nXOEiB6NaIIX 6vh1ZUiFEDYngm/GPLsDgJzDW6COhZvKBTHGZ+7dUBWjJR/TMEN284jSMZ/TeOTTl0SM E4doBitFHc/423l+G33nSh5lErpQ7ozc8XTf39v+ruwuMpXtcHjH6zpq0eM+XJt2Dbay IWuAe//c10CbUEgWxVY2NLzGiEoNYyVXVqlXytmpDBIfBpzSYUVOemSl5cx+7nYFc/D3 h1zk+oq9RV4xem+sV7CgsFq+TRAI31DW5oDREc6lsAvX4pXn7LhK4kCNg5S0d4OBu91Y NzjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=kR7DvnBn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id i129-20020a639d87000000b005bdd82f2821si3555087pgd.551.2023.11.08.23.39.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:39:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=kR7DvnBn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 0CD4B81F8FCD; Wed, 8 Nov 2023 23:39:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233310AbjKIHjI (ORCPT + 32 others); Thu, 9 Nov 2023 02:39:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232951AbjKIHix (ORCPT ); Thu, 9 Nov 2023 02:38:53 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC60EA4 for ; Wed, 8 Nov 2023 23:38:51 -0800 (PST) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0D9631B87; Thu, 9 Nov 2023 08:38:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699515506; bh=tErP6ntTDdC0gabpvQZT2twhldOSaERfSjPvzlINOYg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=kR7DvnBnuKYV6zUJN5kbkxd2PFfd4UnaU7zGCrcxZBRaCg7KC648DlNBkSvzqoz3y FOxBwhff6kCosGe2U5jZ5RCcY158Yk3tZxNcKjH0s1cCQUNyiJzBP53pKSO46Wlp6R wJaujOJ4U6gdcu/vUBhvdNrmX+82QinExMBCKIXc= From: Tomi Valkeinen Date: Thu, 09 Nov 2023 09:38:00 +0200 Subject: [PATCH v2 07/11] drm/tidss: Add simple K2G manual reset MIME-Version: 1.0 Message-Id: <20231109-tidss-probe-v2-7-ac91b5ea35c0@ideasonboard.com> References: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> In-Reply-To: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> To: Aradhya Bhatia , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Francesco Dolcini , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1452; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=tErP6ntTDdC0gabpvQZT2twhldOSaERfSjPvzlINOYg=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlTIx/4yyEc0vlhu0LY6PKDBh3YAinZZWmPblHD ALXeO8ROGWJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUyMfwAKCRD6PaqMvJYe 9f/lD/46bgpdv2S8ITGIdgfaPkwqsjWoOoC0LAxXSonc5kSzdeRIvr9b3YSLkZGj3SwbZ7M0oa+ oHtFqztyD/dYGNcQxIdq47NawuCcZjIC0Oxg9owTgfdSPLvJX5sMC/UolVmF9KroPSo/BO9Fh1i E4REh0S0d1gvKwRL7Bt9CG4QYvzS/biPAml1S62EUDUalTWU3y1WYGrUbgjdps/HdGpjFHdPIv9 eWv+etZe9dRkUDBVkx5pLkgT6tEp6X95wurcYPfticPLbvTc70CYepSF2yAgpOH3XgBEy7h7aNh 3Sk7ZDOsVoYavoI04mQdKguVSdvLFm2fXlpVsq5IMtwy/exdpZLVGFtIxKlJezYv1WHlQvdwKoL vLYHMfz5RIJWuv0ebSZ2vGmG7rRUXcG+jFilL2P3HVN5PRYtT47fzeWMeeRgv9mOJAAMJTFjuKE ViCUFvElQyiaaTC35VSQclLM/dvv5mLF9QftiYqbOopX00vWwa/HPCVurQ+rDtAdWcL3N2/M1h3 +GbWNqcX9MhFm9JTN632CxUZ2GDxTyRCrgziQK5QCMhMMwWiuLvQPXlxBP/25daaG7JAtUpZvVG fbEOnJEc7sCWzqk0qGutAEGJD1SSW4Takmxye3xd2rlq/iwp0eI9v60xmiwTn9P4I9KoKIUQwC1 K44aOqsEWDdAF8A== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 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 (agentk.vger.email [0.0.0.0]); Wed, 08 Nov 2023 23:39:35 -0800 (PST) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 agentk.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782071252903522859 X-GMAIL-MSGID: 1782071252903522859 K2G display controller does not support soft reset, but we can do the most important steps manually: mask the IRQs and disable the VPs. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_dispc.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c index c82fd5bc9be4..a5c0b72596e8 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.c +++ b/drivers/gpu/drm/tidss/tidss_dispc.c @@ -2702,14 +2702,28 @@ static void dispc_init_errata(struct dispc_device *dispc) } } +/* + * K2G display controller does not support soft reset, so we do a basic manual + * reset here: make sure the IRQs are masked and VPs are disabled. + */ +static void dispc_softreset_k2g(struct dispc_device *dispc) +{ + dispc_set_irqenable(dispc, 0); + dispc_read_and_clear_irqstatus(dispc); + + for (unsigned int vp_idx = 0; vp_idx < dispc->feat->num_vps; ++vp_idx) + VP_REG_FLD_MOD(dispc, vp_idx, DISPC_VP_CONTROL, 0, 0, 0); +} + static int dispc_softreset(struct dispc_device *dispc) { u32 val; int ret; - /* K2G display controller does not support soft reset */ - if (dispc->feat->subrev == DISPC_K2G) + if (dispc->feat->subrev == DISPC_K2G) { + dispc_softreset_k2g(dispc); return 0; + } /* Soft reset */ REG_FLD_MOD(dispc, DSS_SYSCONFIG, 1, 1, 1); From patchwork Thu Nov 9 07:38:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163265 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp274515vqs; Wed, 8 Nov 2023 23:39:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHH7kTuuNyd+1fDNH5rUPQ+Km712C9wv2KzPYuPBmYUOacf3czUx9kV5buyBgn08TFEPEkc X-Received: by 2002:a05:6358:e499:b0:168:ea15:f193 with SMTP id by25-20020a056358e49900b00168ea15f193mr3973302rwb.23.1699515551660; Wed, 08 Nov 2023 23:39:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699515551; cv=none; d=google.com; s=arc-20160816; b=Z7XdxrRtkxs7EdFS3nEJ2gbi/8+hi+FotllnjzEjJSGty/iaPud+GcO5SOwzYmYhuz CJ2wUuboRJkyx/7Nh4Yt3GVW740p90ZFg4/lSbAhUpCAYLRroNISjHAT2sjU+mtCpSDB 4SgJuTFHY4Ahh05X+VBJ6N7hQ+gSPTjzIKuGxrSY/zY70X63uS/e3NySH0j+YBwabkNd z/DYpRj+gSeuVG+m0ug7GId/Ono1CHdro6QvSKiYwl0A1/trPyoC6ct9o29MIFSU3EY9 G40NanzPzVUB4Mli0owCuPVFua2zeaqd9pjwKT5sr+KTVyfsYF2wzpb3NcOuUYEQR4ac Nq5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=Cs6aJm5nEmXcKgK3azSny1lhNdVgx61huATu38cdrVE=; fh=ar9Kuonru+6un71Fc3+cR+miWSr4t5vPPiuWh6IeKvI=; b=JG0jvAlnyEAZoQjN+rkDpvJ/H8Eh96O7fpOuOqYjc0zHb7sZE6xrSqY659jodkdRhi NsRtkdgKJeDjBfBFpcFCd8ch/LaGvL8oh6BHm0f8mPfQbTOEzyvKHAk2smsaOWphoZX4 tTiTrpWWWKthFjaXs6x/s3rAVqmC4HI1tfNzBT9jr0jeI+qs3yJjEgz+bQSR7ghPCxF0 zfTG1lHIIDFT9j4y97OBf4c4Z4PcvdJ3niTxoHKEwkyVwfDJw/T/WjtjPcustWfGEKj4 aBfdanT6jNeESq/TER0TR7xCGUlkK2V+UPSYU5tmRONE6qEwbfbOs4EMS78VVfBQOZ3F NQzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=BwTNgUW6; 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id o14-20020a656a4e000000b005b8f24e6526si7424096pgu.234.2023.11.08.23.39.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:39:11 -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; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=BwTNgUW6; 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 B4DED8328FC8; Wed, 8 Nov 2023 23:39:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232832AbjKIHjH (ORCPT + 32 others); Thu, 9 Nov 2023 02:39:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232970AbjKIHix (ORCPT ); Thu, 9 Nov 2023 02:38:53 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1F282D4F for ; Wed, 8 Nov 2023 23:38:51 -0800 (PST) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E774E1BA7; Thu, 9 Nov 2023 08:38:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699515507; bh=VyQFOHUX27qoYp+sEZHLrOOnAGthD9ucCI4/pfyGBgw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BwTNgUW6HHSjGvrI/xQoVOgNcJJSymBeJ1IwQYT3VnMqE3zMJ28jh6WegKgj48+q0 bA8KGaYB2vUFhpfeBfBiaPrXrjZOuarBHjnkS/PCzE9OO5Pq4CBJW9QvmuOowoJncY FhE6xEDT05EBQTT4BnjG0rXjPtkeiEXAlg1ev4Vg= From: Tomi Valkeinen Date: Thu, 09 Nov 2023 09:38:01 +0200 Subject: [PATCH v2 08/11] drm/tidss: Fix dss reset MIME-Version: 1.0 Message-Id: <20231109-tidss-probe-v2-8-ac91b5ea35c0@ideasonboard.com> References: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> In-Reply-To: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> To: Aradhya Bhatia , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Francesco Dolcini , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2802; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=VyQFOHUX27qoYp+sEZHLrOOnAGthD9ucCI4/pfyGBgw=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlTIyA7lAsXjoKndhmceZLoKWYp42ow/HZpdLXl v4dYGJXejyJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUyMgAAKCRD6PaqMvJYe 9VK0EACmedDicf6gu2jeCVhtFxLC9E7UeAPCWk8iDpU8txnM2UKnf/2Go7QKMtArXh7urR+JczJ lPIcEj+cKoKoelW+JOkyhfKtMHFknHr+0G+yMV9G0aVG6CPrN8jXKnUyUr9Rf6j0LJGYM3svaxw gUTPMrQXlwjH510BZra9/VwGvOdYT6DZK1eBfqQwVufSrIAw//M8JDnXhuBNgLNxOIoMO//SbUH 0zQwWL7Au8mypN65+rf9hoZuvJs2D6T2nenjZ/lQ26eJcvIsWefgzWjJKq3HJUdRWdHzriIlkQD Pr4MiGGXTvMlZxmXWP/jK3sHUpFm7+IjeI40nVdZ1Jg+PrzlrhrX0TfzMJpAj3XvGg3yKfeAPFE mMHfvUwDI3UL8MxSdwtjgMSd3GjFAQX2Oe9NHY0RDAiQL/SeryP9GxHM+/+VZzcV/a5u3aschyA 645hz2iFhRKX+lom9GWv5ZVe2zHl5WBI/aw0ExkpSriVkiX+usBZzBDuSlcT3GsSC8Rh2cVKQDR TK6F5pv3ddLcvg2zoqHdiLxnovgQavANTbXML4TIpZ35iqGA0MZ/iE2XGJxWcsRsd/QuFw67m0y OLfH9hQuOOxpWdB1EMpiarxQ3CWJxY/lJKuRx2KIrYVxqGzXY1ZJvv2PqoPMDW/vEspDmy843wJ 8nEq+2DvwXOJN5Q== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 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]); Wed, 08 Nov 2023 23:39:10 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782071219102850927 X-GMAIL-MSGID: 1782071219102850927 The probe function calls dispc_softreset() before runtime PM is enabled and without enabling any of the DSS clocks. This happens to work by luck, and we need to make sure the DSS HW is active and the fclk is enabled. To fix the above, add a new function, dispc_init_hw(), which does: - pm_runtime_set_active() - clk_prepare_enable(fclk) - dispc_softreset(). This ensures that the reset can be successfully accomplished. Note that we use pm_runtime_set_active(), not the normal pm_runtime_get(). The reason for this is that at this point we haven't enabled the runtime PM yet and also we don't want the normal resume callback to be called: the dispc resume callback does some initial HW setup, and it expects that the HW was off (no video ports are streaming). If the bootloader has enabled the DSS and has set up a boot time splash-screen, the DSS would be enabled and streaming which might lead to issues with the normal resume callback. Fixes: c9b2d923befd ("drm/tidss: Soft Reset DISPC on startup") Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_dispc.c | 45 ++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c index a5c0b72596e8..8d6ac618c539 100644 --- a/drivers/gpu/drm/tidss/tidss_dispc.c +++ b/drivers/gpu/drm/tidss/tidss_dispc.c @@ -2738,6 +2738,49 @@ static int dispc_softreset(struct dispc_device *dispc) return 0; } +static int dispc_init_hw(struct dispc_device *dispc) +{ + struct device *dev = dispc->dev; + int ret; + + ret = pm_runtime_set_active(dev); + if (ret) { + dev_err(dev, "Failed to set DSS PM to active\n"); + return ret; + } + + ret = clk_prepare_enable(dispc->fclk); + if (ret) { + dev_err(dev, "Failed to enable DSS fclk\n"); + goto err_runtime_suspend; + } + + ret = dispc_softreset(dispc); + if (ret) + goto err_clk_disable; + + clk_disable_unprepare(dispc->fclk); + ret = pm_runtime_set_suspended(dev); + if (ret) { + dev_err(dev, "Failed to set DSS PM to suspended\n"); + return ret; + } + + return 0; + +err_clk_disable: + clk_disable_unprepare(dispc->fclk); + +err_runtime_suspend: + ret = pm_runtime_set_suspended(dev); + if (ret) { + dev_err(dev, "Failed to set DSS PM to suspended\n"); + return ret; + } + + return ret; +} + int dispc_init(struct tidss_device *tidss) { struct device *dev = tidss->dev; @@ -2847,7 +2890,7 @@ int dispc_init(struct tidss_device *tidss) of_property_read_u32(dispc->dev->of_node, "max-memory-bandwidth", &dispc->memory_bandwidth_limit); - r = dispc_softreset(dispc); + r = dispc_init_hw(dispc); if (r) return r; From patchwork Thu Nov 9 07:38:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163270 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp274847vqs; Wed, 8 Nov 2023 23:40:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IH8845phJ7HJU2J2n3CRBL1qGHxXLf1/BmNRbOccPf9JiHLLvOfWgtTDvf7SYQxPv/fkiKP X-Received: by 2002:a05:6358:5913:b0:168:eccb:cd60 with SMTP id g19-20020a056358591300b00168eccbcd60mr4089809rwf.27.1699515611432; Wed, 08 Nov 2023 23:40:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699515611; cv=none; d=google.com; s=arc-20160816; b=NIcEnSRg0LY5ihqL+9hU2Z595N3q6C7d96jQQTUjBAeOKXzmSw74FivCuKLLgOHRXF C/ExOQ0o6ICWx7d/EmYwGmBtXJ7ul7XatCzn879lbHCwYe6HibrYjyOOrJPlLqL5VESI opQHYq2ZEvTamz+1e+L+6ihBpjwna+8C08GFwhbyNfrlyl+7Lg464+fCvE9VYxfLLh1X 98N66IEFXBBKJKWgfms/qccIsjV1ZwsVwJ+GXLP99mW1IKQCMTvFIPB2VXuD2Coq/Yhv xmyuA2duwL7oVHG8dXnhOtTqZhRs5scTkHwz5S16Z7QEAVoqgHbIEq2XgICN7EBm3S75 sMdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=eA6NtHqPjnJcJi3+ePRA2qfxt3yeLOFgL5ikD4bLLVQ=; fh=ar9Kuonru+6un71Fc3+cR+miWSr4t5vPPiuWh6IeKvI=; b=Mf/H65L2j93mOrKv8QanEywL+8AIwL+uuv9QfE3r/pX0fe+j5OgrBgHFunxa+mdf2w w0WKjZmXyf9O4iXwAR2DmJzi6mSs545RCbb+1lYSn3kkj5s/360eQqMQqOeatPsikE5x LvMu5DR00SkL1F4T5QwLyBQgx2ZCgdB3qrEJuTFrnrhBKvSspZJSQqcNfxrfJ7RnL08l uCdZyDeATO3Ly94aJ1wLDBQLxgS0X1UOFMtAgJcu4645+dntpxVhkg+rkmVI0PMNxYXU 8TX86ypzFPaZ771gXzYt1TTtXkfHliaFp454HS0Wqj0Zsfin5JFwL8L8R0bKXmD1tM1p Z3OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="Dc9GjD7/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id cb10-20020a056a02070a00b00573fa4cfe49si7462637pgb.166.2023.11.08.23.40.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:40:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="Dc9GjD7/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 7BEDA83174BB; Wed, 8 Nov 2023 23:39:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233394AbjKIHjK (ORCPT + 32 others); Thu, 9 Nov 2023 02:39:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233101AbjKIHiz (ORCPT ); Thu, 9 Nov 2023 02:38:55 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 347832728 for ; Wed, 8 Nov 2023 23:38:53 -0800 (PST) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C4D1DAF2; Thu, 9 Nov 2023 08:38:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699515508; bh=DctFIvkDoFEqJ33Z6ruCYMdZFJxb/7pQYzOou//Ap3I=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Dc9GjD7/juHAmMUUFhiwOgCXA4OXdrRrZ1hX8ejF44mMI0MHKeBCDabyy6gpnwGsv zV7+IhxWEZhz/maI/drQJZZAYppVK+28umotd42BzVPPnqHeFwOLd7o8gFcHVnViF8 w0XlrVI7Beh8FITWRxveF3I6mOEOHc2W6Mt6WLbc= From: Tomi Valkeinen Date: Thu, 09 Nov 2023 09:38:02 +0200 Subject: [PATCH v2 09/11] drm/tidss: IRQ code cleanup MIME-Version: 1.0 Message-Id: <20231109-tidss-probe-v2-9-ac91b5ea35c0@ideasonboard.com> References: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> In-Reply-To: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> To: Aradhya Bhatia , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Francesco Dolcini , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=3782; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=DctFIvkDoFEqJ33Z6ruCYMdZFJxb/7pQYzOou//Ap3I=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlTIyA/Ed2GdhSjNB0TdLDAtTBLS3T3owhC5Feg AjEZ5prDE+JAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUyMgAAKCRD6PaqMvJYe 9bfXEACOcy1uY/FsnMlL7FZbPFWduaeQxZS35htX2N1qTBrmP6urK9VYAyugcSbuDvezOUMkNi5 dYnMaRD08OrqD6HlQLiDVOjP+DWiS0DN2JNnXctyXKrl/ozrbnPLGqdwEQcjSDYkusWqyaYP/Kk QUfzxb1KDStz9dlgI7nBBOlQY7mS0jJymZc4JlZw4IF+ZSBGvGA5xVgWUn2vb85mm/6sOCcDizn ysgYo6Bl4YwOH1LQrCIMOvtLdx2EgfpkDmkig9QteDP6r3UXwQUV3iG+X0w46kcf7wvgDYdpHhH 6k6dHcVk/BWSbWCY1k3Hy4rXRWmch85qQTnY12w4aGi5j2BfBZeAcZ3nVuRNeN026GQfvIXDh5y 0zu5lkUlg0aiH6EsXU6UQmJG/IATb/8r8gSV50VWUon+GOwDdHI6OcGGYKlUHFcWBrpOdGaeSpb orpwMgoAbzYT2gvSPS1UAtlg/bs6gq6YjyA3x1mm19wy1ux4yY7q53P+Oz9UAfqTYpGQYofn/cG XLy5u+yMAiKmIJFSpMaliWPdcRnbmCynwcIZulo8IHMq80pkSWPuR6H8O5LxTzU0OZNHUYsYHbw dvHXWuOL6B+qzOYSNEVWI9SBF4a9icPSWQ1ooKTbt7XF+5RuxOkymCUhRONJCwetNsRm/IUYAxC BxCTt++Vmnonh2w== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 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 (groat.vger.email [0.0.0.0]); Wed, 08 Nov 2023 23:39:50 -0800 (PST) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 groat.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782071281490884528 X-GMAIL-MSGID: 1782071281490884528 The IRQ setup code is overly complex. All we really need to do is initialize the related fields in struct tidss_device, and request the IRQ. We can drop all the HW accesses, as they are pointless: the driver will set the IRQs correctly when it needs any of the IRQs, and at probe time we have done a reset, so we know that all the IRQs are masked by default in the hardware. Thus we can combine the tidss_irq_preinstall() and tidss_irq_postinstall() into the tidss_irq_install() function, drop the HW accesses, and drop the use of spinlock, as this is done at init time and there can be no races. We can also drop the HW access from the tidss_irq_uninstall(), as the driver will anyway disable and suspend the hardware at remove time. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_drv.c | 2 ++ drivers/gpu/drm/tidss/tidss_irq.c | 54 ++++++--------------------------------- 2 files changed, 10 insertions(+), 46 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c index f51c87e26e10..490d15ed2216 100644 --- a/drivers/gpu/drm/tidss/tidss_drv.c +++ b/drivers/gpu/drm/tidss/tidss_drv.c @@ -138,6 +138,8 @@ static int tidss_probe(struct platform_device *pdev) platform_set_drvdata(pdev, tidss); + spin_lock_init(&tidss->wait_lock); + ret = dispc_init(tidss); if (ret) { dev_err(dev, "failed to initialize dispc: %d\n", ret); diff --git a/drivers/gpu/drm/tidss/tidss_irq.c b/drivers/gpu/drm/tidss/tidss_irq.c index 0c681c7600bc..604334ef526a 100644 --- a/drivers/gpu/drm/tidss/tidss_irq.c +++ b/drivers/gpu/drm/tidss/tidss_irq.c @@ -93,33 +93,21 @@ void tidss_irq_resume(struct tidss_device *tidss) spin_unlock_irqrestore(&tidss->wait_lock, flags); } -static void tidss_irq_preinstall(struct drm_device *ddev) -{ - struct tidss_device *tidss = to_tidss(ddev); - - spin_lock_init(&tidss->wait_lock); - - tidss_runtime_get(tidss); - - dispc_set_irqenable(tidss->dispc, 0); - dispc_read_and_clear_irqstatus(tidss->dispc); - - tidss_runtime_put(tidss); -} - -static void tidss_irq_postinstall(struct drm_device *ddev) +int tidss_irq_install(struct drm_device *ddev, unsigned int irq) { struct tidss_device *tidss = to_tidss(ddev); - unsigned long flags; - unsigned int i; + int ret; - tidss_runtime_get(tidss); + if (irq == IRQ_NOTCONNECTED) + return -ENOTCONN; - spin_lock_irqsave(&tidss->wait_lock, flags); + ret = request_irq(irq, tidss_irq_handler, 0, ddev->driver->name, ddev); + if (ret) + return ret; tidss->irq_mask = DSS_IRQ_DEVICE_OCP_ERR; - for (i = 0; i < tidss->num_crtcs; ++i) { + for (unsigned int i = 0; i < tidss->num_crtcs; ++i) { struct tidss_crtc *tcrtc = to_tidss_crtc(tidss->crtcs[i]); tidss->irq_mask |= DSS_IRQ_VP_SYNC_LOST(tcrtc->hw_videoport); @@ -127,28 +115,6 @@ static void tidss_irq_postinstall(struct drm_device *ddev) tidss->irq_mask |= DSS_IRQ_VP_FRAME_DONE(tcrtc->hw_videoport); } - tidss_irq_update(tidss); - - spin_unlock_irqrestore(&tidss->wait_lock, flags); - - tidss_runtime_put(tidss); -} - -int tidss_irq_install(struct drm_device *ddev, unsigned int irq) -{ - int ret; - - if (irq == IRQ_NOTCONNECTED) - return -ENOTCONN; - - tidss_irq_preinstall(ddev); - - ret = request_irq(irq, tidss_irq_handler, 0, ddev->driver->name, ddev); - if (ret) - return ret; - - tidss_irq_postinstall(ddev); - return 0; } @@ -156,9 +122,5 @@ void tidss_irq_uninstall(struct drm_device *ddev) { struct tidss_device *tidss = to_tidss(ddev); - tidss_runtime_get(tidss); - dispc_set_irqenable(tidss->dispc, 0); - tidss_runtime_put(tidss); - free_irq(tidss->irq, ddev); } From patchwork Thu Nov 9 07:38:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163273 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp275213vqs; Wed, 8 Nov 2023 23:41:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IEON5WQv2Ql0DXVCzlLhcHckZ20P4VlBKjZz8DuEBxpv8qYszJFBjhDdOnC3pB8CwFqa6IN X-Received: by 2002:a05:6808:18a4:b0:3b2:e520:dfab with SMTP id bi36-20020a05680818a400b003b2e520dfabmr1039814oib.44.1699515680306; Wed, 08 Nov 2023 23:41:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699515680; cv=none; d=google.com; s=arc-20160816; b=zgThIiy43r8DKrj+FomQLG+Gx/DSQygCcrjhfJyVFJQmLKLYDfhviK5FMVqFVW7E9i dwY3PMkPSJgZAzP2u92jnIpPsI/50gWKbZOpFAYoJFTe9g3zGuV7M5JkD/teuadvTD8y st39urWYCgss8ubpSx1/Sy1d6V0fftrRKaOUxKeor+bX8k6Ge3YOk9X9rRc1AT+xerLk p4hU1INqW/XbGQ4GU0VQMp9uUZ7ockbAqOKVFy9pPwT5OhYyPh3j7IbHBApu091XaYr+ FENii0bPg+MOc0vCrNju2908p9HPspuQcIAFNDmyYXNRX1SrXpRG8vI7MJKX5Zgb8EDz npag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=1uxKZ6zslGPR37wAKGOCx2BIGqHy9nQ4X9rDm/EOlJc=; fh=VcFGZLNWgMGQ4upKwTm/W4LWonQY/s0njiVgLSyQISc=; b=wYU9vPrYL8Ay+ti3/xLiF5vcXXY/G9I437IYMsKKP/TNFwUqyec7NUHTMP+/Wf3Krt +niid0cej2uzPtMn0XAbGlvNPQSJy+A/dtVsEcIz+t7hnGxEqNmkC2X6mDldCeFw3HcV VE9VJFHz+WFBsa+5jiiW1Z65txl4yIG2Xuh+xm1vpG4TOI8EG0sZbVBFLEKES/2/Pbfc 6xtMvzyqXMYe+b8csAakFSXg2T+znOQgKx1tT7F9NdhdeqWHhBJ+xeRHU2LB3exubpFS 1TGO4WKP3Nw6/Xj3dhHDGo98I4BYRN37Gy6ZiDpovVszbzzWW74ffZPoIvMGoYLhl/3K xuXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=l0LuD9VG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id g22-20020a056a000b9600b006bff78d3cb7si15353639pfj.36.2023.11.08.23.41.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:41:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=l0LuD9VG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 4901E806D7F4; Wed, 8 Nov 2023 23:40:53 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233582AbjKIHjy (ORCPT + 32 others); Thu, 9 Nov 2023 02:39:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233109AbjKIHiz (ORCPT ); Thu, 9 Nov 2023 02:38:55 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48399A4; Wed, 8 Nov 2023 23:38:53 -0800 (PST) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A50561BB1; Thu, 9 Nov 2023 08:38:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699515509; bh=bQWW0pZKCuRvL4IYy0nb/sJkN3i+ZB5gIxx8kN/IznA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=l0LuD9VGb7eGrWm9XEivrXjRtUJffMyYuUz8AQ6e05CYLu00NmxUHnvlSb+FQgE+y zsRrT1lF6oCv6DOcX/wzDPsJ4CED71YeadhcEuDEd0bPG2ZFIljZSqKT3LjR9ohx/J ins6WciQkLFs+8jHswhDa6gmUT0DT23Oyp+fHJWE= From: Tomi Valkeinen Date: Thu, 09 Nov 2023 09:38:03 +0200 Subject: [PATCH v2 10/11] drm/tidss: Fix atomic_flush check MIME-Version: 1.0 Message-Id: <20231109-tidss-probe-v2-10-ac91b5ea35c0@ideasonboard.com> References: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> In-Reply-To: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> To: Aradhya Bhatia , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Francesco Dolcini , Tomi Valkeinen , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1862; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=bQWW0pZKCuRvL4IYy0nb/sJkN3i+ZB5gIxx8kN/IznA=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlTIyAJ1HO4rcoZbtH19be+oc3Ci8occSFZkPT1 5g9ExgrbdSJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUyMgAAKCRD6PaqMvJYe 9aK4D/9TZFHEorS4CIO2opcLsKveOvHzSNF7GVjMUdyC2+VwtHV9aOK9w/GH+Fg1ulHRhV0who3 wzU5oEyy03kPxpgx+6ZqG4/GOCOGCSzZecZsxxWInNhKE+PwhwUuZgZFRWf+TDN4buVb8uuzKkL HPYOUwzGzLeOK4L+6cA9nyCg7xSJf9XpEchNWbPk63ZXTdld0G72d51K6OYL5Awu8L0D0ALwrHo yHYyiv2lqSkY/jtElucHxmYqocQS2rhJ6mSCyJXOrPQkpqYyI/Jg3EtV51w7QjE+c7M3ANBdAk4 CBxPZSYB3fwR3lHjYU2XFxF64H+lR+hW9gZq/+49RHo5c3yUNwKjl+reS1jp7BZk3XHm1H7IXiv Sda2sKpeDnduAIjtJLmyxo9ouB7VY4l3G8A/ZJad3w20DhrO0E2by5+fcCg0Q0LImTPkLK/ZbT/ hFX6yIQmJE8pAFyJcRnUalWwQ6NfPuGBu5bqlGfjkNoosx76nfD3/2VKn9ehFwaBf2EUhu1Nhaa UAG0If8UvUjSSfwm/YphrmKHrUfK+r24knzPvZ/zloNF7FT77oElqqi5vHopO55ysk5lhlqaOnw a87SxnFzLV1lkW8zg5/rsp7EMO4W0RgTS5bypPky4PnIwafKPwUCqSRhhVdwJ9yMjNEH5i6B9Xm dLMJIvlAcjXrK8w== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 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 (groat.vger.email [0.0.0.0]); Wed, 08 Nov 2023 23:40:53 -0800 (PST) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 groat.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782071354452158995 X-GMAIL-MSGID: 1782071354452158995 tidss_crtc_atomic_flush() checks if the crtc is enabled, and if not, returns immediately as there's no reason to do any register changes. However, the code checks for 'crtc->state->enable', which does not reflect the actual HW state. We should instead look at the 'crtc->state->active' flag. This causes the tidss_crtc_atomic_flush() to proceed with the flush even if the active state is false, which then causes us to hit the WARN_ON(!crtc->state->event) check. Fix this by checking the active flag, and while at it, fix the related debug print which had "active" and "needs modeset" wrong way. Cc: stable@vger.kernel.org Fixes: 32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem") Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_crtc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_crtc.c b/drivers/gpu/drm/tidss/tidss_crtc.c index 5e5e466f35d1..7c78c074e3a2 100644 --- a/drivers/gpu/drm/tidss/tidss_crtc.c +++ b/drivers/gpu/drm/tidss/tidss_crtc.c @@ -169,13 +169,13 @@ static void tidss_crtc_atomic_flush(struct drm_crtc *crtc, struct tidss_device *tidss = to_tidss(ddev); unsigned long flags; - dev_dbg(ddev->dev, - "%s: %s enabled %d, needs modeset %d, event %p\n", __func__, - crtc->name, drm_atomic_crtc_needs_modeset(crtc->state), - crtc->state->enable, crtc->state->event); + dev_dbg(ddev->dev, "%s: %s is %sactive, %s modeset, event %p\n", + __func__, crtc->name, crtc->state->active ? "" : "not ", + drm_atomic_crtc_needs_modeset(crtc->state) ? "needs" : "doesn't need", + crtc->state->event); /* There is nothing to do if CRTC is not going to be enabled. */ - if (!crtc->state->enable) + if (!crtc->state->active) return; /* From patchwork Thu Nov 9 07:38:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 163266 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp274552vqs; Wed, 8 Nov 2023 23:39:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/G7685uUP3VwMf78FJMV36nr9tMx6gVgBUxGmmz+z/lY1figpDMh3so4j1yvcVTFr98Kn X-Received: by 2002:a0d:f6c3:0:b0:5a7:be1d:7ad3 with SMTP id g186-20020a0df6c3000000b005a7be1d7ad3mr4070310ywf.1.1699515560866; Wed, 08 Nov 2023 23:39:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699515560; cv=none; d=google.com; s=arc-20160816; b=NZ0pXFh1mJ5jyd4Snbp9tW0JeWq05w1pvKduMp/rQkbhZ+olq9kMAkhmzmL7d/LMhI J9kMpkworHfRSB/bXg81eH9Loltt3rft9nDWWVn/rjvrPvyhlSyKRn1gV733afYr5P1M 01y52f1eVBUA5EppIncf90hNlXAxSk4+62k+3JM5/utkPv05ghDJRrf/7vsxfMqJUT4p F1yOm3du7RpN4otfW06vmlJVs/WisG2/LjSKaoIL5I44fc9WZWbx8RzDx6aSTOKf8ANe yZfyH88spPGFrzGXLsem1bN70A0Fm0f902WRv5w9Mlxafy9r1lKb3ixoVVgNA2i2FQJN RGsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=iP1jDoaVd3DWIKZ4q5MOV78vnWJLqLkMKjtNIxvxyRk=; fh=ar9Kuonru+6un71Fc3+cR+miWSr4t5vPPiuWh6IeKvI=; b=BFFSiKgRLb2nDrUkjZpR+yOwLaEis+PJ9A755h2WREL8MKph+kSBogzBHcnL6PWwD1 58BUMKaEWm2D0yB4k4LNHLFh2/oZkrqxW4ef14UFqusIJQ5ZOP57te91uM7f2sXB1yno O+ipDTAFA8xQTXGESw/OxAPXa5+pyxJJs6cDQ4/Hxf+YY1rayRpq12qsCxPj5xL4OuD4 BnTRw9PlCJ5PRlxgZHLEPKme61iG+vnky+eeqnbazOJz6OjhY0Bp4ZTPie4lru8XgC+R fpKZwQO1dELJt4ZmhdGAkbhsTI0AJm+tajnU0Ycb1y+zcI1qFppcnl5GyznFptcDrvlk IqnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=AsVZ7pcc; 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id ay29-20020a056a00301d00b006c3211608adsi15234930pfb.80.2023.11.08.23.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Nov 2023 23:39:20 -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; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=AsVZ7pcc; 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 C714D8350FC8; Wed, 8 Nov 2023 23:39:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232613AbjKIHjO (ORCPT + 32 others); Thu, 9 Nov 2023 02:39:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233201AbjKIHi5 (ORCPT ); Thu, 9 Nov 2023 02:38:57 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDD462D50 for ; Wed, 8 Nov 2023 23:38:54 -0800 (PST) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 919B28CD; Thu, 9 Nov 2023 08:38:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1699515510; bh=+jaNPtduetcEvhSP7u6BC4egR5EmPv/b6uS08H/KztU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=AsVZ7pcctQSiPyOw0SEvmSJkLI4kp0LZnRuQsCOhHeDnWLar5vqsjrMgqtxLgy2LD syDzZ+6TmaE5dPeJO7ySe96MzYnj3jvUkXjCNBMF36+mLChbrxs5g1JwXaTGFHcgeV gESZKz351l0kxkuKKADDHd9QT9h30hwJ2Uxqu7cg= From: Tomi Valkeinen Date: Thu, 09 Nov 2023 09:38:04 +0200 Subject: [PATCH v2 11/11] drm/tidss: Use DRM_PLANE_COMMIT_ACTIVE_ONLY MIME-Version: 1.0 Message-Id: <20231109-tidss-probe-v2-11-ac91b5ea35c0@ideasonboard.com> References: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> In-Reply-To: <20231109-tidss-probe-v2-0-ac91b5ea35c0@ideasonboard.com> To: Aradhya Bhatia , Devarsh Thakkar , Jyri Sarha , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Laurent Pinchart , Francesco Dolcini , Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2310; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=+jaNPtduetcEvhSP7u6BC4egR5EmPv/b6uS08H/KztU=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlTIyBOL8n/raVGNTFxAt6t4oVrY3lRU98v9mD6 wDphIwh4YWJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZUyMgQAKCRD6PaqMvJYe 9XUvD/9JzEs7/j+qn0lz37oFW98QMakrkW9ly9/P/8fIlKNfmLjm6XaxkaldaDArWfd3nPy2bjK Td/Xz2a0t3opx9NcyDkuyaBYrkOkGsmY6XnB/Ik8hrE8On5C4V9OC/aXY30Ly0NZzgCom2NhV4C lR1JDRV7oJvzOe2GQ5Zr6z9UqnkLH0q+mHMVmXJ/o9D+nA9MlPpCYmgNKHQJFsfrLuQdGOaszvT YyQL3q78Ro+5OavI892p7olYrAd2/LmFkRstTzf8l3CGPb1VZFzFM4sHH3NoHycsGPA1Lbvje9u 8/ISjpjSmNzihCIbJrnzVgW/Sl5jyRN1sovgwE1bbBrOtfyxFejfhWwHNSSa3IRfaU2B4qIKDeh E6lwQe0Ws33WsXhDQJvJ2BQFYIzfyNu5ND5R3UvMCOlStvlTcy/1KuynTrbZeDfznLoAfqMHRYC a5NCD6b+df4PoownUg+NQteSkWko6Y3DghpRGfwHClpm3b5qqeNSl/0Xqa1kMRzUoSDif4Alfx3 xJDqMnt6cZZ13aPChj/deHRL3KpVDLqNfqWF3sA1HqViwjXG52KOI4/cxgZ6fdbzoYOHbwciHVu kMKfsNCtGlEOiCg3TkrbeRib6hvqC+gSApbfKGpMoM979GQIv2a2qQaM9tU0dmrXSV/wdDYiJPQ zj8HTwyz3y48EGA== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 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]); Wed, 08 Nov 2023 23:39:18 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782071228731374648 X-GMAIL-MSGID: 1782071228731374648 At the moment the driver does not use DRM_PLANE_COMMIT_ACTIVE_ONLY, but still checks for crtc->state->active in tidss_crtc_atomic_flush(), and skips the flush if the crtc is not active. The exact reason why DRM_PLANE_COMMIT_ACTIVE_ONLY is not used has been lost in history. DRM_PLANE_COMMIT_ACTIVE_ONLY does also affect the plane updates, and I think the issue was related to multi-display systems and moving planes between the displays. However, it is possible the issue was only present on the older DSS hardware, handled by the omapdrm driver (on which the tidss driver is loosely based). Reviewing the code related to DRM_PLANE_COMMIT_ACTIVE_ONLY does not show any issues, and testing on J7 EVM with two displays works fine. Change the driver to use DRM_PLANE_COMMIT_ACTIVE_ONLY. Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/tidss/tidss_crtc.c | 4 ---- drivers/gpu/drm/tidss/tidss_kms.c | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tidss/tidss_crtc.c b/drivers/gpu/drm/tidss/tidss_crtc.c index 7c78c074e3a2..5f838980c7a1 100644 --- a/drivers/gpu/drm/tidss/tidss_crtc.c +++ b/drivers/gpu/drm/tidss/tidss_crtc.c @@ -174,10 +174,6 @@ static void tidss_crtc_atomic_flush(struct drm_crtc *crtc, drm_atomic_crtc_needs_modeset(crtc->state) ? "needs" : "doesn't need", crtc->state->event); - /* There is nothing to do if CRTC is not going to be enabled. */ - if (!crtc->state->active) - return; - /* * Flush CRTC changes with go bit only if new modeset is not * coming, so CRTC is enabled trough out the commit. diff --git a/drivers/gpu/drm/tidss/tidss_kms.c b/drivers/gpu/drm/tidss/tidss_kms.c index d096d8d2bc8f..a0e494c806a9 100644 --- a/drivers/gpu/drm/tidss/tidss_kms.c +++ b/drivers/gpu/drm/tidss/tidss_kms.c @@ -29,7 +29,7 @@ static void tidss_atomic_commit_tail(struct drm_atomic_state *old_state) tidss_runtime_get(tidss); drm_atomic_helper_commit_modeset_disables(ddev, old_state); - drm_atomic_helper_commit_planes(ddev, old_state, 0); + drm_atomic_helper_commit_planes(ddev, old_state, DRM_PLANE_COMMIT_ACTIVE_ONLY); drm_atomic_helper_commit_modeset_enables(ddev, old_state); drm_atomic_helper_commit_hw_done(old_state);