CHROMIUM: [media] rk3288-vpu: Bump ACLK frequency to 400 MHz
authorTomasz Figa <tfiga@chromium.org>
Wed, 14 Jan 2015 07:20:41 +0000 (16:20 +0900)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 30 Jun 2016 11:50:56 +0000 (19:50 +0800)
According to RK3288 TRM, the maximum worst case operating frequency of
VPU is 400 MHz, but by default it is set to 200 MHz. To fix (or work
around) performance issues with VP8 encoder, this patch bumps the
frequency to maximum possible value.

BUG=chrome-os-partner:35405
TEST=./video_encode_accelerator_unittest
--test_stream_data=tulip2-1280x720-1b95123232922fe0067869c74e19cd09.yuv:1280:720:11:out1280x720.ivf:1200000
--v

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/240644
Reviewed-by: Pawel Osciak <posciak@chromium.org>
Change-Id: I397139fe1195b74b8ebd516eae0968bccff7ef4b
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
drivers/media/platform/rk3288-vpu/rk3288_vpu_hw.c

index cb12166f75e92049d4f80bde5ad46e9e8abd39a6..7b7a79ff4cf61332e945a90c2dfdfc16a99eef37 100644 (file)
@@ -265,6 +265,13 @@ int rk3288_vpu_hw_probe(struct rk3288_vpu_dev *vpu)
                return PTR_ERR(vpu->hclk_vcodec);
        }
 
+       /*
+        * Bump ACLK to max. possible freq. (400 MHz) to improve performance.
+        *
+        * VP8 encoding 1280x720@1.2Mbps 200 MHz: 39 fps, 400: MHz 77 fps
+        */
+       clk_set_rate(vpu->aclk_vcodec, 400*1000*1000);
+
        res = platform_get_resource(vpu->pdev, IORESOURCE_MEM, 0);
        vpu->base = devm_ioremap_resource(vpu->dev, res);
        if (IS_ERR(vpu->base))