Sfoglia il codice sorgente

video: driver: allow two 8k sessions support

Allow one 8k + one 4k realtime sessions.
Maximum allow two 8K sessions which includes RT and NRT sessions.

Change-Id: I68acfc4942c5c930bed7d9584cd82f2667010136
Signed-off-by: Darshana Patil <[email protected]>
Darshana Patil 3 anni fa
parent
commit
b965b9307f

+ 2 - 1
driver/platform/waipio/src/msm_vidc_waipio.c

@@ -54,7 +54,8 @@ static struct msm_platform_core_capability core_data_waipio[] = {
 	{DEC_CODECS, H264|HEVC|VP9|HEIC},
 	{MAX_SESSION_COUNT, 16},
 	{MAX_SECURE_SESSION_COUNT, 3},
-	{MAX_MBPF, 173056},	/* (8192x4320)/256 + (4096x2176)/256*/
+	{MAX_RT_MBPF, 173056},	/* (8192x4320)/256 + (4096x2176)/256*/
+	{MAX_MBPF, 276480}, /* ((8192x4320)/256) * 2 */
 	{MAX_MBPS, 7833600},	/* max_load
 					 * 7680x4320@60fps or 3840x2176@240fps
 					 * which is greater than 4096x2176@120fps,

+ 1 - 0
driver/vidc/inc/msm_vidc_internal.h

@@ -306,6 +306,7 @@ enum msm_vidc_core_capability_type {
 	MAX_SESSION_COUNT,
 	MAX_SECURE_SESSION_COUNT,
 	MAX_LOAD,
+	MAX_RT_MBPF,
 	MAX_MBPF,
 	MAX_MBPS,
 	MAX_IMAGE_MBPF,

+ 19 - 1
driver/vidc/src/msm_vidc_driver.c

@@ -5164,7 +5164,7 @@ int msm_vidc_check_core_mbps(struct msm_vidc_inst *inst)
 
 static int msm_vidc_check_core_mbpf(struct msm_vidc_inst *inst)
 {
-	u32 video_mbpf = 0, image_mbpf = 0;
+	u32 video_mbpf = 0, image_mbpf = 0, video_rt_mbpf = 0;
 	struct msm_vidc_core *core;
 	struct msm_vidc_inst *instance;
 
@@ -5199,6 +5199,24 @@ static int msm_vidc_check_core_mbpf(struct msm_vidc_inst *inst)
 		return -ENOMEM;
 	}
 
+	core_lock(core, __func__);
+	/* check real-time video sessions max limit */
+	list_for_each_entry(instance, &core->instances, list) {
+		if (is_thumbnail_session(instance) ||
+			is_image_session(instance) ||
+			!is_realtime_session(instance))
+			continue;
+
+		video_rt_mbpf += msm_vidc_get_mbs_per_frame(instance);
+	}
+	core_unlock(core, __func__);
+
+	if (video_rt_mbpf > core->capabilities[MAX_RT_MBPF].value) {
+		i_vpr_e(inst, "%s: real-time video overloaded. needed %u, max %u",
+			__func__, video_rt_mbpf, core->capabilities[MAX_RT_MBPF].value);
+		return -ENOMEM;
+	}
+
 	return 0;
 }