mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
To: "Brian Norris" <briannorris@chromium.org>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"David Airlie" <airlied@linux.ie>,
	"Heiko Stübner" <heiko@sntech.de>
Cc: Sandy Huang <hjc@rock-chips.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	linux-rockchip@lists.infradead.org, stable@vger.kernel.org,
	Mark Yao <markyao0591@gmail.com>
Subject: Re: [PATCH] drm/rockchip: vop: Correct RK3399 VOP register fields
Date: Tue, 8 Feb 2022 14:05:30 +0100	[thread overview]
Message-ID: <73b30627-2908-8472-01db-d07e176ce129@collabora.com> (raw)
In-Reply-To: <20220119161104.1.I1d01436bef35165a8cdfe9308789c0badb5ff46a@changeid>

Hi Brian,

Sorry about the delay.

W dniu 20.01.2022 o 01:11, Brian Norris pisze:
> Commit 7707f7227f09 ("drm/rockchip: Add support for afbc") switched up
> the rk3399_vop_big[] register windows, but it did so incorrectly.
> 
> The biggest problem is in rk3288_win23_data[] vs.
> rk3368_win23_data[] .format field:
> 
>    RK3288's format: VOP_REG(RK3288_WIN2_CTRL0, 0x7, 1)
>    RK3368's format: VOP_REG(RK3368_WIN2_CTRL0, 0x3, 5)
> 
> Bits 5:6 (i.e., shift 5, mask 0x3) are correct for RK3399, according to
> the TRM.
> 
> There are a few other small differences between the 3288 and 3368
> definitions that were swapped in commit 7707f7227f09. I reviewed them to
> the best of my ability according to the RK3399 TRM and fixed them up.
> 
> This fixes IOMMU issues (and display errors) when testing with BG24
> color formats.
> 
> Fixes: 7707f7227f09 ("drm/rockchip: Add support for afbc")
> Cc: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Brian Norris <briannorris@chromium.org>

Tested-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>

> ---
> I'd appreciate notes or testing from Andrzej, since I'm not sure how he
> tested his original AFBC work.
> 
>   drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
> index 1f7353f0684a..798b542e5916 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c
> @@ -902,6 +902,7 @@ static const struct vop_win_phy rk3399_win01_data = {
>   	.enable = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 0),
>   	.format = VOP_REG(RK3288_WIN0_CTRL0, 0x7, 1),
>   	.rb_swap = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 12),
> +	.x_mir_en = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 21),
>   	.y_mir_en = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 22),
>   	.act_info = VOP_REG(RK3288_WIN0_ACT_INFO, 0x1fff1fff, 0),
>   	.dsp_info = VOP_REG(RK3288_WIN0_DSP_INFO, 0x0fff0fff, 0),
> @@ -912,6 +913,7 @@ static const struct vop_win_phy rk3399_win01_data = {
>   	.uv_vir = VOP_REG(RK3288_WIN0_VIR, 0x3fff, 16),
>   	.src_alpha_ctl = VOP_REG(RK3288_WIN0_SRC_ALPHA_CTRL, 0xff, 0),
>   	.dst_alpha_ctl = VOP_REG(RK3288_WIN0_DST_ALPHA_CTRL, 0xff, 0),
> +	.channel = VOP_REG(RK3288_WIN0_CTRL2, 0xff, 0),
>   };
>   
>   /*
> @@ -922,11 +924,11 @@ static const struct vop_win_phy rk3399_win01_data = {
>   static const struct vop_win_data rk3399_vop_win_data[] = {
>   	{ .base = 0x00, .phy = &rk3399_win01_data,
>   	  .type = DRM_PLANE_TYPE_PRIMARY },
> -	{ .base = 0x40, .phy = &rk3288_win01_data,
> +	{ .base = 0x40, .phy = &rk3368_win01_data,
>   	  .type = DRM_PLANE_TYPE_OVERLAY },
> -	{ .base = 0x00, .phy = &rk3288_win23_data,
> +	{ .base = 0x00, .phy = &rk3368_win23_data,
>   	  .type = DRM_PLANE_TYPE_OVERLAY },
> -	{ .base = 0x50, .phy = &rk3288_win23_data,
> +	{ .base = 0x50, .phy = &rk3368_win23_data,
>   	  .type = DRM_PLANE_TYPE_CURSOR },
>   };
>   


  reply	other threads:[~2022-02-08 13:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20  0:11 Brian Norris
2022-02-08 13:05 ` Andrzej Pietrasiewicz [this message]
2022-02-08 17:12 ` Heiko Stuebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73b30627-2908-8472-01db-d07e176ce129@collabora.com \
    --to=andrzej.p@collabora.com \
    --cc=airlied@linux.ie \
    --cc=briannorris@chromium.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=markyao0591@gmail.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®