From: Tomasz Figa Date: Wed, 14 Jan 2015 07:20:41 +0000 (+0900) Subject: CHROMIUM: [media] rk3288-vpu: Bump ACLK frequency to 400 MHz X-Git-Tag: firefly_0821_release~2315 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ccf4a8af5a5d13460fe63590aee9dbcad9b6ba68;p=firefly-linux-kernel-4.4.55.git CHROMIUM: [media] rk3288-vpu: Bump ACLK frequency to 400 MHz 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 Reviewed-on: https://chromium-review.googlesource.com/240644 Reviewed-by: Pawel Osciak Change-Id: I397139fe1195b74b8ebd516eae0968bccff7ef4b Signed-off-by: Jeffy Chen Signed-off-by: Yakir Yang --- diff --git a/drivers/media/platform/rk3288-vpu/rk3288_vpu_hw.c b/drivers/media/platform/rk3288-vpu/rk3288_vpu_hw.c index cb12166f75e9..7b7a79ff4cf6 100644 --- a/drivers/media/platform/rk3288-vpu/rk3288_vpu_hw.c +++ b/drivers/media/platform/rk3288-vpu/rk3288_vpu_hw.c @@ -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))