Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp247609lqo; Thu, 16 May 2024 05:26:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWPPDxZYc3m//HJmaI0DqKZtlf6iS5WLNZr8uEp8moiQ7ANr3OehhRZ211KgzNYt4aD/RbNbTOmO5In/ioXmSwFxylO9GKBBdU1AFalvQ== X-Google-Smtp-Source: AGHT+IElR6r5c1FudCeA4WCbH3NdNanWvELu1xnOtRlCL24cuJd1zpjQX6Vm7m+kvcAYF6V6Ty8R X-Received: by 2002:ac8:5acb:0:b0:43d:d78e:68f4 with SMTP id d75a77b69052e-43dfdd471afmr185606341cf.64.1715862364920; Thu, 16 May 2024 05:26:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715862364; cv=pass; d=google.com; s=arc-20160816; b=cKDT6V7GtnexrH7XJuetksgrw3HsF251BN18Z8zuqDgtyoFGnN6XvI2iYKQztCBnO2 ui2XRLy0VZN/f9CNvnt65g+LiJToe3jvqHOoNUictLxkiVO/n6bEGtO7eCysxhxI2Umr sF7AEVOWQZi1VBShukoPJ+R6CBfMPNvuWm+stfb7pupkNeSQSArqCNc3u+yqOtTnya6W YE0EAzA+PfuQMAtxHrF60+2Z8oZblMLTLoNWzSrwny0cLjFZUiOHlBjMTC0Q3j9uP5hq tK1vygBpSN0yPDpEtAvEWX4OFb40ON1yeFNyiJOFMbu0b5YJYWfij6E38M2pA1dDKdXx 9bOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ZblLR2C4UhsbHICQRvt3WjFVk7cSmtf/IbfU+xbcDqQ=; fh=biKe3ab6vu9B2YV/BY0rSGdgJ9M/b05dGcvzyA7ivrs=; b=wAPXWcQDx6eKYiQkj+pCNOE89m5HsQl3p8OhDrtmek/ksEUFQYE7H67hIhWzdaYmEJ ZcOJ4DpcWdMjYbfeDGGtM4quf6+UVEzWptKY7qnWE3fmtpQC+JYwPn6RZU9jy3UsAXmL qW3bmbKyYKdwyXn7GvZgcSsTZoi6n51US6LIs4QuSfG2D7Y0vwMUr1KnPeTHUrUgQuCW CJlj55LLJYXU9hn2pk3H0/Cf1Svx6xfVEo9H/Cmzc89By8dq7zrw6YRGt6hwEILh5l3k lj6wTRdd/SITL/p0yLcftd+VN2gzDEwIUwiGhBC9TToI3xniZeid8JiKdRUpyXgU224W 6gfw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="si1Rdl/O"; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-181012-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181012-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43e134c8bbdsi97106721cf.433.2024.05.16.05.26.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 05:26:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-181012-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="si1Rdl/O"; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-181012-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-181012-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A26131C21891 for ; Thu, 16 May 2024 12:26:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F234F153BF7; Thu, 16 May 2024 12:21:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="si1Rdl/O" Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54B7B1465B3; Thu, 16 May 2024 12:21:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.61.82.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715862103; cv=none; b=TT/F4gjg8rfnjxcZhR04qPOR+vswyoNJReeAl00V2fntjILFP8wAD8RbjQERZ7HyJlrRAwSYiqDLrpsMJbBpF2KSak2M8iZE1VJgqx2akX0HiZ8qUXGbNvWvNbE/cDJv6CVkOlDXZzfoZhK8PPoIRYFafPmjNbzSgw3dkq3aLdw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715862103; c=relaxed/simple; bh=SMQX8uh8GhXxmDXP80YNvFITTdApmw8BMN9/scJutTM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Zz3MdpAXrn47a+djT3+GkMe1fO8G33/+B1szHL9GwRSkDBRiYjRrekvJU3bCe8orv7oEZcVBIV+TBoODqDDaU3jSq1haqUTnSE2M8tZoLzOoDkSk2KUFD7s6AvjTTSQpYWIm+zKECIrnJeQ2MWV5Kk+2im2yQNgZ0alRftHoG/w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=si1Rdl/O; arc=none smtp.client-ip=210.61.82.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com X-UUID: d7a77d94137e11ef8065b7b53f7091ad-20240516 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=ZblLR2C4UhsbHICQRvt3WjFVk7cSmtf/IbfU+xbcDqQ=; b=si1Rdl/O4gaYn7SncfS5NjleqZrJ9Te1WdrBoeh1TPQkhkYN1nev3F9s+xWvUxFGE4RR0ZRo5XrfNN2xQqetLFrWheSZwZ5dVyEHq++q9rRuAqf7iC6x7eSTh/9GHQ6k0CML8dY3vU699blSsMzmGQLsNvFZ9o2u/PMAWhPrULQ=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.38,REQID:4d973b1e-bc20-43c5-b7be-545c33bd4d14,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:82c5f88,CLOUDID:5aa82cfc-ed05-4274-9204-014369d201e8,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT: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: d7a77d94137e11ef8065b7b53f7091ad-20240516 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1797836797; Thu, 16 May 2024 20:21:37 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 16 May 2024 20:21:36 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 16 May 2024 20:21:35 +0800 From: Yunfei Dong To: Jeffrey Kardatzke , =?UTF-8?q?N=C3=ADcolas=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , Nathan Hebert , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Sebastian Fricke , Tomasz Figa , Mauro Carvalho Chehab , Marek Szyprowski CC: Chen-Yu Tsai , Yong Wu , Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , Yunfei Dong , Sumit Semwal , Brian Starkey , John Stultz , "T . J . Mercier" , =?UTF-8?q?Christian=20K=C3=B6nig?= , Matthias Brugger , , , , , , Subject: [PATCH v6,20/24] media: mediatek: vcodec: support tee decoder Date: Thu, 16 May 2024 20:20:58 +0800 Message-ID: <20240516122102.16379-21-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240516122102.16379-1-yunfei.dong@mediatek.com> References: <20240516122102.16379-1-yunfei.dong@mediatek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N 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 f47c98faf068..08e7d250487b 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); @@ -466,6 +469,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.25.1