Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3944662pxv; Mon, 26 Jul 2021 16:36:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxxrq1D9Vl4dzByd5I1xul1Ty4wwq1JvcdnvRmya4E03rnwS09Czm192sMqNtPDVezcSNk X-Received: by 2002:a05:6638:3a4:: with SMTP id z4mr18727945jap.65.1627342601433; Mon, 26 Jul 2021 16:36:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627342601; cv=none; d=google.com; s=arc-20160816; b=phQqSKBSGVO6KeVaOebfMalAZI1qsNjGKWxekArd8YAFKoH44Gc245uZRh+zUaBRBy Vhjq6j7mAceVvrKGKzPWibR4535CZqUwhKC7Rfak5OaHML+HQHsh0TfN1uR2ZMKk+vyX OXX7IRKLvRrLU+wJDnpmNvglesQ+8kO+yhCq0HT79qd9XCgc6j0jU7cm1Xy46woYYKK+ c4QcDRBrUKdkrx1tkFObFGbDh0Bu1pfXhttAuLwoKmwiy4GvEWqlp8lxZoSezRcLD6yC 7fn04Ged9XJ8LBqHDbDug1ZVDYwsUlOUgnfwIrKQ5jcsIhy6tWR9cxOnjGdfYc7d8U2f fyrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=oJHcf2A+v4Xg1Z8UjOIkujJQfUCL6EomQD60/Cu1nbQ=; b=qMCUbo6vpPvHPSrN/ortwyaJDoNJOUywQpnFF5zMMThLFjkYd9CsJl5MHb2S/VGYqb zwqmKOXjduONL2nroDEyD8eVrCoklgsxq0xrQ8WVlI6cGDujfCBLA+RefgvKVrMjWqfw aOkJUjpDU4m/Jh1AMcjjNtr2vB/ghIE5XGZ46HvwW39V0OSKFwtxYxm+INyHSeuywmB4 wGceQkl6RFueX1PbpNVyi2NWG69MBNBFlPkPbJ/4A0jbzswIhDRBPRdjiby+52bNyA1C fOowQm9ynYi+lf9UA30iMcEVddtuydC7tvB0KTGk3vL11a/oNaYFM/1IAAjW3J07SZXI KQ5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gyFbRvsB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u6si1159961ioc.42.2021.07.26.16.36.29; Mon, 26 Jul 2021 16:36:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gyFbRvsB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233809AbhGZWyT (ORCPT + 99 others); Mon, 26 Jul 2021 18:54:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233380AbhGZWyS (ORCPT ); Mon, 26 Jul 2021 18:54:18 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FC5CC061757; Mon, 26 Jul 2021 16:34:45 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id k4-20020a17090a5144b02901731c776526so1347152pjm.4; Mon, 26 Jul 2021 16:34:45 -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:mime-version :content-transfer-encoding; bh=oJHcf2A+v4Xg1Z8UjOIkujJQfUCL6EomQD60/Cu1nbQ=; b=gyFbRvsBvc3GB64q5FVHckiBc7Bagj0Tn576aP7P1xv3GzUUQkBWJlEisCbs9U1dPd Tk9UniFqVFVZWkkYVe1Q1ZOH/y1b0ES64cKz3YE9cpvrUvfXin7PGX5SgM/fSQmgbPjk IHkil3GlN09mZixx++iR0YhCsRfzIPUMLFQCMFak/xuSx+i9Wlv4yBlf/FsDIzTJQRFr IWRf/VAat9oNJUSf+dFtyQmcsNSIvOeN51hisgAPe/GHMdkIr6qjXRXcB4eg+5segHnv PsndZ2Np2QQf2USln8vIOGRHB9j7rj5TsrwX+/cjAu2Pbo8lWTKf/n3p4hHL0MYG7FFd vzbQ== 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:mime-version :content-transfer-encoding; bh=oJHcf2A+v4Xg1Z8UjOIkujJQfUCL6EomQD60/Cu1nbQ=; b=cNvhE2cqsg80k5UuLdK/laf2MK47yFoytkjtA0E82u9JibELi8J+wf4WI9w1tGcMnw rtLLBh3H1v891hxlN+P9J+hc/iTPsjPtoyIoiMxoIwQ090N7xcACT/EHkpqkXxSBDRz5 35ZXV9AzxsnhDtkpKFc2q6JB/1IURlbge4PiEY6PCp267tXIkZV2aGezWLvn6hTQz3Sy YzqLaP8xKguGQYmmdSXgiC9mVycRd6Bm9puJi6Ag22A17J15byXqWGjOShxETin6pXrW ET4L0boUOblGMca4Xe46j4K3BXwasZ9XTMvp3iau7j9Ru4BB4zrzHaQ1fp4+8CAd+C5N vFOw== X-Gm-Message-State: AOAM533HhpSYsEAWbZB7ja5ugUMl/lce0flrHoRoMAx+SGQldi/HI7Ne zn8p9VXNou73jMYInhVeaL4= X-Received: by 2002:a63:b953:: with SMTP id v19mr20385890pgo.40.1627342484886; Mon, 26 Jul 2021 16:34:44 -0700 (PDT) Received: from localhost ([2601:1c0:5200:a6:307:a401:7b76:c6e5]) by smtp.gmail.com with ESMTPSA id k11sm1000201pgg.25.2021.07.26.16.34.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 16:34:43 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: Daniel Vetter , Matthew Brost , =?UTF-8?q?Christian=20K=C3=B6nig?= , Rob Clark , Alex Deucher , Andrey Grodzovsky , =?UTF-8?q?Christian=20K=C3=B6nig?= , Gustavo Padovan , Jack Zhang , Lee Jones , linaro-mm-sig@lists.linaro.org (moderated list:DMA BUFFER SHARING FRAMEWORK), linux-kernel@vger.kernel.org (open list), linux-media@vger.kernel.org (open list:DMA BUFFER SHARING FRAMEWORK), Luben Tuikov , Maarten Lankhorst , Roy Sun , Tian Tao Subject: [RFC 0/4] dma-fence: Deadline awareness Date: Mon, 26 Jul 2021 16:38:47 -0700 Message-Id: <20210726233854.2453899-1-robdclark@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rob Clark Based on discussion from a previous series[1] to add a "boost" mechanism when, for example, vblank deadlines are missed. Instead of a boost callback, this approach adds a way to set a deadline on the fence, by which the waiter would like to see the fence signalled. I've not yet had a chance to re-work the drm/msm part of this, but wanted to send this out as an RFC in case I don't have a chance to finish the drm/msm part this week. Original description: In some cases, like double-buffered rendering, missing vblanks can trick the GPU into running at a lower frequence, when really we want to be running at a higher frequency to not miss the vblanks in the first place. This is partially inspired by a trick i915 does, but implemented via dma-fence for a couple of reasons: 1) To continue to be able to use the atomic helpers 2) To support cases where display and gpu are different drivers [1] https://patchwork.freedesktop.org/series/90331/ Rob Clark (4): dma-fence: Add deadline awareness drm/vblank: Add helper to get next vblank time drm/atomic-helper: Set fence deadline for vblank drm/scheduler: Add fence deadline support drivers/dma-buf/dma-fence.c | 39 +++++++++++++++++++++++++ drivers/gpu/drm/drm_atomic_helper.c | 36 +++++++++++++++++++++++ drivers/gpu/drm/drm_vblank.c | 31 ++++++++++++++++++++ drivers/gpu/drm/scheduler/sched_fence.c | 10 +++++++ drivers/gpu/drm/scheduler/sched_main.c | 3 ++ include/drm/drm_vblank.h | 1 + include/linux/dma-fence.h | 17 +++++++++++ 7 files changed, 137 insertions(+) -- 2.31.1