From patchwork Fri Aug 24 17:54:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 1372241 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 61DF3DF28C for ; Fri, 24 Aug 2012 17:55:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 46E0BA0EBA for ; Fri, 24 Aug 2012 10:55:10 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) by gabe.freedesktop.org (Postfix) with ESMTP id D07E4A0F4D for ; Fri, 24 Aug 2012 10:54:37 -0700 (PDT) Received: by pbbrq8 with SMTP id rq8so3996975pbb.36 for ; Fri, 24 Aug 2012 10:54:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=I3+8605h7OxWds4zQ4/GcFN0XwYhubxpgoO9GULsK7g=; b=lF05JVf5QcxMGy/UYaUo3JzcU73cTe91w1IF4OB204FTM1IDG5PD6f9bVDRAOtLZWZ cS1WZ2OU7rIpYlsWRRonXBoj7KSFR78m8Ku1Z7RRXPTNO4jrdAJBZgWNA76eWBUEr7IJ C0qj9/jkQOiaRkukyLjIQzlIWM3QC8cf3rFZfNe0Gdww7B2m3QSf8L6rjyALak8b4Wk0 zjjBqopGdfALRIeHCLo+g+qul1+R7/vqr4n/tU7z1ESd5IdvzUTHGSjHXqaxaL/UYi5F fc2URRpThcTRRLOqmpK7C8gSghTE4KG3UZ4LH+fxgfDXI2EcZs8m1jy+Kx0ya4h08ih5 PSFA== Received: by 10.68.230.232 with SMTP id tb8mr14690299pbc.19.1345830877514; Fri, 24 Aug 2012 10:54:37 -0700 (PDT) Received: from localhost.localdomain ([125.130.210.14]) by mx.google.com with ESMTPS id pj8sm8728021pbb.60.2012.08.24.10.54.35 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 24 Aug 2012 10:54:36 -0700 (PDT) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/exynos: Disable plane when released Date: Fri, 24 Aug 2012 10:54:12 -0700 Message-Id: <1345830852-2949-1-git-send-email-daeinki@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1345800435-3088-1-git-send-email-inki.dae@samsung.com> References: <1345800435-3088-1-git-send-email-inki.dae@samsung.com> 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 From: Inki Dae this patch ensures that each plane connected to encoder is disabled when released, by adding disable callback function of encoder helper we had faced with one issue that invalid memory is accessed by dma once drm is released and then the dma is turned on again. actually, in our case, page fault was incurred with iommu. the reason is that a gem buffer accessed by the dma is also released once drm is released. so this patch would fix this issue ensuring the dma 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)