From patchwork Mon Dec 19 08:43:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlo Caione X-Patchwork-Id: 34435 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2271622wrn; Mon, 19 Dec 2022 00:49:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf7wOWV0WsD0liw9UySKpzNhl2DxmS9SvEFwXbuTA8P1KJ1MybLwH1xXryQrk6pvyfYCBEb6 X-Received: by 2002:a05:6a20:28a0:b0:ad:58d4:2a7a with SMTP id q32-20020a056a2028a000b000ad58d42a7amr36692010pzf.22.1671439780182; Mon, 19 Dec 2022 00:49:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671439780; cv=none; d=google.com; s=arc-20160816; b=GgmKs5Mp/KFdWkQ3xW9BA5yo7AQpWgrjRm9wwKzYsLMgtyD80TFkFxmqUfjkG/RrhD rFKNsM6tSpBhYWvC3EWG1GoO9tSVs8edwV9sopiJIlRIgcP+Wvm9RTvV1sqn36E99LUG ZjkrKzMI4V/QR8nvJgXahcwITVkovNiZu+06RnvRVpfPA32V3gC1pQLw8KxQqUEbtNxH wQKckRYBv7MO9XHrYKhEeu3rm5WXN+A/d8KdhDUGFyd9xmKGmF5d+Y8YQJGG/sw/fPz2 GSHDvEOfDyfJybTgmUmy7D7AGllVF373ZMvJL9pSPokhuzc7puXdIoW+ttwsnJm8f3Xe d2zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=kYYaE3bwqOZpjy9bqglp5kw8THeTMFyYTG3Pe3WusMY=; b=E4FVU14A+7mZTkoOTCL82n2LGv7ZbNLOhj5Czs3Q0FaLo0A+diavuGjULvAhWMmfh9 BrAHMC23OCB6S7uUc1RYS9nU9DC4MExRDzMQM30wIlrpEm8ESwtp0Rl40cHJVrzgmCte w2Se5qWwM+qng5gRFcFkjy5pdEj7KSgT6vxx/R8cEx+y9/fcSfOXWDsLis2BwU3IdEtB UMRrHVITzhtuMDAMZjiNxnnn4PbnPzyZ90BjnR38d9wlmOyKA/djs4OBh7DWzOLuZqZJ 03hTTmw4y7sQMpQLo8j3K7OEp2VsdBLqBKG2QzLayfBFMnntFuyyAtplixLKSVsImfQZ 3S0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=73G2LxFw; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k3-20020a637b43000000b004781390a139si9915021pgn.240.2022.12.19.00.49.26; Mon, 19 Dec 2022 00:49:40 -0800 (PST) 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=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=73G2LxFw; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231574AbiLSInX (ORCPT + 99 others); Mon, 19 Dec 2022 03:43:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231352AbiLSInV (ORCPT ); Mon, 19 Dec 2022 03:43:21 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EA96A19A for ; Mon, 19 Dec 2022 00:43:19 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id vv4so19794477ejc.2 for ; Mon, 19 Dec 2022 00:43:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=kYYaE3bwqOZpjy9bqglp5kw8THeTMFyYTG3Pe3WusMY=; b=73G2LxFwIuXcJ8JfikxHBeTK8Ai8+099d7TsNEgBayS3aGnT3o3UhXd2w5UnDtt3Ia 0sIi4pHg+1OyBNaU//uOizs1AYrUWG3CyYuYFuOI1PE5M5UPmWEfmAZhzFVLQro/CjuR nOevReLfQUP7X4vhPqEh1sfp38tL+m0m27GS4zbsfo5WkN1gzXKerBonhxbzgq4fiC+l 5XQY4rvgo80IFX4GjhiUWF8UjdWrPH9ncuS0egroDJR7bwpeaLjA3a3sZe7nxggczXLQ dDh9f93/9dRvQWVcZAD7UwR/uJEhOqRZ0xeNv/HJN2ab/rZYMMolHOLoTxlxZqJKdebN v7yQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kYYaE3bwqOZpjy9bqglp5kw8THeTMFyYTG3Pe3WusMY=; b=jmHz/FnnyIVv0IHSL3mFDzM1R7EvF9jZ450t0nOYblnXH2y+3r2l3kWv9zW+oFwPUk x9KJZA453DJhCC8cjE/Dzj2auUwoABqvdy2EqUlaTHoXFShmK6ObGt1W/XobUiBNipEZ BmKjAtWUHyICmTLZxHLOfG8W1LdqZr/bVyptrYuF/qmoOTmiTkmVANqp8q/gMZbaip9R gWYsY3TNrHZqnJzmZ/A6tOPDrI2qpmYzFlCgYW8ttP4lis4vLEc5fL+4L0Ukedhxuf/u Y5YHYzOC4ta4i+l2tc75EBauxi7EcEY392HYaW6eDA6tt9SBHG3htdTfiw2u6xNJbrVE TTOg== X-Gm-Message-State: ANoB5pnIAdMHt7fIpfQsGyODnIrP2/HysujswGzd3CwZ6+sdIwqW1j03 tDYgX3eUcW8juzNEXNKlqvTdzQ== X-Received: by 2002:a17:906:8d08:b0:7c1:700:1e2d with SMTP id rv8-20020a1709068d0800b007c107001e2dmr55156347ejc.20.1671439397658; Mon, 19 Dec 2022 00:43:17 -0800 (PST) Received: from [127.0.1.1] ([2001:b07:5d39:f336:a0ba:cfa5:2107:c2c4]) by smtp.gmail.com with ESMTPSA id w7-20020a170906b18700b007c0b28b85c5sm4083755ejy.138.2022.12.19.00.43.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 00:43:17 -0800 (PST) From: Carlo Caione Date: Mon, 19 Dec 2022 09:43:05 +0100 Subject: [PATCH] drm/meson: Reduce the FIFO lines held when AFBC is not used MIME-Version: 1.0 Message-Id: <20221216-afbc_s905x-v1-0-033bebf780d9@baylibre.com> To: David Airlie , Martin Blumenstingl , Jerome Brunet , Daniel Vetter , Kevin Hilman , Neil Armstrong Cc: linux-amlogic@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Carlo Caione X-Mailer: b4 0.10.1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752631638942207810?= X-GMAIL-MSGID: =?utf-8?q?1752631638942207810?= Having a bigger number of FIFO lines held after vsync is only useful to SoCs using AFBC to give time to the AFBC decoder to be reset, configured and enabled again. For SoCs not using AFBC this, on the contrary, is causing on some displays issues and a few pixels vertical offset in the displayed image. Conditionally increase the number of lines held after vsync only for SoCs using AFBC, leaving the default value for all the others. Signed-off-by: Carlo Caione Acked-by: Martin Blumenstingl Acked-by: Neil Armstrong --- Fix display issues for amlogic SoCs not using AFBC In 24e0d4058eff the number of lines held after VSYNC was incremented to give time to the AFBC decoder to do its job. This is causing an issue (seen on S905x) where the image (on some panels) is dislayed with a vertical offset. With this patch we try to keep the fix only when AFBC is actually used filtering on the SoC type. To: Neil Armstrong To: David Airlie To: Daniel Vetter To: Kevin Hilman To: Jerome Brunet To: Martin Blumenstingl Cc: dri-devel@lists.freedesktop.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/gpu/drm/meson/meson_viu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- base-commit: 84e57d292203a45c96dbcb2e6be9dd80961d981a change-id: 20221216-afbc_s905x-4baf5fdc9970 Best regards, diff --git a/drivers/gpu/drm/meson/meson_viu.c b/drivers/gpu/drm/meson/meson_viu.c index d4b907889a21..cd399b0b7181 100644 --- a/drivers/gpu/drm/meson/meson_viu.c +++ b/drivers/gpu/drm/meson/meson_viu.c @@ -436,15 +436,14 @@ void meson_viu_init(struct meson_drm *priv) /* Initialize OSD1 fifo control register */ reg = VIU_OSD_DDR_PRIORITY_URGENT | - VIU_OSD_HOLD_FIFO_LINES(31) | VIU_OSD_FIFO_DEPTH_VAL(32) | /* fifo_depth_val: 32*8=256 */ VIU_OSD_WORDS_PER_BURST(4) | /* 4 words in 1 burst */ VIU_OSD_FIFO_LIMITS(2); /* fifo_lim: 2*16=32 */ if (meson_vpu_is_compatible(priv, VPU_COMPATIBLE_G12A)) - reg |= VIU_OSD_BURST_LENGTH_32; + reg |= (VIU_OSD_BURST_LENGTH_32 | VIU_OSD_HOLD_FIFO_LINES(31)); else - reg |= VIU_OSD_BURST_LENGTH_64; + reg |= (VIU_OSD_BURST_LENGTH_64 | VIU_OSD_HOLD_FIFO_LINES(4)); writel_relaxed(reg, priv->io_base + _REG(VIU_OSD1_FIFO_CTRL_STAT)); writel_relaxed(reg, priv->io_base + _REG(VIU_OSD2_FIFO_CTRL_STAT));