Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4635700rdb; Tue, 12 Dec 2023 05:27:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFl/uBvN6xUlv2QUnarSU1uSz6PSEPB3p+pG6n/j/UQDovNCuZm9xe3m+B31BS1XBPQ+Nji X-Received: by 2002:a05:6870:35cf:b0:1fb:75b:12f9 with SMTP id c15-20020a05687035cf00b001fb075b12f9mr8139083oak.75.1702387646144; Tue, 12 Dec 2023 05:27:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702387646; cv=none; d=google.com; s=arc-20160816; b=eXrb3vNrv8s6m6mAi9PEvwWTrRl1v8JmQrCAOesRSb2THSejaO8MB+V7OP86nezEb7 /a38xG157ogYHZOc8zIwCyhnPAOp+tCfEezSiSYrakk3AXrVt5FdEN84LbpjY5lFvC60 VLqJRRegLVY4/XBP4/RTaV4VPqZnrt+RXzgsMlbBV9gDOAIJupQNIeeyP8LJySEK2ySo iVpqeemo88FTaRJdl1z2dKh+VKnan8dEUoN5MI5N1O8p20NLhfhwIDYp8nsORpis+j4/ qbZr/PggYJmjQobddzX6lbtX5xyCEqXbxR5H8qf4avzANN6SRDacJJH7vuwAoev9P/Nt 2KOw== 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=ayRToWjnATMUiSSHuLBfauHzv3VzguRBjQyXJ5ZLY/4=; fh=cUJS5hkCHuZNsG04xKQwIr7R+dpRjn1BVJB3FT6LGek=; b=rKoY4dmqpZlH79LLu46JaDoIQbPiMpQACGnkW9tAUMwfDogUD6LUe8zYR6VhXbqIqZ zgOb+dVDD9epBW04nE3bhqAlTFGTSmj0wtqp0JEcZNxf8ODX0Qed3fMwuXsDl70Byg3B sq8MCMkQZsM1VptIPDH2KFsyrk2asVw0e9pey5SgihciT9z1sxw4ICHP76jw5fWXJadZ 81lZFB2gUo93KWoSm+CS3zODFVk5RYH1o0zYMfMQTXFyjjBJvZ2Cc+XCkdDC1pe5JJa6 Q1rJS25OKDI8Uq5lrgD5KU4NTycGIBM4D1Pd3WxAep//dbXqBbzU/xmIjU3x3RkwFI5F oD+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=jzPgk9Vp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id u18-20020a656712000000b005c621de522csi7951292pgf.361.2023.12.12.05.27.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 05:27:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=jzPgk9Vp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B904E80A8B6B; Tue, 12 Dec 2023 05:27:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346427AbjLLN1O (ORCPT + 99 others); Tue, 12 Dec 2023 08:27:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232470AbjLLN1N (ORCPT ); Tue, 12 Dec 2023 08:27:13 -0500 Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96567BD; Tue, 12 Dec 2023 05:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1702387638; bh=bORQa449volAyT+EMZHJvP/KuwY9i8DhbUIZ63euxMM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=jzPgk9VpkKV0fyriB7dHtcuDiQiXIp7w4XYDgCGGGdxIGa7V17zVpEAa4vvK8LokN Y9T/mwQTVlchSTjlJfz7UOd/WS3ssJXCBtdb/f1L3UdXittnqS8CkK46Eyz3j41CUu O91taj9MdqhHul2r9rH5mM+QFkIRuQKINyKbAEbMU0+GcRGZSKOUgxk8M0cYr1ywfF T2oy8yfo3K/fqI2UlVo8WfoX+ZFteWofeBFAvnCvnLB8lrzUUa2SY/M6IiFWex+80F xQri1CebiCNRwW0FqRYBDujV4oT4BmHcmNaJ6CwBnfr2c1CURfiUDJkyTI4h8uevTA tRMMaqDCZnEBQ== Received: from [100.113.186.2] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 4CD513781461; Tue, 12 Dec 2023 13:27:17 +0000 (UTC) Message-ID: <315011be-59c6-42b1-be9b-cd2eaf6debd9@collabora.com> Date: Tue, 12 Dec 2023 14:27:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 11/17] drm/mediatek: Turn off the layers with zero width or height Content-Language: en-US To: Hsiao Chien Sung , Chun-Kuang Hu , CK Hu Cc: Philipp Zabel , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , Chen-Yu Tsai , Sean Paul , Fei Shao , Bibby Hsieh , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20231212121957.19231-1-shawn.sung@mediatek.com> <20231212121957.19231-12-shawn.sung@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20231212121957.19231-12-shawn.sung@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 12 Dec 2023 05:27:24 -0800 (PST) Il 12/12/23 13:19, Hsiao Chien Sung ha scritto: > We found that IGT (Intel GPU Tool) will try to commit layers with > zero width or height and lead to undefined behaviors in hardware. > Disable the layers in such situations. > > Signed-off-by: Hsiao Chien Sung This commit needs a Fixes tag. Please add the relevant one. Thanks, Angelo > --- > drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c | 2 +- > drivers/gpu/drm/mediatek/mtk_ethdr.c | 7 ++++++- > 2 files changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c > index 10d23e76acaa..8789442c039f 100644 > --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c > +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c > @@ -156,7 +156,7 @@ void mtk_ovl_adaptor_layer_config(struct device *dev, unsigned int idx, > merge = ovl_adaptor->ovl_adaptor_comp[OVL_ADAPTOR_MERGE0 + idx]; > ethdr = ovl_adaptor->ovl_adaptor_comp[OVL_ADAPTOR_ETHDR0]; > > - if (!pending->enable) { > + if (!pending->enable || !pending->width || !pending->height) { > mtk_merge_stop_cmdq(merge, cmdq_pkt); > mtk_mdp_rdma_stop(rdma_l, cmdq_pkt); > mtk_mdp_rdma_stop(rdma_r, cmdq_pkt); > diff --git a/drivers/gpu/drm/mediatek/mtk_ethdr.c b/drivers/gpu/drm/mediatek/mtk_ethdr.c > index 73c9e3da56a7..e95331c06815 100644 > --- a/drivers/gpu/drm/mediatek/mtk_ethdr.c > +++ b/drivers/gpu/drm/mediatek/mtk_ethdr.c > @@ -163,7 +163,12 @@ void mtk_ethdr_layer_config(struct device *dev, unsigned int idx, > if (idx >= 4) > return; > > - if (!pending->enable) { > + if (!pending->enable || !pending->width || !pending->height) { > + /* > + * instead of disabling layer with MIX_SRC_CON directly > + * set the size to 0 to avoid screen shift due to mixer > + * mode switch (hardware behavior) > + */ > mtk_ddp_write(cmdq_pkt, 0, &mixer->cmdq_base, mixer->regs, MIX_L_SRC_SIZE(idx)); > return; > }