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: 10869323 X-Patchwork-Delegate: neil.armstrong@linaro.org 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 435531575 for ; Mon, 25 Mar 2019 14:18:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CA4428FFE for ; Mon, 25 Mar 2019 14:18:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2144329019; Mon, 25 Mar 2019 14:18:47 +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,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C1C322900F for ; Mon, 25 Mar 2019 14:18:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fXPCFpstugm4vocIP0Q/KkaeUj4xXDToKl8Tc9hV/vs=; b=YkykYeyib9GLJc Aw3p76NYDiM470HUGQ7Jcaj4MsAl5rGt1Y5dD4vrbr1DV6MC0MTVupHFBMlVMN2qYJjOFfs0NeNpQ fH8+O5eTu5kb6mTVAh8q4bh1Ca7VeQeLobzU/kY+fTBYQPOUjQ3ccjXsIMwAF4YIHPPCKNdq6o3gV exr8PxgcR5hy3K0ob3ADmwSrqqjuqPGRVbLVsN9YL0bTzxF1/ijab70hngI+q+WQk5OKh5XYCO+wb gMQ7o4zCjOddccPekOgGWEZCudQzIWsBr2CJKpCgor55T9mmmUExc14GK3vm03BwKAQlbT5aYM2wi /xYOVHv5vYy+TZiq4/lQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8QR3-0007lY-Jv; Mon, 25 Mar 2019 14:18:45 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h8QQv-0007fd-AS for linux-amlogic@lists.infradead.org; Mon, 25 Mar 2019 14:18:42 +0000 Received: by mail-wm1-x342.google.com with SMTP id v14so9295861wmf.2 for ; Mon, 25 Mar 2019 07:18:34 -0700 (PDT) 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-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=NdGjmYdcoO3zwU7ihYSqkOVn2hZTEMUi8wX745dm1C3jUec1os1KN9wxUdOiIJplsP EBEr00G9Uaq5rZ1THUJEV73r94UWWUJduNl6uGdnPwoO8D5EhcHy4+dbYz86NdzL638b OYt/bqGHBaqse6KY+kEsaIe/xpHyX6ePkx8025GOkjKBE8JB1bEWHDPkGwOxiagw53NW 0g+DJaM7sSmhKVX6FtMn2zAmh9bvkoeJLJ8Ao/njQB7jzxGvAiYFRqhzm/M5/+1qFdiC cEjNeF0CCDpsRxGtTsOmnM4cYtvR57nmS6FsAQmCo5g/uxOafNay0GwQwIyT7zBeOAEt abjg== X-Gm-Message-State: APjAAAVrigKfsjTRvS7H7+ncIVxCDfuR+F2IbCQC5eAhku6vh5gWoHEN Ax2Wf0ik9aIHCbCzavu9blj2Gw== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190325_071837_357277_BDC924E1 X-CRM114-Status: GOOD ( 12.86 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, Neil Armstrong Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org 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;