From patchwork Thu Jun 22 01:28:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Kleiner X-Patchwork-Id: 9803217 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 93B9160234 for ; Thu, 22 Jun 2017 01:28:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DCA72853C for ; Thu, 22 Jun 2017 01:28:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70D0828558; Thu, 22 Jun 2017 01:28:46 +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 F06272853C for ; Thu, 22 Jun 2017 01:28:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EF2A889BBD; Thu, 22 Jun 2017 01:28:44 +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 9169A89BBD for ; Thu, 22 Jun 2017 01:28:42 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id x23so661885wrb.0 for ; Wed, 21 Jun 2017 18:28:42 -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; bh=oxPI/AaOTEYcIhUxY+q7NRZsN1yZ6SiH6+/E6wgEhmQ=; b=MTL2ogjPSxlHnfjArsCunMJqLXV9UXhHSnRDpejHZnO4Wf+Z6NAclR+oQr6K5ret1s yslSgS1JNFKeHY03oGDoxugQaV074YynvhrUjBxJ6m5ocE02AMsAfNeLRWrhPC9ehL0I VrBbZWuZOqXUqhsbJVRTxIFuP72jhJPqLX+vhvDSFyj/S/ZdnJbDF49eDRz8EJXxZU8l hGEjp5D7RI0eDUUgdAstokVvRdOctgxzSIjRYOqByE0nnBRpzhlJNxBBoVMfttikezAa QWhkBElitfGnFabhYdauejz7CTwbN8BC2yU3OQQfpCU6jxL9cLgD+V+ySqamQRowQTDA X0rw== 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; bh=oxPI/AaOTEYcIhUxY+q7NRZsN1yZ6SiH6+/E6wgEhmQ=; b=BAvL30luv8s2DS8mj0X+u65hdPUpDZ14OEtmycutkEq6GfTItjcd+MS3gKlKDr6IdY 3Bl4ju2A3Df/ECbMu2suqrP293FqRaxzZvjgRCJ5VC+Iw39ZcIrj1HA0Wgsv7jQfkgGf HmACojCaZSTWmDSeKQZS5APJoL92dKwX8oEiXw2IZshtUrMbn6gL0gSmEQMZC7CfzRC2 4UiuNXMErMVyl/VIWFR/cc7ltxImcZdtdCNSw3QcK88LQH8lIzVNUFQE5jWd/2HgeM5Y 83Ejprua6wHBqnhvDvRRi3lmec0RN72C/hfNNdsOEN7C2laITnXmTHtoJk9q5tVaX3Ua iadg== X-Gm-Message-State: AKS2vOzHd0JiGzQjhd7C2ERGBqkqmGzbtyCOe/Gx5Y3rueNehMGqPDmF e4BPSSI90viMZ3rG9sk= X-Received: by 10.223.136.11 with SMTP id d11mr27628wrd.73.1498094920814; Wed, 21 Jun 2017 18:28:40 -0700 (PDT) Received: from twisty.localdomain (x4db0ff7a.dyn.telefonica.de. [77.176.255.122]) by smtp.gmail.com with ESMTPSA id 201sm550552wmr.4.2017.06.21.18.28.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Jun 2017 18:28:40 -0700 (PDT) From: Mario Kleiner To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/vc4: Allow vblank_disable_immediate on non-fw-kms. (v2) Date: Thu, 22 Jun 2017 03:28:11 +0200 Message-Id: <20170622012811.2139-1-mario.kleiner.de@gmail.com> X-Mailer: git-send-email 2.13.0.rc1.294.g07d810a77f 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 With instantaneous high precision vblank timestamping that updates at leading edge of vblank, the emulated "hw vblank counter" from vblank timestamping 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 vblank irq disable/enable. Testing against rpi-4.12-rc5 Linux kernel 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 would keep vblank irqs on to approximate old behavior. v2: Respin onto drm-misc-next, per Eric's suggestion. Drop !vc4->firmware_kms check, as the firmware_kms implementation does not exist in upstream. Signed-off-by: Mario Kleiner Cc: Eric Anholt --- drivers/gpu/drm/vc4/vc4_kms.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index bc6ecdc6f104..c2c9f82b2df1 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -241,6 +241,9 @@ int vc4_kms_load(struct drm_device *dev) sema_init(&vc4->async_modeset, 1); + /* Set support for vblank irq fast disable, before drm_vblank_init() */ + dev->vblank_disable_immediate = true; + ret = drm_vblank_init(dev, dev->mode_config.num_crtc); if (ret < 0) { dev_err(dev->dev, "failed to initialize vblank\n");