* Re: [PATCH v7 4/9] drm/mediatek: update display module connections
From: CK Hu @ 2016-09-06 7:39 UTC (permalink / raw)
To: YT Shen
Cc: Daniel Vetter, Jie Qiu, Mao Huang, yingjoe.chen, Dan Carpenter,
Jitao Shi, Sascha Hauer, linux-mediatek, dri-devel,
Matthias Brugger, shaoming chen, linux-arm-kernel, srv_heupstream,
emil.l.velikov, linux-kernel, Maxime Ripard
In-Reply-To: <1472815484-43821-5-git-send-email-yt.shen@mediatek.com>
Hi, YT:
On Fri, 2016-09-02 at 19:24 +0800, YT Shen wrote:
> update connections for OVL, RDMA, BLS, DSI
>
> Signed-off-by: YT Shen <yt.shen@mediatek.com>
> ---
> drivers/gpu/drm/mediatek/mtk_drm_ddp.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
[snip...]
> @@ -111,6 +119,9 @@ static unsigned int mtk_ddp_mout_en(enum mtk_ddp_comp_id cur,
> if (cur == DDP_COMPONENT_OVL0 && next == DDP_COMPONENT_COLOR0) {
> *addr = DISP_REG_CONFIG_DISP_OVL0_MOUT_EN;
> value = OVL0_MOUT_EN_COLOR0;
> + } else if (cur == DDP_COMPONENT_OVL0 && next == DDP_COMPONENT_RDMA0) {
> + *addr = DISP_REG_CONFIG_DISP_OVL_MOUT_EN;
> + value = OVL_MOUT_EN_RDMA;
> } else if (cur == DDP_COMPONENT_OD && next == DDP_COMPONENT_RDMA0) {
> *addr = DISP_REG_CONFIG_DISP_OD_MOUT_EN;
> value = OD_MOUT_EN_RDMA0;
> @@ -148,6 +159,9 @@ static unsigned int mtk_ddp_sel_in(enum mtk_ddp_comp_id cur,
> } else if (cur == DDP_COMPONENT_OVL1 && next == DDP_COMPONENT_COLOR1) {
> *addr = DISP_REG_CONFIG_DISP_COLOR1_SEL_IN;
> value = COLOR1_SEL_IN_OVL1;
> + } else if (cur == DDP_COMPONENT_BLS && next == DDP_COMPONENT_DSI0) {
DDP_COMPONENT_BLS is a new symbol which is defined in 9th patch of this
series. I think the definition of DDP_COMPONENT_BLS should be in front
of this patch.
> + *addr = DISP_REG_CONFIG_DSI_SEL;
> + value = DSI_SEL_IN_BLS;
> } else {
> value = 0;
> }
> @@ -155,6 +169,15 @@ static unsigned int mtk_ddp_sel_in(enum mtk_ddp_comp_id cur,
> return value;
> }
>
Regards,
CK
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply
* [PATCH] vcodec: mediatek: fix odd_ptr_err.cocci warnings
From: Julia Lawall @ 2016-09-06 14:51 UTC (permalink / raw)
To: Tiffany Lin
Cc: Hans Verkuil, Mauro Carvalho Chehab, linux-media,
Matthias Brugger, linux-arm-kernel, linux-mediatek, linux-kernel,
kbuild-all
PTR_ERR should access the value just tested by IS_ERR
Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci
CC: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---
mtk_vcodec_dec_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
@@ -255,7 +255,7 @@ static int mtk_vcodec_probe(struct platf
}
dev->reg_base[i] = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR((__force void *)dev->reg_base[i])) {
- ret = PTR_ERR((__force void *)dev->reg_base);
+ ret = PTR_ERR((__force void *)dev->reg_base[i]);
goto err_res;
}
mtk_v4l2_debug(2, "reg[%d] base=%p", i, dev->reg_base[i]);
^ permalink raw reply
* Re: [PATCH net-next v5 0/2] net: ethernet: mediatek: add enhancements to RX path
From: David Miller @ 2016-09-06 20:33 UTC (permalink / raw)
To: sean.wang-NuS5LvNUpcJWk0Htik3J/w
Cc: nbd-p3rKhJxN3npAfugRpC6u6w, keyhaede-Re5JQEeQqe8AvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA, john-Pj+rj9U5foFAfugRpC6u6w,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
objelf-Re5JQEeQqe8AvxtiuMwx3w
In-Reply-To: <1472896767-18352-1-git-send-email-sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
From: <sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Date: Sat, 3 Sep 2016 17:59:25 +0800
> Changes since v1:
> - fix message typos and add coverletter
>
> Changes since v2:
> - split from the previous series for submitting add enhancements as
> a series targeting 'net-next' and add indents before comments.
>
> Changes since v3:
> - merge the patch using PDMA RX path
> - fixed the input of mtk_poll_rx is with the remaining budget
>
> Changes since v4:
> - save one wmb and register update when no packet is being handled
> inside mtk_poll_rx call
> - fixed incorrect return packet count from mtk_napi_rx
Series applied.
^ permalink raw reply
* Re: [PATCH v7 6/9] drm/mediatek: add dsi interrupt control
From: CK Hu @ 2016-09-07 1:39 UTC (permalink / raw)
To: YT Shen
Cc: Daniel Vetter, Jie Qiu, Mao Huang, yingjoe.chen, Dan Carpenter,
Jitao Shi, Sascha Hauer, linux-mediatek, dri-devel,
Matthias Brugger, shaoming chen, linux-arm-kernel, srv_heupstream,
emil.l.velikov, linux-kernel, Maxime Ripard
In-Reply-To: <1472815484-43821-7-git-send-email-yt.shen@mediatek.com>
Hi, YT:
On Fri, 2016-09-02 at 19:24 +0800, YT Shen wrote:
> From: shaoming chen <shaoming.chen@mediatek.com>
>
> add dsi interrupt control
>
> Signed-off-by: shaoming chen <shaoming.chen@mediatek.com>
> ---
> drivers/gpu/drm/mediatek/mtk_dsi.c | 76 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 76 insertions(+)
>
[snip...]
>
> +static wait_queue_head_t _dsi_irq_wait_queue;
I think it's better to move this global variable into platform driver
data. Maybe one day you have two dsi device and one global variable is
not enough.
> +
[snip...]
> +
> +static irqreturn_t mtk_dsi_irq(int irq, void *dev_id)
> +{
> + struct mtk_dsi *dsi = dev_id;
> + u32 status, tmp;
> + u32 flag = LPRX_RD_RDY_INT_FLAG | CMD_DONE_INT_FLAG | VM_DONE_INT_FLAG;
> +
> + status = readl(dsi->regs + DSI_INTSTA);
If you define as
status = readl(dsi->regs + DSI_INTSTA) & flag;
You can remove 'flag' in below statements and reduce code size.
> +
> + if (status & flag) {
> + do {
> + mtk_dsi_mask(dsi, DSI_RACK, RACK, RACK);
> + tmp = readl(dsi->regs + DSI_INTSTA);
> + } while (tmp & DSI_BUSY);
> +
> + mtk_dsi_mask(dsi, DSI_INTSTA, status & flag, 0);
> + mtk_dsi_irq_data_set(dsi, status & flag);
> + wake_up_interruptible(&_dsi_irq_wait_queue);
> + }
> +
> + return IRQ_HANDLED;
> +}
> +
[snip...]
>
> @@ -869,8 +926,27 @@ static int mtk_dsi_probe(struct platform_device *pdev)
> return ret;
> }
>
> + irq_num = platform_get_irq(pdev, 0);
> + if (irq_num < 0) {
> + dev_err(&pdev->dev, "failed to request dsi irq resource\n");
> + return -EPROBE_DEFER;
> + }
> +
> + irq_set_status_flags(irq_num, IRQ_TYPE_LEVEL_LOW);
> + ret = devm_request_irq(&pdev->dev, irq_num, mtk_dsi_irq,
> + IRQF_TRIGGER_LOW, dev_name(&pdev->dev), dsi);
> + if (ret) {
> + dev_err(&pdev->dev, "failed to request mediatek dsi irq\n");
> + return -EPROBE_DEFER;
> + }
> +
> + dsi->irq_data = 0;
You use devm_kzalloc() to allocate 'dsi', so this statement is
redundant.
> + dev_info(dev, "dsi irq num is 0x%x\n", irq_num);
> +
> platform_set_drvdata(pdev, dsi);
>
> + init_waitqueue_head(&_dsi_irq_wait_queue);
> +
> return component_add(&pdev->dev, &mtk_dsi_component_ops);
> }
Regards,
CK
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply
* Re: [PATCH v7 7/9] drm/mediatek: add dsi transfer function
From: CK Hu @ 2016-09-07 2:33 UTC (permalink / raw)
To: YT Shen
Cc: Daniel Vetter, Jie Qiu, Mao Huang, yingjoe.chen, Dan Carpenter,
Jitao Shi, Sascha Hauer, linux-mediatek, dri-devel,
Matthias Brugger, shaoming chen, linux-arm-kernel, srv_heupstream,
emil.l.velikov, linux-kernel, Maxime Ripard
In-Reply-To: <1472815484-43821-8-git-send-email-yt.shen@mediatek.com>
Hi, YT:
On Fri, 2016-09-02 at 19:24 +0800, YT Shen wrote:
> From: shaoming chen <shaoming.chen@mediatek.com>
>
> add dsi read/write commands for transfer function
>
> Signed-off-by: shaoming chen <shaoming.chen@mediatek.com>
> ---
> drivers/gpu/drm/mediatek/mtk_dsi.c | 188 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 188 insertions(+)
>
[snip...]
>
> +static void mtk_dsi_irq_data_clear(struct mtk_dsi *dsi, u32 irq_bit)
> +{
> + dsi->irq_data &= ~irq_bit;
> +}
> +
[snip...]
> +
> +static s32 mtk_dsi_wait_for_irq_done(struct mtk_dsi *dsi, u32 irq_flag,
> + unsigned int timeout)
> +{
> + s32 ret = 0;
> + unsigned long jiffies = msecs_to_jiffies(timeout);
> +
> + ret = wait_event_interruptible_timeout(_dsi_irq_wait_queue,
> + dsi->irq_data & irq_flag,
> + jiffies);
> + if (ret == 0) {
> + dev_info(dsi->dev, "Wait DSI IRQ(0x%08x) Timeout\n", irq_flag);
> +
> + mtk_dsi_enable(dsi);
> + mtk_dsi_reset_engine(dsi);
> + }
> +
> + return ret;
> +}
I think mtk_dsi_irq_data_clear() and mtk_dsi_wait_for_irq_done() should
be moved to the 6th patch [1] of this series because these two functions
deal the irq control.
[1] https://patchwork.kernel.org/patch/9310819/
Regards,
CK
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply
* Re: [PATCH v7 8/9] drm/mediatek: update DSI sub driver flow
From: CK Hu @ 2016-09-07 4:58 UTC (permalink / raw)
To: YT Shen
Cc: Daniel Vetter, Jie Qiu, Mao Huang, yingjoe.chen, Dan Carpenter,
Jitao Shi, Sascha Hauer, linux-mediatek, dri-devel,
Matthias Brugger, shaoming chen, linux-arm-kernel, srv_heupstream,
emil.l.velikov, linux-kernel, Maxime Ripard
In-Reply-To: <1472815484-43821-9-git-send-email-yt.shen@mediatek.com>
Hi, YT:
On Fri, 2016-09-02 at 19:24 +0800, YT Shen wrote:
> This patch update enable/disable flow of DSI module and MIPI TX module
>
> Signed-off-by: shaoming chen <shaoming.chen@mediatek.com>
> Signed-off-by: YT Shen <yt.shen@mediatek.com>
> ---
I think the description is too simple. Please briefly describe WHY of
this patch. The original enable/disable flow is workable, so why do you
need this patch? Without this patch, what problem would happen?
Regards,
CK
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply
* Re: [PATCH] vcodec: mediatek: fix odd_ptr_err.cocci warnings
From: Tiffany Lin @ 2016-09-07 5:25 UTC (permalink / raw)
To: Julia Lawall
Cc: Hans Verkuil, Mauro Carvalho Chehab, linux-media,
Matthias Brugger, linux-arm-kernel, linux-mediatek, linux-kernel,
kbuild-all
In-Reply-To: <alpine.DEB.2.10.1609062249430.3144@hadrien>
On Tue, 2016-09-06 at 22:51 +0800, Julia Lawall wrote:
> PTR_ERR should access the value just tested by IS_ERR
>
> Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci
>
> CC: Tiffany Lin <tiffany.lin@mediatek.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by:Tiffany Lin <tiffany.lin@mediatek.com>
> ---
>
> mtk_vcodec_dec_drv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
> +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
> @@ -255,7 +255,7 @@ static int mtk_vcodec_probe(struct platf
> }
> dev->reg_base[i] = devm_ioremap_resource(&pdev->dev, res);
> if (IS_ERR((__force void *)dev->reg_base[i])) {
> - ret = PTR_ERR((__force void *)dev->reg_base);
> + ret = PTR_ERR((__force void *)dev->reg_base[i]);
> goto err_res;
> }
> mtk_v4l2_debug(2, "reg[%d] base=%p", i, dev->reg_base[i]);
^ permalink raw reply
* Re: [PATCH v7 9/9] drm/mediatek: add support for Mediatek SoC MT2701
From: CK Hu @ 2016-09-07 5:37 UTC (permalink / raw)
To: YT Shen
Cc: Daniel Vetter, Jie Qiu, Mao Huang, yingjoe.chen, Dan Carpenter,
Jitao Shi, Sascha Hauer, linux-mediatek, dri-devel,
Matthias Brugger, shaoming chen, linux-arm-kernel, srv_heupstream,
emil.l.velikov, linux-kernel, Maxime Ripard
In-Reply-To: <1472815484-43821-10-git-send-email-yt.shen@mediatek.com>
Hi, YT:
On Fri, 2016-09-02 at 19:24 +0800, YT Shen wrote:
> This patch add support for the Mediatek MT2701 DISP subsystem.
> There is only one OVL engine in MT2701.
>
> Signed-off-by: YT Shen <yt.shen@mediatek.com>
[snip...]
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
> index 4b4e449..465819b 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c
> @@ -112,6 +112,7 @@ struct mtk_ddp_comp_match {
>
> static const struct mtk_ddp_comp_match mtk_ddp_matches[DDP_COMPONENT_ID_MAX] = {
> [DDP_COMPONENT_AAL] = { MTK_DISP_AAL, 0, NULL },
> + [DDP_COMPONENT_BLS] = { MTK_DISP_PWM, 0, NULL },
I think BLS is different than PWM, so this statement should be
[DDP_COMPONENT_BLS] = { MTK_DISP_BLS, 0, NULL };
> [DDP_COMPONENT_COLOR0] = { MTK_DISP_COLOR, 0, &ddp_color },
> [DDP_COMPONENT_COLOR1] = { MTK_DISP_COLOR, 1, &ddp_color },
> [DDP_COMPONENT_DPI0] = { MTK_DPI, 0, NULL },
Regards,
CK
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply
* Re: [PATCH] vcodec: mediatek: add Maintainers entry for Mediatek MT8173 vcodec drivers
From: Yingjoe Chen @ 2016-09-07 6:04 UTC (permalink / raw)
To: Tiffany Lin
Cc: Hans Verkuil, Laurent Pinchart, Mauro Carvalho Chehab,
Matthias Brugger, Daniel Kurtz, Pawel Osciak, Eddie Huang,
linux-kernel, linux-media, linux-mediatek, Andrew-CT Chen
In-Reply-To: <1473143730-22156-1-git-send-email-tiffany.lin@mediatek.com>
On Tue, 2016-09-06 at 14:35 +0800, Tiffany Lin wrote:
> Add Tiffany Lin and Andrew-CT Chen as maintainers for
> Mediatek MT8173 vcodec drivers
>
> Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
> Signed-off-by: Andrew-CT Chen <andrew-ct.chen@mediatek.com>
> ---
> MAINTAINERS | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 0a16a82..ed830c7 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -7590,6 +7590,15 @@ F: include/uapi/linux/meye.h
> F: include/uapi/linux/ivtv*
> F: include/uapi/linux/uvcvideo.h
>
> +MT8173 MEDIA DRIVER
We might upstream mediate driver for other SoC based on this driver.
I think we can just write "MEDIATEK MEDIA DRIVER" here.
Joe.C
> +M: Tiffany Lin <tiffany.lin@mediatek.com>
> +M: Andrew-CT Chen <andrew-ct.chen@mediatek.com>
> +S: Supported
> +F: drivers/media/platform/mtk-vcodec/
> +F: drivers/media/platform/mtk-vpu/
> +F: Documentation/devicetree/bindings/media/mediatek-vcodec.txt
> +F: Documentation/devicetree/bindings/media/mediatek-vpu.txt
> +
> MEDIATEK ETHERNET DRIVER
> M: Felix Fietkau <nbd@openwrt.org>
> M: John Crispin <blogic@openwrt.org>
^ permalink raw reply
* [PATCH] vcodec: mediatek: Fix decoder compiler/sparse warnings
From: Tiffany Lin @ 2016-09-07 6:18 UTC (permalink / raw)
To: Hans Verkuil, Laurent Pinchart, Mauro Carvalho Chehab,
Matthias Brugger, Daniel Kurtz, Pawel Osciak
Cc: Eddie Huang, Yingjoe Chen, linux-kernel, linux-media,
linux-mediatek, Tiffany.lin, Tiffany Lin
This patch fix decoder compiler/sparse warnings
Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
---
.../media/platform/mtk-vcodec/vdec/vdec_h264_if.c | 7 ++++---
.../media/platform/mtk-vcodec/vdec/vdec_vp8_if.c | 1 +
.../media/platform/mtk-vcodec/vdec/vdec_vp9_if.c | 4 ++--
drivers/media/platform/mtk-vcodec/vdec_vpu_if.c | 6 ++++--
4 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c b/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c
index 0353a47..57a842f 100644
--- a/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c
+++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c
@@ -239,7 +239,7 @@ static void put_fb_to_free(struct vdec_h264_inst *inst, struct vdec_fb *fb)
mtk_vcodec_debug(inst, "[FB] put fb into free_list @(%p, %llx)",
fb->base_y.va, (u64)fb->base_y.dma_addr);
- list->fb_list[list->write_idx].vdec_fb_va = (u64)fb;
+ list->fb_list[list->write_idx].vdec_fb_va = (u64)(uintptr_t)fb;
list->write_idx = (list->write_idx == H264_MAX_FB_NUM - 1) ?
0 : list->write_idx + 1;
list->count++;
@@ -350,7 +350,7 @@ static int vdec_h264_decode(unsigned long h_vdec, struct mtk_vcodec_mem *bs,
unsigned char *buf;
unsigned int buf_sz;
unsigned int data[2];
- uint64_t vdec_fb_va = (u64)fb;
+ uint64_t vdec_fb_va = (u64)(uintptr_t)fb;
uint64_t y_fb_dma = fb ? (u64)fb->base_y.dma_addr : 0;
uint64_t c_fb_dma = fb ? (u64)fb->base_c.dma_addr : 0;
@@ -443,7 +443,8 @@ static void vdec_h264_get_fb(struct vdec_h264_inst *inst,
return;
}
- fb = (struct vdec_fb *)list->fb_list[list->read_idx].vdec_fb_va;
+ fb = (struct vdec_fb *)
+ (uintptr_t)list->fb_list[list->read_idx].vdec_fb_va;
fb->status |= (disp_list ? FB_ST_DISPLAY : FB_ST_FREE);
*out_fb = fb;
diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c
index d4fce3e..054d4d1 100644
--- a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c
+++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c
@@ -13,6 +13,7 @@
* GNU General Public License for more details.
*/
+#include <linux/slab.h>
#include "../vdec_drv_if.h"
#include "../mtk_vcodec_util.h"
#include "../mtk_vcodec_dec.h"
diff --git a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c
index 60a7b00..ca3174d 100644
--- a/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c
+++ b/drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c
@@ -475,7 +475,7 @@ static void vp9_swap_frm_bufs(struct vdec_vp9_inst *inst)
*/
if (frm_to_show->fb != NULL)
mtk_vcodec_err(inst,
- "inst->cur_fb->base_y.size=%lx, frm_to_show->fb.base_y.size=%lx",
+ "inst->cur_fb->base_y.size=%zu, frm_to_show->fb.base_y.size=%zu",
inst->cur_fb->base_y.size,
frm_to_show->fb->base_y.size);
}
@@ -791,7 +791,7 @@ static int vdec_vp9_decode(unsigned long h_vdec, struct mtk_vcodec_mem *bs,
return -EINVAL;
}
- mtk_vcodec_debug(inst, "Input BS Size = %ld", bs->size);
+ mtk_vcodec_debug(inst, "Input BS Size = %zu", bs->size);
while (1) {
struct vdec_fb *cur_fb = NULL;
diff --git a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c
index 0798a6b..5a24c51 100644
--- a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c
+++ b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c
@@ -19,7 +19,8 @@
static void handle_init_ack_msg(struct vdec_vpu_ipi_init_ack *msg)
{
- struct vdec_vpu_inst *vpu = (struct vdec_vpu_inst *)msg->ap_inst_addr;
+ struct vdec_vpu_inst *vpu = (struct vdec_vpu_inst *)
+ (unsigned long)msg->ap_inst_addr;
mtk_vcodec_debug(vpu, "+ ap_inst_addr = 0x%llx", msg->ap_inst_addr);
@@ -38,7 +39,8 @@ static void handle_init_ack_msg(struct vdec_vpu_ipi_init_ack *msg)
void vpu_dec_ipi_handler(void *data, unsigned int len, void *priv)
{
struct vdec_vpu_ipi_ack *msg = data;
- struct vdec_vpu_inst *vpu = (struct vdec_vpu_inst *)msg->ap_inst_addr;
+ struct vdec_vpu_inst *vpu = (struct vdec_vpu_inst *)
+ (unsigned long)msg->ap_inst_addr;
mtk_vcodec_debug(vpu, "+ id=%X", msg->msg_id);
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2] vcodec: mediatek: add Maintainers entry for Mediatek MT8173 vcodec drivers
From: Tiffany Lin @ 2016-09-07 6:29 UTC (permalink / raw)
To: Hans Verkuil, Laurent Pinchart, Mauro Carvalho Chehab,
Matthias Brugger, Daniel Kurtz, Pawel Osciak
Cc: Eddie Huang, Yingjoe Chen, linux-kernel, linux-media,
linux-mediatek, Tiffany.lin, Tiffany Lin, Andrew-CT Chen
Add Tiffany Lin and Andrew-CT Chen as maintainers for
Mediatek MT8173 vcodec drivers
Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: Andrew-CT Chen <andrew-ct.chen@mediatek.com>
---
v2: Rename MT8173 MEDIA DRIVER to MEDIATEK MEDIA DRIVER
---
MAINTAINERS | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 0a16a82..96854c1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7590,6 +7590,15 @@ F: include/uapi/linux/meye.h
F: include/uapi/linux/ivtv*
F: include/uapi/linux/uvcvideo.h
+MEDIATEK MEDIA DRIVER
+M: Tiffany Lin <tiffany.lin@mediatek.com>
+M: Andrew-CT Chen <andrew-ct.chen@mediatek.com>
+S: Supported
+F: drivers/media/platform/mtk-vcodec/
+F: drivers/media/platform/mtk-vpu/
+F: Documentation/devicetree/bindings/media/mediatek-vcodec.txt
+F: Documentation/devicetree/bindings/media/mediatek-vpu.txt
+
MEDIATEK ETHERNET DRIVER
M: Felix Fietkau <nbd@openwrt.org>
M: John Crispin <blogic@openwrt.org>
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH net-next v5 1/2] net: ethernet: mediatek: enhance RX path by reducing the frequency of the memory barrier used
From: John Crispin @ 2016-09-07 6:35 UTC (permalink / raw)
To: sean.wang, davem; +Cc: nbd, netdev, linux-mediatek, keyhaede, objelf
In-Reply-To: <1472896767-18352-2-git-send-email-sean.wang@mediatek.com>
On 03/09/2016 11:59, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
>
> The patch makes move wmb() to outside the loop that could help
> RX path handling more faster although that RX descriptors aren't
> freed for DMA to use as soon as possible, but based on my experiment
> and the result shows it still can reach about 943Mbpis without
> performance drop that is tested based on the setup with one port
> using Giga PHY and 256 RX descriptors for DMA to move.
>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
gave it a quick spin on my hardware and it works well even when using
more than 1 gmac.
Acked-by: John Crispin <john@phrozen.org>
> ---
> drivers/net/ethernet/mediatek/mtk_eth_soc.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> index 431b851..a1bdb53 100644
> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> @@ -890,13 +890,14 @@ release_desc:
> rxd->rxd2 = RX_DMA_PLEN0(ring->buf_size);
>
> ring->calc_idx = idx;
> - /* make sure that all changes to the dma ring are flushed before
> - * we continue
> - */
> - wmb();
> - mtk_w32(eth, ring->calc_idx, MTK_PRX_CRX_IDX0);
> +
> done++;
> }
> + /* make sure that all changes to the dma ring are flushed before
> + * we continue
> + */
> + wmb();
> + mtk_w32(eth, ring->calc_idx, MTK_PRX_CRX_IDX0);
>
> if (done < budget)
> mtk_w32(eth, MTK_RX_DONE_INT, MTK_PDMA_INT_STATUS);
>
^ permalink raw reply
* Re: [PATCH net-next v5 2/2] net: ethernet: mediatek: enhance RX path by aggregating more SKBs into NAPI
From: John Crispin @ 2016-09-07 6:38 UTC (permalink / raw)
To: sean.wang, davem; +Cc: nbd, keyhaede, netdev, linux-mediatek, objelf
In-Reply-To: <1472896767-18352-3-git-send-email-sean.wang@mediatek.com>
On 03/09/2016 11:59, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
>
> The patch adds support for aggregating more SKBs feed into NAPI in
> order to get more benefits from generic receive offload (GRO) by
> peeking at the RX ring status and moving more packets right before
> returning from NAPI RX polling handler if NAPI budgets are still
> available and some packets already present in hardware.
>
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
this looks ok to me, gave it a quick try on my HW and it works well. i
am just not sure if this is something that is commonly done. someone
with more overview of how NAPI should be used might want to comment on this.
Tested-by: John Crispin <john@phrozen.org>
> ---
> drivers/net/ethernet/mediatek/mtk_eth_soc.c | 31 ++++++++++++++++-------------
> 1 file changed, 17 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> index a1bdb53..66fd45a 100644
> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
> @@ -893,14 +893,14 @@ release_desc:
>
> done++;
> }
> - /* make sure that all changes to the dma ring are flushed before
> - * we continue
> - */
> - wmb();
> - mtk_w32(eth, ring->calc_idx, MTK_PRX_CRX_IDX0);
>
> - if (done < budget)
> - mtk_w32(eth, MTK_RX_DONE_INT, MTK_PDMA_INT_STATUS);
> + if (done) {
> + /* make sure that all changes to the dma ring are flushed before
> + * we continue
> + */
> + wmb();
> + mtk_w32(eth, ring->calc_idx, MTK_PRX_CRX_IDX0);
> + }
>
> return done;
> }
> @@ -1020,10 +1020,13 @@ static int mtk_napi_rx(struct napi_struct *napi, int budget)
> struct mtk_eth *eth = container_of(napi, struct mtk_eth, rx_napi);
> u32 status, mask;
> int rx_done = 0;
> + int remain_budget = budget;
>
> mtk_handle_status_irq(eth);
> +
> +poll_again:
> mtk_w32(eth, MTK_RX_DONE_INT, MTK_PDMA_INT_STATUS);
> - rx_done = mtk_poll_rx(napi, budget, eth);
> + rx_done = mtk_poll_rx(napi, remain_budget, eth);
>
> if (unlikely(netif_msg_intr(eth))) {
> status = mtk_r32(eth, MTK_PDMA_INT_STATUS);
> @@ -1032,18 +1035,18 @@ static int mtk_napi_rx(struct napi_struct *napi, int budget)
> "done rx %d, intr 0x%08x/0x%x\n",
> rx_done, status, mask);
> }
> -
> - if (rx_done == budget)
> + if (rx_done == remain_budget)
> return budget;
>
> status = mtk_r32(eth, MTK_PDMA_INT_STATUS);
> - if (status & MTK_RX_DONE_INT)
> - return budget;
> -
> + if (status & MTK_RX_DONE_INT) {
> + remain_budget -= rx_done;
> + goto poll_again;
> + }
> napi_complete(napi);
> mtk_irq_enable(eth, MTK_PDMA_INT_MASK, MTK_RX_DONE_INT);
>
> - return rx_done;
> + return rx_done + budget - remain_budget;
> }
>
> static int mtk_tx_alloc(struct mtk_eth *eth)
>
^ permalink raw reply
* [PATCH 0/4] Add V4L2_PIX_FMT_MT21C format for MT8173 codec driver
From: Tiffany Lin @ 2016-09-07 6:56 UTC (permalink / raw)
To: Hans Verkuil, Laurent Pinchart, Mauro Carvalho Chehab,
Matthias Brugger, Daniel Kurtz, Pawel Osciak
Cc: Tiffany Lin, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Yingjoe Chen,
Eddie Huang, linux-media-u79uwXL29TY76Z2rM5mHXA
This patch series add Mediatek compressed block format V4L2_PIX_FMT_MT21C, the
decoder driver will decoded bitstream to V4L2_PIX_FMT_MT21C format.
User space applications could use MT8173 MDP driver to convert V4L2_PIX_FMT_MT21C to
V4L2_PIX_FMT_NV12M, V4L2_PIX_FMT_YUV420M and V4L2_PIX_FMT_YVU420.
MDP driver[1] is stand alone driver.
Usage:
MT21C -> MT8173 MDP -> NV12M/YUV420M/YVU420
NV12M/NV21M/YUV420M/YVU420M -> mt8173 Encoder -> H264/VP8
H264/VP8/VP9 -> mtk8173 Decoder -> MT21C
When encode with MT21 source, the pipeline will be:
MT21C -> MDP driver-> NV12M/NV21M/YUV420M/YVU420M -> Encoder -> H264/VP8
When playback, the pipeline will be:
H264/VP8/VP9 -> Decoder driver -> MT21C -> MDP Driver -> DRM
[1]https://patchwork.kernel.org/patch/9305329/
Tiffany Lin (4):
v4l: add Mediatek compressed video block format
docs-rst: Add compressed video formats used on MT8173 codec driver
vcodec: mediatek: Add V4L2_PIX_FMT_MT21C support for v4l2 decoder
arm64: dts: mediatek: Add Video Decoder for MT8173
Documentation/media/uapi/v4l/pixfmt-reserved.rst | 6 +++
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 44 ++++++++++++++++++++
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c | 7 +++-
drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
include/uapi/linux/videodev2.h | 1 +
5 files changed, 58 insertions(+), 1 deletion(-)
--
1.7.9.5
^ permalink raw reply
* [PATCH 1/4] v4l: add Mediatek compressed video block format
From: Tiffany Lin @ 2016-09-07 6:56 UTC (permalink / raw)
To: Hans Verkuil, Laurent Pinchart, Mauro Carvalho Chehab,
Matthias Brugger, Daniel Kurtz, Pawel Osciak
Cc: Tiffany Lin, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Yingjoe Chen,
Eddie Huang, linux-media-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1473231403-14900-1-git-send-email-tiffany.lin-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Add V4L2_PIX_FMT_MT21C format used on MT8173 driver.
It is compressed format and need MT8173 MDP driver to transfer to other
standard format.
Signed-off-by: Tiffany Lin <tiffany.lin-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
drivers/media/v4l2-core/v4l2-ioctl.c | 1 +
include/uapi/linux/videodev2.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 2bd1581..1d45c58 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1288,6 +1288,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
case V4L2_PIX_FMT_JPGL: descr = "JPEG Lite"; break;
case V4L2_PIX_FMT_SE401: descr = "GSPCA SE401"; break;
case V4L2_PIX_FMT_S5C_UYVY_JPG: descr = "S5C73MX interleaved UYVY/JPEG"; break;
+ case V4L2_PIX_FMT_MT21C: descr = "Mediatek Compressed Format"; break;
default:
WARN(1, "Unknown pixelformat 0x%08x\n", fmt->pixelformat);
if (fmt->description[0])
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 43326c3..ddd0083 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -635,6 +635,7 @@ struct v4l2_pix_format {
#define V4L2_PIX_FMT_Y8I v4l2_fourcc('Y', '8', 'I', ' ') /* Greyscale 8-bit L/R interleaved */
#define V4L2_PIX_FMT_Y12I v4l2_fourcc('Y', '1', '2', 'I') /* Greyscale 12-bit L/R interleaved */
#define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */
+#define V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */
/* SDR formats - used only for Software Defined Radio devices */
#define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */
--
1.7.9.5
^ permalink raw reply related
* [PATCH 2/4] docs-rst: Add compressed video formats used on MT8173 codec driver
From: Tiffany Lin @ 2016-09-07 6:56 UTC (permalink / raw)
To: Hans Verkuil, Laurent Pinchart, Mauro Carvalho Chehab,
Matthias Brugger, Daniel Kurtz, Pawel Osciak
Cc: Eddie Huang, Yingjoe Chen, linux-kernel, linux-media,
linux-mediatek, Tiffany.lin, Tiffany Lin
In-Reply-To: <1473231403-14900-2-git-send-email-tiffany.lin@mediatek.com>
Add V4L2_PIX_FMT_MT21C documentation
Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
---
Documentation/media/uapi/v4l/pixfmt-reserved.rst | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/media/uapi/v4l/pixfmt-reserved.rst b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
index 0dd2f7f..2e21fbc 100644
--- a/Documentation/media/uapi/v4l/pixfmt-reserved.rst
+++ b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
@@ -339,7 +339,13 @@ please make a proposal on the linux-media mailing list.
array. Anything what's in between the UYVY lines is JPEG data and
should be concatenated to form the JPEG stream.
+ - .. _V4L2-PIX-FMT-MT21C:
+ - ``V4L2_PIX_FMT_MT21C``
+
+ - 'MT21C'
+
+ - Compressed two-planar YVU420 format used by Mediatek MT8173.
.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
--
1.7.9.5
^ permalink raw reply related
* [PATCH 3/4] vcodec: mediatek: Add V4L2_PIX_FMT_MT21C support for v4l2 decoder
From: Tiffany Lin @ 2016-09-07 6:56 UTC (permalink / raw)
To: Hans Verkuil, Laurent Pinchart, Mauro Carvalho Chehab,
Matthias Brugger, Daniel Kurtz, Pawel Osciak
Cc: Eddie Huang, Yingjoe Chen, linux-kernel, linux-media,
linux-mediatek, Tiffany.lin, Tiffany Lin
In-Reply-To: <1473231403-14900-3-git-send-email-tiffany.lin@mediatek.com>
Add V4L2_PIX_FMT_MT21C support
Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
---
drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
index 28a8453..fd3befc 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
@@ -25,7 +25,7 @@
#include "mtk_vcodec_dec_pm.h"
#define OUT_FMT_IDX 0
-#define CAP_FMT_IDX 0
+#define CAP_FMT_IDX 3
#define MTK_VDEC_MIN_W 64U
#define MTK_VDEC_MIN_H 64U
@@ -48,6 +48,11 @@ static struct mtk_video_fmt mtk_video_formats[] = {
.type = MTK_FMT_DEC,
.num_planes = 1,
},
+ {
+ .fourcc = V4L2_PIX_FMT_MT21C,
+ .type = MTK_FMT_FRAME,
+ .num_planes = 2,
+ },
};
static const struct mtk_codec_framesizes mtk_vdec_framesizes[] = {
--
1.7.9.5
^ permalink raw reply related
* [PATCH 4/4] arm64: dts: mediatek: Add Video Decoder for MT8173
From: Tiffany Lin @ 2016-09-07 6:56 UTC (permalink / raw)
To: Hans Verkuil, Laurent Pinchart, Mauro Carvalho Chehab,
Matthias Brugger, Daniel Kurtz, Pawel Osciak
Cc: Tiffany Lin, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Yingjoe Chen,
Eddie Huang, linux-media-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1473231403-14900-4-git-send-email-tiffany.lin-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Add video decoder node for MT8173
Signed-off-by: Tiffany Lin <tiffany.lin-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
arch/arm64/boot/dts/mediatek/mt8173.dtsi | 44 ++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
index 10f638f..2872cd7 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
@@ -974,6 +974,50 @@
#clock-cells = <1>;
};
+ vcodec_dec: vcodec@16000000 {
+ compatible = "mediatek,mt8173-vcodec-dec";
+ reg = <0 0x16000000 0 0x100>, /* VDEC_SYS */
+ <0 0x16020000 0 0x1000>, /* VDEC_MISC */
+ <0 0x16021000 0 0x800>, /* VDEC_LD */
+ <0 0x16021800 0 0x800>, /* VDEC_TOP */
+ <0 0x16022000 0 0x1000>, /* VDEC_CM */
+ <0 0x16023000 0 0x1000>, /* VDEC_AD */
+ <0 0x16024000 0 0x1000>, /* VDEC_AV */
+ <0 0x16025000 0 0x1000>, /* VDEC_PP */
+ <0 0x16026800 0 0x800>, /* VDEC_HWD */
+ <0 0x16027000 0 0x800>, /* VDEC_HWQ */
+ <0 0x16027800 0 0x800>, /* VDEC_HWB */
+ <0 0x16028400 0 0x400>; /* VDEC_HWG */
+ interrupts = <GIC_SPI 204 IRQ_TYPE_LEVEL_LOW>;
+ mediatek,larb = <&larb1>;
+ iommus = <&iommu M4U_PORT_HW_VDEC_MC_EXT>,
+ <&iommu M4U_PORT_HW_VDEC_PP_EXT>,
+ <&iommu M4U_PORT_HW_VDEC_AVC_MV_EXT>,
+ <&iommu M4U_PORT_HW_VDEC_PRED_RD_EXT>,
+ <&iommu M4U_PORT_HW_VDEC_PRED_WR_EXT>,
+ <&iommu M4U_PORT_HW_VDEC_UFO_EXT>,
+ <&iommu M4U_PORT_HW_VDEC_VLD_EXT>,
+ <&iommu M4U_PORT_HW_VDEC_VLD2_EXT>;
+ mediatek,vpu = <&vpu>;
+ power-domains = <&scpsys MT8173_POWER_DOMAIN_VDEC>;
+ clocks = <&apmixedsys CLK_APMIXED_VCODECPLL>,
+ <&topckgen CLK_TOP_UNIVPLL_D2>,
+ <&topckgen CLK_TOP_CCI400_SEL>,
+ <&topckgen CLK_TOP_VDEC_SEL>,
+ <&topckgen CLK_TOP_VCODECPLL>,
+ <&apmixedsys CLK_APMIXED_VENCPLL>,
+ <&topckgen CLK_TOP_VENC_LT_SEL>,
+ <&topckgen CLK_TOP_VCODECPLL_370P5>;
+ clock-names = "vcodecpll",
+ "univpll_d2",
+ "clk_cci400_sel",
+ "vdec_sel",
+ "vdecpll",
+ "vencpll",
+ "venc_lt_sel",
+ "vdec_bus_clk_src";
+ };
+
larb1: larb@16010000 {
compatible = "mediatek,mt8173-smi-larb";
reg = <0 0x16010000 0 0x1000>;
--
1.7.9.5
^ permalink raw reply related
* [PATCH v3] vcodec: mediatek: add Maintainers entry for Mediatek MT8173 vcodec drivers
From: Tiffany Lin @ 2016-09-07 7:08 UTC (permalink / raw)
To: Hans Verkuil, Laurent Pinchart, Mauro Carvalho Chehab,
Matthias Brugger, Daniel Kurtz, Pawel Osciak
Cc: Eddie Huang, Yingjoe Chen, linux-kernel, linux-media,
linux-mediatek, Tiffany.lin, Tiffany Lin, Andrew-CT Chen
Add Tiffany Lin and Andrew-CT Chen as maintainers for
Mediatek MT8173 vcodec drivers
Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: Andrew-CT Chen <andrew-ct.chen@mediatek.com>
---
v3: Move MEDIATEK MEDIA DRIVER after MEDIATEK ETHERNET DRIVER to follow
alphabet sequence
v2: Rename MT8173 MEDIA DRIVER to MEDIATEK MEDIA DRIVER
---
MAINTAINERS | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 0a16a82..14a48cc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7597,6 +7597,15 @@ L: netdev@vger.kernel.org
S: Maintained
F: drivers/net/ethernet/mediatek/
+MEDIATEK MEDIA DRIVER
+M: Tiffany Lin <tiffany.lin@mediatek.com>
+M: Andrew-CT Chen <andrew-ct.chen@mediatek.com>
+S: Supported
+F: drivers/media/platform/mtk-vcodec/
+F: drivers/media/platform/mtk-vpu/
+F: Documentation/devicetree/bindings/media/mediatek-vcodec.txt
+F: Documentation/devicetree/bindings/media/mediatek-vpu.txt
+
MEDIATEK MT7601U WIRELESS LAN DRIVER
M: Jakub Kicinski <kubakici@wp.pl>
L: linux-wireless@vger.kernel.org
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH 2/4] docs-rst: Add compressed video formats used on MT8173 codec driver
From: Hans Verkuil @ 2016-09-07 9:23 UTC (permalink / raw)
To: Tiffany Lin, Hans Verkuil, Laurent Pinchart,
Mauro Carvalho Chehab, Matthias Brugger, Daniel Kurtz,
Pawel Osciak
Cc: Eddie Huang, Yingjoe Chen, linux-kernel, linux-media,
linux-mediatek
In-Reply-To: <1473231403-14900-3-git-send-email-tiffany.lin@mediatek.com>
On 09/07/16 08:56, Tiffany Lin wrote:
> Add V4L2_PIX_FMT_MT21C documentation
>
> Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
> ---
> Documentation/media/uapi/v4l/pixfmt-reserved.rst | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/Documentation/media/uapi/v4l/pixfmt-reserved.rst b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> index 0dd2f7f..2e21fbc 100644
> --- a/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> +++ b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> @@ -339,7 +339,13 @@ please make a proposal on the linux-media mailing list.
> array. Anything what's in between the UYVY lines is JPEG data and
> should be concatenated to form the JPEG stream.
>
> + - .. _V4L2-PIX-FMT-MT21C:
>
> + - ``V4L2_PIX_FMT_MT21C``
> +
> + - 'MT21C'
> +
> + - Compressed two-planar YVU420 format used by Mediatek MT8173.
This really needs to be expanded.
Ideally this should reference the precise specification of this format if
available.
It certainly should explain which HW blocks of the mediatek SoC use this
format, it should explain that is it meant as an opaque intermediate format
between those blocks.
If you have some characteristics (i.e. is it lossy or lossless
compression, I
presume it's lossless), then that will be useful to add as well.
We like to have as much information about formats as possible.
Regards,
Hans
>
> .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
>
>
^ permalink raw reply
* [PATCH] thermal: mtk_thermal: Check return value of devm_thermal_zone_of_sensor_register
From: Axel Lin @ 2016-09-07 9:24 UTC (permalink / raw)
To: Zhang Rui
Cc: Eduardo Valentin, Matthias Brugger, linux-pm, linux-mediatek,
Axel Lin
devm_thermal_zone_of_sensor_register can fail, so check it's return value.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/thermal/mtk_thermal.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c
index 7b233c7..34169c3 100644
--- a/drivers/thermal/mtk_thermal.c
+++ b/drivers/thermal/mtk_thermal.c
@@ -584,6 +584,7 @@ static int mtk_thermal_probe(struct platform_device *pdev)
struct resource *res;
const struct of_device_id *of_id;
u64 auxadc_phys_base, apmixed_phys_base;
+ struct thermal_zone_device *tzdev;
mt = devm_kzalloc(&pdev->dev, sizeof(*mt), GFP_KERNEL);
if (!mt)
@@ -666,11 +667,17 @@ static int mtk_thermal_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, mt);
- devm_thermal_zone_of_sensor_register(&pdev->dev, 0, mt,
- &mtk_thermal_ops);
+ tzdev = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, mt,
+ &mtk_thermal_ops);
+ if (IS_ERR(tzdev)) {
+ ret = PTR_ERR(tzdev);
+ goto err_disable_clk_peri_therm;
+ }
return 0;
+err_disable_clk_peri_therm:
+ clk_disable_unprepare(mt->clk_peri_therm);
err_disable_clk_auxadc:
clk_disable_unprepare(mt->clk_auxadc);
--
2.7.4
^ permalink raw reply related
* Re: [PATCH v2 3/3] arm: dts: thermal: add thermal/auxadc node.
From: Dawei Chien @ 2016-09-07 9:47 UTC (permalink / raw)
To: Zhang Rui
Cc: Eduardo Valentin, Rob Herring, Pawel Moll, Mark Rutland,
Ian Campbell, Kumar Gala, Russell King, Matthias Brugger,
linux-pm, devicetree, linux-kernel, linux-arm-kernel,
linux-mediatek, srv_heupstream, Sascha Hauer, Fan Chen,
Eddie Huang, Yingjoe Chen, Erin Lo
In-Reply-To: <1473132510.15922.13.camel@mtksdaap41>
On Tue, 2016-09-06 at 11:28 +0800, Dawei Chien wrote:
> Dear Rui,
>
> On Tue, 2016-09-06 at 08:30 +0800, Zhang Rui wrote:
> > On 二, 2016-09-06 at 08:24 +0800, Zhang Rui wrote:
> > > On 四, 2016-08-18 at 11:50 +0800, Dawei Chien wrote:
> > > >
> > > > This adds the thermal controller and auxadc nodes
> > > > to the Mediatek MT2701 dtsi file.
> > > >
> > > > Signed-off-by: Dawei Chien <dawei.chien@mediatek.com>
> > > > ---
> > > > This patch depned on:
> > > > https://patchwork.kernel.org/patch/9249589/
> > > > https://patchwork.kernel.org/patch/9249589/
> > > Hmm, does this mean that I should take all these three patches and
> > > hold
> > > the patches in next merge window until the above patch has been
> > > merged?
> > >
> Yes, this patch is base on auxadc patchset.
>
> > Patch 3/3 can not be applied on top of upstream kernel, so I guess it
> > still has some other dependencies.
> > I think I can apply patch 1, 2 first. And patch 3/3 should be handled
> > in the dt tree.
>
> Sorry, this patch is also need Mediatek's clock patchset what I miss to
> add in dependency list, I would resend this dt tree once clock patch
> merge, or resend this for right dependency on next version, thank you.
Actually, since patch1/patch2 would be OK so far, I would just only
resend patch3 after MTK clock pathcset ready, I prefer to merge
patch1/patch2 if possible, thank you.
> > thanks,
> > rui
> > > thanks,
> > > rui
> > > >
> > > > ---
> > > > arch/arm/boot/dts/mt2701.dtsi | 44
> > > > +++++++++++++++++++++++++++++++++++++++++
> > > > 1 file changed, 44 insertions(+)
> > > >
> > > > diff --git a/arch/arm/boot/dts/mt2701.dtsi
> > > > b/arch/arm/boot/dts/mt2701.dtsi
> > > > index e9150a4..cee4724 100644
> > > > --- a/arch/arm/boot/dts/mt2701.dtsi
> > > > +++ b/arch/arm/boot/dts/mt2701.dtsi
> > > > @@ -87,6 +87,36 @@
> > > > clock-output-names = "rtc32k";
> > > > };
> > > >
> > > > + thermal-zones {
> > > > + cpu_thermal: cpu_thermal {
> > > > + polling-delay-passive = <1000>; /*
> > > > milliseconds */
> > > > + polling-delay = <1000>; /* milliseconds */
> > > > +
> > > > + thermal-sensors = <&thermal 0>;
> > > > + sustainable-power = <1000>;
> > > > +
> > > > + trips {
> > > > + threshold: trip-point@0 {
> > > > + temperature = <68000>;
> > > > + hysteresis = <2000>;
> > > > + type = "passive";
> > > > + };
> > > > +
> > > > + target: trip-point@1 {
> > > > + temperature = <85000>;
> > > > + hysteresis = <2000>;
> > > > + type = "passive";
> > > > + };
> > > > +
> > > > + cpu_crit: cpu_crit@0 {
> > > > + temperature = <115000>;
> > > > + hysteresis = <2000>;
> > > > + type = "critical";
> > > > + };
> > > > + };
> > > > + };
> > > > + };
> > > > +
> > > > timer {
> > > > compatible = "arm,armv7-timer";
> > > > interrupt-parent = <&gic>;
> > > > @@ -222,4 +252,18 @@
> > > > clock-names = "baud", "bus";
> > > > status = "disabled";
> > > > };
> > > > +
> > > > + thermal: thermal@1100b000 {
> > > > + #thermal-sensor-cells = <0>;
> > > > + compatible = "mediatek,mt2701-thermal";
> > > > + reg = <0 0x1100b000 0 0x1000>;
> > > > + interrupts = <GIC_SPI 70 IRQ_TYPE_LEVEL_LOW>;
> > > > + clocks = <&pericfg CLK_PERI_THERM>, <&pericfg
> > > > CLK_PERI_AUXADC>;
> > > > + clock-names = "therm", "auxadc";
> > > > + resets = <&pericfg 0x10>;
> > > > + reset-names = "therm";
> > > > + mediatek,auxadc = <&auxadc>;
> > > > + mediatek,apmixedsys = <&apmixedsys>;
> > > > + };
> > > > +
> > > > };
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-pm"
> > > in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* [PATCH] [media] VPU: mediatek: fix null pointer dereference on pdev
From: Colin King @ 2016-09-07 17:10 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Matthias Brugger, Hans Verkuil,
Wei Yongjun, Tiffany Lin, Andrew-CT Chen, linux-media,
linux-arm-kernel, linux-mediatek
Cc: linux-kernel
From: Colin Ian King <colin.king@canonical.com>
pdev is being null checked, however, prior to that it is being
dereferenced by platform_get_drvdata. Move the assignments of
vpu and run to after the pdev null check to avoid a potential
null pointer dereference.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/media/platform/mtk-vpu/mtk_vpu.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.c b/drivers/media/platform/mtk-vpu/mtk_vpu.c
index c9bf58c..43907a3 100644
--- a/drivers/media/platform/mtk-vpu/mtk_vpu.c
+++ b/drivers/media/platform/mtk-vpu/mtk_vpu.c
@@ -523,9 +523,9 @@ static int load_requested_vpu(struct mtk_vpu *vpu,
int vpu_load_firmware(struct platform_device *pdev)
{
- struct mtk_vpu *vpu = platform_get_drvdata(pdev);
+ struct mtk_vpu *vpu;
struct device *dev = &pdev->dev;
- struct vpu_run *run = &vpu->run;
+ struct vpu_run *run;
const struct firmware *vpu_fw = NULL;
int ret;
@@ -534,6 +534,9 @@ int vpu_load_firmware(struct platform_device *pdev)
return -EINVAL;
}
+ vpu = platform_get_drvdata(pdev);
+ run = &vpu->run;
+
mutex_lock(&vpu->vpu_mutex);
if (vpu->fw_loaded) {
mutex_unlock(&vpu->vpu_mutex);
--
2.9.3
^ permalink raw reply related
* Re: [PATCH] [media] VPU: mediatek: fix null pointer dereference on pdev
From: Tiffany Lin @ 2016-09-08 5:21 UTC (permalink / raw)
To: Colin King
Cc: Andrew-CT Chen, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Wei Yongjun,
Hans Verkuil, Matthias Brugger,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
Mauro Carvalho Chehab,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-media-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20160907171027.16424-1-colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
On Wed, 2016-09-07 at 18:10 +0100, Colin King wrote:
> From: Colin Ian King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
>
> pdev is being null checked, however, prior to that it is being
> dereferenced by platform_get_drvdata. Move the assignments of
> vpu and run to after the pdev null check to avoid a potential
> null pointer dereference.
>
Reviewed-by:Tiffany Lin <tiffany.lin-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Colin Ian King <colin.king-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
> ---
> drivers/media/platform/mtk-vpu/mtk_vpu.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.c b/drivers/media/platform/mtk-vpu/mtk_vpu.c
> index c9bf58c..43907a3 100644
> --- a/drivers/media/platform/mtk-vpu/mtk_vpu.c
> +++ b/drivers/media/platform/mtk-vpu/mtk_vpu.c
> @@ -523,9 +523,9 @@ static int load_requested_vpu(struct mtk_vpu *vpu,
>
> int vpu_load_firmware(struct platform_device *pdev)
> {
> - struct mtk_vpu *vpu = platform_get_drvdata(pdev);
> + struct mtk_vpu *vpu;
> struct device *dev = &pdev->dev;
> - struct vpu_run *run = &vpu->run;
> + struct vpu_run *run;
> const struct firmware *vpu_fw = NULL;
> int ret;
>
> @@ -534,6 +534,9 @@ int vpu_load_firmware(struct platform_device *pdev)
> return -EINVAL;
> }
>
> + vpu = platform_get_drvdata(pdev);
> + run = &vpu->run;
> +
> mutex_lock(&vpu->vpu_mutex);
> if (vpu->fw_loaded) {
> mutex_unlock(&vpu->vpu_mutex);
^ permalink raw reply
* Re: [PATCH 2/4] docs-rst: Add compressed video formats used on MT8173 codec driver
From: Tiffany Lin @ 2016-09-08 6:44 UTC (permalink / raw)
To: Hans Verkuil
Cc: Hans Verkuil, Laurent Pinchart, Mauro Carvalho Chehab,
Matthias Brugger, Daniel Kurtz, Pawel Osciak, Eddie Huang,
Yingjoe Chen, linux-kernel, linux-media, linux-mediatek
In-Reply-To: <246f1aca-0b46-b2f1-edd0-158a2a07b1d9@xs4all.nl>
Hi Hans,
On Wed, 2016-09-07 at 11:23 +0200, Hans Verkuil wrote:
> On 09/07/16 08:56, Tiffany Lin wrote:
> > Add V4L2_PIX_FMT_MT21C documentation
> >
> > Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
> > ---
> > Documentation/media/uapi/v4l/pixfmt-reserved.rst | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/Documentation/media/uapi/v4l/pixfmt-reserved.rst b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> > index 0dd2f7f..2e21fbc 100644
> > --- a/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> > +++ b/Documentation/media/uapi/v4l/pixfmt-reserved.rst
> > @@ -339,7 +339,13 @@ please make a proposal on the linux-media mailing list.
> > array. Anything what's in between the UYVY lines is JPEG data and
> > should be concatenated to form the JPEG stream.
> >
> > + - .. _V4L2-PIX-FMT-MT21C:
> >
> > + - ``V4L2_PIX_FMT_MT21C``
> > +
> > + - 'MT21C'
> > +
> > + - Compressed two-planar YVU420 format used by Mediatek MT8173.
>
> This really needs to be expanded.
>
> Ideally this should reference the precise specification of this format if
> available.
>
> It certainly should explain which HW blocks of the mediatek SoC use this
> format, it should explain that is it meant as an opaque intermediate format
> between those blocks.
>
Yes. it is an opaque intermediate format.
VDEC HW only output MT21C format, and it need MDP HW to convert to other
standard format.
At first, we plan to put "convert MT21C to other standard format" in our
v4l2 decoder driver, actually in VPU firmware.
In this case, there is no need to expose MT21C format to user space.
But consider that MDP is a stand alone HW (interrupt, power, clk),
combine decode and format convert in one decode step impact performance.
VDEC HW and MDP HW could process different frame at same time.
MDP may also used by other modules to do format convert, not only VDEC.
That's why we need to expose MT21C to user space.
When user space application enumerate VDEC and display HW and found that
the format is not match.
It need to use MDP driver to do format convert.
> If you have some characteristics (i.e. is it lossy or lossless
> compression, I
> presume it's lossless), then that will be useful to add as well.
>
I will update this in next version.
best regards,
Tiffany
> We like to have as much information about formats as possible.
>
> Regards,
>
> Hans
>
> >
> > .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
> >
> >
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox