From patchwork Wed Jun 21 01:44:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mario Kleiner X-Patchwork-Id: 9800573 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 2FB5C6086C for ; Wed, 21 Jun 2017 02:02:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1384A28569 for ; Wed, 21 Jun 2017 02:02:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06C262856B; Wed, 21 Jun 2017 02:02:16 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 77B1628569 for ; Wed, 21 Jun 2017 02:02:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A83326E414; Wed, 21 Jun 2017 02:02:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id A12D36E413; Wed, 21 Jun 2017 01:45:25 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id 77so22254505wrb.3; Tue, 20 Jun 2017 18:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/ckegG1PG6tyXzUG41EKhu7d3WxPJ9KER3Rm7iXU3AY=; b=RbEmCIcRDCCorkjQ9Qtof1NhPNb98BbXddqbO/cYxAe+gRhCzoTyHvaLz6l2PweDk+ U0wRbRsJ16AYVA7eY3tZItBotQibJbHjISLcY/ZbVpMRnK/1+oWSavYFdoi5KRY651iT KP8a/F7jkwXTkjkUYXiWVz/xsiP5MAGYNp4my5+hhQS1HhzgYMdKUp0KcMbHFb75SZ8b 7DGQw6Eed0pJsPegr++A32K+7sBi45JfuAznq1dH7W+c0R68CFBUH+WQeixZZ4/bXrWr AKA/rQof0y6LpGS6NPkQhXzlBuM69BmEcyCXtU1XsFjo5f2dyp4mom07lL4di7OAxyXT MJNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/ckegG1PG6tyXzUG41EKhu7d3WxPJ9KER3Rm7iXU3AY=; b=EYxCw7z+1ewU7ZKttHsA4jfTSz7Pqiw6hgKcY5UQQRK46qAE+AwGpZJo0smP/9gSni jc+HUML0mdjNEzxKtf3CXGUB6piviFTs9TabSZ72OkXpTvjHeOjDoMi1haKJ44OomnTF lGwC2FJofGfVpaQ57UoDmm6w20cd5NjcJXNmsY0DjBx99msBfkYkP1fD+nteUcz8SkLI noiMJowZNveNlAgxvzmKnG+PaHjY7/SqFuTjBJIampQTTNzihzmqEbuIjK228bqpz+eg 5IqHr6cO3R5lg4+I0Fzd7+YhgnYZVG3vkmxf93Z3KbQnfMJ2VhM38Hx8A43zM69SRFWg dQVw== X-Gm-Message-State: AKS2vOyB5Vd1POMpjRCbZvrqGYJh6mSnk/NPuoVmWsC8sGBkOzyodINk 3iRWWq9unIGHoXOg X-Received: by 10.28.196.142 with SMTP id u136mr4858915wmf.25.1498009524093; Tue, 20 Jun 2017 18:45:24 -0700 (PDT) Received: from twisty.cin.medizin.uni-tuebingen.de (cin-11.medizin.uni-tuebingen.de. [134.2.118.242]) by smtp.gmail.com with ESMTPSA id 29sm24507651wrv.23.2017.06.20.18.45.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 18:45:23 -0700 (PDT) From: Mario Kleiner To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/4] drm/radeon: Allow vblank_disable_immediate. Date: Wed, 21 Jun 2017 03:44:55 +0200 Message-Id: <20170621014457.26587-3-mario.kleiner.de@gmail.com> X-Mailer: git-send-email 2.13.0.rc1.294.g07d810a77f In-Reply-To: <20170621014457.26587-1-mario.kleiner.de@gmail.com> References: <20170621014457.26587-1-mario.kleiner.de@gmail.com> MIME-Version: 1.0 Cc: nouveau@lists.freedesktop.org, =?UTF-8?q?Michel=20D=C3=A4nzer?= , amd-gfx@lists.freedesktop.org, Alex Deucher 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP With instantaneous high precision vblank timestamping that updates at leading edge of vblank, a cooked hw vblank counter which increments at leading edge of vblank, and reliable page flip execution and completion at leading edge of vblank, we should meet the requirements for fast/immediate vblank irq disable/enable. Testing on Linux-4.12-rc5 + drm-next on a Radeon HD 5770 (DCE 4) with timing measurement equipment indicates this works fine, so allow immediate vblank disable for power saving. For debugging in case of unexpected trouble, booting with kernel cmdline option drm.vblankoffdelay=0 (or echo 0 > /sys/module/drm/parameters/vblankoffdelay) would keep vblank irqs permanently on to approximate old behavior. Signed-off-by: Mario Kleiner Cc: Alex Deucher Cc: Michel Dänzer --- drivers/gpu/drm/radeon/radeon_irq_kms.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c b/drivers/gpu/drm/radeon/radeon_irq_kms.c index 7aacb44..1860764 100644 --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c @@ -283,6 +283,10 @@ int radeon_irq_kms_init(struct radeon_device *rdev) int r = 0; spin_lock_init(&rdev->irq.lock); + + /* Disable vblank irqs aggressively for power-saving */ + rdev->ddev->vblank_disable_immediate = true; + r = drm_vblank_init(rdev->ddev, rdev->num_crtc); if (r) { return r;