Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2071284rdf; Mon, 6 Nov 2023 04:07:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFVHSB2DfMykYaN5r+eu7tPyon7RFktI4rtplWUGz3v5WcxPYdw/4nY0OWuZwbz1PQV8HXs X-Received: by 2002:a05:6e02:2188:b0:357:a1cd:a16 with SMTP id j8-20020a056e02218800b00357a1cd0a16mr35559577ila.6.1699272477144; Mon, 06 Nov 2023 04:07:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699272477; cv=none; d=google.com; s=arc-20160816; b=uFzMeU+w7rZzBNXe0EvIHXivMYzJsHy6kEj43vxjIhySRaqgIIdwF8ToCkQ1yO12jW LBEa3XBR8UzOrMm9MD8y9Q8B9lfML7gWLivFbSHs35hs/s4COf0IrG23MQVBXqthrDeN bj8FTUOlVgFHt/wovnv73pBX4qEgsl3SHSrYzb9pz6wO+flMAOS6ducu4FMaVo1soby2 RMGZupQyGINjY2WXI5epEy6kYMPCDd316ccEwk2xWXehPSQqu99zRlsq7al2dWX2dWBo N2kiNTOO2g7B+6o7amTtU1yL1i3QbqxFdr2DAc4bSENXadbywb7BnYPhNAjCzN7nwvdn aOlw== 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 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id y4-20020a655b04000000b00578a66db83fsi8064616pgq.141.2023.11.06.04.07.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 04:07:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; 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 23.128.96.35 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 D5FFD8056C45; Mon, 6 Nov 2023 04:07:34 -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 S231695AbjKFMGK (ORCPT + 99 others); Mon, 6 Nov 2023 07:06:10 -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 ); 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 ) (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 To: Jeffrey Kardatzke , "T . J . Mercier" , John Stultz , Yong Wu , =?UTF-8?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert CC: Chen-Yu Tsai , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , Yunfei Dong , , , , , , 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: 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:07:35 -0800 (PST) Initialize tee private data to support secure decoder. Release tee related information for each instance when decoder done. Signed-off-by: Yunfei Dong --- .../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) { -- 2.18.0