From patchwork Fri Aug 24 09:27:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 1370511 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 7C69B3FC33 for ; Fri, 24 Aug 2012 09:27:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6338E9E732 for ; Fri, 24 Aug 2012 02:27:43 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id F02E79E75B for ; Fri, 24 Aug 2012 02:27:32 -0700 (PDT) Received: from epcpsbgm2.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M99006D968WCFQ0@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 24 Aug 2012 18:27:16 +0900 (KST) X-AuditID: cbfee61b-b7faf6d00000476a-37-503748f45a49 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 6C.36.18282.4F847305; Fri, 24 Aug 2012 18:27:16 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.90.51.53]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M9900BEV69G6880@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 24 Aug 2012 18:27:16 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/exynos: fixed a issue that plane isn't disabled when released Date: Fri, 24 Aug 2012 18:27:15 +0900 Message-id: <1345800435-3088-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.4.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFJMWRmVeSWpSXmKPExsVy+t9jQd0vHuYBBi2rFSyufH3P5sDocb/7 OFMAYxSXTUpqTmZZapG+XQJXxvW210wF0/gqnk27wNbA2M/TxcjJISFgItFz5BIThC0mceHe erYuRi4OIYHpjBLPtv1kBUkICaxnkuh+bAViswmoSkxccZ8NxBYRMJXomLSUBcRmFiiUWNjz FMwWFgiReL/0H5jNAlR/5O1dsDm8As4SW55eY4RYpiCx4N5btgmM3AsYGVYxiqYWJBcUJ6Xn GukVJ+YWl+al6yXn525iBPvwmfQOxlUNFocYBTgYlXh4d7SYBQixJpYVV+YeYpTgYFYS4Z3/ GCjEm5JYWZValB9fVJqTWnyIUZqDRUmcl7/PMEBIID2xJDU7NbUgtQgmy8TBKdXAaPDQIM// nGts1fK/7S8FvWcUZsfF1ZuvCt/+5LCxssCz1T9MX01dq3/94O/pL/Oddp8M+HLjzrIlx1hY r5r16vYzn1p76Y3bBUWhIHEmf4WPWvaKv3bZLk62ztx0h+P4EY0l1mkesxlePZvOu6X4tL7F ueXLpk18yMTKnp2wtYHpxaJ1k/gc4pRYijMSDbWYi4oTAYPyo/HdAQAA X-TM-AS-MML: No Cc: kyungmin.park@samsung.com 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 when drm is released, drm framebuffers are released and all crtcs using same framebuffer and also all gem buffers used but plane isn't disabled so when crtc and encoder are turned on, overlay can access to invalid memory because plane still has memory address released already. this patch makes sure that each plane is disabled when released. Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c index 92f9acf..96a10c3 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c @@ -214,12 +214,27 @@ static void exynos_drm_encoder_commit(struct drm_encoder *encoder) manager_ops->commit(manager->dev); } +static void exynos_drm_encoder_disable(struct drm_encoder *encoder) +{ + struct drm_plane *plane; + struct drm_device *dev = encoder->dev; + + exynos_drm_encoder_dpms(encoder, DRM_MODE_DPMS_OFF); + + /* all planes connected to this encoder should be also disabled. */ + list_for_each_entry(plane, &dev->mode_config.plane_list, head) { + if (plane->crtc == encoder->crtc) + plane->funcs->disable_plane(plane); + } +} + static struct drm_encoder_helper_funcs exynos_encoder_helper_funcs = { .dpms = exynos_drm_encoder_dpms, .mode_fixup = exynos_drm_encoder_mode_fixup, .mode_set = exynos_drm_encoder_mode_set, .prepare = exynos_drm_encoder_prepare, .commit = exynos_drm_encoder_commit, + .disable = exynos_drm_encoder_disable, }; static void exynos_drm_encoder_destroy(struct drm_encoder *encoder)