From patchwork Wed Nov 26 18:10:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 5387281 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 842159F2F5 for ; Wed, 26 Nov 2014 18:11:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A1DF0201EF for ; Wed, 26 Nov 2014 18:11:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B1815201FA for ; Wed, 26 Nov 2014 18:11:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C2C2A6E66C; Wed, 26 Nov 2014 10:11:19 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by gabe.freedesktop.org (Postfix) with ESMTP id B6F816E66C for ; Wed, 26 Nov 2014 10:11:18 -0800 (PST) Received: by mail-qc0-f182.google.com with SMTP id r5so2434546qcx.41 for ; Wed, 26 Nov 2014 10:11:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+jVNA8oZev3aBFyQP73hoSbF+rK4UZw/qhqg33Gz0zI=; b=Iul1TjE36i9/tk+9WhWiaxqtp8tQD6xEKglWs+NseEtWlQtnZzwTzdq2wIRpdcryR9 eRVOWgRAzN8t1RwQYWiw4BnupnapHF3iHD2VjMgLpDvDgflkMC9+PVzPNFFIljEMzMcv AE7G1xYU3ZXTHEIttmicqaK1APYNd4yrGQ8dUdhBWNO/xVJnOW06uAUsesR0dqSnEqnr plg4Nts5sFK+PDHP8iWoTv3KnypUGRZjB1WQWmR7xZYNKSwk/AuO0u911ltLRkN7bnnY Hxuo6NCwaOCpHPrzt5h+yU3qGzDpp5MYlGKdDs2ofxn9dCR6FueQWem2LNSbBe79S2lu 9Lpw== X-Received: by 10.224.21.133 with SMTP id j5mr48188253qab.83.1417025478279; Wed, 26 Nov 2014 10:11:18 -0800 (PST) Received: from localhost.localdomain ([191.8.93.69]) by mx.google.com with ESMTPSA id n8sm4483509qaz.40.2014.11.26.10.11.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Nov 2014 10:11:17 -0800 (PST) From: Gustavo Padovan To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 4/6] drm/exynos: unify plane update on exynos_update_plane() Date: Wed, 26 Nov 2014 16:10:52 -0200 Message-Id: <1417025454-3916-5-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1417025454-3916-1-git-send-email-gustavo@padovan.org> References: <1417025454-3916-1-git-send-email-gustavo@padovan.org> Cc: Gustavo Padovan , dri-devel@lists.freedesktop.org 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 From: Gustavo Padovan We can safely use the exynos_update_plane() to update the plane framebuffer for both the overlay and primary planes. Note that this patch removes a call to manager->ops->commit() in exynos_drm_crtc_mode_set_commit(). The commit() call is used only by the fimd driver to set underlying timings and need only in full modeset operations. For plane update only win_commit is needed. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 17 ++--------------- drivers/gpu/drm/exynos/exynos_drm_plane.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_plane.h | 5 +++++ 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index a43e25d..4c8bd4d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -117,12 +117,9 @@ static int exynos_drm_crtc_mode_set_commit(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *old_fb) { struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); - struct exynos_drm_manager *manager = exynos_crtc->manager; - struct exynos_drm_plane *exynos_plane = to_exynos_plane(crtc->primary); struct drm_framebuffer *fb = crtc->primary->fb; unsigned int crtc_w; unsigned int crtc_h; - int ret; /* when framebuffer changing is requested, crtc's dpms should be on */ if (exynos_crtc->dpms > DRM_MODE_DPMS_ON) { @@ -133,18 +130,8 @@ static int exynos_drm_crtc_mode_set_commit(struct drm_crtc *crtc, int x, int y, crtc_w = fb->width - x; crtc_h = fb->height - y; - ret = exynos_plane_mode_set(crtc->primary, crtc, fb, 0, 0, - crtc_w, crtc_h, x, y, crtc_w, crtc_h); - if (ret) - return ret; - - if (manager->ops->win_commit) - manager->ops->win_commit(manager, exynos_plane->zpos); - - if (manager->ops->commit) - manager->ops->commit(manager); - - return 0; + return exynos_update_plane(crtc->primary, crtc, fb, 0, 0, + crtc_w, crtc_h, x, y, crtc_w, crtc_h); } static int exynos_drm_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index aa9cc9a..dadd306 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -165,7 +165,7 @@ void exynos_plane_dpms(struct drm_plane *plane, int mode) } } -static int +int exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_framebuffer *fb, int crtc_x, int crtc_y, unsigned int crtc_w, unsigned int crtc_h, diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.h b/drivers/gpu/drm/exynos/exynos_drm_plane.h index 3c23989..d25c079 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.h +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.h @@ -14,6 +14,11 @@ int exynos_plane_mode_set(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); +int exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, + struct drm_framebuffer *fb, int crtc_x, int crtc_y, + 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); struct drm_plane *exynos_plane_init(struct drm_device *dev, unsigned long possible_crtcs,