From patchwork Tue Oct 29 09:54:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Yan X-Patchwork-Id: 13854595 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E875CD2AB13 for ; Tue, 29 Oct 2024 09:59:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=687IqWcLPlz4Q4Icp3MQs1+piM7X92xdzSU2FfAwtN8=; b=08H4c7/j4zWWF5 FQOOJmRFmXpjjh3b1OQnBl5YTcdP1c4zAwgp6+goPEclmjCC34KbBkC3ZDiFZVvx0vpEyvKyZspfZ etltvF1rY6saei7ALKrUqlwdiRtASbIT1jHrJxWPgR5CKtIpeX3DZQclVGTO7buUuboCAGvzXAvYS tvcjgu6iFuUiqWcTfsGNqcdXpwVLiCRnbEctOt/IaPrydvrVn5YmbgE10FhEnLZKf5UFzT/A7Uldu 5FNqHGihw9y6ukylbAHjLVp+vseFYtTWhO1d9V5+7pOZy2dV/eHtBiGe9ywfpvNuK6wheJQZp1EbG g1510b6uKbcDuBkY5LoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t5j0Z-0000000DxTp-0GAW; Tue, 29 Oct 2024 09:59:27 +0000 Received: from m16.mail.163.com ([117.135.210.5]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t5iwx-0000000DwHR-3ndI; Tue, 29 Oct 2024 09:55:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version; bh=sWL+u A6N3RP7S0oEEy+dt5J028U96XG2qpaI3whbCC8=; b=nT1GAGRm3e1rS7G0nQxdk c12589OMffZqPCBHdrB63piwn1vO3q01+e6Y5o76j5mt75cxO1DDhI63vta2bqkI SNHF2pXbY+bwfkrbz9d595BqKvUtBiLptepisQ7O/p5qu+toYnxeaIwSl0LJe83k zkyqKB1cbZBVnTH2lu9/7Q= Received: from ProDesk.. (unknown [58.22.7.114]) by gzga-smtp-mtada-g1-1 (Coremail) with SMTP id _____wD3nxoCsSBn8+3dEA--.3291S5; Tue, 29 Oct 2024 17:55:22 +0800 (CST) From: Andy Yan To: heiko@sntech.de Cc: hjc@rock-chips.com, krzk+dt@kernel.org, s.hauer@pengutronix.de, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, derek.foreman@collabora.com, minhuadotchen@gmail.com, detlev.casanova@collabora.com, Andy Yan , Michael Riesch Subject: [PATCH v4 03/14] drm/rockchip: vop2: Fix the mixer alpha setup for layer 0 Date: Tue, 29 Oct 2024 17:54:56 +0800 Message-ID: <20241029095513.391006-4-andyshrk@163.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241029095513.391006-1-andyshrk@163.com> References: <20241029095513.391006-1-andyshrk@163.com> MIME-Version: 1.0 X-CM-TRANSID: _____wD3nxoCsSBn8+3dEA--.3291S5 X-Coremail-Antispam: 1Uf129KBjvJXoW7WrWDGF1UXryfGrWrXr4fXwb_yoW8Gr43pF s8uFWj9w40krsFqr1DJan7uF4Syan7Cay7Grs7J3W3X3W3KF9rCwnxWr98ArZ8JF4xWF4a krZrKr98Wa12vrJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jBD73UUUUU= X-Originating-IP: [58.22.7.114] X-CM-SenderInfo: 5dqg52xkunqiywtou0bp/1tbiMwqHXmcgqJmjwgABs2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241029_025544_442205_C415039F X-CRM114-Status: GOOD ( 10.66 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org From: Andy Yan The alpha setup should start from the second layer, the current calculation starts incorrectly from the first layer, a negative offset will be obtained in the following formula: offset = (mixer_id + zpos - 1) * 0x10 Fixes: 604be85547ce ("drm/rockchip: Add VOP2 driver") Signed-off-by: Andy Yan Tested-by: Derek Foreman Tested-by: Michael Riesch # on RK3568 Tested-by: Detlev Casanova --- (no changes since v1) drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c index bff190151ae8c..c50d93df84046 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop2.c @@ -2282,6 +2282,12 @@ static void vop2_setup_alpha(struct vop2_video_port *vp) struct vop2_win *win = to_vop2_win(plane); int zpos = plane->state->normalized_zpos; + /* + * Need to configure alpha from second layer. + */ + if (zpos == 0) + continue; + if (plane->state->pixel_blend_mode == DRM_MODE_BLEND_PREMULTI) premulti_en = 1; else