Message ID | 20231106120423.23364-21-yunfei.dong@mediatek.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2608832vqu; Mon, 6 Nov 2023 04:09:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IGUrJIfBAS0E3nWACTMz+5VweagWmhPN6PIsyP9cW+KxhB/aS7E3mTqmAauHuGbzuQEYEXA X-Received: by 2002:a05:6a21:4881:b0:181:ed8b:4826 with SMTP id av1-20020a056a21488100b00181ed8b4826mr7399051pzc.55.1699272554283; Mon, 06 Nov 2023 04:09:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699272554; cv=none; d=google.com; s=arc-20160816; b=pnaDSCkq+k15B26aM3Ft0nwMcBXWoKe2honvOcx9qfx0s53FKQaOhSGc7hXkexUKq6 LXunQ+HMFI2ATHhY8d6OfQtuvmDsYsc5H2IKYWtyupWlx6HgXETixUMalMsD87twZL1m Y4SGiC/jOMwgcd773JLAfX9zCPc3fXfOwyiieMAYwHih7yYHhpfaPLww9wLK59mUv1xs hkdpOMZ4xOk6M7KKfiEwEhzjt4pQPTGta/Riv/BDJaR44Jtta5dAWJ91lWyZHB8w+7rU 0HNzZ18AgzC2BrmhWu3WXlvFJes7J5rTrRWYLplDviIwWYg43mSzwS7fj9BzsWtByyvv LO0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VtQsGmlkq0o9F4gZkx4FlZ5bjMdfC2lqKQqTsMmWuoI=; fh=8U7QuxU7cADb+Zu8vDAVVKQqqLyxXSbl7CN71zWgSeE=; b=r93+k/s6OimoQ4e/9NVIFIjH0FyMQW1AdPOgZ1yZhUGfHOLgdLke+hLmOjiyECf221 ssa3FYDvmhOJpbog5eHZupx098zqtSMLEAHyZbm/NXmYCflA20M0GC+fgeeitGarUxG1 gW5/peppNI+YTRH0/rXucBODP5b2OLVTRpRxfw0h2rS8aV9m8SaS5a1+l3Yz6TNEAyrt lANqwAopeYOwsGMNQiyNsUBPB/5yl29uIQGDazZYEV7MTMeivMC7cC4zNDcmJlgigVUP Tckv7XZralMiXkBmTnvutHqZDuL0IaRi4sRG3hTtYVjCl/Tf88FjClrYW2Ukt1veRsrO wwAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=cFtenyqw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id m5-20020a170902db0500b001ca1bd194b4si8308828plx.416.2023.11.06.04.09.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 04:09:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=cFtenyqw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id EF90E8075B00; Mon, 6 Nov 2023 04:09:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231810AbjKFMGL (ORCPT <rfc822;jaysivo@gmail.com> + 36 others); Mon, 6 Nov 2023 07:06:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231741AbjKFMFG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 6 Nov 2023 07:05:06 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A067910D1; Mon, 6 Nov 2023 04:04:51 -0800 (PST) X-UUID: af58f36e7c9c11ee8051498923ad61e6-20231106 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=VtQsGmlkq0o9F4gZkx4FlZ5bjMdfC2lqKQqTsMmWuoI=; b=cFtenyqwz429cxhCpTCMBn6zPpOMb4WIcCfWhIA+XzWWoN3N7AHANDtfJIvly/KKQNIvT+nuruLuZ+M30IIU7UjIMuccK3zSFby3gc8b1tQwSGMOMuUWJvY0SCpgj79GRA44G80kKaNefkmy03Ojx1K45bp0PKoEsUZaBnv+mfw=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.33,REQID:64098679-262e-4e23-a598-1d46dfcd7a7f,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:364b77b,CLOUDID:ad485472-1bd3-4f48-b671-ada88705968c,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO, DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: af58f36e7c9c11ee8051498923ad61e6-20231106 Received: from mtkmbs14n2.mediatek.inc [(172.21.101.76)] by mailgw02.mediatek.com (envelope-from <yunfei.dong@mediatek.com>) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1295776172; Mon, 06 Nov 2023 20:04:49 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Mon, 6 Nov 2023 20:04:47 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Mon, 6 Nov 2023 20:04:46 +0800 From: Yunfei Dong <yunfei.dong@mediatek.com> To: Jeffrey Kardatzke <jkardatzke@google.com>, "T . J . Mercier" <tjmercier@google.com>, John Stultz <jstultz@google.com>, Yong Wu <yong.wu@mediatek.com>, =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Pr?= =?utf-8?q?ado?= <nfraprado@collabora.com>, Nicolas Dufresne <nicolas.dufresne@collabora.com>, Hans Verkuil <hverkuil-cisco@xs4all.nl>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Benjamin Gaignard <benjamin.gaignard@collabora.com>, Nathan Hebert <nhebert@chromium.org> CC: Chen-Yu Tsai <wenst@chromium.org>, Hsin-Yi Wang <hsinyi@chromium.org>, Fritz Koenig <frkoenig@chromium.org>, Daniel Vetter <daniel@ffwll.ch>, Steve Cho <stevecho@chromium.org>, Yunfei Dong <yunfei.dong@mediatek.com>, <linux-media@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-mediatek@lists.infradead.org>, <Project_Global_Chrome_Upstream_Group@mediatek.com> Subject: [PATCH v2,20/21] media: medkatek: vcodec: support tee decoder Date: Mon, 6 Nov 2023 20:04:22 +0800 Message-ID: <20231106120423.23364-21-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231106120423.23364-1-yunfei.dong@mediatek.com> References: <20231106120423.23364-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 06 Nov 2023 04:09:02 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781816417701122572 X-GMAIL-MSGID: 1781816417701122572 |
Series |
add driver to support secure video decoder
|
|
Commit Message
Yunfei Dong (董云飞)
Nov. 6, 2023, 12:04 p.m. UTC
Initialize tee private data to support secure decoder.
Release tee related information for each instance when decoder
done.
Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
---
.../platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c index 0a89ce452ac3..35b411313699 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c @@ -310,6 +310,9 @@ static int fops_vcodec_release(struct file *file) v4l2_fh_exit(&ctx->fh); v4l2_ctrl_handler_free(&ctx->ctrl_hdl); + if (ctx->is_secure_playback) + mtk_vcodec_dec_optee_release(dev->optee_private); + mtk_vcodec_dbgfs_remove(dev, ctx->id); list_del_init(&ctx->list); kfree(ctx); @@ -440,6 +443,11 @@ static int mtk_vcodec_probe(struct platform_device *pdev) atomic_set(&dev->dec_active_cnt, 0); memset(dev->vdec_racing_info, 0, sizeof(dev->vdec_racing_info)); mutex_init(&dev->dec_racing_info_mutex); + ret = mtk_vcodec_dec_optee_private_init(dev); + if (ret) { + dev_err(&pdev->dev, "Failed to init svp private."); + goto err_reg_cont; + } ret = video_register_device(vfd_dec, VFL_TYPE_VIDEO, -1); if (ret) {