.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) 2016 MediaTek Inc. |
---|
3 | 4 | * Author: PC Chen <pc.chen@mediatek.com> |
---|
4 | 5 | * Tiffany Lin <tiffany.lin@mediatek.com> |
---|
5 | | -* |
---|
6 | | -* This program is free software; you can redistribute it and/or modify |
---|
7 | | -* it under the terms of the GNU General Public License version 2 as |
---|
8 | | -* published by the Free Software Foundation. |
---|
9 | | -* |
---|
10 | | -* This program is distributed in the hope that it will be useful, |
---|
11 | | -* but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | | -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | | -* GNU General Public License for more details. |
---|
14 | 6 | */ |
---|
15 | 7 | |
---|
16 | 8 | #include <linux/module.h> |
---|
17 | 9 | |
---|
18 | 10 | #include "mtk_vcodec_drv.h" |
---|
19 | 11 | #include "mtk_vcodec_util.h" |
---|
20 | | -#include "mtk_vpu.h" |
---|
21 | 12 | |
---|
22 | 13 | /* For encoder, this will enable logs in venc/*/ |
---|
23 | 14 | bool mtk_vcodec_dbg; |
---|
.. | .. |
---|
50 | 41 | struct device *dev = &ctx->dev->plat_dev->dev; |
---|
51 | 42 | |
---|
52 | 43 | mem->va = dma_alloc_coherent(dev, size, &mem->dma_addr, GFP_KERNEL); |
---|
53 | | - |
---|
54 | 44 | if (!mem->va) { |
---|
55 | 45 | mtk_v4l2_err("%s dma_alloc size=%ld failed!", dev_name(dev), |
---|
56 | 46 | size); |
---|
57 | 47 | return -ENOMEM; |
---|
58 | 48 | } |
---|
59 | | - |
---|
60 | | - memset(mem->va, 0, size); |
---|
61 | 49 | |
---|
62 | 50 | mtk_v4l2_debug(3, "[%d] - va = %p", ctx->id, mem->va); |
---|
63 | 51 | mtk_v4l2_debug(3, "[%d] - dma = 0x%lx", ctx->id, |
---|