Loading drivers/media/platform/msm/vidc/msm_vidc.c +11 −7 Original line number Diff line number Diff line Loading @@ -911,6 +911,8 @@ static inline int start_streaming(struct msm_vidc_inst *inst) struct hfi_device *hdev; struct hal_buffer_size_minimum b; dprintk(VIDC_DBG, "%s: %x : inst %pK\n", __func__, hash32_ptr(inst->session), inst); hdev = inst->core->device; /* Check if current session is under HW capability */ Loading Loading @@ -1004,14 +1006,13 @@ static inline int start_streaming(struct msm_vidc_inst *inst) } } if (is_batching_allowed(inst)) { dprintk(VIDC_DBG, "%s: batching enabled for inst %pK (%#x)\n", __func__, inst, hash32_ptr(inst->session)); if (is_batching_allowed(inst)) inst->batch.enable = true; /* this will disable dcvs as batching enabled */ msm_dcvs_try_enable(inst); } else inst->batch.enable = false; dprintk(VIDC_DBG, "%s: batching %s for inst %pK (%#x)\n", __func__, inst->batch.enable ? "enabled" : "disabled", inst, hash32_ptr(inst->session)); /* * For seq_changed_insufficient, driver should set session_continue Loading Loading @@ -1147,6 +1148,9 @@ static inline int stop_streaming(struct msm_vidc_inst *inst) { int rc = 0; dprintk(VIDC_DBG, "%s: %x : inst %pK\n", __func__, hash32_ptr(inst->session), inst); rc = msm_comm_try_state(inst, MSM_VIDC_RELEASE_RESOURCES_DONE); if (rc) dprintk(VIDC_ERR, Loading drivers/media/platform/msm/vidc/msm_vidc_clocks.c +2 −0 Original line number Diff line number Diff line Loading @@ -373,6 +373,8 @@ static int msm_dcvs_scale_clocks(struct msm_vidc_inst *inst) if (!inst->clk_data.dcvs_mode || inst->batch.enable) { dprintk(VIDC_DBG, "Skip DCVS (dcvs %d, batching %d)\n", inst->clk_data.dcvs_mode, inst->batch.enable); /* Request right clocks (load normal clocks) */ inst->clk_data.load = inst->clk_data.load_norm; return 0; } Loading drivers/media/platform/msm/vidc/msm_vidc_common.c +23 −17 Original line number Diff line number Diff line Loading @@ -2757,14 +2757,13 @@ bool is_batching_allowed(struct msm_vidc_inst *inst) * - session resolution <= 1080p * - low latency not enabled * - not a thumbnail session * - realtime session * - UBWC color format */ if (is_decode_session(inst) && inst->core->resources.decode_batching && (msm_vidc_get_mbs_per_frame(inst) <= MAX_DEC_BATCH_WIDTH * MAX_DEC_BATCH_HEIGHT) && !inst->clk_data.low_latency_mode && !is_thumbnail_session(inst) && is_realtime_session(inst) && !is_thumbnail_session(inst) && (inst->fmts[CAPTURE_PORT].fourcc == V4L2_PIX_FMT_NV12_UBWC || inst->fmts[CAPTURE_PORT].fourcc == V4L2_PIX_FMT_NV12_TP10_UBWC)) allowed = true; Loading Loading @@ -4168,18 +4167,19 @@ int msm_comm_qbuf_decode_batch(struct msm_vidc_inst *inst, } /* * Don't batch for initial few buffers to avoid startup latency increase * Don't defer buffers initially to avoid startup latency increase * due to batching */ if (inst->count.fbd < 30) return msm_comm_qbuf(inst, mbuf); count = num_pending_qbufs(inst, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); if (inst->clk_data.buffer_counter > SKIP_BATCH_WINDOW) { count = num_pending_qbufs(inst, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); if (count < inst->batch.size) { mbuf->flags |= MSM_VIDC_FLAG_DEFERRED; print_vidc_buffer(VIDC_DBG, "qbuf_batch deferred", inst, mbuf); print_vidc_buffer(VIDC_DBG, "batch-qbuf deferred", inst, mbuf); return 0; } } rc = msm_comm_scale_clocks_and_bus(inst); if (rc) Loading @@ -4197,7 +4197,7 @@ int msm_comm_qbuf_decode_batch(struct msm_vidc_inst *inst, /* Don't queue if RBR event is pending on this buffer */ if (buf->flags & MSM_VIDC_FLAG_RBR_PENDING) continue; print_vidc_buffer(VIDC_DBG, "qbuf", inst, buf); print_vidc_buffer(VIDC_DBG, "batch-qbuf", inst, buf); rc = msm_comm_qbuf_to_hfi(inst, buf); if (rc) { dprintk(VIDC_ERR, "%s: Failed qbuf to hfi: %d\n", Loading Loading @@ -6179,6 +6179,8 @@ struct msm_vidc_buffer *msm_comm_get_vidc_buffer(struct msm_vidc_inst *inst, rc = -EEXIST; } if (rc == -EEXIST) { print_vidc_buffer(VIDC_DBG, "existing qbuf", inst, mbuf); /* enable RBR pending */ mbuf->flags |= MSM_VIDC_FLAG_RBR_PENDING; } Loading @@ -6189,10 +6191,15 @@ struct msm_vidc_buffer *msm_comm_get_vidc_buffer(struct msm_vidc_inst *inst, list_add_tail(&mbuf->list, &inst->registeredbufs.list); mutex_unlock(&inst->registeredbufs.lock); if (rc == -EEXIST) { print_vidc_buffer(VIDC_DBG, "qbuf upon rbr", inst, mbuf); /* * Return mbuf if decode batching is enabled as this buffer * may trigger queuing full batch to firmware, also this buffer * will not be queued to firmware while full batch queuing, * it will be queued when rbr event arrived from firmware. */ if (rc == -EEXIST && !inst->batch.enable) return ERR_PTR(rc); } return mbuf; Loading Loading @@ -6345,7 +6352,6 @@ void handle_release_buffer_reference(struct msm_vidc_inst *inst, mutex_unlock(&inst->registeredbufs.lock); if (found) { print_vidc_buffer(VIDC_DBG, "rbr qbuf", inst, mbuf); rc = msm_comm_qbuf_in_rbr(inst, mbuf); if (rc) print_vidc_buffer(VIDC_ERR, Loading drivers/media/platform/msm/vidc/msm_vidc_common.h +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #define MAX_DEC_BATCH_SIZE 6 #define MAX_DEC_BATCH_WIDTH 1920 #define MAX_DEC_BATCH_HEIGHT 1088 #define SKIP_BATCH_WINDOW 100 struct vb2_buf_entry { struct list_head list; Loading Loading
drivers/media/platform/msm/vidc/msm_vidc.c +11 −7 Original line number Diff line number Diff line Loading @@ -911,6 +911,8 @@ static inline int start_streaming(struct msm_vidc_inst *inst) struct hfi_device *hdev; struct hal_buffer_size_minimum b; dprintk(VIDC_DBG, "%s: %x : inst %pK\n", __func__, hash32_ptr(inst->session), inst); hdev = inst->core->device; /* Check if current session is under HW capability */ Loading Loading @@ -1004,14 +1006,13 @@ static inline int start_streaming(struct msm_vidc_inst *inst) } } if (is_batching_allowed(inst)) { dprintk(VIDC_DBG, "%s: batching enabled for inst %pK (%#x)\n", __func__, inst, hash32_ptr(inst->session)); if (is_batching_allowed(inst)) inst->batch.enable = true; /* this will disable dcvs as batching enabled */ msm_dcvs_try_enable(inst); } else inst->batch.enable = false; dprintk(VIDC_DBG, "%s: batching %s for inst %pK (%#x)\n", __func__, inst->batch.enable ? "enabled" : "disabled", inst, hash32_ptr(inst->session)); /* * For seq_changed_insufficient, driver should set session_continue Loading Loading @@ -1147,6 +1148,9 @@ static inline int stop_streaming(struct msm_vidc_inst *inst) { int rc = 0; dprintk(VIDC_DBG, "%s: %x : inst %pK\n", __func__, hash32_ptr(inst->session), inst); rc = msm_comm_try_state(inst, MSM_VIDC_RELEASE_RESOURCES_DONE); if (rc) dprintk(VIDC_ERR, Loading
drivers/media/platform/msm/vidc/msm_vidc_clocks.c +2 −0 Original line number Diff line number Diff line Loading @@ -373,6 +373,8 @@ static int msm_dcvs_scale_clocks(struct msm_vidc_inst *inst) if (!inst->clk_data.dcvs_mode || inst->batch.enable) { dprintk(VIDC_DBG, "Skip DCVS (dcvs %d, batching %d)\n", inst->clk_data.dcvs_mode, inst->batch.enable); /* Request right clocks (load normal clocks) */ inst->clk_data.load = inst->clk_data.load_norm; return 0; } Loading
drivers/media/platform/msm/vidc/msm_vidc_common.c +23 −17 Original line number Diff line number Diff line Loading @@ -2757,14 +2757,13 @@ bool is_batching_allowed(struct msm_vidc_inst *inst) * - session resolution <= 1080p * - low latency not enabled * - not a thumbnail session * - realtime session * - UBWC color format */ if (is_decode_session(inst) && inst->core->resources.decode_batching && (msm_vidc_get_mbs_per_frame(inst) <= MAX_DEC_BATCH_WIDTH * MAX_DEC_BATCH_HEIGHT) && !inst->clk_data.low_latency_mode && !is_thumbnail_session(inst) && is_realtime_session(inst) && !is_thumbnail_session(inst) && (inst->fmts[CAPTURE_PORT].fourcc == V4L2_PIX_FMT_NV12_UBWC || inst->fmts[CAPTURE_PORT].fourcc == V4L2_PIX_FMT_NV12_TP10_UBWC)) allowed = true; Loading Loading @@ -4168,18 +4167,19 @@ int msm_comm_qbuf_decode_batch(struct msm_vidc_inst *inst, } /* * Don't batch for initial few buffers to avoid startup latency increase * Don't defer buffers initially to avoid startup latency increase * due to batching */ if (inst->count.fbd < 30) return msm_comm_qbuf(inst, mbuf); count = num_pending_qbufs(inst, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); if (inst->clk_data.buffer_counter > SKIP_BATCH_WINDOW) { count = num_pending_qbufs(inst, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); if (count < inst->batch.size) { mbuf->flags |= MSM_VIDC_FLAG_DEFERRED; print_vidc_buffer(VIDC_DBG, "qbuf_batch deferred", inst, mbuf); print_vidc_buffer(VIDC_DBG, "batch-qbuf deferred", inst, mbuf); return 0; } } rc = msm_comm_scale_clocks_and_bus(inst); if (rc) Loading @@ -4197,7 +4197,7 @@ int msm_comm_qbuf_decode_batch(struct msm_vidc_inst *inst, /* Don't queue if RBR event is pending on this buffer */ if (buf->flags & MSM_VIDC_FLAG_RBR_PENDING) continue; print_vidc_buffer(VIDC_DBG, "qbuf", inst, buf); print_vidc_buffer(VIDC_DBG, "batch-qbuf", inst, buf); rc = msm_comm_qbuf_to_hfi(inst, buf); if (rc) { dprintk(VIDC_ERR, "%s: Failed qbuf to hfi: %d\n", Loading Loading @@ -6179,6 +6179,8 @@ struct msm_vidc_buffer *msm_comm_get_vidc_buffer(struct msm_vidc_inst *inst, rc = -EEXIST; } if (rc == -EEXIST) { print_vidc_buffer(VIDC_DBG, "existing qbuf", inst, mbuf); /* enable RBR pending */ mbuf->flags |= MSM_VIDC_FLAG_RBR_PENDING; } Loading @@ -6189,10 +6191,15 @@ struct msm_vidc_buffer *msm_comm_get_vidc_buffer(struct msm_vidc_inst *inst, list_add_tail(&mbuf->list, &inst->registeredbufs.list); mutex_unlock(&inst->registeredbufs.lock); if (rc == -EEXIST) { print_vidc_buffer(VIDC_DBG, "qbuf upon rbr", inst, mbuf); /* * Return mbuf if decode batching is enabled as this buffer * may trigger queuing full batch to firmware, also this buffer * will not be queued to firmware while full batch queuing, * it will be queued when rbr event arrived from firmware. */ if (rc == -EEXIST && !inst->batch.enable) return ERR_PTR(rc); } return mbuf; Loading Loading @@ -6345,7 +6352,6 @@ void handle_release_buffer_reference(struct msm_vidc_inst *inst, mutex_unlock(&inst->registeredbufs.lock); if (found) { print_vidc_buffer(VIDC_DBG, "rbr qbuf", inst, mbuf); rc = msm_comm_qbuf_in_rbr(inst, mbuf); if (rc) print_vidc_buffer(VIDC_ERR, Loading
drivers/media/platform/msm/vidc/msm_vidc_common.h +1 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ #define MAX_DEC_BATCH_SIZE 6 #define MAX_DEC_BATCH_WIDTH 1920 #define MAX_DEC_BATCH_HEIGHT 1088 #define SKIP_BATCH_WINDOW 100 struct vb2_buf_entry { struct list_head list; Loading