Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp212644rdb; Sun, 28 Jan 2024 22:35:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHLXMgYxItAZr/TBHS6hGikv6slkJYcWCJRvyBhSEOuY5BDxmZKnEj51Cw8Gx0rroe+AoZx X-Received: by 2002:a05:622a:15cf:b0:42a:a8b2:d6c6 with SMTP id d15-20020a05622a15cf00b0042aa8b2d6c6mr574768qty.132.1706510137347; Sun, 28 Jan 2024 22:35:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706510137; cv=pass; d=google.com; s=arc-20160816; b=0xSYM6elnwQtL5+i5WCAyS/4EfqCJzVHsuTz8HFCWLP6wCciVfndrBcs6moi173HaA 95TLuTdIJDGzHqynpaM99GAKcHXZQPPQALWJI0tUci713YjTbwDjGS48+qJcidE3waV7 Yd7xFtAhfXLCVARVT+q3HP3YI9x7b6qPP/TJN2WhSoTv7UEK9GPn4uhCOgnRd0veG7SJ i3ynY89HtSMV9kx6P8CA+oEBaW0uiaLXbYlQtePLYHRii9hfmI0JqQLBt2Akps/ULVy0 5kgb4Bkw3YpMpXR0WAQ9UKHhAV01D9fIVv28UgZD74vOD8wtVCa3UhTnGWN12rYHn3QW m26Q== 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=kC7KzWLgDHvbqhzMWnc/8P0WK0I0J12Fa3NbbNqI088=; fh=Jm1zUP85NkLhaS8mFbLRiIHu8uZd7NKlphUk8mYvM1c=; b=P8CSXEXT5BdLj3oK+1ZVGZ1Fr61nZPk1WjOqV/DhJhAm3Zqsps1enMnW/qX7f2Vg+T t6BFl81ZcAdoPyw8BTtIbwWuo8eRXpmIn8Ku5MUsKBnn77WjuqyOZ4pAZYIOHxkCXPPB C1B/FGc7479VdoGWAYhgSArgL8rUqL6MkykYa5eksXtsiJ3q2q2sBPJz1u2aucbEk86z t7YuvC6Ws/AyJ8WNs7ULo0KPoO5oPEUQ4hMxHBL230tS3rNXx4vLMIQhKJ9ApHu9px3f laXDMpdem5bfci9IFnzEp82yYpDkekWD/T/iyXrn8svQHXgQ6IlryVkvwOZtr/FIarEu I4dA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=HnisB5Y3; 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-42255-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42255-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 i19-20020ac85e53000000b00429a50c4264si6963154qtx.619.2024.01.28.22.35.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 22:35:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42255-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=HnisB5Y3; 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-42255-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42255-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 203781C2322C for ; Mon, 29 Jan 2024 06:35:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5B8457887; Mon, 29 Jan 2024 06:31:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="HnisB5Y3" 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 BB6EB56461; Mon, 29 Jan 2024 06:31:08 +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=1706509870; cv=none; b=VVnq/TjxH59HRyq8okHA1ZtLVYyeIFx2YVPYRZ2cNerL8nyp4RaLqoq6p56MR8of5SqLROkxcUmCopazL3/8oiRzmxXsM5+XyczFCdFa/mTUXcQ/f0WsiZk91ADbUEVpnzRnKm6+h7CvCJclNfdMDaIlk4bJyzud5zGfZAXRXXg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706509870; c=relaxed/simple; bh=huiD7USOrdWu9NopWmVGEcrOlYp+dwqjiEDlssjdViU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EaKi6B9j0Dvlw+7UljxLgOetT1LcBt8BlHnWsNdt3uRHrJOMGPBMVAurU43AoDJyadlV66KZpsOLsuHCvfWI8zIYzBHeJlzIKcE0OrqvR5T/nqLeQUod33+pdCreWrpBrzrfGXSTDBNrfd9FXHBb2BiMIX6kZR2NB8xNjRrJe/s= 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=HnisB5Y3; 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: f99da7b6be6f11eea2298b7352fd921d-20240129 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=kC7KzWLgDHvbqhzMWnc/8P0WK0I0J12Fa3NbbNqI088=; b=HnisB5Y3YujX0dYJ5G4wTIht/qYjcKfhdp7/iM3HAt86p6MqP7ph7gLg8dGtt7RiaUnIfNi2lLZZW8MjRG837ymxqkdWIw8Udx+8hi5CTMgWzR6ZhrVTFFEbShtXHPsJEs2OtAW5nknpjC+SlJAlKCcqeZJgP1IdhfNebEsFwwI=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.36,REQID:76f735b0-8a53-47a3-802f-4b27768c9f2d,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:6e16cf4,CLOUDID:bfa95c83-8d4f-477b-89d2-1e3bdbef96d1,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: f99da7b6be6f11eea2298b7352fd921d-20240129 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 456716777; Mon, 29 Jan 2024 14:31:03 +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, 29 Jan 2024 14:31:02 +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, 29 Jan 2024 14:31:01 +0800 From: Yunfei Dong To: Jeffrey Kardatzke , =?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 , 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 v4,20/22] media: mediatek: vcodec: support tee decoder Date: Mon, 29 Jan 2024 14:30:23 +0800 Message-ID: <20240129063025.29251-21-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240129063025.29251-1-yunfei.dong@mediatek.com> References: <20240129063025.29251-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.18.0