From patchwork Wed Jul 22 18:13:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 11680129 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 155986C1 for ; Thu, 23 Jul 2020 07:03:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 E6A1320714 for ; Thu, 23 Jul 2020 07:03:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MQ+lxwAO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6A1320714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D6E21892A5; Thu, 23 Jul 2020 07:03:15 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0CE4489F3B for ; Wed, 22 Jul 2020 18:14:01 +0000 (UTC) Received: by mail-ej1-x643.google.com with SMTP id f12so3233650eja.9 for ; Wed, 22 Jul 2020 11:14:00 -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; bh=+2yRql0PqZgjMLyfhyquRo9Q78YxnYMENZUh8aYO2bY=; b=MQ+lxwAOW3hhiw4GW1RPkyHjPo9/BRI+QBF7guB/qd5C5OnecF8OtmuxofFp16OQKy EMC7+3g2nf08aEbMghDQXRUvp0fzhowa/jIcH4uXJQcWIR+vhpTF7YBAWLdEqVTyRrxi nEhOKHX26y8VBaerO9+Gur87dZwtsRan/KUnWmIdLqMKDQ8IHg7GVLNx/MuIh/DBx4/i n+32kVouDv63jjHxIpv23Kk7as0nYKbP2vG5AJd9sjHS5i9a/4J9Xakc4RoidDus1kVc rMZAfP4oHMJ77Om9k45dDrjCZ9zAK2l+LCGC+Y+8IaIgcJpY13tGbBxu+8Xa1N+OB/Px rgZA== 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; bh=+2yRql0PqZgjMLyfhyquRo9Q78YxnYMENZUh8aYO2bY=; b=b6Xf57vbqqdsWTWXUBDxyTRG5FOL09vC7vZLuMn9YLAduhEHtW0pqPKPeFpnDuoLpF 2Gk33/Bvk2Gp6srGJw7nXqVvPYyJycPH+Kd9g2DE5H0slynVcL01aLvhNb/r4DnySrgn mghX/TWGdAfDKOnrbfThjdLJ2ybbubY7joSUq/MDF30H/3rzgiKF86Ieg/zaQwIHNrP/ DOeHJTS2enIHDVSywJ/ONuxYLVAXPChUCGRPzrXhgOjw8r4JTvnY3CBL0lMf5CLL1uUH 2CE4OFFL1rs9+D5iocEbvnsZlzHfFTrCgTEPw5dCozbTyvwltj40Op0RD30DrM8z0dT/ K3nQ== X-Gm-Message-State: AOAM530lZm16hv/wFb+9VEf8OZEOTE1Ap88fWrj91i/Mfo6rAG8NeRZL 8WWq3oTudVmZ1w83Y7JQgkeSkHd4/w== X-Google-Smtp-Source: ABdhPJydtGJH1Wsx4NdMMVNpjKYL+ExfG/m+mBecCKK9gKXGYtqpdmrFWa/WLjRkpoXM2dmiBGmovw== X-Received: by 2002:a17:906:456:: with SMTP id e22mr811200eja.178.1595441639663; Wed, 22 Jul 2020 11:13:59 -0700 (PDT) Received: from localhost.localdomain ([2a02:810b:f40:e00:922b:34ff:fe38:6455]) by smtp.googlemail.com with ESMTPSA id x64sm372954edc.95.2020.07.22.11.13.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2020 11:13:59 -0700 (PDT) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner_?= Subject: [PATCH v2 1/5] drm: rockchip: add scaling for RK3036 win1 Date: Wed, 22 Jul 2020 20:13:28 +0200 Message-Id: <20200722181332.26995-2-knaerzche@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200722181332.26995-1-knaerzche@gmail.com> References: <20200722181332.26995-1-knaerzche@gmail.com> X-Mailman-Approved-At: Thu, 23 Jul 2020 07:03:15 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Alex Bee , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add the registers needed to make scaling work on RK3036's win1. Signed-off-by: Alex Bee --- Changes in v2: - rephrase commit message drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c index 80053d91a301..b046910129fb 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c @@ -77,15 +77,20 @@ static const uint64_t format_modifiers_win_lite[] = { DRM_FORMAT_MOD_INVALID, }; -static const struct vop_scl_regs rk3036_win_scl = { +static const struct vop_scl_regs rk3036_win0_scl = { .scale_yrgb_x = VOP_REG(RK3036_WIN0_SCL_FACTOR_YRGB, 0xffff, 0x0), .scale_yrgb_y = VOP_REG(RK3036_WIN0_SCL_FACTOR_YRGB, 0xffff, 16), .scale_cbcr_x = VOP_REG(RK3036_WIN0_SCL_FACTOR_CBR, 0xffff, 0x0), .scale_cbcr_y = VOP_REG(RK3036_WIN0_SCL_FACTOR_CBR, 0xffff, 16), }; +static const struct vop_scl_regs rk3036_win1_scl = { + .scale_yrgb_x = VOP_REG(RK3036_WIN1_SCL_FACTOR_YRGB, 0xffff, 0x0), + .scale_yrgb_y = VOP_REG(RK3036_WIN1_SCL_FACTOR_YRGB, 0xffff, 16), +}; + static const struct vop_win_phy rk3036_win0_data = { - .scl = &rk3036_win_scl, + .scl = &rk3036_win0_scl, .data_formats = formats_win_full, .nformats = ARRAY_SIZE(formats_win_full), .format_modifiers = format_modifiers_win_full, @@ -102,6 +107,7 @@ static const struct vop_win_phy rk3036_win0_data = { }; static const struct vop_win_phy rk3036_win1_data = { + .scl = &rk3036_win1_scl, .data_formats = formats_win_lite, .nformats = ARRAY_SIZE(formats_win_lite), .format_modifiers = format_modifiers_win_lite, From patchwork Wed Jul 22 18:13:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 11680137 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9C5186C1 for ; Thu, 23 Jul 2020 07:03:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 7A36E20714 for ; Thu, 23 Jul 2020 07:03:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B3tIpl7T" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A36E20714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BBDBB8969E; Thu, 23 Jul 2020 07:03:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id A34356E067 for ; Wed, 22 Jul 2020 18:14:20 +0000 (UTC) Received: by mail-ed1-x544.google.com with SMTP id h28so2380616edz.0 for ; Wed, 22 Jul 2020 11:14:20 -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; bh=RThPcly/jHnmJGOhuBZQDBDLJozqCS4adNNhKvYM4Mg=; b=B3tIpl7TcVNNRXBuZlga8XftggXq7bERUxzV260Fo9X43VhGO6VZRdWcUPOlTFHvd7 kSpw3npLSuA0SyJ6bVVhduLTwnPqeCeeuUTd6D7nSJc1D8dLD6s6oaurlHq9DLPsYxzM atOy5pKERBUqD9sKNa2ypB5dD0j1YWxJu/Wr4Nm2MrW+TA7FFfLbPB0Z/R1SjZYn7wC5 sfskxZ4FDUo/OKrA/xXnxd4nL45smGcElGi8Oz9QF39Hr7zTaygaaVaa1ZM39uGRH+j4 Pj7mx4q5aXWt08ecF6UURZodhiL46pXRCYbFx+B9p987RWuhrAzj2ZjIeOtsU+GpBx0A PZgQ== 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; bh=RThPcly/jHnmJGOhuBZQDBDLJozqCS4adNNhKvYM4Mg=; b=tr8LAS8AV0TB3U9q52homPADovoaAeYxjaD41w4YE539/SFBWT3bmF2dYf7CptOg0z GEprK1KhSQZYB38oKrfbJeyVSsHkFQIKEMgIcMQt6V8NoZLwQHabn+dNHZHvg5WqilMn NJx20cR5Nk0tgjl8uR+FDnfyxxuQHFCGCAduaPQ4axhH/PRoCblH500wkZ2jPE4W5eO8 FRTnG1kHsrk/PmAhjApCnnuY89NwnH7vD8So02nja1i6rypOBcaHv2uadiTGhBquJstx xaOP3Mav7MUsK3bciy8vbh4TLP8vEO2XEzmMtbTTJ3dISC7J1JpzDJyrACY+rdE7TBCU M99g== X-Gm-Message-State: AOAM531u+xtIPjLUz/rv9qSQaLXEfy9NefY07Mbfiy9Sg10rrD3ubov3 yzwZsxVg+Woy8WIJGl47GJ31DXhK3Q== X-Google-Smtp-Source: ABdhPJw92ztJ/Nw8og4fgLjKEfKRszbcX6/RXPzIu2YBLzTwtDy6VFd45FxJ1Z76COkY76NtNEZ5JA== X-Received: by 2002:a05:6402:1c10:: with SMTP id ck16mr738438edb.72.1595441659181; Wed, 22 Jul 2020 11:14:19 -0700 (PDT) Received: from localhost.localdomain ([2a02:810b:f40:e00:922b:34ff:fe38:6455]) by smtp.googlemail.com with ESMTPSA id x64sm372954edc.95.2020.07.22.11.14.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2020 11:14:18 -0700 (PDT) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner_?= Subject: [PATCH v2 2/5] drm: rockchip: add missing registers for RK3188 Date: Wed, 22 Jul 2020 20:13:29 +0200 Message-Id: <20200722181332.26995-3-knaerzche@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200722181332.26995-1-knaerzche@gmail.com> References: <20200722181332.26995-1-knaerzche@gmail.com> X-Mailman-Approved-At: Thu, 23 Jul 2020 07:03:15 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Alex Bee , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add dither_up, dsp_lut_en and data_blank registers to enable their respective functionality for RK3188's VOP. Signed-off-by: Alex Bee --- Changes in v2: - drop the not yet upstreamed dsp_data_swap and rephrase the commit message according drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c index b046910129fb..a50877818a86 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c @@ -512,6 +512,9 @@ static const struct vop_common rk3188_common = { .dither_down_en = VOP_REG(RK3188_DSP_CTRL0, 0x1, 11), .dither_down_mode = VOP_REG(RK3188_DSP_CTRL0, 0x1, 10), .dsp_blank = VOP_REG(RK3188_DSP_CTRL1, 0x3, 24), + .dither_up = VOP_REG(RK3188_DSP_CTRL0, 0x1, 9), + .dsp_lut_en = VOP_REG(RK3188_SYS_CTRL, 0x1, 28), + .data_blank = VOP_REG(RK3188_DSP_CTRL1, 0x1, 25), }; static const struct vop_win_data rk3188_vop_win_data[] = { From patchwork Wed Jul 22 18:13:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 11680159 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 984A36C1 for ; Thu, 23 Jul 2020 07:04:03 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 75F6320714 for ; Thu, 23 Jul 2020 07:04:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="h74/5hAi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75F6320714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 799286E46D; Thu, 23 Jul 2020 07:03:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 126476E06D for ; Wed, 22 Jul 2020 18:14:27 +0000 (UTC) Received: by mail-ed1-x544.google.com with SMTP id a1so2342408edt.10 for ; Wed, 22 Jul 2020 11:14:26 -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; bh=8DzSnA+/kDSS5MO4IA6iCFwIhWVFbU1RNSo1HqBPhhE=; b=h74/5hAiMInjB9Fh08FXp2jhDwcfejMysp5Tyeezamsue8iNB23OsKWUBXt3A0am1I nBcB+8gUGZiVM+0ZthTspcxTVKzsI2CiMMnms+shi3KdJrcrDrMgIxO+aT0hhMmRJFad M70iXUs+ZS9QGlP1Uek4npwRV356wYHb2Bdf+hlVb+rwsO/CbS4qsXMSeBwJW9/uAwG7 g8ChBR4i4ULijJk16piKMt6//vlz9v7LW8fecxk983jDTUNMFk1ytlwkGhEa62Zdlipj BH5jReOJYvJpbf9HJvGd/PILO0NpoYP0tI3wnh32qfYXKLnntvmtzPOtbOty08HT5Nsf LoGQ== 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; bh=8DzSnA+/kDSS5MO4IA6iCFwIhWVFbU1RNSo1HqBPhhE=; b=BybKFE4thRNl+U1sxXP4ZpK4tiKhwc3bnAKax2PaBzpxUeaWFH+/V+p9X3cZEMPe5G W0uni0m5A2PxfPYTQpCQSaa08Vevjt0j917Gcxax5+GCJ1HmIEROFA7+4JniL+DAJbN7 KZzaI2OekQ2CDzOpMEdYcoq/fXLMKM6bTXHDKsH75jaMjxPCTDCzkvGN4JI6Qrl85a4D OL/O/ueCMeTcm0xNf8XGORmc5aoajcHnY0aElR0HNNucDIqP1UmysI/lJLRwwVC9fJ62 +yk8tQQhgE1wNlSyIoakQjy+c7XSfYwp88duap/bc799RDr9Wfl84zdM39lGvEalcUis JyTw== X-Gm-Message-State: AOAM531iNPFWVZi47JKQgHA76NdjLT2jLa8SwZQ424eG+tq9QB8PfkX/ obv0wClGGffGT4Rb55G2iA== X-Google-Smtp-Source: ABdhPJwP7oFCOGzbeuXabVgTdjc+lVDGG1HApDtuMAMIV7v5O3m1ikWS1rZCnLDPzEy+7DsURp/2eQ== X-Received: by 2002:aa7:c4d1:: with SMTP id p17mr680912edr.268.1595441665602; Wed, 22 Jul 2020 11:14:25 -0700 (PDT) Received: from localhost.localdomain ([2a02:810b:f40:e00:922b:34ff:fe38:6455]) by smtp.googlemail.com with ESMTPSA id x64sm372954edc.95.2020.07.22.11.14.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2020 11:14:25 -0700 (PDT) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner_?= Subject: [PATCH v2 3/5] drm: rockchip: add alpha support for RK3036, RK3066, RK3126 and RK3188 Date: Wed, 22 Jul 2020 20:13:30 +0200 Message-Id: <20200722181332.26995-4-knaerzche@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200722181332.26995-1-knaerzche@gmail.com> References: <20200722181332.26995-1-knaerzche@gmail.com> X-Mailman-Approved-At: Thu, 23 Jul 2020 07:03:15 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Alex Bee , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" With commit 2aae8ed1f390 ("drm/rockchip: Add per-pixel alpha support for the PX30 VOP") alpha support was introduced for PX30's VOP. RK3036, RK3066, RK3126 and RK3188 VOPs support alpha blending in the same manner. With the exception of RK3066 all of them support pre-multiplied alpha. Lets add these registers to make this work for those VOPs as well. Signed-off-by: Alex Bee --- Changes in v2: - rephrase commit message drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 21 +++++++++++++++++++++ drivers/gpu/drm/rockchip/rockchip_vop_reg.h | 1 + 2 files changed, 22 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c index a50877818a86..5a13b4ab77e1 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c @@ -104,6 +104,9 @@ static const struct vop_win_phy rk3036_win0_data = { .uv_mst = VOP_REG(RK3036_WIN0_CBR_MST, 0xffffffff, 0), .yrgb_vir = VOP_REG(RK3036_WIN0_VIR, 0xffff, 0), .uv_vir = VOP_REG(RK3036_WIN0_VIR, 0x1fff, 16), + .alpha_mode = VOP_REG(RK3036_DSP_CTRL0, 0x1, 18), + .alpha_en = VOP_REG(RK3036_ALPHA_CTRL, 0x1, 0), + .alpha_pre_mul = VOP_REG(RK3036_DSP_CTRL0, 0x1, 29), }; static const struct vop_win_phy rk3036_win1_data = { @@ -119,6 +122,9 @@ static const struct vop_win_phy rk3036_win1_data = { .dsp_st = VOP_REG(RK3036_WIN1_DSP_ST, 0x1fff1fff, 0), .yrgb_mst = VOP_REG(RK3036_WIN1_MST, 0xffffffff, 0), .yrgb_vir = VOP_REG(RK3036_WIN1_VIR, 0xffff, 0), + .alpha_mode = VOP_REG(RK3036_DSP_CTRL0, 0x1, 19), + .alpha_en = VOP_REG(RK3036_ALPHA_CTRL, 0x1, 1), + .alpha_pre_mul = VOP_REG(RK3036_DSP_CTRL0, 0x1, 29), }; static const struct vop_win_data rk3036_vop_win_data[] = { @@ -185,6 +191,9 @@ static const struct vop_win_phy rk3126_win1_data = { .dsp_st = VOP_REG(RK3126_WIN1_DSP_ST, 0x1fff1fff, 0), .yrgb_mst = VOP_REG(RK3126_WIN1_MST, 0xffffffff, 0), .yrgb_vir = VOP_REG(RK3036_WIN1_VIR, 0xffff, 0), + .alpha_mode = VOP_REG(RK3036_DSP_CTRL0, 0x1, 19), + .alpha_en = VOP_REG(RK3036_ALPHA_CTRL, 0x1, 1), + .alpha_pre_mul = VOP_REG(RK3036_DSP_CTRL0, 0x1, 29), }; static const struct vop_win_data rk3126_vop_win_data[] = { @@ -364,6 +373,8 @@ static const struct vop_win_phy rk3066_win0_data = { .uv_mst = VOP_REG(RK3066_WIN0_CBR_MST0, 0xffffffff, 0), .yrgb_vir = VOP_REG(RK3066_WIN0_VIR, 0xffff, 0), .uv_vir = VOP_REG(RK3066_WIN0_VIR, 0x1fff, 16), + .alpha_mode = VOP_REG(RK3066_DSP_CTRL0, 0x1, 21), + .alpha_en = VOP_REG(RK3066_BLEND_CTRL, 0x1, 0), }; static const struct vop_win_phy rk3066_win1_data = { @@ -381,6 +392,8 @@ static const struct vop_win_phy rk3066_win1_data = { .uv_mst = VOP_REG(RK3066_WIN1_CBR_MST, 0xffffffff, 0), .yrgb_vir = VOP_REG(RK3066_WIN1_VIR, 0xffff, 0), .uv_vir = VOP_REG(RK3066_WIN1_VIR, 0x1fff, 16), + .alpha_mode = VOP_REG(RK3066_DSP_CTRL0, 0x1, 22), + .alpha_en = VOP_REG(RK3066_BLEND_CTRL, 0x1, 1), }; static const struct vop_win_phy rk3066_win2_data = { @@ -394,6 +407,8 @@ static const struct vop_win_phy rk3066_win2_data = { .dsp_st = VOP_REG(RK3066_WIN2_DSP_ST, 0x1fff1fff, 0), .yrgb_mst = VOP_REG(RK3066_WIN2_MST, 0xffffffff, 0), .yrgb_vir = VOP_REG(RK3066_WIN2_VIR, 0xffff, 0), + .alpha_mode = VOP_REG(RK3066_DSP_CTRL0, 0x1, 23), + .alpha_en = VOP_REG(RK3066_BLEND_CTRL, 0x1, 2), }; static const struct vop_modeset rk3066_modeset = { @@ -476,6 +491,9 @@ static const struct vop_win_phy rk3188_win0_data = { .yrgb_mst = VOP_REG(RK3188_WIN0_YRGB_MST0, 0xffffffff, 0), .uv_mst = VOP_REG(RK3188_WIN0_CBR_MST0, 0xffffffff, 0), .yrgb_vir = VOP_REG(RK3188_WIN_VIR, 0x1fff, 0), + .alpha_mode = VOP_REG(RK3188_DSP_CTRL0, 0x1, 18), + .alpha_en = VOP_REG(RK3188_ALPHA_CTRL, 0x1, 0), + .alpha_pre_mul = VOP_REG(RK3188_DSP_CTRL0, 0x1, 29), }; static const struct vop_win_phy rk3188_win1_data = { @@ -490,6 +508,9 @@ static const struct vop_win_phy rk3188_win1_data = { .dsp_st = VOP_REG(RK3188_WIN1_DSP_ST, 0x0fff0fff, 0), .yrgb_mst = VOP_REG(RK3188_WIN1_MST, 0xffffffff, 0), .yrgb_vir = VOP_REG(RK3188_WIN_VIR, 0x1fff, 16), + .alpha_mode = VOP_REG(RK3188_DSP_CTRL0, 0x1, 19), + .alpha_en = VOP_REG(RK3188_ALPHA_CTRL, 0x1, 1), + .alpha_pre_mul = VOP_REG(RK3188_DSP_CTRL0, 0x1, 29), }; static const struct vop_modeset rk3188_modeset = { diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.h b/drivers/gpu/drm/rockchip/rockchip_vop_reg.h index 6e9fa5815d4d..0b3cd65ba5c1 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.h +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.h @@ -955,6 +955,7 @@ #define RK3188_DSP_CTRL0 0x04 #define RK3188_DSP_CTRL1 0x08 #define RK3188_INT_STATUS 0x10 +#define RK3188_ALPHA_CTRL 0x14 #define RK3188_WIN0_YRGB_MST0 0x20 #define RK3188_WIN0_CBR_MST0 0x24 #define RK3188_WIN0_YRGB_MST1 0x28 From patchwork Wed Jul 22 18:13:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 11680135 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A8746C1 for ; Thu, 23 Jul 2020 07:03:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 EC72220714 for ; Thu, 23 Jul 2020 07:03:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YZT+wLdJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC72220714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F413B89739; Thu, 23 Jul 2020 07:03:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0A2196E067 for ; Wed, 22 Jul 2020 18:14:33 +0000 (UTC) Received: by mail-ej1-x643.google.com with SMTP id w6so3252449ejq.6 for ; Wed, 22 Jul 2020 11:14:32 -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; bh=9YXzBu5CzF+ORy2slLhhzsC7TGMl1ab46whl8Gc0jIE=; b=YZT+wLdJt81DIoI1eEOPyqj1ApstGxBDSFtKpxwA9aFw78rHiaPtz1o5R5aWPA7mJV zmNy+2woINSM+h80UBALJOtOA5Upoq2morXnjWFdTQ+Wtq6buPJsqYcpPDzzaESTPck8 tqZXYqMilV+HuupNqSOpFSxS29xvqMO9EENURQIGqLlabe8vJ8zb3/5WKCe6akTx6gDA SUp6DhxR16CeNKMBUPluYu+Z6vVdb83WgEs8iYvA+T5Qj20InAeKKUMLFkdk+OmiOKLc LL+k+HbMYlgqkEwBrDHamrOmKY1UgM1OIJAGO7wZjw+h6mM9gTK41HYB0dM36Eqxdsr9 pJvA== 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; bh=9YXzBu5CzF+ORy2slLhhzsC7TGMl1ab46whl8Gc0jIE=; b=dgk2S+LgJL07DvtsU6l/g16aGbPMlQ8z4JOn9AYzNLQ0KOSiosI+u1JIEFPNLuFA3L CXZx6afuZVanjXf2SC16QqzlddHc/otmsZP0ZoHiG/oxq9IgS3N6+K/lidODnl3WNOdd PT6Y2Trh7YfapTrSCKDqEG3028HPnyh7mIdPvK3pEXHKWK/LLzouJgyYxdUzFF3Ym1MI 4acJ1thnmWrc0Ew9vdHo0JL5gzdR+ekzaYbodFLLkmwsoUsi9BCkiI8xziahYSXD0X/p QG42+C3uKip3fPrPMGCCg33hCEFmgVqKAxi94Chphusi+ZeVUmm7CGgbVMttGiWNs4oK a08w== X-Gm-Message-State: AOAM533GsvgYjv+zD8YLne0KP204fEmz5NtTY93dSxRRVTibwu2iByXH c08LyM8YVju85/I6YfOi7g== X-Google-Smtp-Source: ABdhPJw3iiCki6IlU7m1rxI1/D3e8gIWcFUfyjOXBSfZ5zryqeraDoQ2XJLCt9CzAECYRrmd99AhNA== X-Received: by 2002:a17:906:6406:: with SMTP id d6mr810152ejm.30.1595441671712; Wed, 22 Jul 2020 11:14:31 -0700 (PDT) Received: from localhost.localdomain ([2a02:810b:f40:e00:922b:34ff:fe38:6455]) by smtp.googlemail.com with ESMTPSA id x64sm372954edc.95.2020.07.22.11.14.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2020 11:14:31 -0700 (PDT) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner_?= Subject: [PATCH v2 4/5] drm: rockchip: set alpha_en to 0 if it is not used Date: Wed, 22 Jul 2020 20:13:31 +0200 Message-Id: <20200722181332.26995-5-knaerzche@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200722181332.26995-1-knaerzche@gmail.com> References: <20200722181332.26995-1-knaerzche@gmail.com> X-Mailman-Approved-At: Thu, 23 Jul 2020 07:03:15 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Alex Bee , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" alpha_en should be set to 0 if it is not used, i.e. to disable alpha blending if it was enabled before and should be disabled now. Fixes: 2aae8ed1f390 ("drm/rockchip: Add per-pixel alpha support for the PX30 VOP") Signed-off-by: Alex Bee --- Changes in v2: - capitalize "F" of "Fixes" in the commit message drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index c80f7d9fd13f..0f23144491e4 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1013,6 +1013,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane, VOP_WIN_SET(vop, win, alpha_en, 1); } else { VOP_WIN_SET(vop, win, src_alpha_ctl, SRC_ALPHA_EN(0)); + VOP_WIN_SET(vop, win, alpha_en, 0); } VOP_WIN_SET(vop, win, enable, 1); From patchwork Wed Jul 22 18:13:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 11680155 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA0AD13B1 for ; Thu, 23 Jul 2020 07:03:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 A6FA420714 for ; Thu, 23 Jul 2020 07:03:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Yr0A25+8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6FA420714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D2406E413; Thu, 23 Jul 2020 07:03:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by gabe.freedesktop.org (Postfix) with ESMTPS id 01FCA6E09E for ; Wed, 22 Jul 2020 18:14:36 +0000 (UTC) Received: by mail-ed1-x541.google.com with SMTP id by13so2341491edb.11 for ; Wed, 22 Jul 2020 11:14:36 -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; bh=NUkQtv3OJHBzboi9ru1HyxK6os+k6GP868ADn16gFFU=; b=Yr0A25+8HZhtQNRtUXpWrihE5hC09s6PB8Ecc61nnw5jJrjAHYEaAZFsC4OeW1QdKk uoZp5lL7mWGagAVynN3amwJeNlbHpj4Z/FETX9Iu/837eiy7dcyuCEz4CFZL/rRzqpOe uinUfsZ9dlvU0P37gCridlrLSYBV16dzMZ8nX1JVYBxyMrQ2jcqv4ooxYjV7mRzUtBgV 6dB87LJQjMUwdF88P/oixIA1jQ0NcQa48DuNh86HCl1+4VkhSRYPJTCkrGiCnsNsE6Pb ijZ2Jx3aaiRyjI2Ner8PI6Rc8klmEmfDcVeHQDjClW6B6HkBoO/EJmV+MPEyEVUL8ssr Lc9g== 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; bh=NUkQtv3OJHBzboi9ru1HyxK6os+k6GP868ADn16gFFU=; b=pUiJs7MWJlt2Xq8FaLLr/VRd/jfxIQEkWoZRS0dMSmgJxzeMA3CgMFMd92XmAG+Bw3 KFPQ+P2QGwJjPrOtC7a26Z1cJHoTN8OxTR5K1W0rUVJCu+sARdXOPaWt+ziLZvH9zWY9 9GlOu1Chp4r8aUTaRMOaIHcGnG40wTtp4TPkNNf3lgBpVHw5sQnvkb5vr6azGxnX3lJ+ 5PW5rVUHvs/BeO7k+Lvi02r0Ix61vzKA4KQ1E7fZW/W0Ofod/Q5metbsKFzBbajKlBpf zI2aF5R/gbw4i9avaFbwhET8yjHq1Ze7z2urdUVAcLszAf8u3SCFh4vCA+3pdrdO6FAP gYRg== X-Gm-Message-State: AOAM533bAOnyp8lK9FxzU9jLbBkOiSmenCUZqmZICEWh02qAk8uqJJaP ifrIK4C6AlLORngblGw+xw== X-Google-Smtp-Source: ABdhPJxHHQnxfYsacvYxK8fphmFU5Y2/bDjz1g0ykQdB6aaEDAKTVi+GC+doGqCwIerSb2ZyUtCjkQ== X-Received: by 2002:aa7:d802:: with SMTP id v2mr689281edq.77.1595441675574; Wed, 22 Jul 2020 11:14:35 -0700 (PDT) Received: from localhost.localdomain ([2a02:810b:f40:e00:922b:34ff:fe38:6455]) by smtp.googlemail.com with ESMTPSA id x64sm372954edc.95.2020.07.22.11.14.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2020 11:14:35 -0700 (PDT) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner_?= Subject: [PATCH v2 5/5] drm: rockchip: use overlay windows as such Date: Wed, 22 Jul 2020 20:13:32 +0200 Message-Id: <20200722181332.26995-6-knaerzche@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200722181332.26995-1-knaerzche@gmail.com> References: <20200722181332.26995-1-knaerzche@gmail.com> X-Mailman-Approved-At: Thu, 23 Jul 2020 07:03:15 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Alex Bee , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" As stated in the comment for rk3288_vop_win_data windows that are supposed to be an overlay window are missused as HWC windows due to the missing implementation of that window type in the VOP driver. This also applies to VOPs RK3036, RK3126, RK3188 and RK3228, which all have at least one (1) dedicated HWC window (which are not currently defined in the driver). Since all the VOPs mentioned have only one (1) overlay window and all now support alpha blending , it should also be used as such, as this offers a much broader usage perspective for them. Signed-off-by: Alex Bee --- Changes in v2: - rephrase commit message drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c index 5a13b4ab77e1..b4a00f13b559 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c @@ -131,7 +131,7 @@ static const struct vop_win_data rk3036_vop_win_data[] = { { .base = 0x00, .phy = &rk3036_win0_data, .type = DRM_PLANE_TYPE_PRIMARY }, { .base = 0x00, .phy = &rk3036_win1_data, - .type = DRM_PLANE_TYPE_CURSOR }, + .type = DRM_PLANE_TYPE_OVERLAY }, }; static const int rk3036_vop_intrs[] = { @@ -200,7 +200,7 @@ static const struct vop_win_data rk3126_vop_win_data[] = { { .base = 0x00, .phy = &rk3036_win0_data, .type = DRM_PLANE_TYPE_PRIMARY }, { .base = 0x00, .phy = &rk3126_win1_data, - .type = DRM_PLANE_TYPE_CURSOR }, + .type = DRM_PLANE_TYPE_OVERLAY }, }; static const struct vop_data rk3126_vop = { @@ -542,7 +542,7 @@ static const struct vop_win_data rk3188_vop_win_data[] = { { .base = 0x00, .phy = &rk3188_win0_data, .type = DRM_PLANE_TYPE_PRIMARY }, { .base = 0x00, .phy = &rk3188_win1_data, - .type = DRM_PLANE_TYPE_CURSOR }, + .type = DRM_PLANE_TYPE_OVERLAY }, }; static const int rk3188_vop_intrs[] = { @@ -979,7 +979,7 @@ static const struct vop_win_data rk3228_vop_win_data[] = { { .base = 0x00, .phy = &rk3288_win01_data, .type = DRM_PLANE_TYPE_PRIMARY }, { .base = 0x40, .phy = &rk3288_win01_data, - .type = DRM_PLANE_TYPE_CURSOR }, + .type = DRM_PLANE_TYPE_OVERLAY }, }; static const struct vop_data rk3228_vop = {