Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1576361rwb; Fri, 28 Jul 2023 11:24:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlED/z2dIt/1Qe7yb/ktHZQD2mUmSlZTt4WuWzu/ze0lpKerMLoxcTzU0Kddv52zYpANfGlN X-Received: by 2002:a05:6a20:3c8f:b0:132:8620:8d21 with SMTP id b15-20020a056a203c8f00b0013286208d21mr3476592pzj.58.1690568693959; Fri, 28 Jul 2023 11:24:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690568693; cv=none; d=google.com; s=arc-20160816; b=viPp3MNErgW30XB0GsPsskowoEMK9Z6XsQfsGBpqMGWTU5LusP7ezi/E2Lqz1aQphf k9vfpQkQ1VJ0RGctXmPDcvN9Qz6qea5vrfRPz8ahCuaozX98GUrPAVAyjTkdfi09xJOd 8eGjrvxslehZYeYmk7FMgsrUl9I8pCNI5S4ikoj23lyAyhU90s6Yt5dE2UhsFYM+nEDK 3w6GbsunvBs2owANywDzWDkOllepj8chm+bETjTyzo6Zy7/Z6XrOf4AbC0CcIy2pmblo Ip/HaiR86oG/R1V01iLnS6KYQZek2o9L736XQDRv9BY1cEl9DVR1v90rTs1TPTAjvxyQ /ciA== 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=IO0OFH0oUMMupA6OukcceVhS0L4SRH/Rh0UjiIiLnes=; fh=VApxsLOhcWp+rMHTQl8gqwvI0b5c2M0Aivn4tQcb+Ag=; b=GPYL/NS2cA6aOPQPGgGbHFVqq8RdwlEzCHCZ9CCaFFZq/HqiM0wD4f7JFgwuggT7sH KSVOQxOal07GVUbyJNPH0POhW1IMLnrhnpRVD/+Qd9yUh68zPilSTkKgl89PRQFP0Tz9 rxnphR6jf71biFzlPc9tXd7OviseLo1NPDDVWbGQ9I4+UhdkNlcJyu7uQ3aJQkUFt/3U VNIj27+iGZW9/lmAgdxumdZOzdlChB5UoVIgUmDSSt20B7Pyl0iUjGj/nRV7X+jCcCJm mYJDszf3QHsgps6uW0qsMgHH/M+TBakBRkj6F3UoSd2zRf+d0tbHq1orTz7rxmfYfWip JE5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oKD5+5IA; 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 k8-20020a633d08000000b00563eced0fe6si1890122pga.236.2023.07.28.11.24.42; Fri, 28 Jul 2023 11:24:53 -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=oKD5+5IA; 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 S229519AbjG1RXE (ORCPT + 99 others); Fri, 28 Jul 2023 13:23:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233155AbjG1RW7 (ORCPT ); Fri, 28 Jul 2023 13:22:59 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 579F81FFF for ; Fri, 28 Jul 2023 10:22:58 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2b9a2033978so36663411fa.0 for ; Fri, 28 Jul 2023 10:22:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690564976; x=1691169776; 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=IO0OFH0oUMMupA6OukcceVhS0L4SRH/Rh0UjiIiLnes=; b=oKD5+5IAOmXR3esQou5EBar56x+DVKWDv6xGRkDAl2V2EuPrZJoP/aI+szj2K3RhhJ FrD/A5qz80ZzcSN0tPI7C7UYdiONl1tjkKftTF2/B7MTALz5xqP4Qbd4shUBC1hyLDxA InsvA2UB6h/m8RBDjYStLTY7RIQlCuvxphTBUMf82x3o2ulB6auyGKhzyN8VUaDJk+we chBmEqtRWVtPIsko+dC/O92lGPVV94+UMYuRu1PxTFgw+Tl1bjkC2nE0/v3BnT23ZXtd Uf+HUwGpJY1jU3bAU6LBpJ53GmOMgFoqlw5+WgfvP+bRfbZqRbUucSLuDi++ZMuufss6 NTIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690564976; x=1691169776; 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=IO0OFH0oUMMupA6OukcceVhS0L4SRH/Rh0UjiIiLnes=; b=gYM+KvtQH83IaGA5Yvmg3hQ8PbukoVRTwAyGSyYs2nmHog8sdXqNFSpg/Nd7p+bGDg xxWYBazlF3duLrI7Juyda3udOp8loeGqbAegN3faYukxhLQv85jdxBYtx/mdREc/alO3 pWMvNN1Fgil1GqG45iWv9NU4uhKJR0RxjIDmVhOrx7LL2qunfG/5NAiwNnQXWL8gZTQN hqtZiifhSOcDeWgXs9QhdhN/TePbKgW/JAlB76bM5dU/Q+3UVU6H2afSSQ+o3bOmSRQQ de/ecByWFXPVqhvBOAfc99r9tHkWfGfGipFgKCcwsHYZBRQkXTn2SEKe6o+XP1LE0DNY 28nA== X-Gm-Message-State: ABy/qLYxYhDBXPdJiFhQBDz6DW/9G8XARWvBLa7iqXrnrGlhcKzotgvV KeYypFOElwkF8cja4ZOPPsL43Q== X-Received: by 2002:a2e:9356:0:b0:2b6:b98e:fe87 with SMTP id m22-20020a2e9356000000b002b6b98efe87mr2188280ljh.16.1690564976596; Fri, 28 Jul 2023 10:22:56 -0700 (PDT) Received: from [192.168.1.101] (abyk53.neoplus.adsl.tpnet.pl. [83.9.30.53]) by smtp.gmail.com with ESMTPSA id x11-20020a2e9dcb000000b002b69f44646bsm1048747ljj.17.2023.07.28.10.22.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Jul 2023 10:22:56 -0700 (PDT) Message-ID: <9c6e098a-5d7f-4a1a-80d6-116a2c6b8867@linaro.org> Date: Fri, 28 Jul 2023 19:22:55 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 11/33] iris: vidc: add helpers for memory management Content-Language: en-US To: Bjorn Andersson , Vikash Garodia Cc: 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, quic_dikshita@quicinc.com References: <1690550624-14642-1-git-send-email-quic_vgarodia@quicinc.com> <1690550624-14642-12-git-send-email-quic_vgarodia@quicinc.com> <20230728162817.GE1428172@hu-bjorande-lv.qualcomm.com> From: Konrad Dybcio Autocrypt: addr=konrad.dybcio@linaro.org; keydata= xsFNBF9ALYUBEADWAhxdTBWrwAgDQQzc1O/bJ5O7b6cXYxwbBd9xKP7MICh5YA0DcCjJSOum BB/OmIWU6X+LZW6P88ZmHe+KeyABLMP5s1tJN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4JBgIbFPJCFyng4HwbniWgQJZ1WqaUC nas9J77uICis2WH7N8Bs9jy0wQYezNzqS+FxoNXmDQg2jetX8en4bO2Di7Pmx0jXA4TOb9TM izWDgYvmBE8= In-Reply-To: <20230728162817.GE1428172@hu-bjorande-lv.qualcomm.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=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 On 28.07.2023 18:28, Bjorn Andersson wrote: > On Fri, Jul 28, 2023 at 06:53:22PM +0530, Vikash Garodia wrote: >> diff --git a/drivers/media/platform/qcom/iris/vidc/src/msm_vidc_memory.c b/drivers/media/platform/qcom/iris/vidc/src/msm_vidc_memory.c > [..] >> +static const struct msm_vidc_memory_ops msm_mem_ops = { >> + .dma_buf_get = msm_vidc_dma_buf_get, >> + .dma_buf_put = msm_vidc_dma_buf_put, >> + .dma_buf_put_completely = msm_vidc_dma_buf_put_completely, >> + .dma_buf_attach = msm_vidc_dma_buf_attach, >> + .dma_buf_detach = msm_vidc_dma_buf_detach, >> + .dma_buf_map_attachment = msm_vidc_dma_buf_map_attachment, >> + .dma_buf_unmap_attachment = msm_vidc_dma_buf_unmap_attachment, >> + .memory_alloc_map = msm_vidc_memory_alloc_map, >> + .memory_unmap_free = msm_vidc_memory_unmap_free, >> + .buffer_region = msm_vidc_buffer_region, > > Will there ever be more than one implementation of the > msm_vidc_memory_ops? > > Unless there's a really strong reason, just call the functions directly > without the function pointers and call_mem_op(), this will be slightly > faster, but more importantly it allows for much faster navigation of the > code base. Same for HFI ops Konrad