Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6022753pxb; Mon, 14 Feb 2022 13:20:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJwktK41X4DI/OqnaLDKnupUxxTeHVnV+JW0nFcEaVMJhpDN/9I4ILNgwCZ9nDbbDMudFR+k X-Received: by 2002:a63:9307:: with SMTP id b7mr782412pge.291.1644873632272; Mon, 14 Feb 2022 13:20:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644873632; cv=none; d=google.com; s=arc-20160816; b=qHsmfFOzJJLH7vaAzgjoKiJASaeLWH2jY4AFLvvfcZBsRJivGxUAYBq5ZqZ37oPcMI 2QqkOBKqa5D50uAJpzJ4DKa9LAXvXi5wGIqq2hok3Lm911Dc5AjfhZY/fpYGgft+eZwO oXdSnwK2wvT7DmGKDQ7CGFIVdZQzds/HAgyTtpIqqKxgreqnAcdboc/f1ldjKWt5OF+D Mz6/OxfvKHzc/jsrATj4+AP19nMgfVtr40DJcHCZjmkvoCjBShf0f6gY6X6WEeEA5ME2 9x6m0fUSSkRPBtQu5/hQ8+SJPRi2myKocS4PdgnJOrkzVYDEpEmsk+DF+YnY93cDL8O7 gWSg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9Fa2Utb6GHcLAKqHNhvzX0ea2n8XEk0XXW4vC7ep/lk=; b=NPmWwAcxJECNWvUNwi7uF73tJ82v9HY4+A6mg8eDh2B0F5mIxHDexywYX3KIPovNCt jProO+BKjZw82MPI7uC935pwJeXv0WhBevzOunVhcMt0ARRYCEKzd88rZwjwYJqNQKDA GPH9DEG8zNNG2OxI8ltv63cxuvYfyLRHFqLM+g6y0CF4P9NywH6q+pSpHtNmf0B87Fff U0Q1nZiJf3iOoc/hCxXP4TsrQuXtlTAkMPBxc4pv4sZHPEIBA9TajoeN0vKilItUcib7 kTTHMKoTbjImqLDXzxT73kY5Jg4hJxX5UTMI0zmxHIOO8wEt/qPqkolPpJgDfLHE0dJs vLkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QxH2VKWt; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 191si812313pgc.161.2022.02.14.13.20.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 13:20:32 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=QxH2VKWt; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C7600230882; Mon, 14 Feb 2022 12:38:07 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344278AbiBNJvk (ORCPT + 99 others); Mon, 14 Feb 2022 04:51:40 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245318AbiBNJrT (ORCPT ); Mon, 14 Feb 2022 04:47:19 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5052AE6B; Mon, 14 Feb 2022 01:40:44 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D39C86117D; Mon, 14 Feb 2022 09:40:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1532C340E9; Mon, 14 Feb 2022 09:40:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644831643; bh=pvQvL86pNurP4n/DoHviID1KeDX0M1Jc5g2X2Aax/54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QxH2VKWtyDN+fWtqasx3WoWngoi3qB/nY6tL1GY0fD6ZzuDNpKTjImLeJBLDsIJ/+ qq2dO6n+zTw1JQOU8/5Bj3Txekcy7O0LeBxxDXP0XpOBcO1FE01XbZEPrVdzyRn3dV fGWid6A1kfejxANBgbwDRJvHfHM8I9ruobSp61Rs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrzej Pietrasiewicz , Brian Norris , Heiko Stuebner Subject: [PATCH 5.10 049/116] drm/rockchip: vop: Correct RK3399 VOP register fields Date: Mon, 14 Feb 2022 10:25:48 +0100 Message-Id: <20220214092500.407595604@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214092458.668376521@linuxfoundation.org> References: <20220214092458.668376521@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 From: Brian Norris commit 9da1e9ab82c92d0e89fe44cad2cd7c2d18d64070 upstream. 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 Cc: Signed-off-by: Brian Norris Tested-by: Andrzej Pietrasiewicz Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220119161104.1.I1d01436bef35165a8cdfe9308789c0badb5ff46a@changeid Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c @@ -873,6 +873,7 @@ static const struct vop_win_phy rk3399_w .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), @@ -883,6 +884,7 @@ static const struct vop_win_phy rk3399_w .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), }; /* @@ -893,11 +895,11 @@ static const struct vop_win_phy rk3399_w 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 }, };