linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tiffany Lin <tiffany.lin@mediatek.com>
To: Hans Verkuil <hans.verkuil@cisco.com>,
	<daniel.thompson@linaro.org>, Rob Herring <robh+dt@kernel.org>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Daniel Kurtz <djkurtz@chromium.org>,
	Pawel Osciak <posciak@chromium.org>
Cc: Eddie Huang <eddie.huang@mediatek.com>,
	Yingjoe Chen <yingjoe.chen@mediatek.com>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-media@vger.kernel.org>,
	<linux-mediatek@lists.infradead.org>, <PoChun.Lin@mediatek.com>,
	<Tiffany.lin@mediatek.com>,
	Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
	Tiffany Lin <tiffany.lin@mediatek.com>
Subject: [PATCH v3 1/9] VPU: mediatek: Add decode support
Date: Mon, 30 May 2016 20:29:15 +0800	[thread overview]
Message-ID: <1464611363-14936-2-git-send-email-tiffany.lin@mediatek.com> (raw)
In-Reply-To: <1464611363-14936-1-git-send-email-tiffany.lin@mediatek.com>

From: Andrew-CT Chen <andrew-ct.chen@mediatek.com>

VPU driver add decode support

Signed-off-by: Andrew-CT Chen <andrew-ct.chen@mediatek.com>
Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com>
---
 drivers/media/platform/mtk-vpu/mtk_vpu.c |   12 ++++++++++++
 drivers/media/platform/mtk-vpu/mtk_vpu.h |   27 +++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.c b/drivers/media/platform/mtk-vpu/mtk_vpu.c
