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

Commit 937dd4a0 authored by Vikash Garodia's avatar Vikash Garodia
Browse files

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



Currently, for targets which do not have VMEM, video
driver consider it as error and video session fails.
Add check to consider cases for target which do not
have VMEM.

Change-Id: I3661955fa8e72927c9708fe00c5d0eb57e154d29
Signed-off-by: default avatarVikash Garodia <vgarodia@codeaurora.org>
parent 8c15a3c1
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);