From patchwork Wed Oct 29 19:33:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 5191161 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 31192C11AC for ; Wed, 29 Oct 2014 19:34:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6BF8220225 for ; Wed, 29 Oct 2014 19:34:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7ECCD200F0 for ; Wed, 29 Oct 2014 19:34:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 966476EA7C; Wed, 29 Oct 2014 12:33:59 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qa0-f42.google.com (mail-qa0-f42.google.com [209.85.216.42]) by gabe.freedesktop.org (Postfix) with ESMTP id CF17B6EA7C for ; Wed, 29 Oct 2014 12:33:58 -0700 (PDT) Received: by mail-qa0-f42.google.com with SMTP id k15so930365qaq.1 for ; Wed, 29 Oct 2014 12:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=fcz6UE1XPVZv/qwyF/rT0OFk6U7fg1z9W82IYP+YjEs=; b=AECzT7sF8ej+cKHk129W9qVJUMjaAdAfgPNFQIGYL4+PihK43V6ZJ6riao1dEf6fv+ DfhYsgkO4tLXiGkfTBoU32k+9iq0/rhL5b5r0c7EZgpp7rRM6709kmEd4BxWwimwmMXA p/tw6KZ01LjWWrwTG/1UTHi5Stu87vtwXq8oA= 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=fcz6UE1XPVZv/qwyF/rT0OFk6U7fg1z9W82IYP+YjEs=; b=L3Lzgx08BF5rm6TOmU/l8pAbARQo8WfcMhD33OpbYQrZ7ax9TfYqVhc6YFiR44CkE3 E8gD8MVHaUNLnx2sEJf82QpbUbXQ1mjjLOcK7KREQJeDDoc6vmkkfcI1Wl9rwUHXdH/b +WME7Fo1NzvTKDd4JCm64guTtnaAqoOEmH+dJTC6UqlEHKKFCQbn1fWYUzGpln8tDKyr 6On3UWSMs46HfDpo9ZmzGRHj5aV6tchgT5NJ89+v3xSSBPupsdkGTHMw0cs5yLusu09u 6gI+WNvDIHEATBVTDNj3zJOZVx8H0tOBUL+PkcEvMg6FFeCg9jjlboBiOgj/lHAExFtt mBag== X-Gm-Message-State: ALoCoQkgOEhs1QwfH/PTMkc6XKPalUTGwq8SRJGtnkRwQbyM6pkCWhwFiAKaEwt5BHsdTYditgLR X-Received: by 10.224.129.9 with SMTP id m9mr19340979qas.50.1414611238272; Wed, 29 Oct 2014 12:33:58 -0700 (PDT) Received: from philcollins.nc.rr.com (cpe-173-095-180-236.nc.res.rr.com. [173.95.180.236]) by mx.google.com with ESMTPSA id l52sm4872662qgf.43.2014.10.29.12.33.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Oct 2014 12:33:57 -0700 (PDT) From: Sean Paul To: thierry.reding@gmail.com, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/tegra: DPMS off/on in encoder prepare/commit Date: Wed, 29 Oct 2014 15:33:35 -0400 Message-Id: <1414611215-28453-1-git-send-email-seanpaul@chromium.org> X-Mailer: git-send-email 2.1.1 Cc: marcheu@chromium.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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Previously the panel and output were only enabled on encoder->dpms(). If userspace called dpms on before doing a modeset, the driver would get into a state where the connector had a dpms state of ON, but the encoder and output were not enabled (because the encoder is not yet attached to the connector). Subsequent dpms ON calls are ignored b/c the connector's state already matches the desired state. This patch enables/disables the panel and output on modeset as well, so we can catch the above case. Signed-off-by: Sean Paul --- drivers/gpu/drm/tegra/output.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/tegra/output.c b/drivers/gpu/drm/tegra/output.c index 0c67d7e..937a0ea 100644 --- a/drivers/gpu/drm/tegra/output.c +++ b/drivers/gpu/drm/tegra/output.c @@ -157,10 +157,12 @@ static bool tegra_encoder_mode_fixup(struct drm_encoder *encoder, static void tegra_encoder_prepare(struct drm_encoder *encoder) { + tegra_encoder_dpms(encoder, DRM_MODE_DPMS_OFF); } static void tegra_encoder_commit(struct drm_encoder *encoder) { + tegra_encoder_dpms(encoder, DRM_MODE_DPMS_ON); } static void tegra_encoder_mode_set(struct drm_encoder *encoder,