Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4270542pxv; Tue, 27 Jul 2021 03:13:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzV8Z0bXTwUP18Phcz0wiGGflz6D+tLqqQdNF7XEYFVPk88O/nzsYtYZUZa+dr5SuZxXtHC X-Received: by 2002:a02:908a:: with SMTP id x10mr20577660jaf.30.1627380826426; Tue, 27 Jul 2021 03:13:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627380826; cv=none; d=google.com; s=arc-20160816; b=Fhu1XqOd84TwmOTVcLcO467pcC2njieHTL+5BJo4ddgo1CaGXEpuyl5QUPtbLWLCII woPkOFeP1dS7nnff+hdX6S/ADW7EJekhdnIp3Qb4aGfxAY7vD8sDfnMW/vIaoZqzBbnK s8R3WCQNHODiLcXCdbGxPctKPOgl1GEKMKHUNNPaeauVgBI4TZT3R8OLxiOHB9pgOexL wzpWpkij6U9EIilopqtJQXhrAvzZ3PmSYqmtYkb+udDRpM3OqvhcYaTWOs6OAeAyEkdB P8z+xPec9mT2Ujlr7mxgVs2KKNASHES2dQ3ju1eEM90K9eCWS5NzEv15i4zbuCDYZH5r MtOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=wUYbzfvunpccVNJ5rRWJdNJecxbmn6+Scfk3ElzuPfI=; b=ADAq73UxZbvx2GH/Je51noXQ2Y4P0oX6Wyxnh6ycWUTD1MnR6d1LXXb0hYaoA5jb/4 4TCx7/t+gUP8kF2U+ALb8X+k9PoVixZqUNYme3KIS8nTJX4679WdKZATP8LqdsiRiPqE kcXSVFKdHQ6ayHWLdqHMebjLgJsRDvN9lgBZ6FClgKzXBKSCvrpV5sii/MtnwfKEGY4i jr3s7yMsSGw129ogbaJEhE1nwnlQJ4RbpC5ARnliC+xl/yvNsik3Ziqx/QngKQzuCnci Zbz7SOPMyUYqXCvlIhjjk5H4URC5ERpHTGOIk8ZIk2C5bEcOXMIAlBWcBKRSiBPt4Aoa e1dw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l3si2882372ioq.17.2021.07.27.03.13.34; Tue, 27 Jul 2021 03:13:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236302AbhG0KMJ (ORCPT + 99 others); Tue, 27 Jul 2021 06:12:09 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:57204 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S236349AbhG0KLt (ORCPT ); Tue, 27 Jul 2021 06:11:49 -0400 X-UUID: e03408757ba744f7bed19ba47a5a5746-20210727 X-UUID: e03408757ba744f7bed19ba47a5a5746-20210727 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 138919631; Tue, 27 Jul 2021 18:11:45 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 27 Jul 2021 18:11:43 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 27 Jul 2021 18:11:43 +0800 From: Yunfei Dong To: Yunfei Dong , Alexandre Courbot , Hans Verkuil , Tzung-Bi Shih , Tiffany Lin , Andrew-CT Chen , Mauro Carvalho Chehab , Rob Herring , Matthias Brugger , Tomasz Figa CC: Hsin-Yi Wang , Fritz Koenig , Irui Wang , , , , , , , Subject: [PATCH v3, 14/15] media: mtk-vcodec: Add core dec and dec end ipi msg Date: Tue, 27 Jul 2021 18:10:50 +0800 Message-ID: <20210727101051.24418-15-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210727101051.24418-1-yunfei.dong@mediatek.com> References: <20210727101051.24418-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add core dec and dec end ipi msg: AP_IPIMSG_DEC_CORE/AP_IPIMSG_DEC_CORE_END. Signed-off-by: Yunfei Dong --- v3: no change --- .../media/platform/mtk-vcodec/vdec_ipi_msg.h | 4 ++++ .../media/platform/mtk-vcodec/vdec_vpu_if.c | 12 ++++++++++++ .../media/platform/mtk-vcodec/vdec_vpu_if.h | 18 ++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h b/drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h index 5f45a537beb4..9d8079c4f976 100644 --- a/drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h +++ b/drivers/media/platform/mtk-vcodec/vdec_ipi_msg.h @@ -18,12 +18,16 @@ enum vdec_ipi_msgid { AP_IPIMSG_DEC_END = 0xA002, AP_IPIMSG_DEC_DEINIT = 0xA003, AP_IPIMSG_DEC_RESET = 0xA004, + AP_IPIMSG_DEC_CORE = 0xA005, + AP_IPIMSG_DEC_CORE_END = 0xA006, VPU_IPIMSG_DEC_INIT_ACK = 0xB000, VPU_IPIMSG_DEC_START_ACK = 0xB001, VPU_IPIMSG_DEC_END_ACK = 0xB002, VPU_IPIMSG_DEC_DEINIT_ACK = 0xB003, VPU_IPIMSG_DEC_RESET_ACK = 0xB004, + VPU_IPIMSG_DEC_CORE_ACK = 0xB005, + VPU_IPIMSG_DEC_CORE_END_ACK = 0xB006, }; /** diff --git a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c index 5dffc459a33d..bfd8e87dceff 100644 --- a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c +++ b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.c @@ -85,6 +85,8 @@ static void vpu_dec_ipi_handler(void *data, unsigned int len, void *priv) case VPU_IPIMSG_DEC_END_ACK: case VPU_IPIMSG_DEC_DEINIT_ACK: case VPU_IPIMSG_DEC_RESET_ACK: + case VPU_IPIMSG_DEC_CORE_ACK: + case VPU_IPIMSG_DEC_CORE_END_ACK: break; default: @@ -191,11 +193,21 @@ int vpu_dec_start(struct vdec_vpu_inst *vpu, uint32_t *data, unsigned int len) return err; } +int vpu_dec_core(struct vdec_vpu_inst *vpu) +{ + return vcodec_send_ap_ipi(vpu, AP_IPIMSG_DEC_CORE); +} + int vpu_dec_end(struct vdec_vpu_inst *vpu) { return vcodec_send_ap_ipi(vpu, AP_IPIMSG_DEC_END); } +int vpu_dec_core_end(struct vdec_vpu_inst *vpu) +{ + return vcodec_send_ap_ipi(vpu, AP_IPIMSG_DEC_CORE_END); +} + int vpu_dec_deinit(struct vdec_vpu_inst *vpu) { return vcodec_send_ap_ipi(vpu, AP_IPIMSG_DEC_DEINIT); diff --git a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.h b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.h index c2ed5b6cab8b..ae24b75d1649 100644 --- a/drivers/media/platform/mtk-vcodec/vdec_vpu_if.h +++ b/drivers/media/platform/mtk-vcodec/vdec_vpu_if.h @@ -82,4 +82,22 @@ int vpu_dec_deinit(struct vdec_vpu_inst *vpu); */ int vpu_dec_reset(struct vdec_vpu_inst *vpu); +/** + * vpu_dec_core - core start decoding, basically the function will be invoked once + * every frame. + * + * @vpu : instance for vdec_vpu_inst + */ +int vpu_dec_core(struct vdec_vpu_inst *vpu); + +/** + * vpu_dec_core_end - core end decoding, basically the function will be invoked once + * when core HW decoding done and receive interrupt successfully. The + * decoder in VPU will updata hardware information and deinit hardware + * and check if there is a new decoded frame available to display. + * + * @vpu : instance for vdec_vpu_inst + */ +int vpu_dec_core_end(struct vdec_vpu_inst *vpu); + #endif -- 2.25.1