Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4786050ioo; Tue, 31 May 2022 11:32:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrpkq12U9AXlWN+9ESqeIiiWhUUPq/v1ll7njdkTnSj9SHra68YcxIQUdF1UEt7fXXnHLQ X-Received: by 2002:a05:6402:2999:b0:428:bb4d:6cea with SMTP id eq25-20020a056402299900b00428bb4d6ceamr66472629edb.29.1654021926404; Tue, 31 May 2022 11:32:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654021926; cv=none; d=google.com; s=arc-20160816; b=jbb01w7jCAIAV7RlfLcKQEtu9CUVGuolZHS/EXBzO+AR5a3ZOZBfmocoSP4z6NRa2w j6BQDonypBzcOZxlN/O0wC063OstQW8D2l9yE4cs0Bq0w6fxAhw1QR21mtOMR/zSlivy Tq1jAvsP1LgP1NAf0OHraCzjHGQy1K/7DhFKzWotn1p4b2MSyemw8wpI13jFj8wiJlFI 7tmPXJdrL0rUSlIdhE4hnnU1Q0zNFVf0kDgva4chN8AJ7jj40tRxZt6EACApswdZ1Qr+ 8FnzGTgVN7HXpFEprR7RcQsGHzg0fZnBjTKeaqa6s09cX9YC4hIYaFMnFcl+v4CBb1B1 f/0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=8tubySlO9EL1sX7JJbgIYlj3V7gJSLQUkL2tqjiHPYE=; b=rd9GKyFB+w8cJRIwECwJzTXf7iRnA6G3bc+lUTbxOUMuy+4ejCpr9/Ino2BsENso5b cNJ9v+IFMBad8TE54Ftj2oCt5HTNuz/Ov69gQErguUi4gy9wOnw4vzMqbZsxEuV2nni2 jzX6ajOVG6NcdWDa7I+c0jzDrRJiAT4gU9/x1lWP54gQBqviunEwsgPSrkoHMdiB+FFy ntGNmjvLJvm9Fw8KF2dsdeTzKgWCl3QHFdYXk7oYJ+RDOx2V23UVFyQ0g7zutxyAfrqU rDJcUHnwoHxooT4lHthufJCk6kEuwB32UQF9cwW2WJtIvied/XB904hPhO/vw3jlLPqH zmow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=qGFcst+H; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn17-20020a17090794d100b006fed5b3f5fbsi3684270ejc.941.2022.05.31.11.31.34; Tue, 31 May 2022 11:32:06 -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=@gmail.com header.s=20210112 header.b=qGFcst+H; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241189AbiE3O0F (ORCPT + 99 others); Mon, 30 May 2022 10:26:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241388AbiE3ORd (ORCPT ); Mon, 30 May 2022 10:17:33 -0400 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16FE58FF8A for ; Mon, 30 May 2022 06:46:00 -0700 (PDT) Received: by mail-qk1-x72b.google.com with SMTP id b200so11256261qkc.7 for ; Mon, 30 May 2022 06:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=8tubySlO9EL1sX7JJbgIYlj3V7gJSLQUkL2tqjiHPYE=; b=qGFcst+H2sU9jethczFKj5MxMnXaCOn7OK090+/w4SslVfP0RhOPM+PrM/s6zmntEl F0i0jWuXjup30AM1FCFtkmrQsYf603Ww0X7DlWH4G1X8DXidwxDvsLuIyOSA46WT96pb gk/ByJ8wJJ6VG89vBxpWS4sT4viGby0Q7/aGVZjueV2Ol45MU6QR/kGUMziF9kEKL5jr Vq5IvoXl5vRQyKgPRCK8sxmINhmRSQBk+B7MLNnt8CZ+4eyNendacm1T2oVMcG8QIJLi JWs9iipRsPWjnyyw+uAEIr8g/Vhe0bmPXgyg2Sg9dqgZeemBHQFV9hvvB+/wubuuBXQ7 z3Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=8tubySlO9EL1sX7JJbgIYlj3V7gJSLQUkL2tqjiHPYE=; b=wWOLChQuxbRgPwtfmJ5M+Pbm4qOkykKhMDXrAtz8olav73IW4SXMhODRz5AvJNLBiU NOBUrhnEPARp6FzUzQ1HT6eh1b5kka4IX1ZjyNIkRBGUq5kXcFT/ipf+psUwl+XqFyW2 5dRYwiRJg9h0/ORrRSeN4LSP3vjXLsf0bGsdxifG5d/YTPn0aCt9DQdEvyeWZK+egLHV 5zT0FIEoE6COD8bLwz7ytBJl+Y76BV/88a/cpcy2OV6XB29hgankmr1rHvCgqfk9J/z4 llG+5YjthP+7vYZ+GguHdtkYppdZpzxGZTEN7NETGNZD3unKv6OvxkqOUAj3Ia074vtU 1+pA== X-Gm-Message-State: AOAM5337u7akCBwRzpfMiXqM3+gbrmN1Ny/diTj0YN7k0u/hVR3U9R4P 1ZzwNO5D5XHkL225JNFNFP+1KpsCV/yOChj8iVs= X-Received: by 2002:a05:620a:40d1:b0:6a5:b4a3:dfbe with SMTP id g17-20020a05620a40d100b006a5b4a3dfbemr14550181qko.340.1653918359158; Mon, 30 May 2022 06:45:59 -0700 (PDT) MIME-Version: 1.0 References: <20220525115445.93500-1-roman.o.stratiienko@globallogic.com> <20220530132232.himfp7ubiacbmkpx@penduick> In-Reply-To: <20220530132232.himfp7ubiacbmkpx@penduick> From: Roman Stratiienko Date: Mon, 30 May 2022 16:45:48 +0300 Message-ID: Subject: Re: [PATCH] drm/sun4i: Fix blend route/enable register corruption for DE2.0/DE3.0 To: Maxime Ripard Cc: wens@csie.org, =?UTF-8?Q?Jernej_=C5=A0krabec?= , airlied@linux.ie, Daniel Vetter , Samuel Holland , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 Maxime, =D0=BF=D0=BD, 30 =D0=BC=D0=B0=D1=8F 2022 =D0=B3. =D0=B2 16:22, Maxime Ripar= d : > > Hi Roman, > > On Wed, May 25, 2022 at 11:54:45AM +0000, Roman Stratiienko wrote: > > By this commit 2 related issues are solved: > > > > Issue #1. Corruption in blend route/enable register: > > > > Register corruption happens after using old_state->zpos to disable laye= r > > state. Blend route/enable registers are shared with other layers > > and other layers may have already assigned this PIPE to valid value. > > > > Solution: Do not use old_state->zpos to disable the plane pipe in > > blend registers. > > > > Issue #2. Remove disabled layer from blend route/enable registers: > > > > 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. > > > > Remaining pipes (PIPE[X+1] - PIPE[MAX]) can have old data that MUST be > > updated. > > > > new_state->normalized_zpos can't be used, since drm helpers won't updat= e > > it for disabled planes. > > > > Solution: > > > > 1. Track the number of total used planes for crtc. > > 2. Use this number instead of zpos to disable unused blend pipes. > > > > Signed-off-by: Roman Stratiienko > > If there's two issues, and two solutions, it should be two patches. I would say.. It's a single complex issue. Solving one part without solving another will make things only worse. > > Maxime