From patchwork Thu Dec 6 09:38:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10715517 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 0BEBD14E2 for ; Thu, 6 Dec 2018 09:39:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFC772DEF3 for ; Thu, 6 Dec 2018 09:39:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3DE82DF88; Thu, 6 Dec 2018 09:39:10 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B4A32DF95 for ; Thu, 6 Dec 2018 09:39:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729382AbeLFJjJ (ORCPT ); Thu, 6 Dec 2018 04:39:09 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:59888 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729385AbeLFJjJ (ORCPT ); Thu, 6 Dec 2018 04:39:09 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181206093908euoutp01fcc2ae537c585c762333347a5c87077e~ttOZBCysl0031000310euoutp01Q; Thu, 6 Dec 2018 09:39:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181206093908euoutp01fcc2ae537c585c762333347a5c87077e~ttOZBCysl0031000310euoutp01Q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1544089148; bh=6J10P2D3biHJIelxv3U2Zcp9XDw2G1ob3LSmL5qmouw=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=medWKVHtvWnadhKse8+ZmsdDn0TQJREbvdm04jhfqziGMHFzuMeJH3bV9NxrJI64+ cDT4sER1Vrr98dmUh8kZsUrz6so1V63oCDFVP5bB6tispIxLSozV6CPvtv+hZd48sF PFFxUU6CMqvAIsArsnTiKaYgV1xhKReAAU+6SloQ= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181206093907eucas1p1661640a7d941d6debb94ebaf826b9127~ttOYhPzUk0209502095eucas1p1k; Thu, 6 Dec 2018 09:39:07 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 5D.85.04806.B3EE80C5; Thu, 6 Dec 2018 09:39:07 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181206093906eucas1p1ab20b4dabdb0a5e32c1e639cf38b0357~ttOXqx3wb0095000950eucas1p1n; Thu, 6 Dec 2018 09:39:06 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-f1-5c08ee3b86c3 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id EB.AE.04284.A3EE80C5; Thu, 6 Dec 2018 09:39:06 +0000 (GMT) Received: from AMDC3748.DIGITAL.local ([106.120.43.17]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PJB000UL6T4U830@eusync1.samsung.com>; Thu, 06 Dec 2018 09:39:06 +0000 (GMT) From: Andrzej Hajda To: Inki Dae Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 3/3] drm/exynos/fimd: add dynamic zpos support Date: Thu, 06 Dec 2018 10:38:57 +0100 Message-id: <20181206093857.22324-4-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181206093857.22324-1-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprJIsWRmVeSWpSXmKPExsWy7djP87rW7zhiDFrnCFncWneO1WLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnL7sDmcb/7OJNH35ZVjB6fN8kFMEdx2aSk5mSWpRbp2yVw ZbzsPcpcMFmk4s/HzAbGpwJdjJwcEgImEj9PPWTqYuTiEBJYwShx7P4mFpCEkMBnRokLiyRg ima17mGDKFrGKNHz5SlUx39GiV1fv4J1sAloSvzdfJMNxBYRUJZYta+dHaSIWeASo8Trk92M IAlhATuJWUsPATVwcLAIqEpcuqgIEuYVsJBY9qGNCWKbvMTqDQeYQWxOAUuJ92uesIDMkRD4 yCrx6OkPdogiF4k9XdtYIGxhiVfHt0DFZSQ6Ow5CDaqXaJp5hRmiuYNR4sTi5WwQCWuJw8cv soLYzAJ8EpO2TWcGOUhCgFeio00IosRD4uq/FawQX/YwShyftoVpAqPkAkaGVYziqaXFuemp xcZ5qeV6xYm5xaV56XrJ+bmbGIERdvrf8a87GPf9STrEKMDBqMTD++IBe4wQa2JZcWXuIUYJ DmYlEV4GPY4YId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rzVDA+ihQTSE0tSs1NTC1KLYLJMHJxS DYyynjtOKLpYvPx66HPv1XWWb8we9WY7KpUlbP9y8MD5nTltdr1HPhVdv8YiwjOhwqnOT8Vy 6sWuUPtEISNbvbJDaxsN/xnEBt+0LTRLuNHgsygj6tUBto+GCRdevZuh+fVhh/9a2V+WDO+O XLQ9uOVq0SoPjUbVluZyj6syISYiX6f+lrBr7FBiKc5INNRiLipOBADkh+JMrAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGJMWRmVeSWpSXmKPExsVy+t/xy7pW7zhiDKZvNbK4te4cq8XGGetZ La58fc9mMen+BBaLGef3MVmsPXKX3YHN4373cSaPvi2rGD0+b5ILYI7isklJzcksSy3St0vg ynjZe5S5YLJIxZ+PmQ2MTwW6GDk5JARMJGa17mEDsYUEljBKPH+v2MXIBWQ3Mkk8XrCKFSTB JqAp8XfzTbAiEQFliVX72tlBipgFrjBKtH/rYgdJCAvYScxaeoili5GDg0VAVeLSRUWQMK+A hcSyD21MEMvkJVZvOMAMYnMKWEq8X/OEBWKxhcSk5TvZJzDyLGBkWMUoklpanJueW2yoV5yY W1yal66XnJ+7iREYGtuO/dy8g/HSxuBDjAIcjEo8vC8esMcIsSaWFVfmHmKU4GBWEuFl0OOI EeJNSaysSi3Kjy8qzUktPsQozcGiJM573qAySkggPbEkNTs1tSC1CCbLxMEp1cBYfGLBeVMJ bh72j0/dg1wiuebMOibqK6Xo2jFPvjNjs0P/xNC9T4zzfos+j51z/VX7wRdx7uopQif2K9c/ 9S/5s0GqaM9LxYgTJ0/s9ozc4fbp/q/C7mdbI28sWvw0XGnqBimLK4unTb2y85DnLJ1NFc8O BBn/n2DWmMxq5OdclLK/TT2/L7FLiaU4I9FQi7moOBEAUGvZbwkCAAA= X-CMS-MailID: 20181206093906eucas1p1ab20b4dabdb0a5e32c1e639cf38b0357 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181206093906eucas1p1ab20b4dabdb0a5e32c1e639cf38b0357 References: <20181206093857.22324-1-a.hajda@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP FIMD has fixed hardware window order. To implement dynamic zpos normalized_zpos of active plane has to be connected to window number, and remaining windows have to be disabled. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 226127f35052..c4e2129e0e3f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -706,6 +706,12 @@ static void fimd_atomic_flush(struct exynos_drm_crtc *crtc) if (ctx->suspended) return; + for (i = hweight32(crtc->base.state->plane_mask); i < WINDOWS_NR; i++) { + if (!(readl(ctx->regs + WINCON(i)) & WINCONx_ENWIN)) + break; + fimd_disable_win(ctx, i); + } + for (i = 0; i < WINDOWS_NR; i++) fimd_shadow_protect_win(ctx, i, false); @@ -722,7 +728,7 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc, dma_addr_t dma_addr; unsigned long val, size, offset; unsigned int last_x, last_y, buf_offsize, line_size; - unsigned int win = plane->index; + unsigned int win = state->base.normalized_zpos; unsigned int cpp = fb->format->cpp[0]; unsigned int pitch = fb->pitches[0]; @@ -804,17 +810,6 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc, atomic_set(&ctx->win_updated, 1); } -static void fimd_disable_plane(struct exynos_drm_crtc *crtc, - struct exynos_drm_plane *plane) -{ - struct fimd_context *ctx = crtc->ctx; - - if (ctx->suspended) - return; - - fimd_disable_win(ctx, plane->index); -} - static void fimd_enable(struct exynos_drm_crtc *crtc) { struct fimd_context *ctx = crtc->ctx; @@ -933,7 +928,6 @@ static const struct exynos_drm_crtc_ops fimd_crtc_ops = { .disable_vblank = fimd_disable_vblank, .atomic_begin = fimd_atomic_begin, .update_plane = fimd_update_plane, - .disable_plane = fimd_disable_plane, .atomic_flush = fimd_atomic_flush, .atomic_check = fimd_atomic_check, .te_handler = fimd_te_handler, @@ -987,6 +981,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data) ctx->configs[i].num_pixel_formats = ARRAY_SIZE(fimd_formats); ctx->configs[i].zpos = i; ctx->configs[i].type = fimd_win_types[i]; + ctx->configs[i].capabilities = EXYNOS_DRM_PLANE_CAP_ZPOS; ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, &ctx->configs[i]); if (ret)