From patchwork Fri May 28 13:05:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 12287037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0646C2B9F7 for ; Fri, 28 May 2021 13:18:36 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 95D88613E9 for ; Fri, 28 May 2021 13:18:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95D88613E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org 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=581gCQjRXeFwq/7+e7jaFtdHJf11okAKBdE3VSKK3G4=; b=MCaDdAyQL3LypP /WEN/zeZoQBbv506CJnq6JEO+vNsGkJuN1+dZro7Uc7J6ywkkz5zCRxxgDizhIh6F5uO/fdGqb0QJ hG8mOSyzigT7K32OgxZVPV1SBxsRY/kWWtxI1XBIasMV4br7pRGTTfIk9VixGcNPFY0osZXGEZf54 5rgpqkP67hUUOp5rAdOrqJLVmTio7w7P/gi2xXHlsqlaAzGIzkkmAEm3hqqBSM/zm/h0BVv0+VKTv pZp7HDVxaq2l9lfPPuyUXwWsbDPfS2fj5yqAzrnCx/dNe6g5pT3h3XC2oOAHsqqug+pZnmA3Yrmrb tFODW6ckIKdK301gm9vQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmcNi-00FiIy-8M; Fri, 28 May 2021 13:18:30 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmcBu-00FdFi-G7; Fri, 28 May 2021 13:06:21 +0000 Received: by mail-ej1-x634.google.com with SMTP id l1so5246673ejb.6; Fri, 28 May 2021 06:06:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eRDj0MZVdTsSCC1Yf3hrs6Pt5+GzbpR4T0o/AaDM1so=; b=le92jVWjnEdA6redTACjRiKgL2NgrE87F0JvfHKsxfuifm2jTp16JBup34YX7nDupa qWQxUmK1nk8QhbJ6/SebSibILZ94srX5WDvugZRT7DePZBdqw1g8PLrgtov5U1tap8l6 PjOn4C0xkEBn/nGocm9U+4L0j/wz2XxqNRsS5pH25Hb3FuXvtKbpQ4vlX5AIURE4r3Tc tSkAN1LTdKD+GLcDqFVco0ni0pw276ndduPPVqtk/3tMLfZE/qVNJolEM8gPJ4D6vPYX dbYCGGCxKA//VzGHTJfKmGQECY0QxKajXc7LUJ3YyM/26QVdP09G8SJPyw6HPjNPoqnV IXyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eRDj0MZVdTsSCC1Yf3hrs6Pt5+GzbpR4T0o/AaDM1so=; b=X4fFa+pepStJSr7ZU1j8igg4lpMTW7tP5xE0tw9doLi6e3b9DEThqqUIbthbOqRswe huyWxhzZnYpDoqCwpnZeeDrNRTtCelv7V+y0EstTru56FFnQJfMiXMDiIEVmAJrt8JU1 B3klKv+AUnlhJNciqWs7P2YZZEeAF5v3Cu/Rtbiqg8fd2neoa6ol906unWb8RriY4Xpv NMSYFjhlHhDIMEzjjFl9PDXqzmD2oaT8X2oer81t/HWcrHHOMQTvR81w0HLkxyrf6Z8V fA1yoNd83URxFcoBU8b10WnH4PBaxyBGe5MV27U13TOZ2yUhzsiMmnd502VLJ/RmIkhj xV/w== X-Gm-Message-State: AOAM530XCSryOYBDuYKfdYV8Slh9biZqtA4xLrOIjxCLSvFPK5i7AyhR 0aa6qwE9rbRZ3X4Gw0lEpg== X-Google-Smtp-Source: ABdhPJzN2bFZQ/fRjfwL+SSSResnIJ4d7NrC0RuT1/aM7rHhN33jSvaMZPlKhuoDcWNeqB7on3W4+g== X-Received: by 2002:a17:906:4a5a:: with SMTP id a26mr9053546ejv.548.1622207176474; Fri, 28 May 2021 06:06:16 -0700 (PDT) Received: from localhost.localdomain (ip4d17b4b8.dynamic.kabel-deutschland.de. [77.23.180.184]) by smtp.googlemail.com with ESMTPSA id u21sm2322778ejg.50.2021.05.28.06.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 May 2021 06:06:16 -0700 (PDT) From: Alex Bee To: Sandy Huang , Heiko Stuebner , Paul Kocialkowski , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org Cc: David Airlie , Daniel Vetter , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v3 3/5] drm: rockchip: add missing registers for RK3066 Date: Fri, 28 May 2021 15:05:52 +0200 Message-Id: <20210528130554.72191-4-knaerzche@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210528130554.72191-1-knaerzche@gmail.com> References: <20210528130554.72191-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210528_060618_596096_D2091493 X-CRM114-Status: GOOD ( 11.80 ) 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 Add dither_up, dsp_lut_en and data_blank registers to enable their respective functionality for RK3066's VOP. While at that also fix .rb_swap and .format registers for all windows, which have to be set though RK3066_SYS_CTRL1 register. Also remove .scl from win1: Scaling is only supported on the primary plane. Signed-off-by: Alex Bee --- Changes in v3: - added patch drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c index 2aa6d937a078..b7c51933729f 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c @@ -355,8 +355,8 @@ static const struct vop_win_phy rk3066_win0_data = { .nformats = ARRAY_SIZE(formats_win_full), .format_modifiers = format_modifiers_win_full, .enable = VOP_REG(RK3066_SYS_CTRL1, 0x1, 0), - .format = VOP_REG(RK3066_SYS_CTRL0, 0x7, 4), - .rb_swap = VOP_REG(RK3066_SYS_CTRL0, 0x1, 19), + .format = VOP_REG(RK3066_SYS_CTRL1, 0x7, 4), + .rb_swap = VOP_REG(RK3066_SYS_CTRL1, 0x1, 19), .act_info = VOP_REG(RK3066_WIN0_ACT_INFO, 0x1fff1fff, 0), .dsp_info = VOP_REG(RK3066_WIN0_DSP_INFO, 0x0fff0fff, 0), .dsp_st = VOP_REG(RK3066_WIN0_DSP_ST, 0x1fff1fff, 0), @@ -367,13 +367,12 @@ static const struct vop_win_phy rk3066_win0_data = { }; static const struct vop_win_phy rk3066_win1_data = { - .scl = &rk3066_win_scl, .data_formats = formats_win_full, .nformats = ARRAY_SIZE(formats_win_full), .format_modifiers = format_modifiers_win_full, .enable = VOP_REG(RK3066_SYS_CTRL1, 0x1, 1), - .format = VOP_REG(RK3066_SYS_CTRL0, 0x7, 7), - .rb_swap = VOP_REG(RK3066_SYS_CTRL0, 0x1, 23), + .format = VOP_REG(RK3066_SYS_CTRL1, 0x7, 7), + .rb_swap = VOP_REG(RK3066_SYS_CTRL1, 0x1, 23), .act_info = VOP_REG(RK3066_WIN1_ACT_INFO, 0x1fff1fff, 0), .dsp_info = VOP_REG(RK3066_WIN1_DSP_INFO, 0x0fff0fff, 0), .dsp_st = VOP_REG(RK3066_WIN1_DSP_ST, 0x1fff1fff, 0), @@ -388,8 +387,8 @@ static const struct vop_win_phy rk3066_win2_data = { .nformats = ARRAY_SIZE(formats_win_lite), .format_modifiers = format_modifiers_win_lite, .enable = VOP_REG(RK3066_SYS_CTRL1, 0x1, 2), - .format = VOP_REG(RK3066_SYS_CTRL0, 0x7, 10), - .rb_swap = VOP_REG(RK3066_SYS_CTRL0, 0x1, 27), + .format = VOP_REG(RK3066_SYS_CTRL1, 0x7, 10), + .rb_swap = VOP_REG(RK3066_SYS_CTRL1, 0x1, 27), .dsp_info = VOP_REG(RK3066_WIN2_DSP_INFO, 0x0fff0fff, 0), .dsp_st = VOP_REG(RK3066_WIN2_DSP_ST, 0x1fff1fff, 0), .yrgb_mst = VOP_REG(RK3066_WIN2_MST, 0xffffffff, 0), @@ -414,6 +413,9 @@ static const struct vop_common rk3066_common = { .dither_down_en = VOP_REG(RK3066_DSP_CTRL0, 0x1, 11), .dither_down_mode = VOP_REG(RK3066_DSP_CTRL0, 0x1, 10), .dsp_blank = VOP_REG(RK3066_DSP_CTRL1, 0x1, 24), + .dither_up = VOP_REG(RK3066_DSP_CTRL0, 0x1, 9), + .dsp_lut_en = VOP_REG(RK3066_SYS_CTRL1, 0x1, 31), + .data_blank = VOP_REG(RK3066_DSP_CTRL1, 0x1, 25), }; static const struct vop_win_data rk3066_vop_win_data[] = {