Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2499840pxb; Fri, 5 Feb 2021 21:50:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzwB+pTZxuqCmwYNlbJjPS6n+AhndAl2Dl5OEC89ET01VBcIvi6ZHGDSCzPxTLLNq6EFxd X-Received: by 2002:a17:906:653:: with SMTP id t19mr7386368ejb.44.1612590630673; Fri, 05 Feb 2021 21:50:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612590630; cv=none; d=google.com; s=arc-20160816; b=FU/jdcrywn3r4/8rmZlMvAlnPIg0/6SYHflHlN5+Xp8Ara29d2p3y4zlKe1bJZm2oC AwFVxk8RXbMrWHNTWCt35PHf0vCmHbbOfKuyUgU9QvXCGSX/menqbaty+jvFQr1JhVWY bgWJYczxPK5sEFIv81Mj9b2/Pu15Hu8oVzZpgwQNJb/rWsE43NiSGGRsHinvcoAIVcOc tE6TeKi1WYl3M+8xPMlr1babYNZRiKWp4EAD7glAoxabQQFAjhwaSyol6T7UsRFxfGFR vvIqsmev6BICW8leD4pdrCs0XrAoUpbCzr7b29z9ahliq7zJ51Q00jBky/tGUnxgJAdc bObA== 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=BAE/HnEoeH/I6AsDCMIiIUVtpfPBxI4oEAjjMlMZGXc=; b=VHIUGwkCaaKU/wpgEGMvsaiCiPLlPleWgFX29L2E6f/rSgmvs4EaCpJ7qdbtR1bpVg +MjgqZOga5Au2ApnEoA13fHXNTVBxzZ6UIb7pi9Lkgr0PYBqE9MiLPbKRnhn333JHKnC yHIFIGs4c72N/zQ9E/Pt1WAkR62m5TI2wzCn7xtk+lfmzA0G0P/VdA5FcRcfmSX0kgIn oYgIT9wIhyNrTm25fk0e5nJ05aU5x+YsH07z1sNKNfqP8M+6GM4ftDZUzjU/rhos7YY0 BaFgtXM7QN8anLAisklUZruiIH5d++u7FRVgDFxnjbmX7NwyXaDjWY015aNUa9RZCyDd a/7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZfBYm49e; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c15si6462032ejr.124.2021.02.05.21.50.06; Fri, 05 Feb 2021 21:50:30 -0800 (PST) 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=@linaro.org header.s=google header.b=ZfBYm49e; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229621AbhBFFsh (ORCPT + 99 others); Sat, 6 Feb 2021 00:48:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbhBFFsd (ORCPT ); Sat, 6 Feb 2021 00:48:33 -0500 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11A09C061756 for ; Fri, 5 Feb 2021 21:47:53 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id 8so4633717plc.10 for ; Fri, 05 Feb 2021 21:47:53 -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=BAE/HnEoeH/I6AsDCMIiIUVtpfPBxI4oEAjjMlMZGXc=; b=ZfBYm49eLFIQVfzYokXITH5vfeUno9/jvuNet9pJQuW3syR/+XH3/YZk7qYsGlaarI Av8bjd9ybfZ2NrBbkKoH6TkHKgDOozMgh5AfXNz2vBQO/CjBCUCqnALvXpYGfT4saEch /9wCs2JEHatTpiiTbSS0/jeDneToQGX/UbC/riRDR9KDRuze2GzoJovxK+sDxxU3D58G e6dBr1bcw9JY0uhHo7cPlIcQKBZT5TBvifUlt8hsQ+C5nQX5APkE6jPwT6fKeY5Wkcw1 Cy44UKqKF6aOMe5F/BWJyDL454r9LYEwH4Vtz9CEhfiKHMks6kN+2bQt3ndo/gu0Myi9 yXZA== 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=BAE/HnEoeH/I6AsDCMIiIUVtpfPBxI4oEAjjMlMZGXc=; b=kndeWafMR3FWt5PO9xkAbz9IViPbJyKNUVQ9LqKMOf9Kaqo54xj0V/g0E7jgxgyWAX 1MRyj1Bb0ZtnbJwv7NsULMkm4Ze//zKJmlvcnsOIpvHmOqXoNbrZSVJOC8SFgVX9qmju 1bAkhcwHhQMaV+kodBsOc4ZM64wj/l8WZBIVDsVTWC7sf/kVV6QDOFTa304eckvxWWY4 d7GGOP7BBLRSGiNvxRL3w2xBtswEcqnP1H+wg1npLoVe8JFDYn0sfW3YCVum5dUuSzqM VRPYB1LZB+kyapD1An9fyP0w9Xuz2CtNZe2H5yo/vxBV488Iabjc1uR/AN7ngXTBLP8a LTAA== X-Gm-Message-State: AOAM532Kd+gh2+Fm+joqhXlZDueyGW1V9i01x/9d9rGIlU9wTzKKN8zT /t/yXkB4+HlfdEBgBzSdMveqlbMkr8xo5g== X-Received: by 2002:a17:90b:4d09:: with SMTP id mw9mr7553358pjb.199.1612590472244; Fri, 05 Feb 2021 21:47:52 -0800 (PST) Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id ob6sm9200211pjb.30.2021.02.05.21.47.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Feb 2021 21:47:51 -0800 (PST) From: John Stultz To: lkml Cc: John Stultz , Daniel Vetter , Sumit Semwal , Liam Mark , Chris Goldsworthy , Laura Abbott , Brian Starkey , Hridya Valsaraju , Suren Baghdasaryan , Sandeep Patil , Daniel Mentz , =?UTF-8?q?=C3=98rjan=20Eide?= , Robin Murphy , Ezequiel Garcia , Simon Ser , James Jones , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [RFC][PATCH 1/2] dma-buf: dma-heap: Provide accessor to get heap name Date: Sat, 6 Feb 2021 05:47:47 +0000 Message-Id: <20210206054748.378300-1-john.stultz@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It can be useful to access the name for the heap, so provide an accessor to do so. Cc: Daniel Vetter Cc: Sumit Semwal Cc: Liam Mark Cc: Chris Goldsworthy Cc: Laura Abbott Cc: Brian Starkey Cc: Hridya Valsaraju Cc: Suren Baghdasaryan Cc: Sandeep Patil Cc: Daniel Mentz Cc: Ørjan Eide Cc: Robin Murphy Cc: Ezequiel Garcia Cc: Simon Ser Cc: James Jones Cc: linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: John Stultz --- drivers/dma-buf/dma-heap.c | 13 +++++++++++++ include/linux/dma-heap.h | 9 +++++++++ 2 files changed, 22 insertions(+) diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index afd22c9dbdcf..6c746ea67676 100644 --- a/drivers/dma-buf/dma-heap.c +++ b/drivers/dma-buf/dma-heap.c @@ -190,6 +190,19 @@ void *dma_heap_get_drvdata(struct dma_heap *heap) return heap->priv; } + +/** + * dma_heap_get_name() - get heap name + * @heap: DMA-Heap to retrieve private data for + * + * Returns: + * The char* for the heap name. + */ +char *dma_heap_get_name(struct dma_heap *heap) +{ + return heap->name; +} + struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) { struct dma_heap *heap, *h, *err_ret; diff --git a/include/linux/dma-heap.h b/include/linux/dma-heap.h index 454e354d1ffb..b91778291fb1 100644 --- a/include/linux/dma-heap.h +++ b/include/linux/dma-heap.h @@ -50,6 +50,15 @@ struct dma_heap_export_info { */ void *dma_heap_get_drvdata(struct dma_heap *heap); +/** + * dma_heap_get_name() - get heap name + * @heap: DMA-Heap to retrieve private data for + * + * Returns: + * The char* for the heap name. + */ +char *dma_heap_get_name(struct dma_heap *heap); + /** * dma_heap_add - adds a heap to dmabuf heaps * @exp_info: information needed to register this heap -- 2.25.1