Przeglądaj źródła

video: driver: Add support to set AV1 operating point

Add support to set AV1 operating point to firmware.

Change-Id: If0f31c2bf04cb6d4f783264fb3ce706b1bf98261
Signed-off-by: Mihir Ganu <[email protected]>
Mihir Ganu 3 lat temu
rodzic
commit
2f7df152f2

+ 6 - 0
driver/platform/kalama/src/msm_vidc_kalama.c

@@ -17,6 +17,7 @@
 #define DEFAULT_VIDEO_CONCEAL_COLOR_BLACK 0x8020010
 #define MAX_LTR_FRAME_COUNT     2
 #define MAX_BASE_LAYER_PRIORITY_ID 63
+#define MAX_OP_POINT            31
 #define MAX_BITRATE             220000000
 #define DEFAULT_BITRATE         20000000
 #define MINIMUM_FPS             1
@@ -844,6 +845,11 @@ static struct msm_platform_inst_capability instance_data_kalama[] = {
 		{GOP_SIZE, B_FRAME, BIT_RATE, MIN_QUALITY},
 		msm_vidc_adjust_layer_count, msm_vidc_set_layer_count_and_type},
 
+	{ENH_LAYER_COUNT, DEC, AV1,
+		0, MAX_OP_POINT, 1, 0,
+		0,
+		HFI_PROP_AV1_OP_POINT},
+
 	/*
 	 * layer bitrate is treated as BIT_RATE cap sibling and
 	 * is handled in bitrate adjust and set functions

+ 30 - 0
driver/vidc/src/msm_vdec.c

@@ -828,6 +828,32 @@ static int msm_vdec_set_av1_bitstream_format(struct msm_vidc_inst *inst,
 	return rc;
 }
 
+static int msm_vdec_set_av1_operating_point(struct msm_vidc_inst *inst,
+	enum msm_vidc_port_type port)
+{
+	int rc = 0;
+	u32 op_point;
+
+	if (inst->codec != MSM_VIDC_AV1)
+		return 0;
+
+	op_point = inst->capabilities->cap[ENH_LAYER_COUNT].value;
+	i_vpr_h(inst, "%s: op_point: %u\n", __func__, op_point);
+	rc = venus_hfi_session_property(inst,
+			HFI_PROP_AV1_OP_POINT,
+			HFI_HOST_FLAGS_NONE,
+			get_hfi_port(inst, port),
+			HFI_PAYLOAD_U32,
+			&op_point,
+			sizeof(u32));
+	if (rc) {
+		i_vpr_e(inst, "%s: set property failed\n", __func__);
+		return rc;
+	}
+
+	return rc;
+}
+
 static int msm_vdec_set_input_properties(struct msm_vidc_inst *inst)
 {
 	int rc = 0;
@@ -873,6 +899,10 @@ static int msm_vdec_set_input_properties(struct msm_vidc_inst *inst)
 	if (rc)
 		return rc;
 
+	rc = msm_vdec_set_av1_operating_point(inst, INPUT_PORT);
+	if (rc)
+		return rc;
+
 	return rc;
 }
 

+ 2 - 2
driver/vidc/src/msm_vidc_driver.c

@@ -156,8 +156,6 @@ static const struct msm_vidc_cap_name cap_name_arr[] = {
 	{QUALITY_MODE,                   "QUALITY_MODE"               },
 	{CODED_FRAMES,                   "CODED_FRAMES"               },
 	{BIT_DEPTH,                      "BIT_DEPTH"                  },
-	{FILM_GRAIN,                     "FILM_GRAIN"                 },
-	{SUPER_BLOCK,                    "SUPER_BLOCK"                },
 	{CODEC_CONFIG,                   "CODEC_CONFIG"               },
 	{BITSTREAM_SIZE_OVERWRITE,       "BITSTREAM_SIZE_OVERWRITE"   },
 	{THUMBNAIL_MODE,                 "THUMBNAIL_MODE"             },
@@ -167,6 +165,8 @@ static const struct msm_vidc_cap_name cap_name_arr[] = {
 	{PRIORITY,                       "PRIORITY"                   },
 	{ENC_IP_CR,                      "ENC_IP_CR"                  },
 	{DPB_LIST,                       "DPB_LIST"                   },
+	{FILM_GRAIN,                     "FILM_GRAIN"                 },
+	{SUPER_BLOCK,                    "SUPER_BLOCK"                },
 	{ALL_INTRA,                      "ALL_INTRA"                  },
 	{META_LTR_MARK_USE,              "META_LTR_MARK_USE"          },
 	{META_DPB_MISR,                  "META_DPB_MISR"              },