[v2,04/12] drm/rockchip: vop2: clear afbc en and transform bit for cluster window at linear mode
Message ID | 20231122125425.3454549-1-andyshrk@163.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp1299648vqb; Wed, 22 Nov 2023 04:57:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IEFlwZpyL4L+UpappO/WQWkfn1Krl/vjf9jex3Uwoa2Me+fTy27J6rj4TqPM4YyVZ21o9Tw X-Received: by 2002:a05:6808:90:b0:3b6:d639:35b0 with SMTP id s16-20020a056808009000b003b6d63935b0mr2227290oic.50.1700657828433; Wed, 22 Nov 2023 04:57:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700657828; cv=none; d=google.com; s=arc-20160816; b=t4QmURczFspMz+4EOXjirtmxtcOabROEQ91J9t0sSCAM+kui+IaAvTyg27c0y8ur5h R9qYc19rTDbyQzLEE/HFtkVeFB7jd+PkxpW39R8P+su0zbtnMQ0klvqGihQWltdaQEM5 ojhoSgYxIvzHSFfytNeXW8tlJlzGIPiseCiku2hWu4zpfZ5nCWQh6ezalwUVBPaRW6ce miLFIvoKgRbews+l75foojEbgzlGRCwh2ZGYhGY5X7ok9NOBw8aP7QBlPmpeEwTLRqq4 F7NYNktY+pCj3cSNOybfxZYPBrZ61aCrK0TlMJXYlKd/47mMLYsNUxCiFOSorT3CE5be ZE7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6otUM/47Tf3xP3DWibrhyyFMgkpC7ZW06/QSkEgQJjQ=; fh=cjsv5ohN1TaMP82Yqeh0WKQ1fJXsn/LNnakMe8VYEy4=; b=Hv+d52r8KkIZ7J295aPWWIrRoZ3+BE3Ocb7EtrxKIi8TU9s1kJqGZSqJ29J2Y7uPwr ArsfZC2tF6RsKkUtTFKAntQ3NsDrB25CRJiSl/87nrNR9MDGxhqDROkTe7AqFg4eBU4q 9oCV5n44CVWFsvEE+wdk6wYiOkOdtExIou/u1Eu+3lycUthhjZG1OlArj5V6icoXsK3X c8QWkyJfoRycZM2XH7Gyi+odGxyeQzGh67uYEEj9ZRI5GQP5MxChagwq6Dait3uKtahA +lT0XKDnsQZENL64n0+1Hj80fsiKhf/tCN9lF0Oz/7ZLb9kQ21NX3m4TcJdpYXoWqnd5 rmOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=JWAxZ5kH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id 32-20020a631060000000b005b8f61fcba4si11712132pgq.35.2023.11.22.04.57.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 04:57:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=JWAxZ5kH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id EDFBE8069211; Wed, 22 Nov 2023 04:56:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343956AbjKVMzX (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Wed, 22 Nov 2023 07:55:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344022AbjKVMzQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 22 Nov 2023 07:55:16 -0500 Received: from m15.mail.163.com (m15.mail.163.com [45.254.50.220]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 19729D65; Wed, 22 Nov 2023 04:55:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=6otUM /47Tf3xP3DWibrhyyFMgkpC7ZW06/QSkEgQJjQ=; b=JWAxZ5kHif3HgKYhiECJW tBdkra2uE1y5II7GxxyjRsZfYyNq5uJvzYfPmp6buxD5bJkdC2M3QTZS1UR7kQXu TPymlgxdnVdHNGtNzx96pxZ8AfZNxaKLVU+Uyx7KXlM9hg2QmgJPokxhjP6TCZ0j XeBMKCOq0ZNZ7elxhWf0ps= Received: from ProDesk.. (unknown [58.22.7.114]) by zwqz-smtp-mta-g1-0 (Coremail) with SMTP id _____wDn784C+l1lfIunAw--.35392S2; Wed, 22 Nov 2023 20:54:30 +0800 (CST) From: Andy Yan <andyshrk@163.com> To: heiko@sntech.de Cc: hjc@rock-chips.com, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, krzysztof.kozlowski+dt@linaro.org, robh+dt@kernel.org, devicetree@vger.kernel.org, sebastian.reichel@collabora.com, kever.yang@rock-chips.com, chris.obbard@collabora.com, s.hauer@pengutronix.de, Andy Yan <andy.yan@rock-chips.com> Subject: [PATCH v2 04/12] drm/rockchip: vop2: clear afbc en and transform bit for cluster window at linear mode Date: Wed, 22 Nov 2023 20:54:25 +0800 Message-Id: <20231122125425.3454549-1-andyshrk@163.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231122125316.3454268-1-andyshrk@163.com> References: <20231122125316.3454268-1-andyshrk@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wDn784C+l1lfIunAw--.35392S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrKr47Aw18Jr1fCr4kAw1xAFb_yoWkWrc_Wa 47uwn8GF1vgwn8Cw1UA343C39Fyan29F4rGa1ktas8ZF1vvw40y3s7Xw1UWr15uFWrCr4D GayUWF13uFnxGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU0AMaUUUUUU== X-Originating-IP: [58.22.7.114] X-CM-SenderInfo: 5dqg52xkunqiywtou0bp/xtbBnAowXlghlh76hQAAs2 X-Spam-Status: No, score=0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SORBS_WEB, SPF_HELO_NONE,SPF_PASS,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 agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 22 Nov 2023 04:56:01 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783268983361429203 X-GMAIL-MSGID: 1783268983361429203 |
Series |
Add VOP2 support on rk3588
|
|
Commit Message
Andy Yan
Nov. 22, 2023, 12:54 p.m. UTC
From: Andy Yan <andy.yan@rock-chips.com> The enable bit and transform offset of cluster windows should be cleared when it work at linear mode, or we may have a iommu fault issue. Signed-off-by: Andy Yan <andy.yan@rock-chips.com> --- (no changes since v1) drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 5 +++++ 1 file changed, 5 insertions(+)
Comments
On Wed, Nov 22, 2023 at 08:54:25PM +0800, Andy Yan wrote: > From: Andy Yan <andy.yan@rock-chips.com> > > The enable bit and transform offset of cluster windows should be > cleared when it work at linear mode, or we may have a iommu fault > issue. > > Signed-off-by: Andy Yan <andy.yan@rock-chips.com> Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de> Sascha > --- > > (no changes since v1) > > drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c > index 639dfebc6bd1..a019cc9bbd54 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c > @@ -1312,6 +1312,11 @@ static void vop2_plane_atomic_update(struct drm_plane *plane, > vop2_win_write(win, VOP2_WIN_AFBC_ROTATE_270, rotate_270); > vop2_win_write(win, VOP2_WIN_AFBC_ROTATE_90, rotate_90); > } else { > + if (vop2_cluster_window(win)) { > + vop2_win_write(win, VOP2_WIN_AFBC_ENABLE, 0); > + vop2_win_write(win, VOP2_WIN_AFBC_TRANSFORM_OFFSET, 0); > + } > + > vop2_win_write(win, VOP2_WIN_YRGB_VIR, DIV_ROUND_UP(fb->pitches[0], 4)); > } > > -- > 2.34.1 > > >
Am Mittwoch, 22. November 2023, 13:54:25 CET schrieb Andy Yan: > From: Andy Yan <andy.yan@rock-chips.com> > > The enable bit and transform offset of cluster windows should be > cleared when it work at linear mode, or we may have a iommu fault > issue. > > Signed-off-by: Andy Yan <andy.yan@rock-chips.com> I guess same here? Fixes: 604be85547ce ("drm/rockchip: Add VOP2 driver")
Hi Heiko: On 11/27/23 23:02, Heiko Stübner wrote: > Am Mittwoch, 22. November 2023, 13:54:25 CET schrieb Andy Yan: >> From: Andy Yan <andy.yan@rock-chips.com> >> >> The enable bit and transform offset of cluster windows should be >> cleared when it work at linear mode, or we may have a iommu fault >> issue. >> >> Signed-off-by: Andy Yan <andy.yan@rock-chips.com> > I guess same here? > > Fixes: 604be85547ce ("drm/rockchip: Add VOP2 driver") I'm not sure if we need a Fixes tag here, in fact this issue never happens on rk3566/8 , because the cluster windows of rk356x only support afbc format, they don't have a chance to switch between afbc and linear mode. Of course, the lack support of linear mode of rk356x cluster windows is a thoughtless of IC design, if it really support both afbc and linear format, we indeed need this fix. The situation is the same as patch 03/12. So I hope follow your advice, if it need a Fixes tag here. > > > > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip
Am Dienstag, 28. November 2023, 09:03:46 CET schrieb Andy Yan: > Hi Heiko: > > On 11/27/23 23:02, Heiko Stübner wrote: > > Am Mittwoch, 22. November 2023, 13:54:25 CET schrieb Andy Yan: > >> From: Andy Yan <andy.yan@rock-chips.com> > >> > >> The enable bit and transform offset of cluster windows should be > >> cleared when it work at linear mode, or we may have a iommu fault > >> issue. > >> > >> Signed-off-by: Andy Yan <andy.yan@rock-chips.com> > > I guess same here? > > > > Fixes: 604be85547ce ("drm/rockchip: Add VOP2 driver") > > > I'm not sure if we need a Fixes tag here, in fact this issue never happens on > > rk3566/8 , because the cluster windows of rk356x only support afbc format, > > they don't have a chance to switch between afbc and linear mode. > > Of course, the lack support of linear mode of rk356x cluster windows is a thoughtless > > of IC design, if it really support both afbc and linear format, we indeed need this fix. > > The situation is the same as patch 03/12. > > So I hope follow your advice, if it need a Fixes tag here. ah ok, thanks for the explanation. Then I guess we don't need a fixes tag when the rk3568 is not affected by this. Same for the other patch. If you're re-sending you could add this information to the commit message though. (existing support for rk3568 only supports afbc cluster windows and is therefore not affected) Thanks Heiko
Hi Heiko: On 11/28/23 16:30, Heiko Stübner wrote: > Am Dienstag, 28. November 2023, 09:03:46 CET schrieb Andy Yan: >> Hi Heiko: >> >> On 11/27/23 23:02, Heiko Stübner wrote: >>> Am Mittwoch, 22. November 2023, 13:54:25 CET schrieb Andy Yan: >>>> From: Andy Yan <andy.yan@rock-chips.com> >>>> >>>> The enable bit and transform offset of cluster windows should be >>>> cleared when it work at linear mode, or we may have a iommu fault >>>> issue. >>>> >>>> Signed-off-by: Andy Yan <andy.yan@rock-chips.com> >>> I guess same here? >>> >>> Fixes: 604be85547ce ("drm/rockchip: Add VOP2 driver") >> >> I'm not sure if we need a Fixes tag here, in fact this issue never happens on >> >> rk3566/8 , because the cluster windows of rk356x only support afbc format, >> >> they don't have a chance to switch between afbc and linear mode. >> >> Of course, the lack support of linear mode of rk356x cluster windows is a thoughtless >> >> of IC design, if it really support both afbc and linear format, we indeed need this fix. >> >> The situation is the same as patch 03/12. >> >> So I hope follow your advice, if it need a Fixes tag here. > ah ok, thanks for the explanation. Then I guess we don't need a fixes tag > when the rk3568 is not affected by this. > > Same for the other patch. If you're re-sending you could add this information > to the commit message though. (existing support for rk3568 only supports > afbc cluster windows and is therefore not affected) Ok, will done. > > > Thanks > Heiko > > > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index 639dfebc6bd1..a019cc9bbd54 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -1312,6 +1312,11 @@ static void vop2_plane_atomic_update(struct drm_plane *plane, vop2_win_write(win, VOP2_WIN_AFBC_ROTATE_270, rotate_270); vop2_win_write(win, VOP2_WIN_AFBC_ROTATE_90, rotate_90); } else { + if (vop2_cluster_window(win)) { + vop2_win_write(win, VOP2_WIN_AFBC_ENABLE, 0); + vop2_win_write(win, VOP2_WIN_AFBC_TRANSFORM_OFFSET, 0); + } + vop2_win_write(win, VOP2_WIN_YRGB_VIR, DIV_ROUND_UP(fb->pitches[0], 4)); }