From patchwork Wed Oct 16 19:26:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 3057331 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A192BBF924 for ; Wed, 16 Oct 2013 20:42:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9353820456 for ; Wed, 16 Oct 2013 20:41:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7BA54201F9 for ; Wed, 16 Oct 2013 20:41:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A8EF5E74A4 for ; Wed, 16 Oct 2013 13:41:56 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qe0-f47.google.com (mail-qe0-f47.google.com [209.85.128.47]) by gabe.freedesktop.org (Postfix) with ESMTP id 8A91FE778F for ; Wed, 16 Oct 2013 12:27:19 -0700 (PDT) Received: by mail-qe0-f47.google.com with SMTP id b4so1033343qen.6 for ; Wed, 16 Oct 2013 12:27:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2J3I4aBcDzmt+D8Wl6geT+Bx0EiuoluJD8ugtN+/++U=; b=ajYxTW5+B+UIUHBTypC8kg+X7XsHOAl2euFNmPu06DI+gy9NnIT9i0AwEK0R57K2os uRsbDMp1qZ2QEyiLHNv9OIrvIZmc2Gqg0O+dHwhQ6/7buWCmy3CDvOMtCaYJ3LJCMiUh t07zHFJetUjOBbd+gux+/KEl374tfizhqo78M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2J3I4aBcDzmt+D8Wl6geT+Bx0EiuoluJD8ugtN+/++U=; b=cDCAHzNuEIrxgfuQk0ZsjzNHXSGfrRGWHge9jNvjhq6NNugwFikXyuGlvwbkMgMwzv UV9Fqvt9TL7e/Gomaupf6HXai17pv2TRKXBDdQwu8hfBnUXlOkVgvf1S6XnVExC+uwgr 1CZFKgO4wURjLIWxw9aJaMFiPg79bvlX0lOSWrZm0L1kYTgbEC2zLkSHQ0umZS4/eJOt T/kq6dRC4dAl8yyBdwrH9dF/2l/+GqhtHELAJq+SMu4X45gTkAzHYozCeKGuDPALFedK eK4fXYI09PE14RiSAAsczoAL02qwuopidslImcYsHk+4QfQg+TFuB+HtMgt7U/8RHScx 20Jg== X-Gm-Message-State: ALoCoQmZ8xS9pW0mq9KOyISd+21n2ue9vIymvbqK28hVM2AtlMzBLWwMElBAv/i3dOAEAXMOxTvy X-Received: by 10.224.63.199 with SMTP id c7mr7134663qai.74.1381951639328; Wed, 16 Oct 2013 12:27:19 -0700 (PDT) Received: from seanpaul-glaptop.roam.corp.google.com (cpe-173-095-180-236.nc.res.rr.com. [173.95.180.236]) by mx.google.com with ESMTPSA id 4sm167771575qak.11.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Oct 2013 12:27:18 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, inki.dae@samsung.com Subject: [PATCH v2 07/26] drm/exynos: Remove apply manager callback Date: Wed, 16 Oct 2013 15:26:37 -0400 Message-Id: <1381951616-12548-8-git-send-email-seanpaul@chromium.org> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1381951616-12548-1-git-send-email-seanpaul@chromium.org> References: <1381951616-12548-1-git-send-email-seanpaul@chromium.org> Cc: marcheu@chromium.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 This patch removes the apply() manager callback in favor of putting the relevant commits in the individual drivers. This will mitigate some of the difference between the suspend/resume path and the dpms path Signed-off-by: Sean Paul --- Changes in v2: - This was previously in another patch, but moved since it warrants its own drivers/gpu/drm/exynos/exynos_drm_drv.h | 2 -- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 6 ------ drivers/gpu/drm/exynos/exynos_drm_fimd.c | 22 +++++----------------- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 17 ----------------- drivers/gpu/drm/exynos/exynos_hdmi.c | 1 + drivers/gpu/drm/exynos/exynos_mixer.c | 2 ++ 6 files changed, 8 insertions(+), 42 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 8eb8b83..bff432a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -146,7 +146,6 @@ struct exynos_drm_display_ops { * * @initialize: initializes the manager with drm_dev * @dpms: control device power. - * @apply: set timing, vblank and overlay data to registers. * @mode_fixup: fix mode data comparing to hw specific display mode. * @mode_set: convert drm_display_mode to hw specific display mode and * would be called by encoder->mode_set(). @@ -166,7 +165,6 @@ struct exynos_drm_manager_ops { int (*initialize)(struct exynos_drm_manager *mgr, struct drm_device *drm_dev); void (*dpms)(struct exynos_drm_manager *mgr, int mode); - void (*apply)(struct exynos_drm_manager *mgr); void (*mode_fixup)(struct exynos_drm_manager *mgr, struct drm_connector *connector, const struct drm_display_mode *mode, diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c index ec627fa..19ee84d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c @@ -57,8 +57,6 @@ static void exynos_drm_connector_power(struct drm_encoder *encoder, int mode) static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode) { struct drm_device *dev = encoder->dev; - struct exynos_drm_manager *manager = exynos_drm_get_manager(encoder); - struct exynos_drm_manager_ops *manager_ops = manager->ops; struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder); DRM_DEBUG_KMS("encoder dpms: %d\n", mode); @@ -72,10 +70,6 @@ static void exynos_drm_encoder_dpms(struct drm_encoder *encoder, int mode) switch (mode) { case DRM_MODE_DPMS_ON: - if (manager_ops && manager_ops->apply) - if (!exynos_encoder->updated) - manager_ops->apply(manager); - exynos_drm_connector_power(encoder, mode); exynos_encoder->dpms = mode; break; diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 2769eb3..f0ac1d5 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -672,7 +672,6 @@ static void fimd_wait_for_vblank(struct exynos_drm_manager *mgr) static struct exynos_drm_manager_ops fimd_manager_ops = { .initialize = fimd_mgr_initialize, .dpms = fimd_dpms, - .apply = fimd_apply, .commit = fimd_commit, .enable_vblank = fimd_enable_vblank, .disable_vblank = fimd_disable_vblank, @@ -883,6 +882,8 @@ static int fimd_activate(struct exynos_drm_manager *mgr, bool enable) fimd_enable_vblank(mgr); fimd_window_resume(dev); + + fimd_apply(mgr); } else { fimd_window_suspend(dev); @@ -1037,23 +1038,10 @@ static int fimd_resume(struct device *dev) * of pm runtime would still be 1 so in this case, fimd driver * should be on directly not drawing on pm runtime interface. */ - if (!pm_runtime_suspended(dev)) { - int ret; + if (pm_runtime_suspended(dev)) + return 0; - ret = fimd_activate(mgr, true); - if (ret < 0) - return ret; - - /* - * in case of dpms on(standby), fimd_apply function will - * be called by encoder's dpms callback to update fimd's - * registers but in case of sleep wakeup, it's not. - * so fimd_apply function should be called at here. - */ - fimd_apply(mgr); - } - - return 0; + return fimd_activate(mgr, true); } #endif diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c index ca0a87f..c5de00a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c @@ -302,22 +302,6 @@ static void drm_hdmi_dpms(struct exynos_drm_manager *mgr, int mode) hdmi_ops->dpms(ctx->hdmi_ctx->ctx, mode); } -static void drm_hdmi_apply(struct exynos_drm_manager *mgr) -{ - struct drm_hdmi_context *ctx = mgr->ctx; - int i; - - for (i = 0; i < MIXER_WIN_NR; i++) { - if (!ctx->enabled[i]) - continue; - if (mixer_ops && mixer_ops->win_commit) - mixer_ops->win_commit(ctx->mixer_ctx->ctx, i); - } - - if (hdmi_ops && hdmi_ops->commit) - hdmi_ops->commit(ctx->hdmi_ctx->ctx); -} - static void drm_mixer_win_mode_set(struct exynos_drm_manager *mgr, struct exynos_drm_overlay *overlay) { @@ -362,7 +346,6 @@ static void drm_mixer_win_disable(struct exynos_drm_manager *mgr, int zpos) static struct exynos_drm_manager_ops drm_hdmi_manager_ops = { .initialize = drm_hdmi_mgr_initialize, .dpms = drm_hdmi_dpms, - .apply = drm_hdmi_apply, .enable_vblank = drm_hdmi_enable_vblank, .disable_vblank = drm_hdmi_disable_vblank, .wait_for_vblank = drm_hdmi_wait_for_vblank, diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index a3fba8e..94b1e0c 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -1700,6 +1700,7 @@ static void hdmi_poweron(struct hdmi_context *hdata) clk_prepare_enable(res->sclk_hdmi); hdmiphy_poweron(hdata); + hdmi_commit(hdata); } static void hdmi_poweroff(struct hdmi_context *hdata) diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 2f204c1..60935c4 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -899,6 +899,8 @@ static void mixer_window_resume(struct mixer_context *ctx) win_data = &ctx->win_data[i]; win_data->enabled = win_data->resume; win_data->resume = false; + if (win_data->enabled) + mixer_win_commit(ctx, i); } }