Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp67150iof; Sun, 5 Jun 2022 21:19:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZvrDr48yz46oKEI5cGz0AunteQTgtPqRpNInUQHse47r8smDLiRR4Gf2inXvwdRoNYxLa X-Received: by 2002:a65:6bc4:0:b0:3c2:2f7c:cc74 with SMTP id e4-20020a656bc4000000b003c22f7ccc74mr19421545pgw.307.1654489163241; Sun, 05 Jun 2022 21:19:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654489163; cv=none; d=google.com; s=arc-20160816; b=Q87p3eD742WgJcu7msFHAjoYJOyD77rPNma2jCNx0v27nejyeurR+B4b0QSI0GK+V6 mgJyrkQIYCKfjU+EgsESEoDpf9x6mKU/o2iHAKcMxU2LVkPUa9i7oHmHsvltwupj1aS5 zNiWkhCpO4A7DKT+P9ubblp1vbsGvwJnQXQposE6Zae/5mtSm1HSfAuHK7vl6k1Zw/7z FV501jl+vi5yUzyIXMobPMLwm7W7L+vuYKmwlTs2uFElG3RlHl2/H7Fg2E3nKdrsIwAV PCMxfVgeOPNwp3PGpp4DZVv5RndyMawTalB7TLKs34O1BeBJYdnMrs1pJBqWzmi4rrd7 Zwcw== 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=7zhHII/DS4QRjgxHtKGpmTA0qCxEvYRa7d6vBVg1/3I=; b=x33yAWxKQHRi9SdacFgMIkpaUVzpihWg59RKPdTJ0lWxAj6VjT2Aj2ZGPMct8+fnfr M84dLRfLMG1cF0lpP+YORmsSw3pnag74mRimZTtKuubJj/W68uNYadXyKS9tPrz05L0w UMsvOZ7//2vXSZg/w6iY9dIoHrayxhJ4Vc4lS2IPLrHra64KF5B15Hi1kgtWj3SzCDxS 7m4C/wVOxh9Q76y8J4S81EpxjPq1xGx21SURTRGEDewxkYWp/071tv6mdrGEfWuJWkNc cDt0A10+2PBBn9SIDyzP8Rte/CLPo84a3nxiJH96oznPss+/WX+KlhWVm8x6Kll1wUkH B/Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=THwBYsq4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id r72-20020a632b4b000000b003fd08533f47si14261781pgr.548.2022.06.05.21.19.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 21:19:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=THwBYsq4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F222BDFC4; Sun, 5 Jun 2022 20:52:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242914AbiFCI5w (ORCPT + 99 others); Fri, 3 Jun 2022 04:57:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbiFCI5u (ORCPT ); Fri, 3 Jun 2022 04:57:50 -0400 Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com [IPv6:2607:f8b0:4864:20::82a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2DEF2B1BD for ; Fri, 3 Jun 2022 01:57:47 -0700 (PDT) Received: by mail-qt1-x82a.google.com with SMTP id y15so5108259qtx.4 for ; Fri, 03 Jun 2022 01:57:47 -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=7zhHII/DS4QRjgxHtKGpmTA0qCxEvYRa7d6vBVg1/3I=; b=THwBYsq46Go8yRw7Wlg7M90twt/p83YwtRg3qL/1JSR0F0T37iyEUM00c8QdBcsznG F8IuFGaDjeC1Z4+BSm7HnHXkuhwZvrj0ymkj03rHZF6ZOqi4nt1yNgWyu/x5HC8tpPEM Qlq7rERMDHI23AVBflNh4oDOQCY8ZsjZeg0CN5GL6+qkpxaXow/UenFc4rSfYfe9cvwi 6IAliYt1FzAzZGD1mFWSYNw9SxUfk2MtK2ffcXDIBEsUyIIPTv5aW+HLNemTlBSMbOQk 7Tjn5zPedMx7yhaSebSseH8l1dEFx29eDx0dNpaJLfDGrgY1FQn/aSU5eTYSAy5iJcUX CMxA== 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=7zhHII/DS4QRjgxHtKGpmTA0qCxEvYRa7d6vBVg1/3I=; b=CHI469ZowDmGuiphvna9CSqG9kKXB6eLqth7J5SqZZnNHoKi67A7KdjuSvQLLA3d/S K3tRydaAVZIYxtedp3mpTUAl9eV1Bs/vai0hctzcIPZM7RB1itR8d4ksaeCktamJ/wTE nk42OUAQjRFA2kmnWPLdlLeZJOXHz7NSDFJpf6MTyLB3Sb7WIaL+zVUWMvnfWdfGpbOW rG+HMSQ3WBDoEgmhtWILb6xk9uoA5XgpUeQqfol9JxyMTpkUyhj8CQOeFMIsLltfK36r 8Ts9LXODQi/WQ0wU8aZUhVvCWHaNv5EYcCDJB+L2g2QD9eSCtBg92c3V9Ox3ZyAVvW8v /ouQ== X-Gm-Message-State: AOAM533sTN3G25B6VBBNDCCksNTCbJjA0bSfIwnbM8EA9qNF00eEv7tp 9m4iVoxGs37kY76JquiaA+bX4ojJqW1SgkxyN6w= X-Received: by 2002:ac8:5896:0:b0:2f3:d231:58a9 with SMTP id t22-20020ac85896000000b002f3d23158a9mr6574470qta.131.1654246666777; Fri, 03 Jun 2022 01:57:46 -0700 (PDT) MIME-Version: 1.0 References: <20220602180118.66170-1-r.stratiienko@gmail.com> <20220603082416.ukohug3mwzu43csu@penduick> In-Reply-To: <20220603082416.ukohug3mwzu43csu@penduick> From: Roman Stratiienko Date: Fri, 3 Jun 2022 11:57:35 +0300 Message-ID: Subject: Re: [PATCH] drm/sun4i: sun8i: Add the ability to keep scaler enabled for VI layer 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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=D1=82, 3 =D0=B8=D1=8E=D0=BD. 2022 =D0=B3. =D0=B2 11:24, Maxime Ripar= d : > > Hi, > > On Thu, Jun 02, 2022 at 06:01:18PM +0000, Roman Stratiienko wrote: > > According to DE2.0/DE3.0 manual VI scaler enable register is double > > buffered, but de facto it doesn't, or the hardware has the shadow > > register latching issues which causes single-frame picture corruption > > after changing the state of scaler enable register. > > > > Allow the user to keep the scaler always enabled, preventing the UI > > glitches on the transition from scaled to unscaled state. > > > > NOTE: > > UI layer scaler has more registers with double-buffering issue and can'= t > > be workarounded in the same manner. > > > > You may find a python test and a demo video for this issue at [1] > > > > [1]: https://github.com/GloDroid/glodroid_tests/issues/4 > > Please describe the issue entirely here. The commit log must be self-suff= icient. Commit message already states "single-frame picture corruption after changing the state of scaler enable register", therefore I find it already self-sufficient Also I find demo videos and link to tests useful for the followers to go further with investigation. If you have something specific in mind when asking to enhance the commit message please say it. > > > Signed-off-by: Roman Stratiienko > > --- > > drivers/gpu/drm/sun4i/sun8i_mixer.c | 12 ++++++++++++ > > drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 4 +++- > > 2 files changed, 15 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4= i/sun8i_mixer.c > > index 71ab0a00b4de..15cad0330f66 100644 > > --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c > > +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c > > @@ -27,6 +27,18 @@ > > #include "sun8i_vi_layer.h" > > #include "sunxi_engine.h" > > > > +/* According to DE2.0/DE3.0 manual VI scaler enable register is double > > + * buffered, but de facto it doesn't, or the hardware has the shadow > > + * register latching issues which causes single-frame picture corrupti= on > > + * after changing the state of scaler enable register. > > + * Allow the user to keep the scaler always enabled, preventing the UI > > + * glitches on the transition from scaled to unscaled state. > > + */ > > +int sun8i_vi_keep_scaler_enabled; > > +MODULE_PARM_DESC(keep_vi_scaler_enabled, > > + "Keep VI scaler enabled (1 =3D enabled, 0 =3D disabled (= default))"); > > +module_param_named(keep_vi_scaler_enabled, sun8i_vi_keep_scaler_enable= d, int, 0644); > > + > > It's not clear to me why we would want to make that a parameter? > >1 If it never works, we should fix it once and for all and not allow a bro= ken setup at all. It's a hardware issue and can be fixed only within the hardware. Current patch is a workaround that if enabled can cause increased power consumption for existing users. Therefore I think it is better to give existing distro-maintainers a chance to test it prior to delivery. Also I do not have all the sunxi SOCs to test it. My tests were limited only by A64 and H6 SOCs. > Maxime Best regards, Roman