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

Commit 8458bb40 authored by Shalaj Jain's avatar Shalaj Jain
Browse files

msm: vidc: Add new decoder cmd for reconfig hint



Send buffer size and count when client queries this via decoder cmd
right after port reconfig.

CRs-Fixed: 972394
Change-Id: I9738fd1e1e3066ca54840dee88289861dfc6c85b
Signed-off-by: default avatarShalaj Jain <shalajj@codeaurora.org>
parent 83ab881a
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
@@ -3375,6 +3375,36 @@ int msm_vidc_comm_cmd(void *instance, union msm_v4l2_cmd *cmd)
				"Failed to flush buffers: %d\n", rc);
		}
		break;
	case V4L2_DEC_QCOM_CMD_RECONFIG_HINT:
	{
		u32 *ptr = NULL;
		struct hal_buffer_requirements *output_buf;

		rc = msm_comm_try_get_bufreqs(inst);
		if (rc) {
			dprintk(VIDC_ERR,
					"Getting buffer requirements failed: %d\n",
					rc);
			break;
		}

		output_buf = get_buff_req_buffer(inst,
				msm_comm_get_hal_output_buffer(inst));
		if (!output_buf) {
			dprintk(VIDC_DBG,
					"This output buffer not required, buffer_type: %x\n",
					HAL_BUFFER_OUTPUT);
		} else {
			ptr = (u32 *)dec->raw.data;
			ptr[0] = output_buf->buffer_size;
			ptr[1] = output_buf->buffer_count_actual;
			dprintk(VIDC_DBG,
				"Reconfig hint, size is %u, count is %u\n",
				ptr[0], ptr[1]);

		}
		break;
	}
	default:
		dprintk(VIDC_ERR, "Unknown Command %d\n", which_cmd);
		rc = -ENOTSUPP;
+1 −0
Original line number Diff line number Diff line
@@ -1615,6 +1615,7 @@ struct v4l2_encoder_cmd {
#define V4L2_DEC_CMD_PAUSE       (2)
#define V4L2_DEC_CMD_RESUME      (3)
#define V4L2_DEC_QCOM_CMD_FLUSH  (4)
#define V4L2_DEC_QCOM_CMD_RECONFIG_HINT  (5)

/* Flags for V4L2_DEC_CMD_START */
#define V4L2_DEC_CMD_START_MUTE_AUDIO	(1 << 0)