From patchwork Mon Mar 25 14:18:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 10869319 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8016A1575 for ; Mon, 25 Mar 2019 14:18:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E4F828FFE for ; Mon, 25 Mar 2019 14:18:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62AC829019; Mon, 25 Mar 2019 14:18:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E6F4D28FFE for ; Mon, 25 Mar 2019 14:18:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DD75D6E6B0; Mon, 25 Mar 2019 14:18:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A82B6E6AF for ; Mon, 25 Mar 2019 14:18:35 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id o10so77044wmc.1 for ; Mon, 25 Mar 2019 07:18:35 -0700 (PDT) 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=UakGg7pFINmeFLlNMB831/77cfd9ndMBEIB1YBWHGhc=; b=a8cMhZnBnPLHJynK0h0ZMFB/cFnCESen8bRfiCF8fqyEPvkTwvsENz22tp6nDCA5B0 PffPDRXfC0JCIFZ8T0IcoG7JNpTkQnwz8VXmlcOIHAq4W1Dc8IuT5b7CFmm2C9k0WcFW rxTXUM2y89MiS5WPzzXenKjwuNjxxhMLZUZarxMBBesJ8Z2GlvBl00Anq7sibm7SUH3m oAhwe3IMlyY6Jppu8RW2oXS4ikd9LvI4Gup0mmB7rtbS+RLbLA+41ZXuXdiQUSoKP6yG EM2SrigdZHQDP5foNQI046vSE93VHbulJYh1XvyqV0V68p/1nOmEfEaaCZAYR6f8vzQX 4gng== X-Gm-Message-State: APjAAAU8ze6MB4chPYPtNEsglErflKBz7aL6N0Vel8FWO5cY1lSV8UAh L1h5cDTfcFI1v3EnixhQ7vzL4p8HeIhY1g== X-Google-Smtp-Source: APXvYqzM4VcWDGeQXJKVYSJV2lhPRNdzzEFP02utOoGVpEFuCOSpGmR0y0I44/Qb9BOnnC5mfeAdwg== X-Received: by 2002:a05:600c:2055:: with SMTP id p21mr6456775wmg.118.1553523513566; Mon, 25 Mar 2019 07:18:33 -0700 (PDT) Received: from localhost.localdomain (176-150-251-154.abo.bbox.fr. [176.150.251.154]) by smtp.gmail.com with ESMTPSA id 132sm26976794wmd.30.2019.03.25.07.18.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 25 Mar 2019 07:18:32 -0700 (PDT) From: Neil Armstrong To: dri-devel@lists.freedesktop.org Subject: [PATCH 05/11] drm/meson: Add G12A support for OSD1 Plane Date: Mon, 25 Mar 2019 15:18:18 +0100 Message-Id: <20190325141824.21259-6-narmstrong@baylibre.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190325141824.21259-1-narmstrong@baylibre.com> References: <20190325141824.21259-1-narmstrong@baylibre.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UakGg7pFINmeFLlNMB831/77cfd9ndMBEIB1YBWHGhc=; b=QQdDUz/hynfYXaGL3Ko0DRhMpJQJwBuv9bgNshh7ja7IMkhdkDEpsc7gcoobUUMaf3 2Cm8Z7KCYfpz8lvYM8RvBeUU0AhjVhhqHaN6uI2UfaXGEfSoXfOLjxESmBu7HwiAcgro t24uuyGP9FMSCx7JkT8f3eY2eNQ7HAfsiqQSeEwKePBg3eHip1OPKeKuwUBvKJDvGdFM o3MarFPqIiD03de7r/9jm23tQspRcRbf+nGAfSkj+4zmC6xDhbapdUGwEPkvS4BvRH5z AIXuE3kj/wqIJmgryLie3nksdvXcJVCMp2ppwrFYRLSjfQJmO3g505s+CJrV+Vp7aFlB J5sw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, Neil Armstrong Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Amlogic G12A SoC supports now up to 3 OSD planes (1 more than the previous SoCs) and a brand new OSD plane blender module. This patch uses the same OSD1 plane G12A, using the exact same scaler and OSD1 setup registers, except using the new blender register to disable the plane. Signed-off-by: Neil Armstrong --- drivers/gpu/drm/meson/meson_plane.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c index b7786218cb10..bf8f1fab63aa 100644 --- a/drivers/gpu/drm/meson/meson_plane.c +++ b/drivers/gpu/drm/meson/meson_plane.c @@ -294,6 +294,13 @@ static void meson_plane_atomic_update(struct drm_plane *plane, priv->viu.osd1_blk0_cfg[3] = ((dest.x2 - 1) << 16) | dest.x1; priv->viu.osd1_blk0_cfg[4] = ((dest.y2 - 1) << 16) | dest.y1; + if (meson_vpu_is_compatible(priv, "amlogic,meson-g12a-vpu")) { + priv->viu.osd_blend_din0_scope_h = ((dest.x2 - 1) << 16) | dest.x1; + priv->viu.osd_blend_din0_scope_v = ((dest.y2 - 1) << 16) | dest.y1; + priv->viu.osb_blend0_size = dst_h << 16 | dst_w; + priv->viu.osb_blend1_size = dst_h << 16 | dst_w; + } + /* Update Canvas with buffer address */ gem = drm_fb_cma_get_gem_obj(fb, 0); @@ -320,8 +327,12 @@ static void meson_plane_atomic_disable(struct drm_plane *plane, struct meson_drm *priv = meson_plane->priv; /* Disable OSD1 */ - writel_bits_relaxed(VPP_OSD1_POSTBLEND, 0, - priv->io_base + _REG(VPP_MISC)); + if (meson_vpu_is_compatible(priv, "amlogic,meson-g12a-vpu")) + writel_bits_relaxed(BIT(0) | BIT(21), 0, + priv->io_base + _REG(VIU_OSD1_CTRL_STAT)); + else + writel_bits_relaxed(VPP_OSD1_POSTBLEND, 0, + priv->io_base + _REG(VPP_MISC)); meson_plane->enabled = false;