Parcourir la source

video-driver: Add support for subframe_input

Add support for 'HFI_PROP_SUBFRAME_INPUT'.
Payload '1' indicates that input buffer is
processed. However, FW expects more inputs
to construct a full YUV output buffer.
Overloading 'MSM_VIDC_BUF_FLAG_ERROR' code to
ensure HAL work completion

Change-Id: I05b24a50e587dfd96457af508267843ac3840fbf
Signed-off-by: Vedang Nagar <[email protected]>
Vedang Nagar il y a 3 ans
Parent
commit
078aebf73a

+ 2 - 0
driver/vidc/inc/hfi_property.h

@@ -543,6 +543,8 @@ enum hfi_nal_length_field_type {
 
 #define HFI_PROP_AV1_OP_POINT                                   0x03000182
 
+#define HFI_PROP_SUBFRAME_INPUT                                 0x03000183
+
 #define HFI_PROP_OPB_ENABLE                                     0x03000184
 
 #define HFI_PROP_AV1_DRAP_CONFIG                                0x03000189

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

@@ -762,6 +762,7 @@ struct msm_vidc_subscription_params {
 struct msm_vidc_hfi_frame_info {
 	u32                    picture_type;
 	u32                    no_output;
+	u32                    subframe_input;
 	u32                    cr;
 	u32                    cf;
 	u32                    data_corrupt;

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

@@ -71,6 +71,7 @@ static const u32 msm_vdec_subscribe_for_psc_av1[] = {
 
 static const u32 msm_vdec_input_subscribe_for_properties[] = {
 	HFI_PROP_NO_OUTPUT,
+	HFI_PROP_SUBFRAME_INPUT,
 };
 
 static const u32 msm_vdec_output_subscribe_for_properties[] = {

+ 13 - 0
driver/vidc/src/venus_hfi_response.c

@@ -607,6 +607,10 @@ static int get_driver_buffer_flags(struct msm_vidc_inst *inst, u32 hfi_flags)
 			driver_flags |= MSM_VIDC_BUF_FLAG_ERROR;
 	}
 
+	if (inst->hfi_frame_info.subframe_input)
+		if (inst->capabilities->cap[META_BUF_TAG].value)
+			driver_flags |= MSM_VIDC_BUF_FLAG_ERROR;
+
 	if (hfi_flags & HFI_BUF_FW_FLAG_CODEC_CONFIG)
 		driver_flags |= MSM_VIDC_BUF_FLAG_CODECCONFIG;
 
@@ -1499,6 +1503,15 @@ static int handle_property_with_payload(struct msm_vidc_inst *inst,
 		if (inst->hfi_frame_info.picture_type & HFI_PICTURE_B)
 			inst->has_bframe = true;
 		break;
+	case HFI_PROP_SUBFRAME_INPUT:
+		if (port != INPUT_PORT) {
+			i_vpr_e(inst,
+				"%s: invalid port: %d for property %#x\n",
+				__func__, pkt->port, pkt->type);
+			break;
+		}
+		inst->hfi_frame_info.subframe_input = 1;
+		break;
 	case HFI_PROP_WORST_COMPRESSION_RATIO:
 		inst->hfi_frame_info.cr = payload_ptr[0];
 		break;