From patchwork Fri Oct 25 22:50:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 177795 Delivered-To: patches@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp168692ill; Fri, 25 Oct 2019 15:50:17 -0700 (PDT) X-Received: by 2002:a63:4d0d:: with SMTP id a13mr2915600pgb.451.1572043817593; Fri, 25 Oct 2019 15:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572043817; cv=none; d=google.com; s=arc-20160816; b=f0Sm569uxfdPfETWhHJAakvlNanj3GG8ojWFVix1s8PXa8y1vDpQXzLKMpHAWGeAFU P7Tu6fr/DnW8RnbYWuEWzGJP/QcRKQgOBt5Fvz8+FYz4KNif9+dPKWFF1pfvHJX8U8pM ZS6hPNF7aH7amBTHiIh4cLycqedwv9YEQrCDhYraIHpaDBFp4CQ/mHxPEn9TJxuewIgR qYH3Hm50AFRbnGAHOPwgBLIN3dmqTLMNPRdF2Qc8EAyyut5RSxt0mLQ+t8k8L6BRNbQT 2sUtJiy9kLMZeiAzOYh6TZ1s0bQcKJca5XTz8Owkq4UO+eOrfTnNT9xLN1AxqRZ3YT1c lDDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/QsSnbqT/vxBzyqQX0KdepymXuDj6dGQtXlO9dbOSkk=; b=hBvAC37/JhXeV+w2r4PFDZZFJU9gcIfmCeNDwawxpmg9P7JAs7Kf/1dZXH793Y3Qth R3XftkmiWjc8iXoTTpcMNMKghsXRTtN/hewGAoFRpF9gggrrG49IDh+jI7/Mu9velxPu dRWi1HCvQEy1KhanVuEBat5MOA6LjjGwWJnqcfger/V+8q/Q95PbZ/+NcssIBoJK+WGE 9GZOc3Myw2OS//Iw7F3O/1ILCTFYIdPAWXc/fkQchxU408cbCkF4zux8ade2ctbW35HC 9P24/sOtW02gsXKpDyX9lWDXNmfB2m0TNbME3b0llihXTlu63pPRM6Oc9DnTZpgP0QMe ObvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QuTmYOTq; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id a30sor3551658pgb.48.2019.10.25.15.50.17 for (Google Transport Security); Fri, 25 Oct 2019 15:50:17 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QuTmYOTq; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/QsSnbqT/vxBzyqQX0KdepymXuDj6dGQtXlO9dbOSkk=; b=QuTmYOTqrurVmJ/xuipLBhM7GLFY5pGr1iJX3QKVdcKK/H8I/5AdYHQwYMY2NUiqXc AxSegHg7VxQ7X/0azpl7Q8w46j+KDFXLJrEkkWcH6302yTkS51/vcbuJFQHzVwUgBWj6 JzKzOF5iC3EH7xZqAoCQULcCl2yXADIIzruVCenqNO7lW51zLg2HmLfFuT1VYsYAmSL3 3hnxUHcxN+1kHcPwaaGoAQ+jv/eXxBlLQUSk4/h9aGt3i0AK0wdV7K8dTsU2mZ3h+46J Faj4npHwJnvDE245x+lkyKBoXHWzL1LDqC/pK//cfEiAkdcXSCixwBIguLUCDpUHNjem amjg== 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=/QsSnbqT/vxBzyqQX0KdepymXuDj6dGQtXlO9dbOSkk=; b=rvn/Kqs1/2+Dz7xIVgWcZevkmKCbH2wg6kSa0MyM3dGWCDjJe4iC+hzXIN48oIW3Wy kHDTBgXDA90oToWyxSmWbYY/uoN6cKLtVcMoYk9sucXaLOAG+HJQD2uZPEBCwQ4A9R1h M6iLFBd7AQvLXgipjNZ17NHuK2gbbzMRNfyTa/Cs5FwuEa59dmb8e3LrBD5Zl2Q+lvLX c4eWKd9EKBgkofcJkJJWKLegzX4SlKmKEwIESiwzTKoFaqjiGfdriHd2YT8qxUwj0ZBp ORAgiBw4a0p9Qub5mv7NiM5q3ExlQZeEtYpmE+1dBw273fHRpla6AbOyAIUg0DGNmWD8 wPuQ== X-Gm-Message-State: APjAAAVQ0gfY93JDQ3YjWWTvRqoc8Smu4DxWt6F+u17y1UWfcBp/hhnF gD3qfCCSodmIxDVPg6/O9DqSPt9L X-Google-Smtp-Source: APXvYqziC/rX8OG0ZvE60odRUgM4+OMxyzH9YT1VE6orCRtoxz0Nkzr2UbFad4Lx05yIE7lyxETSEw== X-Received: by 2002:a63:5c21:: with SMTP id q33mr7104380pgb.78.1572043817153; Fri, 25 Oct 2019 15:50:17 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id o15sm2758018pjs.14.2019.10.25.15.50.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 15:50:16 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Rob Herring , Mark Rutland , Laura Abbott , Benjamin Gaignard , Sumit Semwal , Liam Mark , Pratik Patel , Brian Starkey , "Andrew F . Davis" , Chenbo Feng , Alistair Strachan , Sandeep Patil , Hridya Valsaraju , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [RFC][PATCH 1/3] dt-bindings: dma-buf: heaps: Describe CMA regions to be added to dmabuf heaps interface. Date: Fri, 25 Oct 2019 22:50:07 +0000 Message-Id: <20191025225009.50305-2-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025225009.50305-1-john.stultz@linaro.org> References: <20191025225009.50305-1-john.stultz@linaro.org> This binding specifies which CMA regions should be added to the dmabuf heaps interface. Cc: Rob Herring Cc: Mark Rutland Cc: Laura Abbott Cc: Benjamin Gaignard Cc: Sumit Semwal Cc: Liam Mark Cc: Pratik Patel Cc: Brian Starkey Cc: Andrew F. Davis Cc: Chenbo Feng Cc: Alistair Strachan Cc: Sandeep Patil Cc: Hridya Valsaraju Cc: devicetree@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: John Stultz --- .../bindings/dma/dmabuf-heap-cma.txt | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma/dmabuf-heap-cma.txt -- 2.17.1 diff --git a/Documentation/devicetree/bindings/dma/dmabuf-heap-cma.txt b/Documentation/devicetree/bindings/dma/dmabuf-heap-cma.txt new file mode 100644 index 000000000000..bde7b1f1c269 --- /dev/null +++ b/Documentation/devicetree/bindings/dma/dmabuf-heap-cma.txt @@ -0,0 +1,31 @@ +* DMA-BUF CMA Heap + +Specifies a CMA region that should be added to the dma-buf heaps +interface. + +Required properties: +- compatible: Must be "dmabuf-heap-cma" +- memory-region: phandle to a CMA reserved memory node + +Example: +This example has a camera CMA node in reserved memory, which is then +referenced by the dmabuf-heap-cma node. + + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + ... + cma_camera: cma-camera { + compatible = "shared-dma-pool"; + reg = <0x0 0x24C00000 0x0 0x4000000>; + reusable; + }; + ... + }; + + cma_heap { + compatible = "dmabuf-heap-cma"; + memory-region = <&cma_camera>; + }; From patchwork Fri Oct 25 22:50:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 177796 Delivered-To: patches@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp168715ill; Fri, 25 Oct 2019 15:50:19 -0700 (PDT) X-Received: by 2002:a63:cf46:: with SMTP id b6mr7267969pgj.90.1572043818832; Fri, 25 Oct 2019 15:50:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572043818; cv=none; d=google.com; s=arc-20160816; b=TAwbB1ODxXI8YxoYF3RUd+/Sj+9aCkSyrkNzwh1NggypNESTZYY86G1gSr3QOHtn5j ryLNARZ+p2+kvGVqZn5XdaBR1huMtW0F8t4kYXUBh2lsk1OOml/acZUhZXZUX6GCA77l Al3JxbnAyvQnEzjVvEV7Vj4VOo7Ab7zfsfxuZUw5TXWiFVJdmsgJGSMB3WT6jtWFeg9J FwS6HJ1M9ZCYJa4dlQSks5gEqsktPZRdElx9yahDE8PRGzBHauC/Utr9kU/9atnYym4W Gq93/CUkSHqt0YoTNqtCH5yPqNG2m3SlGQ9ePaQC4PjjD34HZHXOWy8i+qjmZ2CU0N3p xz6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KxqkayFb7m9sYPELw0DxQ5VjRvj+WqO4uI8I+KYabjE=; b=lAfl+pJbn4O3OpHPTHpUf9VPxv/gFZSInC8LnNG5T6Lu4/6eXn5OnuJENt5XhKmIyY yQIldCyIi9IIcQ+FumW6pYCfDOH/mm3nia1Mb9B9zX4frtF0qgoBiDRb5o/iDhcvrpSU B3NKw6LhjvCcduwWmIL0Ia1bQbmGgOe/tNnhRWzuln2IzmR7NY1op0SmyHhEhLQOfr8/ zHqFCLrzSIoi9VuUKcmXpKuH5G3WRT7+XX0h2p6USCZZYL+KzHG9tG2HMqG4YdBERf+I 73VLmFZ/SXHZ0E1a94qnBemjCg8JGaBk/U5ae7iuFpOObrMcNEPiH5u7RlXMYZ1HtC4N sNzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YPNNxVZO; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id a14sor3521234pgh.66.2019.10.25.15.50.18 for (Google Transport Security); Fri, 25 Oct 2019 15:50:18 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YPNNxVZO; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KxqkayFb7m9sYPELw0DxQ5VjRvj+WqO4uI8I+KYabjE=; b=YPNNxVZOZJlLKs7oXdvUCzvzCrltQPL8eWMoKdZWWv6dR9YRavL7O8GUrDdJN+aF1c NONSin6KYmGXn/ghUVTQuPQPS7fDeC0To+Axtws+gmTPLAZH8XKDibrwFAtn9aXa44zn z3R6iQ02U7OFyhYvs8GNx7UWmkS60YLobBM9GP1y/oHOBiWjS0KRzPNBiXLalgKt0/lk luVuTeAece9hd7my2vsqWp2iOIEILuRyhxB675rOPv/o+UmDNg2pK5vP4bAZ5+L+q3Bu EBPnMKcpO1TROkAZXERNtRg70QdVQbrEdXao1+P4SsHD5z1hkzgeGU7RNdmqeG+6JL4B pVhQ== 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=KxqkayFb7m9sYPELw0DxQ5VjRvj+WqO4uI8I+KYabjE=; b=JjNMNvlAawgIltR7CgNoIWQ3CHJTlsRUIubkxfPLCDN4xBgz8lJdR96smFWg+gTgJc lvHmemaH96e+5v2qPEl+/sjW3S4IDRS07WWjmQ4P/KAwQ28kPu8lL8ym1FvmmJgsWWAj L24RMdRQKSU7Nb7Oj6eacck3udRDH/0IvkFJtCIg+0dfFLkHXFzuY03YZ8t90sV9IQDE tyRdw/FUxXKXnlrpuMd8/NjfFOoAYocfCeMNDV9Vkz/FRIAgs2t0FT1RvxZdBsvhldT/ eNohs8vl3OM/allcPvz2awh87YybE4FrqFUCXtAv+IODc4C2KZQyO/Dvc7GPxCuDu/VM BCxA== X-Gm-Message-State: APjAAAXp/WbBvB6IoDllqGozHf6BjhqyStDrFmXBDNc/uJxF+IaCO3U9 T37fDM4py2YbBW8iyTvbQ4YtpJCP X-Google-Smtp-Source: APXvYqwH7FDeikwYbqOx/o7f38x/ORIOox29XW0WwLYwBPb50atXz5l+ZpfB/8ub7NnMSoQQiqTbow== X-Received: by 2002:a65:638a:: with SMTP id h10mr7136687pgv.388.1572043818363; Fri, 25 Oct 2019 15:50:18 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id o15sm2758018pjs.14.2019.10.25.15.50.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 15:50:17 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Rob Herring , Mark Rutland , Laura Abbott , Benjamin Gaignard , Sumit Semwal , Liam Mark , Pratik Patel , Brian Starkey , "Andrew F . Davis" , Chenbo Feng , Alistair Strachan , Sandeep Patil , Hridya Valsaraju , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [RFC][PATCH 2/3] dma-buf: heaps: Allow adding specified non-default CMA heaps Date: Fri, 25 Oct 2019 22:50:08 +0000 Message-Id: <20191025225009.50305-3-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025225009.50305-1-john.stultz@linaro.org> References: <20191025225009.50305-1-john.stultz@linaro.org> In earlier versions of the dmabuf CMA heap, we added all CMA areas as CMA heaps. Andrew noted this might not be desired, and so we changed the code to only add the default CMA area. This patch extends the earlier effort so that devices can specifiy which CMA areas they want to add as dmabuf heaps via DT, and we'll only add those. This allows multiple CMA areas to be exported via the dmabuf heaps interface. Cc: Rob Herring Cc: Mark Rutland Cc: Laura Abbott Cc: Benjamin Gaignard Cc: Sumit Semwal Cc: Liam Mark Cc: Pratik Patel Cc: Brian Starkey Cc: Andrew F. Davis Cc: Chenbo Feng Cc: Alistair Strachan Cc: Sandeep Patil Cc: Hridya Valsaraju Cc: devicetree@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: John Stultz --- drivers/dma-buf/heaps/cma_heap.c | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) -- 2.17.1 diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c index 064926b5d735..0d5231a1e561 100644 --- a/drivers/dma-buf/heaps/cma_heap.c +++ b/drivers/dma-buf/heaps/cma_heap.c @@ -15,6 +15,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -174,5 +177,40 @@ static int add_default_cma_heap(void) return ret; } module_init(add_default_cma_heap); + +static int cma_heaps_probe(struct platform_device *pdev) +{ + struct device_node *np = pdev->dev.of_node; + struct cma *cma_area; + int ret; + + ret = of_reserved_mem_device_init_by_idx(&pdev->dev, np, 0); + if (ret) { + pr_err("Error %s(): of_reserved_mem_device_init_by_idx failed!\n", __func__); + return ret; + } + + cma_area = dev_get_cma_area(&pdev->dev); + if (cma_area) + ret = __add_cma_heap(cma_area, NULL); + + return ret; +} + +static const struct of_device_id cma_heap_dt_ids[] = { + { .compatible = "dmabuf-heap-cma" }, + {}, +}; +MODULE_DEVICE_TABLE(of, cma_heap_dt_ids); + +static struct platform_driver cma_heaps_driver = { + .driver = { + .name = "CMA Heaps", + .of_match_table = cma_heap_dt_ids, + }, + .probe = cma_heaps_probe, +}; + +module_platform_driver(cma_heaps_driver); MODULE_DESCRIPTION("DMA-BUF CMA Heap"); MODULE_LICENSE("GPL v2"); From patchwork Fri Oct 25 22:50:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 177797 Delivered-To: patches@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp168731ill; Fri, 25 Oct 2019 15:50:20 -0700 (PDT) X-Received: by 2002:a17:90a:5d85:: with SMTP id t5mr7007910pji.120.1572043820013; Fri, 25 Oct 2019 15:50:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572043820; cv=none; d=google.com; s=arc-20160816; b=f0BIyzGzCCmW8ETnNACt16hEpMea4kj7fAsz8nXclMNarc/Vrt4AkOXJ0i8tws+1WA XWNeFLYFAuhQSEpG2V3YHg2MlhH3BY81D9gq50CYG/QmHBJd20VWrqXxXDpYtxAfFMXJ AC1yuJQlJrCb0W79JYk50MyCI5tZkjiU6SOChu/DqHAcUUxvHz/XrCixgUnE5RDyaWg3 a+jE7bJM6inLNqzZcNoz4IDGZr+QD/dRJkZ3Wou5VN874fB3Gnb8z11Q3c0NcoYRqa7u XknsIFXGt6mjUUTtu6bcZFL12EzlcvXe7yUHHo2zaEueryU/KHTN25lk9QLXmNCfsyem eGNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=osNStqGe/+pixQ+TIIwo4hgOQ0iCE+khF0tMpALPhbA=; b=vj+1D3shvwuArv26GvcGTxSmBr8FOE+RazBgjdu/DcxKXMjaGiNkXLj9aoIowfpAsQ FdDZRKLzGwUrqZXxrQ6qgx5MdLniKfLpdZAGnBZTGmxtmOERs1Bv+8+53rFskVgZ4LR7 k9OrmE/ymkcuuIOIkzerczWwfTIXx++2xIE8QvsRvpd6emQ3kQWw4iUfaJASJRx9a/sA c/o7WdtFzyTf8gFRA1M3uIjbk7TRZP44e28Qa2PXDFidFVZGKjuME35tPEdI88wLVyIw qn1HUJvRfTgETBdSJn1X74obvoQGDeCIago6wvxd0TBczDQrSWWatHwV5wtnX3BSxUeo h7nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="t7oj1A8/"; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id 98sor4848908plc.30.2019.10.25.15.50.19 for (Google Transport Security); Fri, 25 Oct 2019 15:50:19 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="t7oj1A8/"; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=osNStqGe/+pixQ+TIIwo4hgOQ0iCE+khF0tMpALPhbA=; b=t7oj1A8/ELwYNKEiPY/Pw18dHmD+od22U+4C5NhOE2wd5jiFHCseOjSRPgNDzrSyKq dPtd5CcVf9iIPtDONddh2eO4eP3j6pOkNRnByhXulltB5XaUZ4VBvTkOfFT3PuuTpbgR fm3I84wjJaEQhBPHt7WSbAUDubIimzLHWBCLSLWX5sMsbyrT3fCHo5F1xVc6KrpAYg6a AgjQBcwoRkdatjyjUVB6aSuWoLUrCrbKujOVSG/5gs8lzDyIeWuQNxGe2iKOkrtKXEpq 1wh9xGKkBGFWOlUKiBuDHcJfU/9wkfMXegJLC9PRvNvTK7V02u/r9lQ0YSfzf7FIX6cd JAlA== 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=osNStqGe/+pixQ+TIIwo4hgOQ0iCE+khF0tMpALPhbA=; b=hGyLe3zvEc4zMNZqdWbQC7MFXEWhwR+UySlGMTOXm7nu//qYZYpbpWxEPt59tWlwm6 Ykmc4jF3JjpwmPstDBP+5o5rDL3QxUut9Dw2iwGbJH7R9P1HfrctWiXxeDuJGgHi2Axv GPf8pEnLvRsd3qBQ5LtfvPJTK9Rdgw0VqSnFwKa/WfCM7zHrYYkfYsJ/ETYdszu8Q+Ai SrcBWba7kqBNvokrQ/sLoCegPJsdOCc/LX50oM7s5lDRZWCNt80D3eG7/Dcial6N5+GD vbcMwQNQgJPftmdwNjW5qyZHUwn3h2MFMvwUdRAvR0zMtxEVea2A6+T28A7cOMWAgbHG F8Lg== X-Gm-Message-State: APjAAAViGlYoLhKZS1VLmtEhhAS2Nbh3MCMElqMOTD9q8T9aQkh/Mxiq GwnwnsA9TrtCFfilErZNOxMf6G6a X-Google-Smtp-Source: APXvYqwEfPgMUzNALdpaZ7hIfRdBK9Sl+x7omJQowf6j1uRY6bjZJnZXHQcn0Yn6ut98Jyy0zAwi0g== X-Received: by 2002:a17:902:8a96:: with SMTP id p22mr6280974plo.272.1572043819516; Fri, 25 Oct 2019 15:50:19 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id o15sm2758018pjs.14.2019.10.25.15.50.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 15:50:19 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Rob Herring , Mark Rutland , Laura Abbott , Benjamin Gaignard , Sumit Semwal , Liam Mark , Pratik Patel , Brian Starkey , "Andrew F . Davis" , Chenbo Feng , Alistair Strachan , Sandeep Patil , Hridya Valsaraju , devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [RFC][PATCH 3/3] example: dts: hi3660-hikey960: Add dts entries to test cma heap binding Date: Fri, 25 Oct 2019 22:50:09 +0000 Message-Id: <20191025225009.50305-4-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025225009.50305-1-john.stultz@linaro.org> References: <20191025225009.50305-1-john.stultz@linaro.org> Adds example test entry to create and expose a camera cma region via the dmabuf heaps interface This isn't a patch I'm submitting to merge, but just an example of how this functionality can be used, which I've used for testing. Cc: Rob Herring Cc: Mark Rutland Cc: Laura Abbott Cc: Benjamin Gaignard Cc: Sumit Semwal Cc: Liam Mark Cc: Pratik Patel Cc: Brian Starkey Cc: Andrew F. Davis Cc: Chenbo Feng Cc: Alistair Strachan Cc: Sandeep Patil Cc: Hridya Valsaraju Cc: devicetree@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: John Stultz --- arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts b/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts index 190ac29b9e2f..783c5b2abd2d 100644 --- a/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts +++ b/arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts @@ -75,12 +75,23 @@ }; /* global autoconfigured region for contiguous allocations */ - linux,cma { + cma_default: linux,cma { compatible = "shared-dma-pool"; reg = <0x0 0x20C00000 0x0 0x4000000>; reusable; linux,cma-default; }; + + cma_camera: cma-camera { + compatible = "shared-dma-pool"; + reg = <0x0 0x24C00000 0x0 0x4000000>; + reusable; + }; + }; + + cma_heap { + compatible = "dmabuf-heap-cma"; + memory-region = <&cma_camera>; }; reboot-mode-syscon@32100000 {