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

Commit f934b4c9 authored by Suresh Vankadara's avatar Suresh Vankadara
Browse files

msm: camera: jpeg: Fix jpeg flush request issue



Jpeg driver enqueue requests in internal command queue
before sending commands to hardware. Flush request is
issued to a pending command which is not in command queue
and with hardware. Flush tries to free this request
leads to a failure.

Fix to handle flush request on internal command
based on request type.

Change-Id: I3e6541328c71c807c5e24bd1660131bd9c9bd55c
Signed-off-by: default avatarSuresh Vankadara <svankada@codeaurora.org>
parent e5c3238b
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -742,7 +742,7 @@ static int cam_jpeg_mgr_flush(void *hw_mgr_priv,
	struct cam_jpeg_hw_mgr *hw_mgr = hw_mgr_priv;
	uint32_t dev_type;
	struct cam_jpeg_hw_cfg_req *p_cfg_req = NULL;
	struct cam_jpeg_hw_cfg_req *cfg_req, *req_temp;
	struct cam_jpeg_hw_cfg_req *cfg_req = NULL, *req_temp = NULL;

	if (!hw_mgr || !ctx_data) {
		CAM_ERR(CAM_JPEG, "Invalid args");
@@ -776,8 +776,8 @@ static int cam_jpeg_mgr_flush(void *hw_mgr_priv,

	list_for_each_entry_safe(cfg_req, req_temp,
		&hw_mgr->hw_config_req_list, list) {
		if ((struct cam_jpeg_hw_ctx_data *)cfg_req->
			hw_cfg_args.ctxt_to_hw_map != ctx_data)
		if ((cfg_req) && ((struct cam_jpeg_hw_ctx_data *)cfg_req->
			hw_cfg_args.ctxt_to_hw_map != ctx_data))
			continue;

		list_del_init(&cfg_req->list);
@@ -800,11 +800,14 @@ static int cam_jpeg_mgr_flush_req(void *hw_mgr_priv,
		return -EINVAL;
	}

	request_id = *(int64_t *)flush_args->flush_req_pending[0];
	if (flush_args->num_req_pending)
		return 0;

	request_id = *(int64_t *)flush_args->flush_req_active[0];
	list_for_each_entry_safe(cfg_req, req_temp,
		&hw_mgr->hw_config_req_list, list) {
		if (cfg_req->hw_cfg_args.ctxt_to_hw_map
			!= ctx_data)
		if ((cfg_req) && (cfg_req->hw_cfg_args.ctxt_to_hw_map
			!= ctx_data))
			continue;

		if (cfg_req->req_id != request_id)