From patchwork Wed Jun 21 01:44:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Kleiner X-Patchwork-Id: 9800571 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 E1FCA6086C for ; Wed, 21 Jun 2017 02:02:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C597728567 for ; Wed, 21 Jun 2017 02:02:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9DEA2856B; Wed, 21 Jun 2017 02:02:13 +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 4C93028563 for ; Wed, 21 Jun 2017 02:02:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5422F6E407; Wed, 21 Jun 2017 01:58:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8E5676E410; Wed, 21 Jun 2017 01:45:22 +0000 (UTC) Received: by mail-wr0-x243.google.com with SMTP id z45so22264638wrb.2; Tue, 20 Jun 2017 18:45:22 -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; bh=bejW8ZbJ2aRxX0/04AxVAsFbSfVRc8qmhZK1D1DLM1M=; b=bvX639Y7a9m0L3yzhV3eT6KuGFEoUixRTwwXtd+ZJJFzuAwD5GM+RozK0TAno79iv6 Q8oo8RVxyTAoB/DvOmE2zIG3u65p2Nr2LqBSkyIGf3k776SQvry7ctRAKIPiddC4Axl3 uEVkkiLgJGMVOLLk8bWq8N8ppbaDqnWyVIiIz6VMh1SYCrPhnqoa1AXASNm2454q3Zqj SXt2t/rK1YgX7XfPtKVyogo6+UAyEhlEvwGp8Z2Tv6YV5uwOyg9FyRGXR8EX+OZ8Atz1 VVXSBxDqoCcbkls1pUZ3mXODiATgHuIBgPeePO6PwVCY4flOMEDZtiB6n0lSSTFE8X9G +P/A== 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; bh=bejW8ZbJ2aRxX0/04AxVAsFbSfVRc8qmhZK1D1DLM1M=; b=jn+Y50SgnzWAdX1gtZHXAdHAHhmbE8Zc7JLUobJw3EckZx/6+BKYHH6jamdSnaG8fQ n/M++Q7WvxSCFf68nPdAD56tdOOpCczyFbhKumqZ3w736IpQahYeD2k+TsVsLo3BKWeQ n9QN7c0PRF/H8eqdwIQBFLyRN/vNWuGXkj4Ox5uEVTi0YRJJiJaw/rx0m0k/Jk+1V9PR 2sP6qat30JfVdlyb3koBwz4T/9A6k6/jn1kGYiA1CIthHVMSpoFQXqPL/SDNa6Q7HIsU 3dlGTvpF358jhzb0jbd15r0f5a5W89bEjRzuZXJyN1paD8OpHowejXQIIOXnTCMBJp7e Pw3w== X-Gm-Message-State: AKS2vOy5NV7hgJ3rsn7nt1csFxOe8rWaZqfwicXqfGT97DZZSdQo4SVt YW6tQhpat+D1NpJR X-Received: by 10.223.152.211 with SMTP id w77mr17550431wrb.64.1498009520952; Tue, 20 Jun 2017 18:45:20 -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.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 18:45:20 -0700 (PDT) From: Mario Kleiner To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/4] drm/vc4: Allow vblank_disable_immediate on non-fw-kms. Date: Wed, 21 Jun 2017 03:44:54 +0200 Message-Id: <20170621014457.26587-2-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> Cc: nouveau@lists.freedesktop.org, amd-gfx@lists.freedesktop.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-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. Signed-off-by: Mario Kleiner Cc: Eric Anholt --- drivers/gpu/drm/vc4/vc4_kms.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index 928d191..70c4e17 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -216,6 +216,10 @@ 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() */ + if (!vc4->firmware_kms) + 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");