Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d191ea4 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge changes If6b0919c,I3c4f68db into msm-4.14

* changes:
  ARM: dts: msm: Add adsp heap subnode in sdm855 video node
  msm: vidc: Allocate HFI CDSP queues from adsp heap
parents 64484747 9af22043
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -138,6 +138,13 @@ Optional properties:
  this tag will be used to pick the appropriate bus as per the session profile
  as shown below in example.

Memory Heaps
============
Required properties:
- compatible : one of:
	- "qcom,msm-vidc,mem-adsp"
- memory-region : phandle to the memory heap/region.

Example:

	qcom,vidc@fdc00000 {
+6 −0
Original line number Diff line number Diff line
@@ -124,5 +124,11 @@
			virtual-addr-pool = <0x1000000 0x24800000>;
			qcom,secure-context-bank;
		};

		/* Memory Heaps */
		qcom,msm-vidc,mem_adsp {
			compatible = "qcom,msm-vidc,mem-adsp";
			memory-region = <&adsp_mem>;
		};
	};
};
+9 −0
Original line number Diff line number Diff line
@@ -488,6 +488,7 @@ static const struct of_device_id msm_vidc_dt_match[] = {
	{.compatible = "qcom,msm-vidc"},
	{.compatible = "qcom,msm-vidc,context-bank"},
	{.compatible = "qcom,msm-vidc,bus"},
	{.compatible = "qcom,msm-vidc,mem-adsp"},
	{}
};

@@ -679,6 +680,11 @@ static int msm_vidc_probe_vidc_device(struct platform_device *pdev)
	return rc;
}

static int msm_vidc_probe_mem_adsp(struct platform_device *pdev)
{
	return read_mem_adsp_resources_from_dt(pdev);
}

static int msm_vidc_probe_context_bank(struct platform_device *pdev)
{
	return read_context_bank_resources_from_dt(pdev);
@@ -704,6 +710,9 @@ static int msm_vidc_probe(struct platform_device *pdev)
	} else if (of_device_is_compatible(pdev->dev.of_node,
		"qcom,msm-vidc,context-bank")) {
		return msm_vidc_probe_context_bank(pdev);
	} else if (of_device_is_compatible(pdev->dev.of_node,
		"qcom,msm-vidc,mem-adsp")) {
		return msm_vidc_probe_mem_adsp(pdev);
	}

	/* How did we end up here? */
+1 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ struct msm_smem {
	void *dma_buf;
	void *kvaddr;
	u32 device_addr;
	dma_addr_t dma_handle;
	unsigned int offset;
	unsigned int size;
	unsigned long flags;
+31 −0
Original line number Diff line number Diff line
@@ -377,6 +377,14 @@ static int msm_vidc_load_allowed_clocks_table(
	return 0;
}

static int msm_vidc_populate_mem_adsp(struct device *dev,
		struct msm_vidc_platform_resources *res)
{
	res->mem_adsp.dev = dev;

	return 0;
}

static int msm_vidc_populate_bus(struct device *dev,
		struct msm_vidc_platform_resources *res)
{
@@ -1277,3 +1285,26 @@ int read_bus_resources_from_dt(struct platform_device *pdev)

	return msm_vidc_populate_bus(&pdev->dev, &core->resources);
}

int read_mem_adsp_resources_from_dt(struct platform_device *pdev)
{
	struct msm_vidc_core *core;

	if (!pdev) {
		dprintk(VIDC_ERR, "%s: invalid platform device\n", __func__);
		return -EINVAL;
	} else if (!pdev->dev.parent) {
		dprintk(VIDC_ERR, "Failed to find a parent for %s\n",
				dev_name(&pdev->dev));
		return -ENODEV;
	}

	core = dev_get_drvdata(pdev->dev.parent);
	if (!core) {
		dprintk(VIDC_ERR, "Failed to find cookie in parent device %s",
				dev_name(pdev->dev.parent));
		return -EINVAL;
	}

	return msm_vidc_populate_mem_adsp(&pdev->dev, &core->resources);
}
Loading