Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1576373rwb; Fri, 28 Jul 2023 11:24:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlH2PhTD9YpeglmJI6uoZbe7qhayTixaHD4DzL3b0aplfFsTlqsGE9yGjB+Yzz8JrHfQ4WU/ X-Received: by 2002:a17:902:ea95:b0:1b0:6038:2982 with SMTP id x21-20020a170902ea9500b001b060382982mr2402818plb.41.1690568694888; Fri, 28 Jul 2023 11:24:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690568694; cv=none; d=google.com; s=arc-20160816; b=K3rVXGRnCWomCfeqFVFx71uK0iOu6NikLENgZATJtacsD/GGIh8uo/K4UWt6Rv7bgW VWHgjxrO30atxqMfphhzDLqywPv4951U3Lrzbhi7fCC6ovBINSeePBPydDnu6axr8r0+ xIwLd4ZYCy7B4VjZBvxJsw1Orhl4TMOc1IrsDh1R7CVzOXexa6vhedladub0HQxGmfCy Nop599G9IMWnxK1Hln5T0cHxT1QtaSak71tcvIics4xx3/waTF6LBmEedsiuhyqcY8wZ xQPrXWi1hgP7K1b43dB9YhuS6okPnCHQL733vBF27uOckFTN2S+9F2b6rSGEHXx8JBSS JjGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=0PCtupfgsAglFpkiVX1w6ol0/6o9i9+s5VwspB80GYo=; fh=nxTtIXp+YeUW0dy9b6eCXd9HvCzACw07E51P+fRCTrE=; b=OpGgkuDeCAYPDH+ZkaL6bxtg3kl+46I0TFfmPk8hsW/uuV1JANtVdH8goOk1LPmbFL pq3Tpqkj4O9wh9QccN43K3Z8DGFR8ulmhhtqmoRCUHkR+YA+qmQQVqKyaR/IXsWQcmBi G3zHiCGWNyv6KPfpqDUkATNz254bwrszSzZaYw+crxpMkAQCkuOYqNzUYeAJDg1E5U9U wqzA4mwysFu5+JYcS+UH5FYZ6zpEY8kDBMSO/URIPdoQSsV7RoE1bYSr241H9rRS4AG8 f/USQ2Zil/VAo4dwBRlgLq8dgvgzIaRs4WlfZru+6K1JblAw+z18HbsY7ZNIkL8mf5D+ EGfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XDZ7D0tD; 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 q3-20020a17090311c300b001b045d65aedsi3501596plh.228.2023.07.28.11.24.42; Fri, 28 Jul 2023 11:24:54 -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=XDZ7D0tD; 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 S234199AbjG1R65 (ORCPT + 99 others); Fri, 28 Jul 2023 13:58:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232003AbjG1R6z (ORCPT ); Fri, 28 Jul 2023 13:58:55 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C72E03585 for ; Fri, 28 Jul 2023 10:58:53 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2b9cf2b1309so12119941fa.0 for ; Fri, 28 Jul 2023 10:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690567132; x=1691171932; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=0PCtupfgsAglFpkiVX1w6ol0/6o9i9+s5VwspB80GYo=; b=XDZ7D0tDXdczOXhwYoFMDZtgXk7+4VRhpTP0+jiRWT470cNjw2UE8MoaNoY80DFI82 ouqxU9cpTeRclXF2ZLoK05dDy95rlinO4d+QcZ2Fe3Naf2Ld25W7tRgFT24TleMPzpCV WV22cBb520HRReksmKrQXz0VYiM6GLiBAU6RGbEj9jLgulYWNjzSBWbzmiAI1ZSwtGOe pqmWnQBhd+7201bBvESyfvwniwJQ9BvswK092co/3s9A/AtANxsoilK8wmqm/qiIo73c W86bctkcWQSl03GiAuBWnJdKwebz3NAwM4AsxboUNMwVU/W9zJ0p8KpH29nos077+SAp qcSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690567132; x=1691171932; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0PCtupfgsAglFpkiVX1w6ol0/6o9i9+s5VwspB80GYo=; b=ZFr7aMOUlw5NXw/lGwE1P48dC0OgeoioxdmzeiElYj2xy99ICme/Z/sn04czX/QVjN MKoYRVeLI1z/wCI4sLvdDJetyE0GJzVlF04esM0ZYa3iUVjqkxXkyvagmDcWjcACLN6t tHwnmp40VjsNM2mAYyK6MuiZUdjF1DsUTxpmQTFkH4F+2hQJZP2qoPPhtOUYMek0GTK8 WWPJIXaDq93R8Np8Lb5n83J5OrDFQ8DGMGAInESfuJK77Y+6h3842Gkzv2ll95xeVcPS K7Al2oDTe2i8Nbe7Z5Tn2J2wXNqA9gbzlpURG/DTq3bXlafqTAClLlw7/ewETI9lm92L vZbA== X-Gm-Message-State: ABy/qLYA3IjGSnfxlo1BoBwugL3kuRFGRQgBbomMDaYWHb/tPjNmvFlf K2Q/JtZDQVQE92Vw9sET+wR63Q== X-Received: by 2002:a2e:a27b:0:b0:2b9:aad7:9d89 with SMTP id k27-20020a2ea27b000000b002b9aad79d89mr2745154ljm.15.1690567131952; Fri, 28 Jul 2023 10:58:51 -0700 (PDT) Received: from [192.168.1.101] (abyk53.neoplus.adsl.tpnet.pl. [83.9.30.53]) by smtp.gmail.com with ESMTPSA id p28-20020a2ea41c000000b002b94327308asm1053770ljn.133.2023.07.28.10.58.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Jul 2023 10:58:51 -0700 (PDT) Message-ID: <9eec378f-9e77-6c08-eb82-2387c77734f1@linaro.org> Date: Fri, 28 Jul 2023 19:58:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 20/33] iris: vidc: hfi: add helpers for handling shared queues Content-Language: en-US To: Vikash Garodia , stanimir.k.varbanov@gmail.com, agross@kernel.org, andersson@kernel.org, mchehab@kernel.org, hans.verkuil@cisco.com, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: quic_dikshita@quicinc.com References: <1690550624-14642-1-git-send-email-quic_vgarodia@quicinc.com> <1690550624-14642-21-git-send-email-quic_vgarodia@quicinc.com> From: Konrad Dybcio Autocrypt: addr=konrad.dybcio@linaro.org; keydata= xsFNBF9ALYUBEADWAhxdTBWrwAgDQQzc1O/bJ5O7b6cXYxwbBd9xKP7MICh5YA0DcCjJSOum BB/OmIWU6X+LZW6P88ZmHe+KeyABLMP5s1tJNK1j4ntT7mECcWZDzafPWF4F6m4WJOG27kTJ HGWdmtO+RvadOVi6CoUDqALsmfS3MUG5Pj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DQg2jetX8en4bO2Di7Pmx0jXA4TOb9TM izWDgYvmBE8= In-Reply-To: <1690550624-14642-21-git-send-email-quic_vgarodia@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 On 28.07.2023 15:23, Vikash Garodia wrote: > This implements functions to allocate and update the shared memory > used for sending commands to firmware and receiving messages from > firmware. > > Signed-off-by: Dikshita Agarwal > Signed-off-by: Vikash Garodia > --- > .../platform/qcom/iris/vidc/inc/venus_hfi_queue.h | 89 ++++ > .../platform/qcom/iris/vidc/src/venus_hfi_queue.c | 537 +++++++++++++++++++++ > 2 files changed, 626 insertions(+) > create mode 100644 drivers/media/platform/qcom/iris/vidc/inc/venus_hfi_queue.h > create mode 100644 drivers/media/platform/qcom/iris/vidc/src/venus_hfi_queue.c > > diff --git a/drivers/media/platform/qcom/iris/vidc/inc/venus_hfi_queue.h b/drivers/media/platform/qcom/iris/vidc/inc/venus_hfi_queue.h > new file mode 100644 > index 0000000..f533811 > --- /dev/null > +++ b/drivers/media/platform/qcom/iris/vidc/inc/venus_hfi_queue.h > @@ -0,0 +1,89 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* > + * Copyright (c) 2020-2022, The Linux Foundation. All rights reserved. > + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. > + */ > + > +#ifndef _VENUS_HFI_QUEUE_H_ > +#define _VENUS_HFI_QUEUE_H_ > + > +#include > + > +#include "msm_vidc_internal.h" > + > +#define HFI_MASK_QHDR_TX_TYPE 0xff000000 > +#define HFI_MASK_QHDR_RX_TYPE 0x00ff0000 > +#define HFI_MASK_QHDR_PRI_TYPE 0x0000ff00 > +#define HFI_MASK_QHDR_Q_ID_TYPE 0x000000ff > +#define HFI_Q_ID_HOST_TO_CTRL_CMD_Q 0 > +#define HFI_Q_ID_CTRL_TO_HOST_MSG_Q 1 > +#define HFI_Q_ID_CTRL_TO_HOST_DEBUG_Q 2 > +#define HFI_MASK_QHDR_STATUS 0x000000ff GENMASK, BIT().. Konrad