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

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

Merge "msm: vidc: Add check to handle no-VMEM case"

parents 3f65c2c4 937dd4a0
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -932,7 +932,7 @@ static int __alloc_imem(struct venus_hfi_device *device, unsigned long size)
	struct imem *imem = NULL;
	int rc = 0;

	if (!device || !size)
	if (!device)
		return -EINVAL;

	imem = &device->resources.imem;
@@ -963,6 +963,10 @@ static int __alloc_imem(struct venus_hfi_device *device, unsigned long size)
		imem->vmem = vmem_buffer;
		break;
	}
	case IMEM_NONE:
		rc = 0;
		break;

	default:
		rc = -ENOTSUPP;
		goto imem_alloc_failed;
@@ -1026,6 +1030,10 @@ static int __set_imem(struct venus_hfi_device *device, struct imem *imem)
		rhdr.resource_id = VIDC_RESOURCE_VMEM;
		addr = imem->vmem;
		break;
	case IMEM_NONE:
		dprintk(VIDC_DBG, "%s Target does not support IMEM", __func__);
		rc = 0;
		goto imem_set_failed;
	default:
		dprintk(VIDC_ERR, "IMEM of type %d unsupported\n", imem->type);
		rc = -ENOTSUPP;
+5 −0
Original line number Diff line number Diff line
@@ -310,6 +310,11 @@ int vmem_allocate(size_t size, phys_addr_t *addr)
		rc = -ENOTSUPP;
		goto exit;
	}
	if (!size) {
		pr_err("%s Invalid size %ld\n", __func__, size);
		rc = -EINVAL;
		goto exit;
	}

	max_size = resource_size(vmem->mem.resource);