From patchwork Thu Jun 4 09:02:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 6545791 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 576CCC0434 for ; Thu, 4 Jun 2015 11:07:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5546D207BD for ; Thu, 4 Jun 2015 11:07:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 59681206D6 for ; Thu, 4 Jun 2015 11:07:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6570E6EB16; Thu, 4 Jun 2015 04:06:41 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by gabe.freedesktop.org (Postfix) with ESMTP id ECA6A6EAD8 for ; Thu, 4 Jun 2015 02:04:32 -0700 (PDT) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t5494U4W011473; Thu, 4 Jun 2015 04:04:30 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t5494Up8030274; Thu, 4 Jun 2015 04:04:30 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Thu, 4 Jun 2015 04:04:29 -0500 Received: from deskari.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t5493Ywf014785; Thu, 4 Jun 2015 04:04:29 -0500 From: Tomi Valkeinen To: , Laurent Pinchart Subject: [PATCHv2 39/45] drm: omapdrm: inline omap_plane_setup into update/disable Date: Thu, 4 Jun 2015 12:02:56 +0300 Message-ID: <1433408582-9828-40-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1433408582-9828-1-git-send-email-tomi.valkeinen@ti.com> References: <1433408582-9828-1-git-send-email-tomi.valkeinen@ti.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 04 Jun 2015 04:06:34 -0700 Cc: Tomi Valkeinen 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: , 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 At the moment we have omap_plane_setup() function which handles both enabling (and configuring) and disabling the plane. With atomic modesetting we have separate hooks for plane enable/config and disable. This patch moves the code from omap_plane_setup() to omap_plane_atomic_update() and omap_plane_atomic_disable(). Signed-off-by: Tomi Valkeinen Acked-by: Laurent Pinchart --- drivers/gpu/drm/omapdrm/omap_plane.c | 44 ++++++++++++++---------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index a8e617f9f2af..b13fb2fd4a9a 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c @@ -58,7 +58,22 @@ to_omap_plane_state(struct drm_plane_state *state) return container_of(state, struct omap_plane_state, base); } -static void omap_plane_setup(struct drm_plane *plane) +static int omap_plane_prepare_fb(struct drm_plane *plane, + struct drm_framebuffer *fb, + const struct drm_plane_state *new_state) +{ + return omap_framebuffer_pin(fb); +} + +static void omap_plane_cleanup_fb(struct drm_plane *plane, + struct drm_framebuffer *fb, + const struct drm_plane_state *old_state) +{ + omap_framebuffer_unpin(fb); +} + +static void omap_plane_atomic_update(struct drm_plane *plane, + struct drm_plane_state *old_state) { struct omap_plane *omap_plane = to_omap_plane(plane); struct drm_plane_state *state = plane->state; @@ -69,11 +84,6 @@ static void omap_plane_setup(struct drm_plane *plane) DBG("%s, crtc=%p fb=%p", omap_plane->name, state->crtc, state->fb); - if (!state->crtc) { - dispc_ovl_enable(omap_plane->id, false); - return; - } - memset(&info, 0, sizeof(info)); info.rotation_type = OMAP_DSS_ROT_DMA; info.rotation = OMAP_DSS_ROT_0; @@ -128,26 +138,6 @@ static void omap_plane_setup(struct drm_plane *plane) dispc_ovl_enable(omap_plane->id, true); } -static int omap_plane_prepare_fb(struct drm_plane *plane, - struct drm_framebuffer *fb, - const struct drm_plane_state *new_state) -{ - return omap_framebuffer_pin(fb); -} - -static void omap_plane_cleanup_fb(struct drm_plane *plane, - struct drm_framebuffer *fb, - const struct drm_plane_state *old_state) -{ - omap_framebuffer_unpin(fb); -} - -static void omap_plane_atomic_update(struct drm_plane *plane, - struct drm_plane_state *old_state) -{ - omap_plane_setup(plane); -} - static void omap_plane_atomic_disable(struct drm_plane *plane, struct drm_plane_state *old_state) { @@ -158,7 +148,7 @@ static void omap_plane_atomic_disable(struct drm_plane *plane, omap_state->zorder = plane->type == DRM_PLANE_TYPE_PRIMARY ? 0 : omap_plane->id; - omap_plane_setup(plane); + dispc_ovl_enable(omap_plane->id, false); } static const struct drm_plane_helper_funcs omap_plane_helper_funcs = {