Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4460600rwd; Tue, 30 May 2023 05:54:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+GgYyrxC5iyyZMzAtahUlKUBeoiDGvn3tV5KEmrH5mu7J/jTa20OjvbzZ3TpM0m8d7G2i X-Received: by 2002:a17:903:2350:b0:1a6:f93a:a136 with SMTP id c16-20020a170903235000b001a6f93aa136mr11545978plh.22.1685451240776; Tue, 30 May 2023 05:54:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685451240; cv=none; d=google.com; s=arc-20160816; b=1FUB/HL+RywaQnzBpMQNqLiAENx3i0naLWCMfMkhA2YO8DkQlyYN6uM/Z2GsAFJYLx 4cC+n0e5+OhPES9TI6HAyMR2/0PQ1PWVfpgT6B38rY3Ru7mFoC5spjej/RYJqKQs/JTp Kg7TI5923RwmdTFscd5byiHTjgt2siMc/vXaJhEWL8icsEDjZ3ujwtsSmJocXm2IAkBA NSdbfb8xNOweqrUrJRSdaveMKL4Eh9AShD4Z3cvHAZ9A7ovnUiUnBbh1bpDDlJ2+H8GA O/VpMhwlKv7n57RUUCCzjV4YScBf3taRBxn3czQcWN/cxs/9a2jweLh4AluSbsKY9pCc w9OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=5gG/GQ4bkNLXJnem7GziPpF9ACnuRetCT8nUsDWFQHk=; b=YaSDlPz7+3jlEti5lY1ZqXOYWcjvmnWb/PcnzbY7ZFrRZFd4Z9XblmCrI/gyZpO2Hk BtNXUG/wRii9ETkg2Ya9/nzQShG4v5NiOTd8DP23GDgi4S0RPkxeCro3NYn8TknZ3dwD 8SQsEIuvc54ZJUH5SINMoCCvuQlU9jiQsKUwGOqBNAn1Zq2OS8K5KrSn2eFh3GbShFLh CUUNd7GQh8RmQxUy49ETIzET4Mn7z/0gzsOOLWhEVB8oxDw9VfCbtI7fdvsOJlR90uWN UpQMzu1gIjrBiaD5xkgqBATtU0yrcVU8UOZhfiBQWtiFAbBGgoYzf13I8MU5tM6SmHay d/Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FPcrWx+S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f15-20020a170902ce8f00b001ae42afbf93si6378054plg.450.2023.05.30.05.53.48; Tue, 30 May 2023 05:54:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FPcrWx+S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231702AbjE3Mbx (ORCPT + 99 others); Tue, 30 May 2023 08:31:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231648AbjE3Mb3 (ORCPT ); Tue, 30 May 2023 08:31:29 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E8971B3 for ; Tue, 30 May 2023 05:31:06 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2af1ae3a21fso46758061fa.0 for ; Tue, 30 May 2023 05:31:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685449846; x=1688041846; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=5gG/GQ4bkNLXJnem7GziPpF9ACnuRetCT8nUsDWFQHk=; b=FPcrWx+S0QqRRp9vjxeUGVcIokY4/Nke+Ff+Q0JzM8PKBO4+rvXhn1bgO7zpzFOTNP 6BMA/Vey0ohHZ8ULcjp+Qc0nvj/j4EgCpMhld9J2LXcxMeccAmPQzHJSdpTFxWuhcFMb VAsjQA+LYAOsKhdpXM9W3TCxM+ZGRe/+424JuDbGMQpx3yjx4zcaVITqg8gXFN/14UY2 BHHIIHUDMbKMnqNdMRzeUY6rbZbmMTbqpg2v0zIauOVF4kUL8oBiOFuIn/EP6kwDR3af HP9P2GnOSLsIcLYJA/LojzJ4hQDut4jD93IsVYebz0b+1Rs7Z+2DBjEqg13q7bu0uRiQ Tr6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685449846; x=1688041846; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5gG/GQ4bkNLXJnem7GziPpF9ACnuRetCT8nUsDWFQHk=; b=VlRqXN5tXE/aQoqjvpYTF3juilCSkyEED1omc/QBkaYJQaBoRCyvZcedN0qNCXqqC0 seJhWbiO8id703HhU3CcwcIfcZR5q5WOAa+/WGr/mqCueNa8rmTrQNkXQGtFzJGc4nzs eTVqD7U4GX4V1VIR+jaz6jjQTSYhL0Azdvae4fhsEdQ7irq2iUjrqh1RDWjvDi5PkAbu WVpKEVws+fahFcXnKv/amN6wpdj8NZucXFoxkSfCsp77/j5+wWsPfUZosKV4C3JWihTw jVsIx8GEg7sUERC1RjntfNGIfKaFogXc/6VlrJBSWriRwdmm8CvHpWjqVCbiqkQd0koF AZrQ== X-Gm-Message-State: AC+VfDzojDSR7LZ6/X8RcJox5C3WwqsdNYxKtXlgk0xgqOBr6b3xiopk DoEZ37BJ+Q9Xn/IUk7Irzl1i/g== X-Received: by 2002:a2e:97ca:0:b0:2ae:da46:7f62 with SMTP id m10-20020a2e97ca000000b002aeda467f62mr782022ljj.29.1685449846149; Tue, 30 May 2023 05:30:46 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id u18-20020a2e91d2000000b002a8b8baf542sm2854814ljg.126.2023.05.30.05.30.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 05:30:45 -0700 (PDT) From: Konrad Dybcio Date: Tue, 30 May 2023 14:30:39 +0200 Subject: [PATCH v4 05/17] media: venus: firmware: Leave a clue about obtaining CP VARs MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230228-topic-venus-v4-5-feebb2f6e9b8@linaro.org> References: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> In-Reply-To: <20230228-topic-venus-v4-0-feebb2f6e9b8@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Bryan O'Donoghue , Mansur Alisha Shaik , Jonathan Marek , Hans Verkuil , Dikshita Agarwal Cc: Mauro Carvalho Chehab , Stanimir Varbanov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Marijn Suijten , Konrad Dybcio , Vikash Garodia X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1685449837; l=1589; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=v9h9rG/TP42x17XwYSGnOJ0sfKKqjUawup8lEKzjmAc=; b=J7JzvBaATX4OCVY/zIqqe/aOUY/Ubry8yNokzE+j+EO1Y/vbLIyY1ZtEZo9hQK9FF0fPaY9FB uVJ+94MKZQZAw9fX+nNMzg4Ke59YMQPbMOfbWN/jOFeIbOUw5BDoF6w X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The qcom_scm_mem_protect_video_var accepts two sets of pairs as arguments. They describe the virtual address ranges of the CP (Content Protection) and CP_NONPIXEL regions. It is however not immediately obvious how to obtain these values. Leave a comment explaining how one can translate the vendor device tree properties for use with the mainline driver. Reviewed-by: Dikshita Agarwal Reviewed-by: Vikash Garodia Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/firmware.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/media/platform/qcom/venus/firmware.c b/drivers/media/platform/qcom/venus/firmware.c index cfb11c551167..572b649c56f3 100644 --- a/drivers/media/platform/qcom/venus/firmware.c +++ b/drivers/media/platform/qcom/venus/firmware.c @@ -241,6 +241,16 @@ int venus_boot(struct venus_core *core) return ret; if (core->use_tz && res->cp_size) { + /* + * Clues for porting using downstream data: + * cp_start = 0 + * cp_size = venus_ns/virtual-addr-pool[0] - yes, address and not size! + * This works, as the non-secure context bank is placed + * contiguously right after the Content Protection region. + * + * cp_nonpixel_start = venus_sec_non_pixel/virtual-addr-pool[0] + * cp_nonpixel_size = venus_sec_non_pixel/virtual-addr-pool[1] + */ ret = qcom_scm_mem_protect_video_var(res->cp_start, res->cp_size, res->cp_nonpixel_start, -- 2.40.1