From patchwork Thu Jan 24 03:03:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shirish S X-Patchwork-Id: 2029771 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 9A29FDF264 for ; Thu, 24 Jan 2013 07:15:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 77332E662A for ; Wed, 23 Jan 2013 23:15:43 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id 9ADB4E5C79 for ; Wed, 23 Jan 2013 18:41:44 -0800 (PST) Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MH30025TZGJK8C0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 24 Jan 2013 11:41:42 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.125]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id A6.13.03880.66F90015; Thu, 24 Jan 2013 11:41:42 +0900 (KST) X-AuditID: cbfee61b-b7fb06d000000f28-ee-51009f663ce3 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 06.13.03880.66F90015; Thu, 24 Jan 2013 11:41:42 +0900 (KST) Received: from chrome-ubuntu.sisodomain.com ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MH3000RUZHE6R40@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 24 Jan 2013 11:41:42 +0900 (KST) From: Shirish S To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/exynos: add check for the device power status Date: Wed, 23 Jan 2013 22:03:18 -0500 Message-id: <1358996598-24966-1-git-send-email-s.shirish@samsung.com> X-Mailer: git-send-email 1.8.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFLMWRmVeSWpSXmKPExsWyRsSkVjdtPkOgwfKv2hZXvr5nc2D0uN99 nCmAMYrLJiU1J7MstUjfLoErY0WzakETT8Wj17+YGhjncHUxcnJICJhIbP82nRnCFpO4cG89 WxcjF4eQwFJGiad7d7DBFP2b2skEkZjOKLHgxBsWCGcjk8TuRXuYQKrYBNQlLk5eDTZKREBZ 4u/EVYwgNrNAjsTf+1/B4sICThLvd3wCm8oioCpxbs1/VhCbV8BVou9DL9Q2OYkPex6xQ9hb 2CT+n/eHqBeQ+Db5ENBiDqC4rMSmA1BXS0ocXHGDZQKj4AJGhlWMoqkFyQXFSem5RnrFibnF pXnpesn5uZsYgSF1+t8z6R2MqxosDjEKcDAq8fBWqDMECrEmlhVX5h5ilOBgVhLhVasHCvGm JFZWpRblxxeV5qQWH2JMBlo+kVlKNDkfGO55JfGGxibmpsamlkZGZqampAkrifMynnoSICSQ nliSmp2aWpBaBLOFiYNTqoHRo/S3pNRNeSvbpPX208qOn5tXvIZJSMLOtXe9q/oXJ9Zaoxz9 nWE9U2YZWPdnqnqYRR4+8nPm3qzvifNvaC+4VLeyfVOYK79/0UrJjxWBP7d3KXGmbw/9uZGv nDvpy6LM4O32/l9/flldYqG0Qv/B3PyyNbVm3tdLgjQrVvX9y4+dfkSkl1WJpTgj0VCLuag4 EQAkNKGKbQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupikeLIzCtJLcpLzFFi42I5/e+xoG7afIZAg+4fkhZXvr5nc2D0uN99 nCmAMaqB0SYjNTEltUghNS85PyUzL91WyTs43jne1MzAUNfQ0sJcSSEvMTfVVsnFJ0DXLTMH aKySQlliTilQKCCxuFhJ3w7ThNAQN10LmMYIXd+QILgeIwM0kLCGMWNFs2pBE0/Fo9e/mBoY 53B1MXJySAiYSPyb2skEYYtJXLi3nq2LkYtDSGA6o8SCE29YIJyNTBK7F+0Bq2ITUJe4OHk1 M4gtIqAs8XfiKkYQm1kgR+Lv/a9gcWEBJ4n3Oz6xgdgsAqoS59b8ZwWxeQVcJfo+9LJBbJOT +LDnEfsERu4FjAyrGEVTC5ILipPSc430ihNzi0vz0vWS83M3MYJD9pn0DsZVDRaHGAU4GJV4 eCvUGQKFWBPLiitzDzFKcDArifCq1QOFeFMSK6tSi/Lji0pzUosPMSYDbZ/ILCWanA+Mp7yS eENjE3NTY1NLEwsTM0vShJXEeRlPPQkQEkhPLEnNTk0tSC2C2cLEwSnVwDjtkFv6zehdSQwN H6/LMFxezH+8nnP7tqPL32ZquU69/v8Iv8oOtrmHY4yDJmxxefOwaZ5Y0pfqmfuqPFg8Za9c SfS51aQ97aPsA7/9qZ135mmeZW7LeOzwO/N/dY52bquNeBq7v7Xkli6v/OMd7dWlj9e4tqks 6mf4kMdZkR906RtvVdShBCWW4oxEQy3mouJEALXAehidAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Mailman-Approved-At: Wed, 23 Jan 2013 22:46:59 -0800 Cc: sw0312.kim@samsung.com, Shirish S 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 V2: Add mutex protection, while read. The hdmi and mixer win_commit calls currently are not checking the status of IP before updating the respective registers, this patch adds this check. Signed-off-by: Shirish S --- drivers/gpu/drm/exynos/exynos_hdmi.c | 7 +++++++ drivers/gpu/drm/exynos/exynos_mixer.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 2c46b6c..05335ae 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -2170,6 +2170,13 @@ static void hdmi_commit(void *ctx) DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); + mutex_lock(&hdata->hdmi_mutex); + if (!hdata->powered) { + mutex_unlock(&hdata->hdmi_mutex); + return; + } + mutex_unlock(&hdata->hdmi_mutex); + hdmi_conf_apply(hdata); } diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 21db895..9fba6bd 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -775,6 +775,13 @@ static void mixer_win_commit(void *ctx, int win) DRM_DEBUG_KMS("[%d] %s, win: %d\n", __LINE__, __func__, win); + mutex_lock(&mixer_ctx->mixer_mutex); + if (!mixer_ctx->powered) { + mutex_unlock(&mixer_ctx->mixer_mutex); + return; + } + mutex_unlock(&mixer_ctx->mixer_mutex); + if (win > 1 && mixer_ctx->vp_enabled) vp_video_buffer(mixer_ctx, win); else