vp9: Pass transfer type to vpp for HDR videos. [1/1]
authorgan.zhang <gan.zhang@amlogic.com>
Wed, 16 Sep 2020 05:35:37 +0000 (13:35 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Thu, 29 Oct 2020 08:50:58 +0000 (01:50 -0700)
PD#SWPL-33354

Problem:
The HDR status should be returned has "HDR10-GAMMA_HLG" for HLG contents.

Solution:
Pass transfer type HLG/ST2084 to vpp for HDR videos.

Verify:
AB301

Change-Id: I49f963b714098a25cbc478c6f8a76010929a6178
Signed-off-by: gan.zhang <gan.zhang@amlogic.com>
drivers/frame_provider/decoder/vp9/vvp9.c

index 0b81f1b2dab5e6fc11b379cbd12775553fe4730b..4f1c3268e6a4dd8be6b546ac6af05cda5b1fef89 100644 (file)
@@ -10625,10 +10625,11 @@ static void vp9_dump_state(struct vdec_s *vdec)
        vp9_print(pbi, 0, "====== %s\n", __func__);
 
        vp9_print(pbi, 0,
-               "width/height (%d/%d), used_buf_num %d\n",
+               "width/height (%d/%d), used_buf_num %d video_signal_type 0x%x\n",
                cm->width,
                cm->height,
-               pbi->used_buf_num
+               pbi->used_buf_num,
+               pbi->video_signal_type
                );
 
        vp9_print(pbi, 0,
@@ -10766,6 +10767,7 @@ static int ammvdec_vp9_probe(struct platform_device *pdev)
        struct vdec_s *pdata = *(struct vdec_s **)pdev->dev.platform_data;
        int ret;
        int config_val;
+       int transfer_val;
        struct vframe_content_light_level_s content_light_level;
        struct vframe_master_display_colour_s vf_dp;
 
@@ -10942,13 +10944,22 @@ static int ammvdec_vp9_probe(struct platform_device *pdev)
                                        &content_light_level.max_content);
                        get_config_int(pdata->config, "mMaxFALL",
                                        &content_light_level.max_pic_average);
+
+                       get_config_int(pdata->config, "mTransfer",
+                                       &transfer_val);
+
+                       if (transfer_val == 0)
+                               transfer_val = 16;
+
+                       vp9_print(pbi, 0, "transfer_val=%d\n",transfer_val);
+
                        vf_dp.content_light_level = content_light_level;
                        pbi->video_signal_type = (1 << 29)
                                        | (5 << 26)     /* unspecified */
                                        | (0 << 25)     /* limit */
                                        | (1 << 24)     /* color available */
                                        | (9 << 16)     /* 2020 */
-                                       | (16 << 8)     /* 2084 */
+                                       | (transfer_val << 8)   /* 2084 */
                                        | (9 << 0);     /* 2020 */
                }
                pbi->vf_dp = vf_dp;