decode: notify backend secure flag. [1/1]
authorshihong.zheng <shihong.zheng@amlogic.com>
Tue, 4 Aug 2020 08:59:02 +0000 (16:59 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Fri, 20 Nov 2020 01:51:40 +0000 (17:51 -0800)
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 <shihong.zheng@amlogic.com>
drivers/frame_provider/decoder/avs2/vavs2.c
drivers/frame_provider/decoder/avs_multi/avs_multi.c
drivers/frame_provider/decoder/h264_multi/vmh264.c
drivers/frame_provider/decoder/h265/vh265.c
drivers/frame_provider/decoder/mjpeg/vmjpeg_multi.c
drivers/frame_provider/decoder/mpeg12/vmpeg12_multi.c
drivers/frame_provider/decoder/mpeg4/vmpeg4_multi.c
drivers/frame_provider/decoder/vav1/vav1.c
drivers/frame_provider/decoder/vp9/vvp9.c

index 4bef13af973b8f7f140ee7fcfb31177bd09c1d25..fb8a5f95058e4d173f18929e4df8baec88e35398 100644 (file)
@@ -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;
 }
 
index 56db4f1b76129101592f9fa9816982e03aa12ba3..5d3f9d33e41705f31afee68f3285d6b1a952386c 100644 (file)
@@ -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;
 }
 
index ff41344f09c6c529bab38b23025b691ac3d87973..c7b38e08d2f5e5cb102c627f5a9d66105ca6029b 100644 (file)
@@ -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;
index 10d1402ffd0457eb064d32b24612154a8a98f3ac..df572ff893a0c994d905cf64c314255a70a79659 100644 (file)
@@ -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;
 }
 
index 160ee6fd9fe93821d6c0b5f6ee9c2d8f668f3689..2570f65864d260700969c9cce0706037b341f05d 100644 (file)
@@ -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;
 }
 
index 73925e9a4cfe1ec082d36fa8f2bb99c6b4d94750..c487aac3de4a02f4d3d4762ba1922213a06e348f 100644 (file)
@@ -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;
 }
 
index 1d34412d0f78e0d8baf95be341f9adf62878b3dd..860fcadb19ea4efe72a5809055a35f4a2876a02f 100644 (file)
@@ -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;
 }
 
index e53a7c4a4db8ce751d6d2acdb56b06a1e42ccf67..9152e5e7b9a33ce79d3da688fb9478ec1fd1e92b 100644 (file)
@@ -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;
 }
index 4f1c3268e6a4dd8be6b546ac6af05cda5b1fef89..44461fb5cac8d13efb2132072488f591a77fed71 100644 (file)
@@ -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;