Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp875902pxb; Thu, 21 Apr 2022 12:20:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXxQ5eXwYA+Dfqn0YUz4xFMO5TEitO4U4LbpA67n8HfEfoWI6pEjkyPFg0OktHgCSF2I4h X-Received: by 2002:a17:907:1b09:b0:6d8:faa8:4a06 with SMTP id mp9-20020a1709071b0900b006d8faa84a06mr862038ejc.701.1650568826580; Thu, 21 Apr 2022 12:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650568826; cv=none; d=google.com; s=arc-20160816; b=RoF15szEl7pmJ4oH7MyqK4e6lzK1xm/9J+a1t1G+C4qdLGQYXzf+X3Gv7RZkvTtXMl 8pZLuO9heazFfhrhUR+gbxVZ8oV+lKsafLHFcd1VfPdaplHsrkB59ihbavR+xOtWqZ4Y k+TmMRcV/D/OZz5Rxa9t3VXu3FhyQAfc3E0g/tLmpG4KQnIX97VIk4j0+rrcAVM9IZHf gorKMyzoUBJ7SP2tgzqgh2I+kSAq1sYhLVTrGJzew9IjJ47k5V9wAIJuIdhOWTnhwTxv SRFNVmN0hZ+sI7B+nGRiM/wgtJl5sC/d2SH1NXDcHaSvmK5tUMQaqzix86xaTxFMbG1h iHCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YxJkE8G1CRaDGILe7+GoWJTE8swqHANzIKXbTjCxfWA=; b=uweIwi7heT//X9KP7MNHzgUSTmkNhEotNYEb4m1496H40PqT6hClWunyPyIE0oLJ/j c7ehXPgafTsaYmdyxnjCe+UsAviyXSZSvFKT+Td7nuB6hSJxJ+4t44plWrbWjHTc0xTm DK5/6cdVwGrX2UNFmT0DhSLGxp8TvP2n0obBSm9+2XzWHXNhuERq6RSVrV/ZiW9/J6f3 PbZFGTU/t68FXBEzQWxwQHPH0eQZIKKE7ZDIVcHw37E3oPMNTM386Rm6h4ph2hZ3E2AC E3NrBW3bCwv3XBQOkHaGs2k0lRARJQtofGElyxAYVnhRPAiQv1k3A7Nr7oc65wAMRSiF bScA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wmc+QCZr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e9-20020a170906504900b006efc2a9b497si4699568ejk.467.2022.04.21.12.20.03; Thu, 21 Apr 2022 12:20:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wmc+QCZr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384079AbiDUEQq (ORCPT + 99 others); Thu, 21 Apr 2022 00:16:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384063AbiDUEQi (ORCPT ); Thu, 21 Apr 2022 00:16:38 -0400 Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67117E0D9 for ; Wed, 20 Apr 2022 21:13:48 -0700 (PDT) Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-e5ca5c580fso4222268fac.3 for ; Wed, 20 Apr 2022 21:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YxJkE8G1CRaDGILe7+GoWJTE8swqHANzIKXbTjCxfWA=; b=wmc+QCZr7W/1S6Qi4m8vCRTullRSJITUAjG2JkXsl8y5jZBmRrU28R4meMbAFMy3j4 xQHQfXWzBZdgs6/PiN1QjCK7nca7KkIULjqpfArwqsljTp9SwXfgOAPvYa/92cfETLAO LH346HKowgQBSMij8Rm6I/QklFiHzmza27cpSEJEdeZ83KaCQ/3QihpNz/jZGXDcdZXB rgfhCdFLPpwEhmrawwEsfA7x/XzslBP9+9jEx720HPu5cdO5e9TWoRCQ+S0ou0bYepRe DpwKKaqQtinBGgGsOfZBxZeQVVlZTAvWQhsNDyFZh2IskOh9wH/UhEVMJURzOankc7i2 6Jog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YxJkE8G1CRaDGILe7+GoWJTE8swqHANzIKXbTjCxfWA=; b=yxK6k6OthIXp4yHqjsbxNzjlloQlRqROJrb53ei08unU3QWT0QaA1urRZA9sGxwJJq PdDD5EbXYn/S9MHaSkg5hDo7RmByPyGYhDRIBs+CofeSt+OIN7aBtYQBw5FnZ2bf5obT t1XEXnXsSqWAk8/UJeq8AUrIE6Q8zrrSjQRm0UIEUw0rJvpMohvWSR/6nVK8zbJDlQv8 9iksRa3h68bsqv4uEMpaGCD9YXAhpFykF+mvJmBxiSfW1YuXQXg8CGWMT9MuAZCNIREo uCjBbhNJCdm8wGqKRlYDenVJMpj7XsS201KAPJTY7on/SwQgGgOXiXSyycfHzFIdagoq Dkbg== X-Gm-Message-State: AOAM532PWdY2KF4DCWBgRxejkDHQwU4U54lt7FRuA47jWzV1hkIlJkaw sPfeXzedsqBxNzlY22/i0qgFjA== X-Received: by 2002:a05:6870:a707:b0:e2:cc85:d98 with SMTP id g7-20020a056870a70700b000e2cc850d98mr3085213oam.131.1650514427764; Wed, 20 Apr 2022 21:13:47 -0700 (PDT) Received: from ripper.. ([2600:1700:a0:3dc8:205:1bff:fec0:b9b3]) by smtp.gmail.com with ESMTPSA id h186-20020acab7c3000000b002ef5106248asm7115512oif.45.2022.04.20.21.13.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Apr 2022 21:13:47 -0700 (PDT) From: Bjorn Andersson To: Rob Clark , Abhinav Kumar , Rob Herring , Krzysztof Kozlowski , Dmitry Baryshkov Cc: Sean Paul , David Airlie , Daniel Vetter , Philipp Zabel , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 2/2] drm/msm/dpu: Issue MDSS reset during initialization Date: Wed, 20 Apr 2022 21:15:50 -0700 Message-Id: <20220421041550.643964-2-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220421041550.643964-1-bjorn.andersson@linaro.org> References: <20220421041550.643964-1-bjorn.andersson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's typical for the bootloader to bring up the display for showing a boot splash or efi framebuffer. But in some cases the kernel driver ends up only partially configuring (in particular) the DPU, which might result in e.g. that two different data paths attempts to push data to the interface - with resulting graphical artifacts. Naturally the end goal would be to inherit the bootloader's configuration and provide the user with a glitch free handover from the boot configuration to a running DPU. But as implementing seamless transition from the bootloader configuration to the running OS will be a considerable effort, start by simply resetting the entire MDSS to its power-on state, to avoid the partial configuration. Signed-off-by: Bjorn Andersson --- Changes since v3: - Rebased upon the mdss dpu/mdp restructuring (https://patchwork.freedesktop.org/series/98525/) drivers/gpu/drm/msm/msm_mdss.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c index f6f0d0fa5ab2..20f154dda9cf 100644 --- a/drivers/gpu/drm/msm/msm_mdss.c +++ b/drivers/gpu/drm/msm/msm_mdss.c @@ -4,11 +4,13 @@ */ #include +#include #include #include #include #include #include +#include #include "msm_drv.h" #include "msm_kms.h" @@ -193,6 +195,32 @@ static void msm_mdss_destroy(struct msm_mdss *msm_mdss) irq_set_chained_handler_and_data(irq, NULL, NULL); } +static int msm_mdss_reset(struct device *dev) +{ + struct reset_control *reset; + + reset = reset_control_get_optional_exclusive(dev, NULL); + if (!reset) { + /* Optional reset not specified */ + return 0; + } else if (IS_ERR(reset)) { + return dev_err_probe(dev, PTR_ERR(reset), + "failed to acquire mdss reset\n"); + } + + reset_control_assert(reset); + /* + * Tests indicate that reset has to be held for some period of time, + * make it one frame in a typical system + */ + msleep(20); + reset_control_deassert(reset); + + reset_control_put(reset); + + return 0; +} + /* * MDP5 MDSS uses at most three specified clocks. */ @@ -229,6 +257,10 @@ static struct msm_mdss *msm_mdss_init(struct platform_device *pdev, bool is_mdp5 int ret; int irq; + ret = msm_mdss_reset(&pdev->dev); + if (ret) + return ERR_PTR(ret); + msm_mdss = devm_kzalloc(&pdev->dev, sizeof(*msm_mdss), GFP_KERNEL); if (!msm_mdss) return ERR_PTR(-ENOMEM); -- 2.35.1