From patchwork Fri Feb 21 20:51:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 3700071 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 4BDF69F370 for ; Fri, 21 Feb 2014 20:51:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6979020145 for ; Fri, 21 Feb 2014 20:51:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 220CC20131 for ; Fri, 21 Feb 2014 20:51:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5F044FA5CF; Fri, 21 Feb 2014 12:51:17 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yk0-f172.google.com (mail-yk0-f172.google.com [209.85.160.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 333F9FA5CF for ; Fri, 21 Feb 2014 12:51:16 -0800 (PST) Received: by mail-yk0-f172.google.com with SMTP id 200so7354937ykr.3 for ; Fri, 21 Feb 2014 12:51:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZUv0p4XfjzfA7dlsVjv1TMFa2F1oETI1HAzBEArIyvs=; b=jZfC60ZWVyl9qFmyExf/CB/Ubdl07WqcvIZqQn9g0IQkHvQi0bGm7OEMGhAPBdXlcq wXBApJEMLpYdOoL2DLxMvgWZHxjhUhFYxiJl0HcWY4pJoX5i0X9uPTFqDQSI37wWwnZp ErTcZrPMARWK6BQBJL5O1/KlvSZEuAxb4B/B/J6fMX9Mb5yuyUxy2wlxwnFmGT6cRzJz HWrGBR4va7brMVPTVHfsPyMevvvLC24z9Pk5BgKwnPxoKjuqRikpae/EqUWH4HKKHXyh 1MfOdgsU+bbdzWrtWz+vr9goot2js/Rx9IfNLLMuKcXYFLjp+qV9kPBkS5958sVlrcfr SSOg== X-Gm-Message-State: ALoCoQkbN+Tz8TTxCj1j7w5dEXfifauvLL+1bsTKwO1WEA6bJuVUrsWXkf9oR9Iq4dhH0wXjjM2X X-Received: by 10.236.137.14 with SMTP id x14mr13615665yhi.4.1393015875559; Fri, 21 Feb 2014 12:51:15 -0800 (PST) Received: from dsd-ubuntu.endlessm-sf.com ([190.181.182.126]) by mx.google.com with ESMTPSA id k76sm22126108yho.18.2014.02.21.12.51.12 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Feb 2014 12:51:14 -0800 (PST) From: Daniel Drake To: inki.dae@samsung.com, jy0922.shim@samsung.com, w0312.kim@samsung.com, kyungmin.park@samsung.com Subject: [PATCH] drm/exynos: power up HDMI before mixer Date: Fri, 21 Feb 2014 14:51:07 -0600 Message-Id: <1393015867-20333-1-git-send-email-drake@endlessm.com> X-Mailer: git-send-email 1.8.3.2 Cc: dri-devel@lists.freedesktop.org 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@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Testing on Exynos4412, when changing screen resolution under GNOME/X11, first DPMS is set to OFF via drm_mode_obj_set_property_ioctl. This is done via drm_hdmi_dpms which powers down the mixer then the HDMI component. Then the mode change happens. We then see this call chain, powering things back on: exynos_drm_crtc_commit exynos_drm_crtc_dpms exynos_drm_encoder_crtc_dpms drm_hdmi_dpms And at this point, drm_hdmi_dpms first powers on the mixer, then the HDMI component. Strangely enough, this works fine on the first resolution change, but on the second it hangs in mixer_poweron() in: mixer_reg_write(res, MXR_INT_EN, ctx->int_en); Through some experiments I determined that this register write will hang the machine here unless the hdmi_resources.hdmi clock is running. I can't explain why there is a difference between the first and second time; I did check that the underlying clock gating register has the same value in both cases. Anyway, the mixer clearly has some kind of dependency on the HDMI component, so lets make sure we power that up first. Signed-off-by: Daniel Drake --- drivers/gpu/drm/exynos/exynos_drm_hdmi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c index 8548b97..3bfd9d6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c @@ -261,10 +261,17 @@ static void drm_hdmi_dpms(struct device *subdrv_dev, int mode) { struct drm_hdmi_context *ctx = to_context(subdrv_dev); + /* When powering up, we must first power up the HDMI component, as + * otherwise mixer register accesses will sometimes hang. + * When powering down, we do the opposite: mixer off, HDMI off. */ + + if (mode == DRM_MODE_DPMS_ON && hdmi_ops && hdmi_ops->dpms) + hdmi_ops->dpms(ctx->hdmi_ctx->ctx, mode); + if (mixer_ops && mixer_ops->dpms) mixer_ops->dpms(ctx->mixer_ctx->ctx, mode); - if (hdmi_ops && hdmi_ops->dpms) + if (mode != DRM_MODE_DPMS_ON && hdmi_ops && hdmi_ops->dpms) hdmi_ops->dpms(ctx->hdmi_ctx->ctx, mode); }