From: shihong.zheng Date: Tue, 4 Aug 2020 08:59:02 +0000 (+0800) Subject: decode: notify backend secure flag. [1/1] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d33671061caeb3f56580c57c19c43c142e61eb3e;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_media.git decode: notify backend secure flag. [1/1] PD#SWPL-31671 Problem: decode provided the secure flag to backend. Solution: fill the req state in vfm notify callback. Verify: ab301 Change-Id: I2804f606145445b295ae225ba85dc4cff698cac2 Signed-off-by: shihong.zheng --- diff --git a/drivers/frame_provider/decoder/avs2/vavs2.c b/drivers/frame_provider/decoder/avs2/vavs2.c index 4bef13a..fb8a5f9 100644 --- a/drivers/frame_provider/decoder/avs2/vavs2.c +++ b/drivers/frame_provider/decoder/avs2/vavs2.c @@ -4226,6 +4226,17 @@ static void vavs2_vf_put(struct vframe_s *vf, void *op_arg) static int vavs2_event_cb(int type, void *data, void *private_data) { + struct AVS2Decoder_s *dec = (struct AVS2Decoder_s *)private_data; + + if (type & VFRAME_EVENT_RECEIVER_REQ_STATE) { + struct provider_state_req_s *req = + (struct provider_state_req_s *)data; + if (req->req_type == REQ_STATE_SECURE) + req->req_result[0] = vdec_secure(hw_to_vdec(dec)); + else + req->req_result[0] = 0xffffffff; + } + return 0; } diff --git a/drivers/frame_provider/decoder/avs_multi/avs_multi.c b/drivers/frame_provider/decoder/avs_multi/avs_multi.c index 56db4f1..5d3f9d3 100644 --- a/drivers/frame_provider/decoder/avs_multi/avs_multi.c +++ b/drivers/frame_provider/decoder/avs_multi/avs_multi.c @@ -1065,6 +1065,17 @@ static void vavs_vf_put(struct vframe_s *vf, void *op_arg) static int vavs_event_cb(int type, void *data, void *private_data) { + struct vdec_avs_hw_s *hw = (struct vdec_avs_hw_s *)private_data; + + if (type & VFRAME_EVENT_RECEIVER_REQ_STATE) { + struct provider_state_req_s *req = + (struct provider_state_req_s *)data; + if (req->req_type == REQ_STATE_SECURE) + req->req_result[0] = vdec_secure(hw_to_vdec(hw)); + else + req->req_result[0] = 0xffffffff; + } + return 0; } diff --git a/drivers/frame_provider/decoder/h264_multi/vmh264.c b/drivers/frame_provider/decoder/h264_multi/vmh264.c index ff41344..c7b38e0 100644 --- a/drivers/frame_provider/decoder/h264_multi/vmh264.c +++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c @@ -4390,6 +4390,13 @@ static int vh264_event_cb(int type, void *data, void *op_arg) dpb_print(DECODE_ID(hw), PRINT_FLAG_VDEC_STATUS, "%s(type 0x%x vf buf_spec_num 0x%x)=>size 0x%x\n", __func__, type, buf_spec_num, req->aux_size); + } else if (type & VFRAME_EVENT_RECEIVER_REQ_STATE) { + struct provider_state_req_s *req = + (struct provider_state_req_s *)data; + if (req->req_type == REQ_STATE_SECURE) + req->req_result[0] = vdec_secure(vdec); + else + req->req_result[0] = 0xffffffff; } return 0; diff --git a/drivers/frame_provider/decoder/h265/vh265.c b/drivers/frame_provider/decoder/h265/vh265.c index 10d1402..df572ff 100644 --- a/drivers/frame_provider/decoder/h265/vh265.c +++ b/drivers/frame_provider/decoder/h265/vh265.c @@ -8875,17 +8875,26 @@ static int vh265_event_cb(int type, void *data, void *op_arg) hevc_print(hevc, 0, "%s(type 0x%x vf index 0x%x)=>size 0x%x\n", __func__, type, index, req->aux_size); + } #ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION - } else if (type & VFRAME_EVENT_RECEIVER_DOLBY_BYPASS_EL) { + else if (type & VFRAME_EVENT_RECEIVER_DOLBY_BYPASS_EL) { if ((force_bypass_dvenl & 0x80000000) == 0) { hevc_print(hevc, 0, "%s: VFRAME_EVENT_RECEIVER_DOLBY_BYPASS_EL\n", __func__); hevc->bypass_dvenl_enable = 1; } - + } #endif + else if (type & VFRAME_EVENT_RECEIVER_REQ_STATE) { + struct provider_state_req_s *req = + (struct provider_state_req_s *)data; + if (req->req_type == REQ_STATE_SECURE) + req->req_result[0] = vdec_secure(vdec); + else + req->req_result[0] = 0xffffffff; } + return 0; } diff --git a/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c b/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c index 160ee6f..2570f65 100644 --- a/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c +++ b/drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c @@ -501,8 +501,19 @@ static void vmjpeg_vf_put(struct vframe_s *vf, void *op_arg) hw->put_num++; } -static int vmjpeg_event_cb(int type, void *data, void *private_data) +static int vmjpeg_event_cb(int type, void *data, void *op_arg) { + struct vdec_s *vdec = op_arg; + + if (type & VFRAME_EVENT_RECEIVER_REQ_STATE) { + struct provider_state_req_s *req = + (struct provider_state_req_s *)data; + if (req->req_type == REQ_STATE_SECURE) + req->req_result[0] = vdec_secure(vdec); + else + req->req_result[0] = 0xffffffff; + } + return 0; } diff --git a/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c b/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c index 73925e9..c487aac 100644 --- a/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c +++ b/drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c @@ -2423,8 +2423,20 @@ static void vmpeg_vf_put(struct vframe_s *vf, void *op_arg) (const struct vframe_s *)vf); } -static int vmpeg_event_cb(int type, void *data, void *private_data) + +static int vmpeg_event_cb(int type, void *data, void *op_arg) { + struct vdec_s *vdec = op_arg; + + if (type & VFRAME_EVENT_RECEIVER_REQ_STATE) { + struct provider_state_req_s *req = + (struct provider_state_req_s *)data; + if (req->req_type == REQ_STATE_SECURE) + req->req_result[0] = vdec_secure(vdec); + else + req->req_result[0] = 0xffffffff; + } + return 0; } diff --git a/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c b/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c index 1d34412..860fcad 100644 --- a/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c +++ b/drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c @@ -1633,8 +1633,19 @@ static void vmpeg_vf_put(struct vframe_s *vf, void *op_arg) kfifo_put(&hw->newframe_q, (const struct vframe_s *)vf); } -static int vmpeg_event_cb(int type, void *data, void *private_data) +static int vmpeg_event_cb(int type, void *data, void *op_arg) { + struct vdec_s *vdec = op_arg; + + if (type & VFRAME_EVENT_RECEIVER_REQ_STATE) { + struct provider_state_req_s *req = + (struct provider_state_req_s *)data; + if (req->req_type == REQ_STATE_SECURE) + req->req_result[0] = vdec_secure(vdec); + else + req->req_result[0] = 0xffffffff; + } + return 0; } diff --git a/drivers/frame_provider/decoder/vav1/vav1.c b/drivers/frame_provider/decoder/vav1/vav1.c index e53a7c4..9152e5e 100644 --- a/drivers/frame_provider/decoder/vav1/vav1.c +++ b/drivers/frame_provider/decoder/vav1/vav1.c @@ -5809,17 +5809,13 @@ static int vav1_event_cb(int type, void *data, void *op_arg) av1_print(hw, 0, "%s(type 0x%x vf index 0x%x)=>size 0x%x\n", __func__, type, index, req->aux_size); -#if 0 -//def CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION - } else if (type & VFRAME_EVENT_RECEIVER_DOLBY_BYPASS_EL) { - if ((force_bypass_dvenl & 0x80000000) == 0) { - av1_print(hw, 0, - "%s: VFRAME_EVENT_RECEIVER_DOLBY_BYPASS_EL\n", - __func__); - hw->bypass_dvenl_enable = 1; - } - -#endif + } else if (type & VFRAME_EVENT_RECEIVER_REQ_STATE) { + struct provider_state_req_s *req = + (struct provider_state_req_s *)data; + if (req->req_type == REQ_STATE_SECURE) + req->req_result[0] = vdec_secure(hw_to_vdec(hw)); + else + req->req_result[0] = 0xffffffff; } return 0; } diff --git a/drivers/frame_provider/decoder/vp9/vvp9.c b/drivers/frame_provider/decoder/vp9/vvp9.c index 4f1c326..44461fb 100644 --- a/drivers/frame_provider/decoder/vp9/vvp9.c +++ b/drivers/frame_provider/decoder/vp9/vvp9.c @@ -7039,6 +7039,8 @@ static void vvp9_vf_put(struct vframe_s *vf, void *op_arg) static int vvp9_event_cb(int type, void *data, void *private_data) { + struct VP9Decoder_s *pbi = (struct VP9Decoder_s *)private_data; + if (type & VFRAME_EVENT_RECEIVER_RESET) { #if 0 unsigned long flags; @@ -7056,6 +7058,13 @@ static int vvp9_event_cb(int type, void *data, void *private_data) #endif amhevc_start(); #endif + } else if (type & VFRAME_EVENT_RECEIVER_REQ_STATE) { + struct provider_state_req_s *req = + (struct provider_state_req_s *)data; + if (req->req_type == REQ_STATE_SECURE) + req->req_result[0] = vdec_secure(hw_to_vdec(pbi)); + else + req->req_result[0] = 0xffffffff; } return 0;