From patchwork Wed May 27 09:04:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 6488211 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6228EC0434 for ; Wed, 27 May 2015 09:02:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D27552068F for ; Wed, 27 May 2015 09:02:12 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EDB9F20685 for ; Wed, 27 May 2015 09:02:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8142F6E5C2; Wed, 27 May 2015 02:02:10 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by gabe.freedesktop.org (Postfix) with ESMTP id E410B6E3C9 for ; Wed, 27 May 2015 02:02:08 -0700 (PDT) Received: by wgez8 with SMTP id z8so3504079wge.0 for ; Wed, 27 May 2015 02:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=l2ifWwNv+RcwDTj6UdlsoDsjQrbDUAefKDdxOb5WKio=; b=IISZV9z++rDwbfoME9Za1h+B7mG8sfpAT3UQUzymQr4c7jH/RO4lRS1UOid722liVq u/MKQaZy8yUXMV/6b68nBNPMQ3O61R/QhePaj3LCyr/f1XwwRSMZD842n4r491/mv8cW DsipqgJuUs25TmfpqDv0YdxuX3WAph1fBLsEE= 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=l2ifWwNv+RcwDTj6UdlsoDsjQrbDUAefKDdxOb5WKio=; b=EB1BfojoFR+cUw9hgwEPOY4+Y+llPD+U8GW/zXusTL4f9NCORx+BE99+8Rmkc5VwCB aulO9wOQpyxJabdBA31BxhhqgYUNpRBwTE1PQ72cgPofdR7lK0dDcjlFKUj5gN55Zbzm XcIMk0QiV5s/rmARmJGaZjPcSYOiyy+k5bcNmA+gZb6fXoqR3u4yKondlaLr+elvMM4m QSJ6wl/Jdb4K8HO1In5Dr8wBMIDpOvSkE7bqRijgWpSnvOUlqgBVnNG2E4HER7PEbxqi +xobYaT+P8T0q23UYv1JnBnL/IN13A7cxWra918DOzeEkZexzeVwk45HZAapUpdpBuU/ DTLg== X-Gm-Message-State: ALoCoQkrT4dHUFzRPzbUztQzL/MzKfJCVQ2+nsHoHo7bmHroHDURPtyI1vqdKqZc/yKqJBS+dtMp X-Received: by 10.180.95.10 with SMTP id dg10mr3922952wib.41.1432717327773; Wed, 27 May 2015 02:02:07 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by mx.google.com with ESMTPSA id ck16sm25782290wjb.37.2015.05.27.02.02.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 May 2015 02:02:06 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 1/3] drm/nouveau: Use drm_vblank_on/off consistently Date: Wed, 27 May 2015 11:04:29 +0200 Message-Id: <1432717471-7879-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.1.4 Cc: Daniel Vetter , Daniel Vetter , Intel Graphics Development , Ben Skeggs 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_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 In commit 9cba5efab5a8145ae6c52ea273553f069c294482 Author: Mario Kleiner Date: Tue Jul 29 02:36:44 2014 +0200 drm/nouveau: Dis/Enable vblank irqs during suspend/resume drm_vblank_on/off calls where added around suspend/resume to make sure vblank stay doesn't go boom over that transition. But nouveau already used drm_vblank_pre/post_modeset over modesets. Instead use drm_vblank_on/off everyhwere. The slight change here is that after _off drm_vblank_get will refuse to work right away, but nouveau doesn't seem to depend upon that anywhere outside of the pageflip paths. The longer-term plan here is to switch all kms drivers to drm_vblank_on/off so that common code like pending event cleanup can be done there, while drm_vblank_pre/post_modeset will be purely drm internal for the old UMS ioctl. Note that the drm_vblank_off still seems required in the suspend path since nouveau doesn't explicitly disable crtcs. But on the resume side drm_helper_resume_force_mode should end up calling drm_vblank_on through the nouveau crtc hooks already. Hence remove the call in the resume code. Cc: Mario Kleiner Cc: Ben Skeggs Signed-off-by: Daniel Vetter --- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 4 ++-- drivers/gpu/drm/nouveau/nouveau_display.c | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv04/crtc.c b/drivers/gpu/drm/nouveau/dispnv04/crtc.c index 3d96b49fe662..dab24066fa21 100644 --- a/drivers/gpu/drm/nouveau/dispnv04/crtc.c +++ b/drivers/gpu/drm/nouveau/dispnv04/crtc.c @@ -708,7 +708,7 @@ static void nv_crtc_prepare(struct drm_crtc *crtc) if (nv_two_heads(dev)) NVSetOwner(dev, nv_crtc->index); - drm_vblank_pre_modeset(dev, nv_crtc->index); + drm_vblank_off(dev, nv_crtc->index); funcs->dpms(crtc, DRM_MODE_DPMS_OFF); NVBlankScreen(dev, nv_crtc->index, true); @@ -740,7 +740,7 @@ static void nv_crtc_commit(struct drm_crtc *crtc) #endif funcs->dpms(crtc, DRM_MODE_DPMS_ON); - drm_vblank_post_modeset(dev, nv_crtc->index); + drm_vblank_on(dev, nv_crtc->index); } static void nv_crtc_destroy(struct drm_crtc *crtc) diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 8670d90cdc11..d824023f9fc6 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -620,10 +620,6 @@ nouveau_display_resume(struct drm_device *dev, bool runtime) nv_crtc->lut.depth = 0; } - /* Make sure that drm and hw vblank irqs get resumed if needed. */ - for (head = 0; head < dev->mode_config.num_crtc; head++) - drm_vblank_on(dev, head); - /* This should ensure we don't hit a locking problem when someone * wakes us up via a connector. We should never go into suspend * while the display is on anyways.