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

Commit 5d5cee52 authored by Srinu Gorle's avatar Srinu Gorle
Browse files

msm: vidc_3x: populate sid list for each context bank



Added changes to read sids associated with each conext bank.

Change-Id: I5dcc3404ec9b266235d25ea2cb857edac8d1abc1
Signed-off-by: default avatarSrinu Gorle <sgorle@codeaurora.org>
parent 9529f971
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -1426,6 +1426,7 @@ static int msm_vidc_populate_context_bank(struct device *dev,
	int rc = 0;
	struct context_bank_info *cb = NULL;
	struct device_node *np = NULL;
	unsigned int i = 0, j = 0, count = 0;

	if (!dev || !core) {
		dprintk(VIDC_ERR, "%s - invalid inputs\n", __func__);
@@ -1448,8 +1449,21 @@ static int msm_vidc_populate_context_bank(struct device *dev,
			"Failed to read cb label from device tree\n");
		rc = 0;
	}

	dprintk(VIDC_DBG, "%s: context bank has name %s\n", __func__, cb->name);
	of_get_property(np, "iommus", &count);
	memset(&cb->sids, -1, sizeof(cb->sids));
	count /= 4;
	for (i = 1, j = 0 ; i < count; i = i+2, j++) {
		rc = of_property_read_u32_index(dev->of_node,
			"iommus", i, &cb->sids[j]);
		if (rc < 0)
			dprintk(VIDC_ERR, "can't fetch SID\n");

		dprintk(VIDC_DBG,
			"%s sid[%d]:0x%x\n",  cb->name, j, cb->sids[j]);
	}
	cb->num_sids = j;

	rc = of_property_read_u32_array(np, "virtual-addr-pool",
			(u32 *)&cb->addr_range, 2);
	if (rc) {
+4 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -18,6 +18,7 @@
#include <linux/platform_device.h>
#include <media/msm_vidc.h>
#define MAX_BUFFER_TYPES 32
#define VENUS_SID_MAX 32

struct version_table {
	u32 version_mask;
@@ -75,6 +76,8 @@ struct context_bank_info {
	struct addr_range addr_range;
	struct device *dev;
	struct dma_iommu_mapping *mapping;
	int sids[VENUS_SID_MAX];
	int num_sids;
};

struct buffer_usage_table {