From patchwork Thu Jan 29 11:15:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonyoung Shim X-Patchwork-Id: 5741511 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6E05F9F398 for ; Thu, 29 Jan 2015 11:15:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 627A920222 for ; Thu, 29 Jan 2015 11:15:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2FB432021F for ; Thu, 29 Jan 2015 11:15:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 490D56E4F7; Thu, 29 Jan 2015 03:15:34 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id 0EA006E4F7 for ; Thu, 29 Jan 2015 03:15:32 -0800 (PST) Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NIX005WAR9US350@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 29 Jan 2015 20:15:30 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.116]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id DA.ED.18484.2561AC45; Thu, 29 Jan 2015 20:15:30 +0900 (KST) X-AuditID: cbfee68f-f791c6d000004834-44-54ca16521358 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 38.21.09430.2561AC45; Thu, 29 Jan 2015 20:15:30 +0900 (KST) Received: from localhost.localdomain ([10.252.81.123]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NIX00DI2R9UPZ80@mmp2.samsung.com>; Thu, 29 Jan 2015 20:15:30 +0900 (KST) From: Joonyoung Shim To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/exynos: split exynos_plane_dpms function Date: Thu, 29 Jan 2015 20:15:30 +0900 Message-id: <1422530131-18122-1-git-send-email-jy0922.shim@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGLMWRmVeSWpSXmKPExsWyRsSkRDdI7FSIQcM3TYsrX9+zWUy6P4HF 4sW9iywWMya/ZHNg8bjffZzJo2/LKsYApigum5TUnMyy1CJ9uwSujPOrXrMVLJSvOPvhD0sD 42apLkZODgkBE4kb084xQthiEhfurWfrYuTiEBJYyigx9fIiFpiiRWd/sIHYQgLTGSVOTkqF KGpjknhz8xpYN5uAnsSdbceZQGwRAWWJvxNXgcWZBTwlVqyaBxYXFnCUaFjVBDaIRUBV4sa1 XrAaXgF3iQWX26GukJM4eWwyK8gCCYHLbBKNX/4xQzQISHybfAjoIg6ghKzEpgPMEPWSEgdX 3GCZwCi4gJFhFaNoakFyQXFSepGxXnFibnFpXrpecn7uJkZg8J3+96x/B+PdA9aHGAU4GJV4 eBMaT4YIsSaWFVfmHmI0BdowkVlKNDkfGOJ5JfGGxmZGFqYmpsZG5pZmSuK8C6V+BgsJpCeW pGanphakFsUXleakFh9iZOLglGpgPOx0u/NcBuO7uDVcM2a8mcagNGmv5YcPaxu/PxHcuvKA chH7uzpTn4jld/db1xw1KuyefCL/ffq74EDXRy88Q37IK3IYlfPcC5NpmnPGssL51tNg841/ m8O2z4m5qa6z0pyb4fjG5VdETzuyL2jTXbBSsO/CmqbLSoUha/y+PVpmH1t9nd3kkxJLcUai oRZzUXEiAP7DeyY5AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrALMWRmVeSWpSXmKPExsVy+t9jQd0gsVMhBn+vK1pc+fqezWLS/Qks Fi/uXWSxmDH5JZsDi8f97uNMHn1bVjEGMEU1MNpkpCampBYppOYl56dk5qXbKnkHxzvHm5oZ GOoaWlqYKynkJeam2iq5+AToumXmAK1SUihLzCkFCgUkFhcr6dthmhAa4qZrAdMYoesbEgTX Y2SABhLWMGacX/WarWChfMXZD39YGhg3S3UxcnJICJhILDr7gw3CFpO4cG89mC0kMJ1R4uSk 1C5GLiC7jUnizc1rjCAJNgE9iTvbjjOB2CICyhJ/J64CizMLeEqsWDUPLC4s4CjRsKoJbBCL gKrEjWu9YDW8Au4SCy63M0Isk5M4eWwy6wRG7gWMDKsYRVMLkguKk9JzjfSKE3OLS/PS9ZLz czcxgkP7mfQOxlUNFocYBTgYlXh4ExpPhgixJpYVV+YeYpTgYFYS4RUTOBUixJuSWFmVWpQf X1Sak1p8iNEUaPtEZinR5Hxg3OWVxBsam5gZWRqZG1oYGZsrifMq2beFCAmkJ5akZqemFqQW wfQxcXBKNTCG/bp1f2lDXHKoRa+j0sZumQiFF2ueVm69ymT0PDCMoVd/+YT7ytbJjPlzJ3Er u3WYGKnLLr7P9ILz1eU+u8wAnie/jOsjuZbfYZf/4nJg75croYsv32D/o5PB9ORudcTSPw68 sast5rnrSMwTzt245Gx7pLK/64TGk3bvMn5dPC0r93z3jClKLMUZiYZazEXFiQAYlacpgwIA AA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: sw0312.kim@samsung.com 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The exynos_plane_dpms can cause misunderstanding as using dpms term because it is irrelevant with dpms functionality of DRM. Split to functions fit for the one purpose instead of DPMS flags. Signed-off-by: Joonyoung Shim --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_plane.c | 38 +++++++++++++++++-------------- drivers/gpu/drm/exynos/exynos_drm_plane.h | 3 ++- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index a85c451..dac8f90 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -67,7 +67,7 @@ static void exynos_drm_crtc_commit(struct drm_crtc *crtc) if (exynos_crtc->ops->commit) exynos_crtc->ops->commit(exynos_crtc); - exynos_plane_dpms(crtc->primary, DRM_MODE_DPMS_ON); + exynos_plane_on(crtc->primary); } static bool @@ -255,7 +255,7 @@ static int exynos_drm_crtc_set_property(struct drm_crtc *crtc, exynos_drm_crtc_commit(crtc); break; case CRTC_MODE_BLANK: - exynos_plane_dpms(crtc->primary, DRM_MODE_DPMS_OFF); + exynos_plane_off(crtc->primary); break; default: break; diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 358cff6..aa87d79 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -145,30 +145,34 @@ void exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, exynos_crtc->ops->win_mode_set(exynos_crtc, exynos_plane); } -void exynos_plane_dpms(struct drm_plane *plane, int mode) +void exynos_plane_on(struct drm_plane *plane) { struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(plane->crtc); - if (mode == DRM_MODE_DPMS_ON) { - if (exynos_plane->enabled) - return; + if (exynos_plane->enabled) + return; - if (exynos_crtc->ops->win_enable) - exynos_crtc->ops->win_enable(exynos_crtc, - exynos_plane->zpos); + if (exynos_crtc->ops->win_enable) + exynos_crtc->ops->win_enable(exynos_crtc, + exynos_plane->zpos); - exynos_plane->enabled = true; - } else { - if (!exynos_plane->enabled) - return; + exynos_plane->enabled = true; +} - if (exynos_crtc->ops->win_disable) - exynos_crtc->ops->win_disable(exynos_crtc, - exynos_plane->zpos); +void exynos_plane_off(struct drm_plane *plane) +{ + struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); + struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(plane->crtc); - exynos_plane->enabled = false; - } + if (!exynos_plane->enabled) + return; + + if (exynos_crtc->ops->win_disable) + exynos_crtc->ops->win_disable(exynos_crtc, + exynos_plane->zpos); + + exynos_plane->enabled = false; } int @@ -199,7 +203,7 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, static int exynos_disable_plane(struct drm_plane *plane) { - exynos_plane_dpms(plane, DRM_MODE_DPMS_OFF); + exynos_plane_off(plane); return 0; } diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.h b/drivers/gpu/drm/exynos/exynos_drm_plane.h index 59d4075..c778295 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.h +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.h @@ -20,7 +20,8 @@ int exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, unsigned int crtc_w, unsigned int crtc_h, uint32_t src_x, uint32_t src_y, uint32_t src_w, uint32_t src_h); -void exynos_plane_dpms(struct drm_plane *plane, int mode); +void exynos_plane_on(struct drm_plane *plane); +void exynos_plane_off(struct drm_plane *plane); struct drm_plane *exynos_plane_init(struct drm_device *dev, unsigned long possible_crtcs, enum drm_plane_type type);