index b60d02c..ca23b1f 100644
--- a/drivers/media/platform/mtk-vpu/mtk_vpu.c
+++ b/drivers/media/platform/mtk-vpu/mtk_vpu.c
@@ -134,6 +134,8 @@ struct vpu_wdt {
  *
  * @signaled:		the signal of vpu initialization completed
  * @fw_ver:		VPU firmware version
+ * @dec_capability:	decoder capability which is not used for now and
+ *			the value is reserved for future use
  * @enc_capability:	encoder capability which is not used for now and
  *			the value is reserved for future use
  * @wq:			wait queue for VPU initialization status
@@ -141,6 +143,7 @@ struct vpu_wdt {
 struct vpu_run {
 	u32 signaled;
 	char fw_ver[VPU_FW_VER_LEN];
+	unsigned int	dec_capability;
 	unsigned int	enc_capability;
 	wait_queue_head_t wq;
 };
@@ -415,6 +418,14 @@ int vpu_wdt_reg_handler(struct platform_device *pdev,
 }
 EXPORT_SYMBOL_GPL(vpu_wdt_reg_handler);
 
+unsigned int vpu_get_vdec_hw_capa(struct platform_device *pdev)
+{
+	struct mtk_vpu *vpu = platform_get_drvdata(pdev);
+
+	return vpu->run.dec_capability;
+}
+EXPORT_SYMBOL_GPL(vpu_get_vdec_hw_capa);
+
 unsigned int vpu_get_venc_hw_capa(struct platform_device *pdev)
 {
 	struct mtk_vpu *vpu = platform_get_drvdata(pdev);
@@ -600,6 +611,7 @@ static void vpu_init_ipi_handler(void *data, unsigned int len, void *priv)
 
 	vpu->run.signaled = run->signaled;
 	strncpy(vpu->run.fw_ver, run->fw_ver, VPU_FW_VER_LEN);
+	vpu->run.dec_capability = run->dec_capability;
 	vpu->run.enc_capability = run->enc_capability;
 	wake_up_interruptible(&vpu->run.wq);
 }
diff --git a/drivers/media/platform/mtk-vpu/mtk_vpu.h b/drivers/media/platform/mtk-vpu/mtk_vpu.h
index 5ab37f0..f457479 100644
--- a/drivers/media/platform/mtk-vpu/mtk_vpu.h
+++ b/drivers/media/platform/mtk-vpu/mtk_vpu.h
@@ -37,6 +37,18 @@ typedef void (*ipi_handler_t) (void *data,
 			 command to VPU.
 			 For other IPI below, AP should send the request
 			 to VPU to trigger the interrupt.
+ * @IPI_VDEC_H264:	 The interrupt from vpu is to notify kernel to
+			 handle H264 vidoe decoder job, and vice versa.
+			 Decode output format is always MT21 no matter what
+			 the input format is.
+ * @IPI_VDEC_VP8:	 The interrupt from is to notify kernel to
+			 handle VP8 video decoder job, and vice versa.
+			 Decode output format is always MT21 no matter what
+			 the input format is.
+ * @IPI_VDEC_VP9:	 The interrupt from vpu is to notify kernel to
+			 handle VP9 video decoder job, and vice versa.
+			 Decode output format is always MT21 no matter what
+			 the input format is.
  * @IPI_VENC_H264:	 The interrupt from vpu is to notify kernel to
 			 handle H264 video encoder job, and vice versa.
  * @IPI_VENC_VP8:	 The interrupt fro vpu is to notify kernel to
@@ -46,6 +58,9 @@ typedef void (*ipi_handler_t) (void *data,
 
 enum ipi_id {
 	IPI_VPU_INIT = 0,
+	IPI_VDEC_H264,
+	IPI_VDEC_VP8,
+	IPI_VDEC_VP9,
 	IPI_VENC_H264,
 	IPI_VENC_VP8,
 	IPI_MAX,
@@ -55,10 +70,12 @@ enum ipi_id {
  * enum rst_id - reset id to register reset function for VPU watchdog timeout
  *
  * @VPU_RST_ENC: encoder reset id
+ * @VPU_RST_DEC: decoder reset id
  * @VPU_RST_MAX: maximum reset id
  */
 enum rst_id {
 	VPU_RST_ENC,
+	VPU_RST_DEC,
 	VPU_RST_MAX,
 };
 
@@ -125,6 +142,16 @@ struct platform_device *vpu_get_plat_device(struct platform_device *pdev);
 int vpu_wdt_reg_handler(struct platform_device *pdev,
 			void vpu_wdt_reset_func(void *),
 			void *priv, enum rst_id id);
+
+/**
+ * vpu_get_vdec_hw_capa - get video decoder hardware capability
+ *
+ * @pdev:	VPU platform device
+ *
+ * Return: video decoder hardware capability
+ **/
+unsigned int vpu_get_vdec_hw_capa(struct platform_device *pdev);
+
 /**
  * vpu_get_venc_hw_capa - get video encoder hardware capability
  *
-- 
1.7.9.5


  reply	other threads:[~2016-05-30 12:29 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-30 12:29 [PATCH v3 0/9] Add MT8173 Video Decoder Driver Tiffany Lin
2016-05-30 12:29 ` Tiffany Lin [this message]
2016-05-30 12:29   ` [PATCH v3 2/9] v4l: add Mediatek compressed video block format Tiffany Lin
2016-05-30 12:29     ` [PATCH v3 3/9] DocBook/v4l: Add compressed video formats used on MT8173 codec driver Tiffany Lin
2016-05-30 12:29       ` [PATCH v3 4/9] dt-bindings: Add a binding for Mediatek Video Decoder Tiffany Lin
2016-05-30 12:29         ` [PATCH v3 5/9] vcodec: mediatek: Add Mediatek V4L2 Video Decoder Driver Tiffany Lin
2016-05-30 12:29           ` [PATCH v3 6/9] vcodec: mediatek: Add Mediatek H264 " Tiffany Lin
2016-05-30 12:29             ` [PATCH v3 7/9] vcodec: mediatek: Add Mediatek VP8 " Tiffany Lin
2016-05-30 12:29               ` [PATCH v3 8/9] vcodec: mediatek: Add Mediatek VP9 " Tiffany Lin
2016-05-30 12:29                 ` [PATCH v3 9/9] arm64: dts: mediatek: Add Video Decoder for MT8173 Tiffany Lin
2016-07-08 11:06           ` [PATCH v3 5/9] vcodec: mediatek: Add Mediatek V4L2 Video Decoder Driver Hans Verkuil
2016-08-01  9:38             ` Tiffany Lin
2016-08-01 10:39               ` Hans Verkuil
2016-08-01 11:28                 ` Tiffany Lin
2016-07-08 10:23       ` [PATCH v3 3/9] DocBook/v4l: Add compressed video formats used on MT8173 codec driver Hans Verkuil
2016-07-11  2:56         ` tiffany lin
2016-07-12  8:16           ` Wu-Cheng Li (李務誠)
2016-07-12 19:08             ` Nicolas Dufresne
2016-07-12 19:14               ` Nicolas Dufresne
2016-07-12 19:31                 ` Ian Arkver
2016-07-13  2:00                 ` tiffany lin
2016-07-13 13:55                   ` Nicolas Dufresne
2016-07-14  7:30                     ` tiffany lin
2016-07-13  2:22                 ` Wu-Cheng Li (李務誠)
2016-07-13  1:50               ` tiffany lin
2016-07-13  2:03             ` tiffany lin
2016-06-07 14:22 ` [PATCH v3 0/9] Add MT8173 Video Decoder Driver Mauro Carvalho Chehab
2016-06-07 22:13   ` Hans Verkuil
2016-06-14  8:44     ` Wu-Cheng Li (李務誠)
2016-06-14 11:08     ` tiffany lin
2016-06-16 10:54       ` Mauro Carvalho Chehab
2016-07-01 10:11         ` Hans Verkuil
2016-07-01 10:47           ` Wu-Cheng Li (李務誠)
2016-07-01 11:53           ` andrew-ct chen
2016-07-01 12:00             ` Hans Verkuil
2016-07-04 11:09               ` andrew-ct chen
2016-07-06 13:19 ` Hans Verkuil
2016-07-07 10:16   ` tiffany lin
2016-07-07 11:13     ` Hans Verkuil
2016-07-08 11:44     ` Hans Verkuil
2016-07-11  3:58       ` tiffany lin
2016-07-21  9:12       ` tiffany lin
2016-08-15  8:30 ` Hans Verkuil
2016-08-15  9:03   ` Tiffany Lin
2016-08-15  9:07     ` Hans Verkuil
2016-08-15  9:10       ` Tiffany Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464611363-14936-2-git-send-email-tiffany.lin@mediatek.com \
    --to=tiffany.lin@mediatek.com \
    --cc=PoChun.Lin@mediatek.com \
    --cc=andrew-ct.chen@mediatek.com \
    --cc=daniel.thompson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=djkurtz@chromium.org \
    --cc=eddie.huang@mediatek.com \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=mchehab@osg.samsung.com \
    --cc=posciak@chromium.org \
    --cc=robh+dt@kernel.org \
    --cc=yingjoe.chen@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).