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

Commit 6b0dc543 authored by Ruofei Ma's avatar Ruofei Ma
Browse files

msm: cvp: Add support for FD 0



ION allocator supports FD 0 so cvp driver needs to support it.

Change-Id: Ia20526ec291d06cea30423348d83c690e9d6ef4c
Signed-off-by: default avatarRuofei Ma <ruofeim@codeaurora.org>
parent f08e34e4
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -391,7 +391,7 @@ static int msm_cvp_map_buf_user_persist(struct msm_cvp_inst *inst,
		return -EINVAL;
	}

	if (in_buf->fd > 0) {
	if (in_buf->fd >= 0) {
		dma_buf = msm_cvp_smem_get_dma_buf(in_buf->fd);
		if (!dma_buf) {
			dprintk(CVP_ERR, "%s: Invalid fd=%d", __func__,
@@ -462,7 +462,7 @@ static int msm_cvp_map_buf_cpu(struct msm_cvp_inst *inst,
		return -EINVAL;
	}

	if (in_buf->fd > 0) {
	if (in_buf->fd >= 0) {
		dma_buf = msm_cvp_smem_get_dma_buf(in_buf->fd);
		if (!dma_buf) {
			dprintk(CVP_ERR, "%s: Invalid fd=%d", __func__,
@@ -738,7 +738,7 @@ static int msm_cvp_map_user_persist(struct msm_cvp_inst *inst,
			return -EINVAL;
		}

		if (new_buf->fd <= 0 && !new_buf->dbuf)
		if ((new_buf->fd < 0 || new_buf->size == 0) && !new_buf->dbuf)
			continue;

		rc = msm_cvp_map_buf_user_persist(inst, new_buf, &iova);
@@ -817,7 +817,8 @@ static int msm_cvp_map_buf(struct msm_cvp_inst *inst,
				return -EINVAL;
			}

			if (new_buf->fd <= 0 && !new_buf->dbuf)
			if ((new_buf->fd < 0 || new_buf->size == 0) &&
				!new_buf->dbuf)
				continue;

			rc = msm_cvp_map_buf_cpu(inst, new_buf, &iova, frame);
+1 −1
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ int msm_cvp_smem_map_dma_buf(struct msm_cvp_inst *inst,
		return rc;
	}

	if (smem->fd > 0) {
	if (smem->fd >= 0) {
		dbuf = msm_cvp_smem_get_dma_buf(smem->fd);
		if (!dbuf) {
			rc = -EINVAL;