From patchwork Wed May 17 21:14:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 95550 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp56987vqo; Wed, 17 May 2023 14:15:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Lng+RCF9cpncJOCNWcHifyW81ZBYZJ4WBsyX3RCALHy7Vs30qAGeurmzSMMXyl6gTRsys X-Received: by 2002:a17:902:d48e:b0:1ae:4ca9:dc14 with SMTP id c14-20020a170902d48e00b001ae4ca9dc14mr254814plg.27.1684358140060; Wed, 17 May 2023 14:15:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684358140; cv=none; d=google.com; s=arc-20160816; b=I4fYQg/VxbCTnMDKSGRjeZtVpvGTtJp17+PT6vQPkmqh/MNgMUy8vzo3nAd+Yb4o+F WesJVThqqx6AQ2XsSg7g4Vja/0WFRiXRP5Fu53Fcq6uADjPKPktEehejVZkob/aotbrk lHCkgcXvcg84ugxaA6CwVesoVJqiiObIZrKfbkw8EqTi9qBFQVVg5Fm5md9UK/tlCl61 zYQP1/qpGhZKtQq4v6xDhmfoyVAbpE5b74pjQqcV9P9IpuQC9PlMqbXvzG1pJHbZg/XS Jy2eczQoi5bqkolz0e0sszgh6SQxfbedZTpi59btLL5DWR/GcJl0VbZkZUgHqlz+Cyq4 pecw== 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=cScbWIO62WmSOEZcrp9BQCE8howjJKIHUaBaSdauLIDRvnz61MX2riO8XugEJhq1Lp mOrSS/XvzWeZboA3yC1SlIIKmiGWodwfeFX1++nXcvQl5ZSJgP/ug7DLRkNeGbKcFpWA EPMmerSeeYWc1jwnpeLgPXIYq2mlSKb2RNkFpCj6pdhtgBZnUjofsNMx2OmDHuEWMjot wIQr4YIJjNdXb/JFlvag9tqcFRqXUSzCVgeGccyUfC8BfNTYaihS/NGgbvwrpujFES8Y Q93zjQricP+V/82P4bCIt5oHAaP5t5iNsJxgevobXnmutQq92OaquqSFgipygFV+6gpL pvKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vSIj1+oZ; 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 b17-20020a170902ed1100b001ab18eb1764si9657034pld.131.2023.05.17.14.15.23; Wed, 17 May 2023 14:15:40 -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=vSIj1+oZ; 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 S229925AbjEQVOq (ORCPT + 99 others); Wed, 17 May 2023 17:14:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229851AbjEQVOg (ORCPT ); Wed, 17 May 2023 17:14:36 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D1967289 for ; Wed, 17 May 2023 14:14:35 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2af0f1301f7so7841891fa.1 for ; Wed, 17 May 2023 14:14:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684358073; x=1686950073; 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=vSIj1+oZFAYVRtwioBnGxGaAXDLfKXNpJfbu5/rANdjHYWUiK6Bj0df1uAHEXBy8Qv tOH5d33onrkYsznkSUgVGz4FrKk57R91ULfaaMyeKoS+h59UARWZbmN+3siNEK9hZ/wn RZ7d9X05HOFVMxhAQvPZxTkhC/QROoYGWu7ZCMcQ1mEOH1+e0B8oDJq/Tr5jMYXveRPK sRACF9P4AfpZ8RkHZO5jsdWoayleb56OaNGtyGEetPFpfBdxes2W2xyZ8KnlkreNJkDj 0m1dvIP8HCW/9CTDdk7VmOUrhAQdACGjb6UJWwXorM/ggkLbd5Y2vBLsswz0Vjbv3xWo 3KTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684358073; x=1686950073; 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=f8a52zOG+0R1jTTUGOO4f23UKfKU1h8m+LlEdMhTVvASkDk9wm9eC+WWNNH4X4YQ1c FeGx5eWOjg+cdnihZtDT1kj7NewU9I2vd8NzQq2GSjZTziI10/htiQcdonMygF9BaAqc p30Nz2rjZCa9fsexoj73404t4E809y73EoGGXJvw4AD608eotIUjowl0eXjOyCG7m8S7 0EyZzZF13M2/fXC5ofK+Rs0prE6IcR0eKfdrv15QAf3qVRAwIz7oU+64FeMFi4eqlgJl HtzfEJBtVEhQSGEG4scH35soFGf1wCzIfL1ew2h2tTKojpci7va/43ix1F87TvvM6HiA LpHQ== X-Gm-Message-State: AC+VfDy6nVAxGuiaC/USakdryaKzMRfueAkbbqldjcXfQDoMxZlkmnve o+6RRkdgPtp8mheDr+bzRj7JFA== X-Received: by 2002:a2e:2405:0:b0:2ad:fef4:94f8 with SMTP id k5-20020a2e2405000000b002adfef494f8mr5031112ljk.6.1684358073668; Wed, 17 May 2023 14:14:33 -0700 (PDT) Received: from [192.168.1.101] (abxi58.neoplus.adsl.tpnet.pl. [83.9.2.58]) by smtp.gmail.com with ESMTPSA id l5-20020a2e8345000000b002ac88e29049sm4781142ljh.43.2023.05.17.14.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 14:14:33 -0700 (PDT) From: Konrad Dybcio Date: Wed, 17 May 2023 23:14:18 +0200 Subject: [PATCH v3 05/17] media: venus: firmware: Leave a clue about obtaining CP VARs MIME-Version: 1.0 Message-Id: <20230228-topic-venus-v3-5-6092ae43b58f@linaro.org> References: <20230228-topic-venus-v3-0-6092ae43b58f@linaro.org> In-Reply-To: <20230228-topic-venus-v3-0-6092ae43b58f@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=1684358064; l=1589; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=v9h9rG/TP42x17XwYSGnOJ0sfKKqjUawup8lEKzjmAc=; b=A5EEgQQqTZxOi6ejKxEA9oEfEBDTipRgEQMr+gx/nVDMyy8fYOae7ciOxHIEMRchnCpypoJqM GqjWy6f5X3ZDuoLE5VcFWurfDeNy8W4RY+BXSVuLaFeVC9vRYGz+5yj 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=ham 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?1766177521116257992?= X-GMAIL-MSGID: =?utf-8?q?1766177521116257992?= 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,