Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4880462ioo; Tue, 31 May 2022 13:56:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwC5Hp2g0BnUnRFd+yvDMI4xOnmagXAkOBxO7vFa+/NmiWSm/l5LJzYWR3eOT2M37wE+2dt X-Received: by 2002:a05:6402:350e:b0:42b:47d9:88ec with SMTP id b14-20020a056402350e00b0042b47d988ecmr52793087edd.407.1654030575335; Tue, 31 May 2022 13:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654030575; cv=none; d=google.com; s=arc-20160816; b=hs0qAPUU/jbVJvbVL1XxqQXEtz1gsKTU1z7u1+6UQW8YdBjospkCRhdWLap6mfbbOI FVgAGOuS5H2+YDIQIiVSMlTcH7gtEj3aTDgMNXGVgTzedwwkTPUkmkcHblB0Q4umYHDc +B4dJU0QPWHQ3xHX1tvd3eeHMs/0xzU/58FgeijgOYjdt9fiREKP6lUUN3XX1oy5H9YQ UidWa3kZAzK7WE7w62CuFxFexxl9mMNcTi2fjvoOm/2Qn73PbG62rnjhoj2b6HpStQoo gpUkZeyENIas1c4n0KVpXez1NeERUFEjMpz2e8xRGq6X2sPUgapYh6XFIHHXijpdydS3 dYjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:feedback-id:dkim-signature:dkim-signature; bh=z7a79ghN+N76ZhwQ641IsKDuKwUgLOjLc7mVHgDfios=; b=TF037BZL2FofW6eU4PUk8vsmQ1AuqOglRKNec0lfSs+jHAYOA17gbqZczctybWQMI0 rCzOo34pOL1EjPFgRaV4LNPjlZQAjZSZjhFkux94rYfp3yNGRAqiUrRdt64v/OcEVFQQ t/GVexdzL0MVqSwpKslPPmZiYMGMn53dKNdEVv/nd0Bpk9pwogJJ5sVSHidF+DRSJRIC IeUxBqRSDgKYIRkmURzZIRNpQDoldWrLpe3c91GWT+lCcZ1EnFlZI4orrkf1KAzSfUYd x9huqAyY9T3rCOqB5soesYWACQtuOo4c8uvViSpd75wn4iJw8gh1w7H0ou2pXs+r6DOI XPQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (expired) header.i=@cerno.tech header.s=fm3; dkim=neutral (expired) header.i=@cerno.tech header.s=fm1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs6-20020a1709073e8600b006e7ee1a3502si19287318ejc.955.2022.05.31.13.55.50; Tue, 31 May 2022 13:56:15 -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=neutral (expired) header.i=@cerno.tech header.s=fm3; dkim=neutral (expired) header.i=@cerno.tech header.s=fm1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236505AbiE3NWy (ORCPT + 99 others); Mon, 30 May 2022 09:22:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236524AbiE3NWq (ORCPT ); Mon, 30 May 2022 09:22:46 -0400 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0D56819AA for ; Mon, 30 May 2022 06:22:37 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 9A0595C01B4; Mon, 30 May 2022 09:22:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 30 May 2022 09:22:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1653916956; x= 1654003356; bh=z7a79ghN+N76ZhwQ641IsKDuKwUgLOjLc7mVHgDfios=; b=s 3P4KBN+gl3HsslnjzvnXp2LcO5teFuFBSxeCpyP/gLvEO50TDtuuQ1Gf4WK6bdI9 JHrm9pAbafzd/Rudmo4V/fuWNXm3LIYKykwnXVbyDATrswzSL7WOjX28G2OaHPbT 4vkeB1/UIJH3JObjxLlKM6uD9ORLO6Y6KF01wrI7b3vIK8IhZzsChlF5bNQmVjje 6Kv920BrDUY22w4recK/E8+ORAXzRKYrYgG3Q7zqPMcvLF+gAzvsxpUSSq8ScVNW hWpvsiUF5tYHnwZ1MIQxcDkHu/rTlT6L9Bob+gNSy0qDNUITQ0i/eKV7c1IeFATn U7lqNEfuxktZ5xa4SbUqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1653916956; x= 1654003356; bh=z7a79ghN+N76ZhwQ641IsKDuKwUgLOjLc7mVHgDfios=; b=q J8GEZqHBSm/cxidTwgjMDhW6snhd0QwR9/+Vo/PJJnd2Fo8qOtLDo5i3Ki3sXGiY NUq0DeG4Gq5olkpk0aaucPs09yU2glhLRWt3bssdI0ktBqgR5LSGNzKwtrEMZJC2 8dCDQXBQ/QQijgYyA0uIIiaxmm6n8yhd9TySJiydr9Xkti5OGjhlHzn2gZEikg1I enMMUKpwpvuZsBxCGjdBYQxsarpWss/849VnLVDPfk3bAIDL460DL5MG8O38tmNe cqQ/ek4ReRFHJ4xhKC3O3RUcvPo+abI6gddbK6cDtVpzpjOIx3WMuKem+zJW3eS5 C68Tu11QiDQPbqgUn6L6g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrkeeigdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtugfgjgesthhqredttddtvdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpeetgfelgefggeekkefggfeludeiudffjeffgeevveekjedukedtudeuteef teefgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 30 May 2022 09:22:35 -0400 (EDT) Date: Mon, 30 May 2022 15:22:32 +0200 From: Maxime Ripard To: Roman Stratiienko Cc: wens@csie.org, jernej.skrabec@gmail.com, airlied@linux.ie, daniel@ffwll.ch, samuel@sholland.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, megi@xff.cz, Roman Stratiienko Subject: Re: [PATCH] drm/sun4i: Fix blend route/enable register corruption for DE2.0/DE3.0 Message-ID: <20220530132232.himfp7ubiacbmkpx@penduick> References: <20220525115445.93500-1-roman.o.stratiienko@globallogic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20220525115445.93500-1-roman.o.stratiienko@globallogic.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi Roman, On Wed, May 25, 2022 at 11:54:45AM +0000, Roman Stratiienko wrote: > By this commit 2 related issues are solved: >=20 > Issue #1. Corruption in blend route/enable register: >=20 > Register corruption happens after using old_state->zpos to disable layer > state. Blend route/enable registers are shared with other layers > and other layers may have already assigned this PIPE to valid value. >=20 > Solution: Do not use old_state->zpos to disable the plane pipe in > blend registers. >=20 > Issue #2. Remove disabled layer from blend route/enable registers: >=20 > Since sun4i/drm are using normalized_zpos, .atomic_update() will setup > blend route/enable pipes starting from PIPE0 to PIPEX, where X+1 is a > number of layers used by the CRTC in this frame. >=20 > Remaining pipes (PIPE[X+1] - PIPE[MAX]) can have old data that MUST be > updated. >=20 > new_state->normalized_zpos can't be used, since drm helpers won't update > it for disabled planes. >=20 > Solution: >=20 > 1. Track the number of total used planes for crtc. > 2. Use this number instead of zpos to disable unused blend pipes. >=20 > Signed-off-by: Roman Stratiienko If there's two issues, and two solutions, it should be two patches. Maxime