From patchwork Tue May 30 12:30:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 100817 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2149272vqr; Tue, 30 May 2023 05:41:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7r2GtOwSO6svAHIQJEjy9TfY8k385QPwcyMoJYbrJu3ETAOigLSMoqQgQRHO0s73R0Dids X-Received: by 2002:a17:902:ecc5:b0:1b0:58dc:db59 with SMTP id a5-20020a170902ecc500b001b058dcdb59mr2864176plh.23.1685450469508; Tue, 30 May 2023 05:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685450469; cv=none; d=google.com; s=arc-20160816; b=oRQS0d1JhAddYBELuocVlxuLsdukIbjSZGAgJQ+8OSJabk0gtvHasoEKHI0WJhQDTr 4k5WDjjMKuf+oAJ9Ruy34xCal6xkB3j3nGMZQznDgf5Riq/mayNVm/WGz1bQkoteUJkO y1yr1x5h8L+U4Ojs+lN5EIgfhWgG7Qy0A2JJAdjKme0icS8gdIeKQjo26R8NbijS3M0o 6hFHFJZrDjRZRGptwm9gfRk+rYzULhbCt4CoMPKv0VzEAecELlBnVugwuvpJoadR+hxR EcdHtjdEcjJ3q8OFvyiloyoSL5+A6yjm80ltwabe5L6KhH5dZ2oXYKlG4tJ/W+B1Sk5R 0Uhg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k18-20020a170902c41200b001ab259969e7si5733450plk.31.2023.05.30.05.40.57; Tue, 30 May 2023 05:41:09 -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 S231896AbjE3Mby (ORCPT + 99 others); Tue, 30 May 2023 08:31:54 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767322911560381480?= X-GMAIL-MSGID: =?utf-8?q?1767322911560381480?= 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,