From patchwork Mon May 7 09:29:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 10383721 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 53BAF602D8 for ; Mon, 7 May 2018 09:29:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4627328720 for ; Mon, 7 May 2018 09:29:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 391FA2878C; Mon, 7 May 2018 09:29:44 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 6BF382874E for ; Mon, 7 May 2018 09:29:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751861AbeEGJ3m (ORCPT ); Mon, 7 May 2018 05:29:42 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:51388 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751764AbeEGJ3k (ORCPT ); Mon, 7 May 2018 05:29:40 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180507092937euoutp019fc0883904a03608d8491f64050569cd~sUsSQNwRx0115401154euoutp01U; Mon, 7 May 2018 09:29:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180507092937euoutp019fc0883904a03608d8491f64050569cd~sUsSQNwRx0115401154euoutp01U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1525685378; bh=Ew8l9zKiWy6ZF265zztnE8+MO3byNdQ9bZiItDFP6Ho=; h=From:To:Cc:Subject:Date:References:From; b=UetSfShkoRsUCz6shJLej2lffpCZX//Zw5wwD5iYrJObRp9jaUsE9ZVYfH5Lzfgmw s9kJaJY3WWyKuy4Ss6p9SJc+SeVbWLQ3Z5bHZQJfGWKtocn6kDUsea874arnqnDAnG 2T5KDvxbJywQGXMLN3H078fc83MI/5OJrQLV9dV8= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180507092936eucas1p27af025939b5ff7e9ae2c532ab8898ca8~sUsQ2jy8G0292302923eucas1p2K; Mon, 7 May 2018 09:29:36 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 1C.F2.05700.08C10FA5; Mon, 7 May 2018 10:29:36 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180507092935eucas1p2f7e72c96fc3951ca8b645a574b62f11c~sUsP1hGIL0291002910eucas1p2X; Mon, 7 May 2018 09:29:35 +0000 (GMT) X-AuditID: cbfec7f2-1c1ff70000011644-90-5af01c80588c Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 69.B9.04178.F7C10FA5; Mon, 7 May 2018 10:29:35 +0100 (BST) Received: from AMDC2768.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 <0P8C006B0QDA4I80@eusync1.samsung.com>; Mon, 07 May 2018 10:29:35 +0100 (BST) From: Andrzej Hajda To: Inki Dae Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, Hemanshu Srivastava Subject: [PATCH] drm/exynos/dsi: remove mode_set callback Date: Mon, 07 May 2018 11:29:28 +0200 Message-id: <20180507092928.4096-1-a.hajda@samsung.com> X-Mailer: git-send-email 2.17.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHIsWRmVeSWpSXmKPExsWy7djP87oNMh+iDNad4La4te4cq8XGGetZ La58fc9m8er8G2aLSfcnsFjMOL+PyWLtkbvsDuwe97uPM3n0bVnF6PF5k1wAcxSXTUpqTmZZ apG+XQJXRkPjI6aCKVIVFxvnsTcwNot1MXJySAiYSHx91sjYxcjFISSwglFi7+G3zBDOZ0aJ f89PMcFUzf2/jQkisYxRovPmFKiq/4wS22c9YgSpYhPQlPi7+SYbiC0ioCyxal87O0gRs0AT k8TzO/eAOjg4hAUsJe5O1QWpYRFQlfj//hsziM0rYC7RtuISC8Q2eYln0+eB9UoIPGSVOHR0 IhtEwkVi2ufN7BC2sMSr41ugbBmJzo6DUKdWS9x80cQC0dzBKHH/dztUs7XE4eMXWUFsZgE+ iUnbpoMdJCHAK9HRJgRhekjsPpYJUe0o8en0FrBqIYFYiU//vrFOYJRcwMiwilE8tbQ4Nz21 2DAvtVyvODG3uDQvXS85P3cTIzDWTv87/mkH49dLSYcYBTgYlXh4V0x5HyXEmlhWXJl7iFGC g1lJhJf/KFCINyWxsiq1KD++qDQntfgQozQHi5I4b5xGXZSQQHpiSWp2ampBahFMlomDU6qB UXYDy6XnJu1HI558D7w/o/KhXW/37SS2hKWzpa3mvzVUN3h8fkf3UoPM//rW9wKDHguxc/j+ qtgeK7E6wHr+dIlyS+WwhSJrFbndVK/EOSYzLv3bFGN4L2pT0fEb7Au2Rifv2HtCZLl4w9KA Wr4Py69uNHj4mNPyXf5RnkTdFWoJXbuFtefLKbEUZyQaajEXFScCAGNG6EaxAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKJMWRmVeSWpSXmKPExsVy+t/xy7r1Mh+iDKZ1iljcWneO1WLjjPWs Fle+vmezeHX+DbPFpPsTWCxmnN/HZLH2yF12B3aP+93HmTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEro6HxEVPBFKmKi43z2BsYm8W6GDk5JARMJOb+38bUxcjFISSwhFFi0pp1rBBOI5PE 7+arbCBVbAKaEn833wSzRQSUJVbta2cHKWIWaGKSePr4MEsXIweHsIClxN2puiA1LAKqEv/f f2MGsXkFzCXaVlxigdgmL/Fs+jz2CYxcCxgZVjGKpJYW56bnFhvqFSfmFpfmpesl5+duYgR6 ftuxn5t3MF7aGHyIUYCDUYmHd8WU91FCrIllxZW5hxglOJiVRHj5jwKFeFMSK6tSi/Lji0pz UosPMUpzsCiJ8543qIwSEkhPLEnNTk0tSC2CyTJxcEo1MDJesMw0jLJ3PnhGeE9P2ordtztN 3FiyV3uwe83NYbiQev3Xk6bd0r8mKq49crPueGntdJaQ622FZxZ1+RcvX/IgL3OZwIspE+TP czyWOP66da7I491hz/efrij8K+mq433+9YJDG7+eFTq2iW3PxE9Nhw1XxvpfmyEmmen0e2ZV 0Uv1Gob+id1KLMUZiYZazEXFiQCY3PtM+AEAAA== X-CMS-MailID: 20180507092935eucas1p2f7e72c96fc3951ca8b645a574b62f11c X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180507092935eucas1p2f7e72c96fc3951ca8b645a574b62f11c X-RootMTR: 20180507092935eucas1p2f7e72c96fc3951ca8b645a574b62f11c References: 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 The callback was used only to copy provided mode to context for later usage. Since the mode is always available from crtc atomic state this code can be removed. Signed-off-by: Andrzej Hajda --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 40 +++++++------------------ 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 7904ffa9abfb..eae44fd714f0 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -270,7 +270,6 @@ struct exynos_dsi { u32 lanes; u32 mode_flags; u32 format; - struct videomode vm; int state; struct drm_property *brightness; @@ -881,30 +880,30 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi) static void exynos_dsi_set_display_mode(struct exynos_dsi *dsi) { - struct videomode *vm = &dsi->vm; + struct drm_display_mode *m = &dsi->encoder.crtc->state->adjusted_mode; unsigned int num_bits_resol = dsi->driver_data->num_bits_resol; u32 reg; if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO) { reg = DSIM_CMD_ALLOW(0xf) - | DSIM_STABLE_VFP(vm->vfront_porch) - | DSIM_MAIN_VBP(vm->vback_porch); + | DSIM_STABLE_VFP(m->vsync_start - m->vdisplay) + | DSIM_MAIN_VBP(m->vtotal - m->vsync_end); exynos_dsi_write(dsi, DSIM_MVPORCH_REG, reg); - reg = DSIM_MAIN_HFP(vm->hfront_porch) - | DSIM_MAIN_HBP(vm->hback_porch); + reg = DSIM_MAIN_HFP(m->hsync_start - m->hdisplay) + | DSIM_MAIN_HBP(m->htotal - m->hsync_end); exynos_dsi_write(dsi, DSIM_MHPORCH_REG, reg); - reg = DSIM_MAIN_VSA(vm->vsync_len) - | DSIM_MAIN_HSA(vm->hsync_len); + reg = DSIM_MAIN_VSA(m->vsync_end - m->vsync_start) + | DSIM_MAIN_HSA(m->hsync_end - m->hsync_start); exynos_dsi_write(dsi, DSIM_MSYNC_REG, reg); } - reg = DSIM_MAIN_HRESOL(vm->hactive, num_bits_resol) | - DSIM_MAIN_VRESOL(vm->vactive, num_bits_resol); + reg = DSIM_MAIN_HRESOL(m->hdisplay, num_bits_resol) | + DSIM_MAIN_VRESOL(m->vdisplay, num_bits_resol); exynos_dsi_write(dsi, DSIM_MDRESOL_REG, reg); - dev_dbg(dsi->dev, "LCD size = %dx%d\n", vm->hactive, vm->vactive); + dev_dbg(dsi->dev, "LCD size = %dx%d\n", m->hdisplay, m->vdisplay); } static void exynos_dsi_set_display_enable(struct exynos_dsi *dsi, bool enable) @@ -1485,26 +1484,7 @@ static int exynos_dsi_create_connector(struct drm_encoder *encoder) return 0; } -static void exynos_dsi_mode_set(struct drm_encoder *encoder, - struct drm_display_mode *mode, - struct drm_display_mode *adjusted_mode) -{ - struct exynos_dsi *dsi = encoder_to_dsi(encoder); - struct videomode *vm = &dsi->vm; - struct drm_display_mode *m = adjusted_mode; - - vm->hactive = m->hdisplay; - vm->vactive = m->vdisplay; - vm->vfront_porch = m->vsync_start - m->vdisplay; - vm->vback_porch = m->vtotal - m->vsync_end; - vm->vsync_len = m->vsync_end - m->vsync_start; - vm->hfront_porch = m->hsync_start - m->hdisplay; - vm->hback_porch = m->htotal - m->hsync_end; - vm->hsync_len = m->hsync_end - m->hsync_start; -} - static const struct drm_encoder_helper_funcs exynos_dsi_encoder_helper_funcs = { - .mode_set = exynos_dsi_mode_set, .enable = exynos_dsi_enable, .disable = exynos_dsi_disable, };