From patchwork Mon Nov 27 20:57:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?= X-Patchwork-Id: 10078967 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 18E996056A for ; Tue, 28 Nov 2017 08:13:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0094229149 for ; Tue, 28 Nov 2017 08:13:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E788D291AA; Tue, 28 Nov 2017 08:13:23 +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=-4.2 required=2.0 tests=BAYES_00, 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 A080929149 for ; Tue, 28 Nov 2017 08:13:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 144FD6E553; Tue, 28 Nov 2017 08:11:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.siol.net (mailoutvs3.siol.net [213.250.19.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C9406E3C9 for ; Mon, 27 Nov 2017 20:58:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTP id 51453521758; Mon, 27 Nov 2017 21:58:38 +0100 (CET) X-Virus-Scanned: amavisd-new at psrvmta09.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta09.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ICnCA1VFsMXY; Mon, 27 Nov 2017 21:58:37 +0100 (CET) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTPS id C1646521749; Mon, 27 Nov 2017 21:58:37 +0100 (CET) Received: from localhost.localdomain (cpe-86-58-68-135.ftth.triera.net [86.58.68.135]) (Authenticated sender: 031275009) by mail.siol.net (Postfix) with ESMTPSA id 79DAA521756; Mon, 27 Nov 2017 21:58:35 +0100 (CET) From: Jernej Skrabec To: maxime.ripard@free-electrons.com Subject: [PATCH 17/17] [DO NOT MERGE]drm/sun4i: Change zpos of bottom VI plane Date: Mon, 27 Nov 2017 21:57:50 +0100 Message-Id: <20171127205750.19277-18-jernej.skrabec@siol.net> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171127205750.19277-1-jernej.skrabec@siol.net> References: <20171127205750.19277-1-jernej.skrabec@siol.net> X-Mailman-Approved-At: Tue, 28 Nov 2017 08:11:00 +0000 Cc: airlied@linux.ie, linux-sunxi@googlegroups.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, wens@csie.org, linux-arm-kernel@lists.infradead.org, icenowy@aosc.io X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Change zpos of VI plane so it is above primary. Clearly this works only if mixer supports only one VI plane, but it is good enough for testing and developing. Proper solution with zpos property should be developed instead. Signed-off-by: Jernej Skrabec --- drivers/gpu/drm/sun4i/sun8i_mixer.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c index 4d2b42804008..041b7136175c 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -38,6 +38,8 @@ struct de2_fmt_info { enum sun8i_csc_mode csc; }; +static int lmap[] = {1, 0, 2, 3, 4}; + static const struct de2_fmt_info de2_formats[] = { { .drm_fmt = DRM_FORMAT_ARGB8888, @@ -294,13 +296,13 @@ void sun8i_mixer_ui_layer_enable(struct sun8i_mixer *mixer, SUN8I_MIXER_CHAN_UI_LAYER_ATTR_EN, val); if (enable) - val = SUN8I_MIXER_BLEND_PIPE_CTL_EN(layer); + val = SUN8I_MIXER_BLEND_PIPE_CTL_EN(lmap[layer]); else val = 0; regmap_update_bits(mixer->engine.regs, SUN8I_MIXER_BLEND_PIPE_CTL, - SUN8I_MIXER_BLEND_PIPE_CTL_EN(layer), val); + SUN8I_MIXER_BLEND_PIPE_CTL_EN(lmap[layer]), val); } void sun8i_mixer_vi_layer_enable(struct sun8i_mixer *mixer, @@ -321,13 +323,13 @@ void sun8i_mixer_vi_layer_enable(struct sun8i_mixer *mixer, SUN8I_MIXER_CHAN_VI_LAYER_ATTR_EN, val); if (enable) - val = SUN8I_MIXER_BLEND_PIPE_CTL_EN(layer); + val = SUN8I_MIXER_BLEND_PIPE_CTL_EN(lmap[layer]); else val = 0; regmap_update_bits(mixer->engine.regs, SUN8I_MIXER_BLEND_PIPE_CTL, - SUN8I_MIXER_BLEND_PIPE_CTL_EN(layer), val); + SUN8I_MIXER_BLEND_PIPE_CTL_EN(lmap[layer]), val); } int sun8i_mixer_update_ui_layer_coord(struct sun8i_mixer *mixer, @@ -411,10 +413,10 @@ int sun8i_mixer_update_ui_layer_coord(struct sun8i_mixer *mixer, state->dst.x1, state->dst.y1); DRM_DEBUG_DRIVER("Layer destination size W: %d H: %d\n", dst_w, dst_h); regmap_write(mixer->engine.regs, - SUN8I_MIXER_BLEND_ATTR_COORD(layer), + SUN8I_MIXER_BLEND_ATTR_COORD(lmap[layer]), SUN8I_MIXER_COORD(state->dst.x1, state->dst.y1)); regmap_write(mixer->engine.regs, - SUN8I_MIXER_BLEND_ATTR_INSIZE(layer), + SUN8I_MIXER_BLEND_ATTR_INSIZE(lmap[layer]), outsize); return 0; @@ -499,10 +501,10 @@ int sun8i_mixer_update_vi_layer_coord(struct sun8i_mixer *mixer, state->dst.x1, state->dst.y1); DRM_DEBUG_DRIVER("Layer destination size W: %d H: %d\n", dst_w, dst_h); regmap_write(mixer->engine.regs, - SUN8I_MIXER_BLEND_ATTR_COORD(layer), + SUN8I_MIXER_BLEND_ATTR_COORD(lmap[layer]), SUN8I_MIXER_COORD(state->dst.x1, state->dst.y1)); regmap_write(mixer->engine.regs, - SUN8I_MIXER_BLEND_ATTR_INSIZE(layer), + SUN8I_MIXER_BLEND_ATTR_INSIZE(lmap[layer]), outsize); return 0; @@ -771,7 +773,7 @@ static int sun8i_mixer_bind(struct device *dev, struct device *master, SUN8I_MIXER_BLEND_COLOR_BLACK); /* Fixed zpos for now */ - regmap_write(mixer->engine.regs, SUN8I_MIXER_BLEND_ROUTE, 0x43210); + regmap_write(mixer->engine.regs, SUN8I_MIXER_BLEND_ROUTE, 0x43201); plane_cnt = mixer->cfg->vi_num + mixer->cfg->ui_num; for (i = 0; i < plane_cnt; i++)