From patchwork Wed Jan 20 21:09:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 12033673 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C782C433E9 for ; Wed, 20 Jan 2021 21:09:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 35A422343E for ; Wed, 20 Jan 2021 21:09:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35A422343E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1B3BC6E15C; Wed, 20 Jan 2021 21:09:42 +0000 (UTC) Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0DF9B6E15C for ; Wed, 20 Jan 2021 21:09:41 +0000 (UTC) Received: by mail-pf1-x434.google.com with SMTP id m6so15320037pfk.1 for ; Wed, 20 Jan 2021 13:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=O4d6auqSX1j/vMOr3TsD18PFRnP6mGB4INh2IgrTTG4=; b=GdhLdiHi2LyrCQQMhzh0pvLH3gzKbpQzt27Y+CanmyiE5UaGiBQNAUzsr9Zaj0Zhr4 KvJdY3Fzc3gckZGSp5QU8M5TxalhTsGKPF+fViwh/lBrax/yFrCK2Xm92/BNDmnnjPeU RZJryXRD7bznQNqVbnISwkIGndj8vzzsDJqNtcRJVPE2eUPb+buDtT72alBwOE5CVd1b 5Zfg0FvQURoty3ptICEh9eSaAUog4x2tJQcdnvQcurrjdvmybFM9BWre3F69jbtW0JpG vKVbrvhCnyOPCsn02flcKhrtprB++yiII+28o7PgAqZ8wjCfT+pX98YN993EZcpX9kF6 FN9g== 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=O4d6auqSX1j/vMOr3TsD18PFRnP6mGB4INh2IgrTTG4=; b=C8I/L5e0dOX7LmHKEw9toVoMn17lTz9cgQLUoQXwlfwyw2CRnFYOpz2cpKDL3TyO6h 6AH5QYU0IC2ClKkZMXthoUf+Cz4IEr1L8RcENMWHTiIuIjacWgYqTaB/5aZAWMZkIaFX 6tikBh0cQsdQ44pADEmxCrx3vDfKZg7wzKlavo5Kpj8xrHPB8xZ197dNQdR10TX+qjhR KwiIPcNqQSU6H2pCiNXT1Ft40zKhq45m0v4FrS/W0kDSvN6IVGrIE0LSukxKoav6JAbS BevaSoeRw8WFPg/zJe015b61SHeHfiVUB7Nuv3RTWifBpZTvxL++lhLbVkYRBAIiyvfJ ZDVg== X-Gm-Message-State: AOAM5326UPYT7r+aTHqlJM9P8vTr2uHmHcGmVfibPcJ4iXgej9ny1+5n jnz8xWuOeHIcHqIm1BfavbURfg== X-Google-Smtp-Source: ABdhPJwVPrD98BzRwSDLgSwObG8PYNxIaFpiX8zRhpHlai6xWuIyDqUItiSV/D8Cpv4EqgdSPtOpcg== X-Received: by 2002:a63:4d59:: with SMTP id n25mr10926215pgl.122.1611176980657; Wed, 20 Jan 2021 13:09:40 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id f15sm3265629pja.24.2021.01.20.13.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 13:09:39 -0800 (PST) From: John Stultz To: lkml Subject: [RFC][PATCH 0/3] dmabuf heaps: system uncached and cma uncached heaps Date: Wed, 20 Jan 2021 21:09:34 +0000 Message-Id: <20210120210937.15069-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, Bing Song , Sandeep Patil , Chris Goldsworthy , Ezequiel Garcia , Robin Murphy , James Jones , Liam Mark , Laura Abbott , Hridya Valsaraju , =?utf-8?q?=C3=98rjan_Eide?= , linux-media@vger.kernel.org, Suren Baghdasaryan , Daniel Mentz Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" After the last round submitting the system-uncached heap, I got some feedback that Daniel would like to see it demonstrated with a mesa based system. I'm still working on such a gralloc implementation (using the db845c), but along with other work, so I don't yet have something to share there. However, Bing Song reached out and was interested in having a uncached variant for the CMA heap as well, and he shared this patch providing an initial implementation. This gave me some hesitation with regards to the earlier discussion around what sort of attributes would be useful for the flags field of the allocation IOCTL. In earlier discussions, folks seemed happy to provide the uncached system heap functionality as its own heap chardev, as it seemed uncertain that the uncached attribute would truely be generic across all heaps. But with Bing's patch, it seems like it may be generically useful, and utilizing a flag might be a bit cleaner then adding lots of duplicative heap names postfixed with "-uncached". So I wanted to re-submit both of these together to reopen that discussion on the question of if a BUF_FLAG_UNCACHED flag would make sense, or if folks still think separate heap chardevs is the way to go. thanks -john Cc: Daniel Vetter Cc: Sumit Semwal Cc: Liam Mark Cc: Laura Abbott Cc: Brian Starkey Cc: Hridya Valsaraju Cc: Suren Baghdasaryan Cc: Sandeep Patil Cc: Daniel Mentz Cc: Chris Goldsworthy Cc: Ørjan Eide Cc: Robin Murphy Cc: Ezequiel Garcia Cc: Simon Ser Cc: James Jones Cc: Bing Song Cc: linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Bing Song (1): dma-buf: cma_heap: Add a cma-uncached heap re-using the cma heap John Stultz (2): dma-buf: dma-heap: Keep track of the heap device struct dma-buf: system_heap: Add a system-uncached heap re-using the system heap drivers/dma-buf/dma-heap.c | 33 ++++++-- drivers/dma-buf/heaps/cma_heap.c | 119 +++++++++++++++++++++++++--- drivers/dma-buf/heaps/system_heap.c | 111 ++++++++++++++++++++++---- include/linux/dma-heap.h | 9 +++ 4 files changed, 236 insertions(+), 36 deletions(-)