media: mtk-vcodec: vdec: set VPI IPI handler in one place
authorAlexandre Courbot <acourbot@chromium.org>
Fri, 6 Sep 2019 11:55:02 +0000 (08:55 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 1 Oct 2019 19:45:25 +0000 (16:45 -0300)
Each of the supported decoder formats used to set the same RPC
interrupt handler by themselves, even though this could be done
by the IF init function itself. Move it to the right place and stop
making its symbol public.

Signed-off-by: Alexandre Courbot <acourbot@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c
drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c
drivers/media/platform/mtk-vcodec/vdec_vpu_if.c
drivers/media/platform/mtk-vcodec/vdec_vpu_if.h

index 49aa85a9bb5a7f5a649e1fd1ea4db55e9edb6b91..50048c170b99cb221833a99ab22c05c59f0e4ee6 100644 (file)
@@ -283,7 +283,6 @@ static int vdec_h264_init(struct mtk_vcodec_ctx *ctx)
        inst->vpu.id = IPI_VDEC_H264;
        inst->vpu.dev = ctx->dev->vpu_plat_dev;
        inst->vpu.ctx = ctx;
        inst->vpu.id = IPI_VDEC_H264;
        inst->vpu.dev = ctx->dev->vpu_plat_dev;
        inst->vpu.ctx = ctx;
-       inst->vpu.handler = vpu_dec_ipi_handler;
 
        err = vpu_dec_init(&inst->vpu);
        if (err) {
 
        err = vpu_dec_init(&inst->vpu);
        if (err) {
index 63a8708ce6822df186e21ad99d5e658839507e21..6011fdd60a222bab7777c8c44e2931d78d2a8e99 100644 (file)
@@ -402,7 +402,6 @@ static int vdec_vp8_init(struct mtk_vcodec_ctx *ctx)
        inst->vpu.id = IPI_VDEC_VP8;
        inst->vpu.dev = ctx->dev->vpu_plat_dev;
        inst->vpu.ctx = ctx;
        inst->vpu.id = IPI_VDEC_VP8;
        inst->vpu.dev = ctx->dev->vpu_plat_dev;
        inst->vpu.ctx = ctx;
-       inst->vpu.handler = vpu_dec_ipi_handler;
 
        err = vpu_dec_init(&inst->vpu);
        if (err) {
 
        err = vpu_dec_init(&inst->vpu);
        if (err) {
index 5066c283d86d1e29194a8727f6512159b2d4b9d4..24c1f0bf21472f0be8d9eb2b82f7b2e7f369f20d 100644 (file)
@@ -793,7 +793,6 @@ static int vdec_vp9_init(struct mtk_vcodec_ctx *ctx)
        inst->vpu.id = IPI_VDEC_VP9;
        inst->vpu.dev = ctx->dev->vpu_plat_dev;
        inst->vpu.ctx = ctx;
        inst->vpu.id = IPI_VDEC_VP9;
        inst->vpu.dev = ctx->dev->vpu_plat_dev;
        inst->vpu.ctx = ctx;
-       inst->vpu.handler = vpu_dec_ipi_handler;
 
        if (vpu_dec_init(&inst->vpu)) {
                mtk_vcodec_err(inst, "vp9_dec_vpu_init failed");
 
        if (vpu_dec_init(&inst->vpu)) {
                mtk_vcodec_err(inst, "vp9_dec_vpu_init failed");
index 3f38cc4509efbf0b3f28fce74c6788f61fe10c54..70abfd4cd4b9fdbbe08517492da1a2e5faf701f3 100644 (file)
@@ -25,10 +25,16 @@ static void handle_init_ack_msg(struct vdec_vpu_ipi_init_ack *msg)
 }
 
 /*
 }
 
 /*
+ * vpu_dec_ipi_handler - Handler for VPU ipi message.
+ *
+ * @data: ipi message
+ * @len : length of ipi message
+ * @priv: callback private data which is passed by decoder when register.
+ *
  * This function runs in interrupt context and it means there's an IPI MSG
  * from VPU.
  */
  * This function runs in interrupt context and it means there's an IPI MSG
  * from VPU.
  */
-void vpu_dec_ipi_handler(void *data, unsigned int len, void *priv)
+static 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 *)
 {
        struct vdec_vpu_ipi_ack *msg = data;
        struct vdec_vpu_inst *vpu = (struct vdec_vpu_inst *)
@@ -102,6 +108,7 @@ int vpu_dec_init(struct vdec_vpu_inst *vpu)
        mtk_vcodec_debug_enter(vpu);
 
        init_waitqueue_head(&vpu->wq);
        mtk_vcodec_debug_enter(vpu);
 
        init_waitqueue_head(&vpu->wq);
+       vpu->handler = vpu_dec_ipi_handler;
 
        err = vpu_ipi_register(vpu->dev, vpu->id, vpu->handler, "vdec", NULL);
        if (err != 0) {
 
        err = vpu_ipi_register(vpu->dev, vpu->id, vpu->handler, "vdec", NULL);
        if (err != 0) {
index b76f717e4fd71aa2d524ebe51ed039332fb18a3f..f779b0676fbd15e617655696fb09fd571c36fe93 100644 (file)
@@ -76,13 +76,4 @@ int vpu_dec_deinit(struct vdec_vpu_inst *vpu);
  */
 int vpu_dec_reset(struct vdec_vpu_inst *vpu);
 
  */
 int vpu_dec_reset(struct vdec_vpu_inst *vpu);
 
-/**
- * vpu_dec_ipi_handler - Handler for VPU ipi message.
- *
- * @data: ipi message
- * @len : length of ipi message
- * @priv: callback private data which is passed by decoder when register.
- */
-void vpu_dec_ipi_handler(void *data, unsigned int len, void *priv);
-
 #endif
 #endif