Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1494184rdb; Thu, 7 Dec 2023 00:02:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGfRZjOdTfgAWe02dwcNXF4SxMeiA65kUZxloKNysMxwVcbVvYJDwzoP07ULzd4N+OdJf3V X-Received: by 2002:a05:6a20:7f8c:b0:18f:5f6f:fc69 with SMTP id d12-20020a056a207f8c00b0018f5f6ffc69mr2363276pzj.97.1701936127238; Thu, 07 Dec 2023 00:02:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701936127; cv=none; d=google.com; s=arc-20160816; b=t1pJxLmHP77O1JbZ9Q4IqmwUN088lmzRPSnmzmlGOZgacETUlgMWI5z4dugPCv85Fq 59CnyNJvquwGMviWPny6qKZIWge8fPEH4613r8wG0XXgXBD1aoP9yRQ7eOzmixq0MwBP IFPTVKa0Xa9xoVENs2WpJtSBrrgJAY5WMls4DPpO7Es+OGG49QjT4o+qYxpY3MqPXCAJ f2zRteyX3Wckxd/M+1AvJtuqgW+ROByFNrdr/yf5OqLJgyCDHW3xqLrDAfKXmjXuQP6J z0AWHVpWfhdKuJ5eAVFTKVSEfN2LBsUP0hMujGQp8+8m+3wEodcS6MZr8P20z/onYwbB A5aw== 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=zb21FgrwTHHIjSU2lLqUEQQ7s329de26aUDP8GoQ+6A=; fh=UxFpKtBK5VEiehKMA7YEJ/g9njmupgYZNYvE1WeoN9M=; b=H69sDQXnqYMEE3uu15DEblkCiktRSmSGMFEfWEOsoqjCIcn0YyYisZ5NU5rbk5gafN 7VRS7W4DMT+nBuNspMFIdm2YX+8nbgA99o5AD8e+L3w1vj9XlW+haGbkvCHIO5a65Bfl 9M50FVlm2Mb8WLUX35maZC3YpkBAezMM4BPHdv/Pz7E60DwHhHSF06FR11eZN6awvozK A6zqg7Do240Ttf63PhDH0YVev1dQJSd4NZ1KC75ZQSu3ZP40uQzIuX27fsChx5JBpyCj JpZGH2D8Ve7pomzjCqYfqTVZfDVUWJhX3qK0oZ3jLSnz5GJqfa5E04WcyF1gNyLjWfjV siJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=kzoUkzqc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id x1-20020a654541000000b00577461296a9si775732pgr.338.2023.12.07.00.02.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 00:02:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=kzoUkzqc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id C472283328CE; Thu, 7 Dec 2023 00:02:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229794AbjLGIBu (ORCPT + 99 others); Thu, 7 Dec 2023 03:01:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231384AbjLGIBn (ORCPT ); Thu, 7 Dec 2023 03:01:43 -0500 Received: from m15.mail.163.com (m15.mail.163.com [45.254.50.220]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2A7AA10CF; Thu, 7 Dec 2023 00:01:48 -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=zb21F grwTHHIjSU2lLqUEQQ7s329de26aUDP8GoQ+6A=; b=kzoUkzqceLopPCcYi//E7 FZqZMZqU7rFswtGmR6ePN+wpVjclKIsaP1mzN0JGVK74OJ9q2osJobEPh+V8RqGP 3uqTv0FtKHrAIgodl79m4kJX8RSk1oB+JPaHQxEkUmwzefG0+uhfRdA52ecI2auu d4zdg9KrIASxN1eiGtBL8E= Received: from ProDesk.. (unknown [58.22.7.114]) by zwqz-smtp-mta-g0-0 (Coremail) with SMTP id _____wDnr0uee3FlXgKlEw--.44744S2; Thu, 07 Dec 2023 16:00:33 +0800 (CST) From: Andy Yan 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, Andy Yan Subject: [PATCH v4 05/17] drm/rockchip: vop2: Add write mask for VP config done Date: Thu, 7 Dec 2023 16:00:29 +0800 Message-Id: <20231207080029.652110-1-andyshrk@163.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231207075906.651771-1-andyshrk@163.com> References: <20231207075906.651771-1-andyshrk@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wDnr0uee3FlXgKlEw--.44744S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7uw4rKw17GrW5WF13XF4fKrg_yoW8Ar1xpF WrAay5urs2kFsFgr4qkFy5Zr1aya9rAa92yr97Kw13Xas0qr1DZFn09F1jyr98JFWxZr1a ywsrAryrGF4jvrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jSzuXUUUUU= X-Originating-IP: [58.22.7.114] X-CM-SenderInfo: 5dqg52xkunqiywtou0bp/1tbiqAo-XmVOA0YD-wAAsR 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 morse.vger.email 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 (morse.vger.email [0.0.0.0]); Thu, 07 Dec 2023 00:02:05 -0800 (PST) From: Andy Yan The write mask bit is used to make sure when writing config done bit for one VP will not overwrite the other. Unfortunately, the write mask bit is missing on rk3566/8, that means when we write to these bits, it will not take any effect. We need this to make the vop work properly after rk3566/8 variants. Signed-off-by: Andy Yan --- (no changes since v3) Changes in v3: - split from the vop2 driver patch drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index a019cc9bbd54..25c1f33c5622 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -268,12 +268,23 @@ static bool vop2_cluster_window(const struct vop2_win *win) return win->data->feature & WIN_FEATURE_CLUSTER; } +/* + * Note: + * The write mask function is missing on rk3566/8, write + * to this bit has no effect, for the other soc(rk3588 and + * the following...), this function works well. + * + * GLB_CFG_DONE_EN doesn't have a write mask bit + * + */ static void vop2_cfg_done(struct vop2_video_port *vp) { struct vop2 *vop2 = vp->vop2; + u32 val = RK3568_REG_CFG_DONE__GLB_CFG_DONE_EN; + + val |= BIT(vp->id) | (BIT(vp->id) << 16); - regmap_set_bits(vop2->map, RK3568_REG_CFG_DONE, - BIT(vp->id) | RK3568_REG_CFG_DONE__GLB_CFG_DONE_EN); + regmap_set_bits(vop2->map, RK3568_REG_CFG_DONE, val); } static void vop2_win_disable(struct vop2_win *win) -- 2.34.1