From patchwork Mon Nov 14 09:02:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9426893 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 04DD16047D for ; Mon, 14 Nov 2016 09:03:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3A4E286DE for ; Mon, 14 Nov 2016 09:03:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D882B28772; Mon, 14 Nov 2016 09:03:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7F012286DE for ; Mon, 14 Nov 2016 09:03:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D5E676E36D; Mon, 14 Nov 2016 09:03:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5BC1E6E368 for ; Mon, 14 Nov 2016 09:03:07 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id g23so13392236wme.1 for ; Mon, 14 Nov 2016 01:03:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mWRTHv3PfbdHc2/yX0l3RGIWw6sgRRJXJWLP4tzEEQk=; b=Oe49qCh6FLRXedowHNNWNcsYV+fW9CZYQw4phpaFhKS1wM47of79RlSFDbevCbwH0t IU90YAWZcgb4vScDvUke46P9sKorRLl3o17QJ4pXV4B0uicGUFhNvCU1wYX3LMiT4Kz4 dRrF2q4zUy3xJET+W6LND4/7r9X8gUBmblHxo= 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:in-reply-to :references; bh=mWRTHv3PfbdHc2/yX0l3RGIWw6sgRRJXJWLP4tzEEQk=; b=hWmWJUHNsYkakmNhaff31RSJ9UpXMLTciJzHvLIVicJ6+tpjifQ1P1+2B+I10M4zyJ QY2puUXepfVsW2OL/lCkDD3tupGTS2IGmF9wKL82rMK02CgfCFW2BtGM61eTZ79+gjX2 5Q+3/mU1k/TAkUR9cQcqHus96dn69Ji2YsaoTKJJu5Whx9+IdPdr6RDNYYtqPYu/yZbB 1OMUMcm0O65s/Zpw28q5DpwjljQM4ZfdVb0EWBc94TUsUtcnJQWPWWdU3UGoFfbWT+BF KqvWsPK6DprHz7gQF/73OIikXi7p3fPfYQJRgRF/amOPKmYdskEFkH7j6rgKiZqJF/sG 3j0Q== X-Gm-Message-State: ABUngvfodR/5hB1lL1u4n9rDyUdwUwgahD6Dpg+pobdoNoMYEazV5md+MbvMygNUhObiMw== X-Received: by 10.28.152.137 with SMTP id a131mr9006070wme.56.1479114185892; Mon, 14 Nov 2016 01:03:05 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:56b5:0:ac27:b86c:7764:9429]) by smtp.gmail.com with ESMTPSA id hy10sm27393012wjb.10.2016.11.14.01.03.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2016 01:03:05 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 3/6] drm/irq: Make drm_vblank_pre/post_modeset internal Date: Mon, 14 Nov 2016 10:02:52 +0100 Message-Id: <20161114090255.31595-3-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161114090255.31595-1-daniel.vetter@ffwll.ch> References: <20161114090255.31595-1-daniel.vetter@ffwll.ch> Cc: Alex Deucher , Daniel Vetter , Ben Skeggs , Daniel Vetter 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-Virus-Scanned: ClamAV using ClamSMTP Now that all drivers are switched over to drm_crtc_vblank_on/off we can relegate pre/post_modeset to the purely drm_irq.c internal role of supporting old ums userspace. As usual switch to the drm_legacy_ prefix to make it clear this is for old drivers only. v2: Rebase on top of Thierry's s/int crtc/unsigned int pipe/ changes. Cc: Ben Skeggs Cc: Alex Deucher Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_irq.c | 43 ++++++------------------------------------- include/drm/drmP.h | 4 ---- 2 files changed, 6 insertions(+), 41 deletions(-) diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 48a6167f5e7b..2fb5861b04b7 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -1445,30 +1445,8 @@ void drm_crtc_vblank_on(struct drm_crtc *crtc) } EXPORT_SYMBOL(drm_crtc_vblank_on); -/** - * drm_vblank_pre_modeset - account for vblanks across mode sets - * @dev: DRM device - * @pipe: CRTC index - * - * Account for vblank events across mode setting events, which will likely - * reset the hardware frame counter. - * - * This is done by grabbing a temporary vblank reference to ensure that the - * vblank interrupt keeps running across the modeset sequence. With this the - * software-side vblank frame counting will ensure that there are no jumps or - * discontinuities. - * - * Unfortunately this approach is racy and also doesn't work when the vblank - * interrupt stops running, e.g. across system suspend resume. It is therefore - * highly recommended that drivers use the newer drm_vblank_off() and - * drm_vblank_on() instead. drm_vblank_pre_modeset() only works correctly when - * using "cooked" software vblank frame counters and not relying on any hardware - * counters. - * - * Drivers must call drm_vblank_post_modeset() when re-enabling the same crtc - * again. - */ -void drm_vblank_pre_modeset(struct drm_device *dev, unsigned int pipe) +static void drm_legacy_vblank_pre_modeset(struct drm_device *dev, + unsigned int pipe) { struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; @@ -1492,17 +1470,9 @@ void drm_vblank_pre_modeset(struct drm_device *dev, unsigned int pipe) vblank->inmodeset |= 0x2; } } -EXPORT_SYMBOL(drm_vblank_pre_modeset); -/** - * drm_vblank_post_modeset - undo drm_vblank_pre_modeset changes - * @dev: DRM device - * @pipe: CRTC index - * - * This function again drops the temporary vblank reference acquired in - * drm_vblank_pre_modeset. - */ -void drm_vblank_post_modeset(struct drm_device *dev, unsigned int pipe) +static void drm_legacy_vblank_post_modeset(struct drm_device *dev, + unsigned int pipe) { struct drm_vblank_crtc *vblank = &dev->vblank[pipe]; unsigned long irqflags; @@ -1525,7 +1495,6 @@ void drm_vblank_post_modeset(struct drm_device *dev, unsigned int pipe) vblank->inmodeset = 0; } } -EXPORT_SYMBOL(drm_vblank_post_modeset); /* * drm_modeset_ctl - handle vblank event counter changes across mode switch @@ -1558,10 +1527,10 @@ int drm_modeset_ctl(struct drm_device *dev, void *data, switch (modeset->cmd) { case _DRM_PRE_MODESET: - drm_vblank_pre_modeset(dev, pipe); + drm_legacy_vblank_pre_modeset(dev, pipe); break; case _DRM_POST_MODESET: - drm_vblank_post_modeset(dev, pipe); + drm_legacy_vblank_post_modeset(dev, pipe); break; default: return -EINVAL; diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 4e58137c1882..cfa4b80f0628 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1007,10 +1007,6 @@ void drm_clflush_virt_range(void *addr, unsigned long length); * DMA quiscent + idle. DMA quiescent usually requires the hardware lock. */ -/* Modesetting support */ -extern void drm_vblank_pre_modeset(struct drm_device *dev, unsigned int pipe); -extern void drm_vblank_post_modeset(struct drm_device *dev, unsigned int pipe); - /* drm_drv.c */ void drm_put_dev(struct drm_device *dev); void drm_unplug_dev(struct drm_device *dev);