Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3428549ioa; Tue, 26 Apr 2022 03:34:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3CEe9dj3IAsw/RRdrOyBYCHlTZD7PcBGZfkFYMf7ahrFkURl6ns9WfIDDq5zxdn3nbTKq X-Received: by 2002:a17:902:ea01:b0:15c:e746:477a with SMTP id s1-20020a170902ea0100b0015ce746477amr16293122plg.8.1650969272216; Tue, 26 Apr 2022 03:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650969272; cv=none; d=google.com; s=arc-20160816; b=IeTEQMIaj+mBXwNz9hfpZA2sahpqZNBo2lc2HSHLMh+rITto/Hqtg0jgyPEdoqGa2f we4cpFydcxp2zWCqkQKgwCQzYm2XNUowYHRIXSXfkkrYN29nMHC8EqGGWSmq/+Z1rany 1rfA2IjdYBDT7BVzZm/nIqW+lhrzemR+ptor9iuoJyPqTHh/a/X3cam9ar0Y2Cj50WtI HbvkWxd13+JGSHPU/ra9Ry9E47lB0J2hqSrtcvsh7HnnkP4duA9yjEXSWyEZMvcr5aj6 V7zlbkzSSzDMXKEDtSlGVk5av26ttrLQ1J4sO1AcYkwtT26G+i4ZRp0+3vjieqNW7+hp p00Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=wNSzXqr9gdAV/1UM9LYsZKhA56gdS5t/rHhHRCuCh9o=; b=HPKCBS29oNLN83EPxiP5QywUzZOrw8fWCKJLXl27Hu9McBPoEtZRIJONHQER9/7NOH cUE/cudisn/xzXCj1R3Z4ASAEROWg2UQxI4VRvvmJmVoqbKfqJ6km3f3Qh6Qj5Z0/PL0 tK8NSygatVmQ/3FRRfFEhf6FVcpoYEepwWpw+7beQIx9RCXt1Ua5/b92gmLCdumiClDZ mzij71w54w0haZHbiIbJdjb8jEWvcezbUtr6KgjSs6bftcvMFok24hWfzoFjLULCvk1e JWLPHHYEA2jhd0tDAJjhLmK/oBgcLnXX0HtYMq1d6S+4XsH+DwbzBV7IEbwzTFa3oTvq HXkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hiz+GTMf; 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 o16-20020a63f150000000b003ab7e64c0d9si2626810pgk.775.2022.04.26.03.34.17; Tue, 26 Apr 2022 03:34:32 -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=Hiz+GTMf; 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 S236064AbiDYW2K (ORCPT + 99 others); Mon, 25 Apr 2022 18:28:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343695AbiDYWOW (ORCPT ); Mon, 25 Apr 2022 18:14:22 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9FA0167C4 for ; Mon, 25 Apr 2022 15:11:16 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id bu29so28771431lfb.0 for ; Mon, 25 Apr 2022 15:11:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=wNSzXqr9gdAV/1UM9LYsZKhA56gdS5t/rHhHRCuCh9o=; b=Hiz+GTMfZU/jt91kJKCco1eBpfOqVPKVZMhV/zyHzpUJa9fxMwVoWkXni0uPP2otu0 jputn5/iM0C+IFHkKBouHDGxaaUSjcGVmVQSzBARnE3ScQV7/lkhQKbygWxZx6iGnJr9 hu7s2AHKExVON0O6Ah4Eowky6GyYnyEDNiWd3HUwmT5wnID2LVAGVA+HsUmc7os0MBv6 fZ8VyzyqeFQ2b1gpKs+xwyPyVZWhvPtb45NweWrXltBzpcFoA/xNvCeO2QN8bJLLZHou wpb34eHMRCEkIzq5Ib74y5rfhBAWj2t+9hFioOfJR5tltu+0PCFzrNwmG/xiEbl5Usoz THDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=wNSzXqr9gdAV/1UM9LYsZKhA56gdS5t/rHhHRCuCh9o=; b=0rEeP6rqPXqIOSYYz5E0SXe7a3Qy+/FkG42vR+Qu52MlCdZtzJWvXhXLO3n5NOJMiB WVzv44eLLsPI7aIMXAYhd6G3WdRL7CHub6CsREYsHlSBdDbiPcr6l6Kr3PG89t9T7IaT 2A8bpoFmuXJ8BFRRk5RzFALaD7oaW3dvwl7T0fOON5LCy0ExF0C6XBSg6IM1b36YLYK5 iRXEInwHHlbbzi6K40cukqnMQdcVRToGGRetXociEtwn2Omr1pEIz3cWaQGFEJCGp01r brlxkjkyq/2EeQ4C0GiPpgfbM3fZ+XarKDe+TF7F3iw04p1K7msotK5z4h+uJZPIqP5a URNg== X-Gm-Message-State: AOAM533KjvIf5tbGAa8OxoNtZw6CJwzEMU/A7lVooANpRr8PYv+xdQbj C8YEH1f5DF3dWsVI+m1KBzfzrw== X-Received: by 2002:a19:ac04:0:b0:471:664f:95df with SMTP id g4-20020a19ac04000000b00471664f95dfmr14698796lfc.310.1650924675274; Mon, 25 Apr 2022 15:11:15 -0700 (PDT) Received: from [192.168.1.211] ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id i13-20020a2e864d000000b0024f1564ea12sm207876ljj.105.2022.04.25.15.11.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Apr 2022 15:11:14 -0700 (PDT) Message-ID: <94435133-b875-3005-ab23-dc4457ec9002@linaro.org> Date: Tue, 26 Apr 2022 01:11:13 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v4 2/2] drm/msm/dpu: Issue MDSS reset during initialization Content-Language: en-GB To: Bjorn Andersson , Rob Clark , Abhinav Kumar , Rob Herring , Krzysztof Kozlowski 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 References: <20220421041550.643964-1-bjorn.andersson@linaro.org> <20220421041550.643964-2-bjorn.andersson@linaro.org> From: Dmitry Baryshkov In-Reply-To: <20220421041550.643964-2-bjorn.andersson@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On 21/04/2022 07:15, Bjorn Andersson wrote: > 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 Reviewed-by: Dmitry Baryshkov > --- > > 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); -- With best wishes Dmitry