Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1521979rwb; Fri, 28 Jul 2023 10:32:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlF32OFW5UTLuiA49vFbfwlPrubVnuA+u+Yjp7l94PS60FbxKOJQ6NHqtrAvWadZU7WHI/i6 X-Received: by 2002:a17:903:1103:b0:1b8:6850:c3c4 with SMTP id n3-20020a170903110300b001b86850c3c4mr2146141plh.22.1690565531779; Fri, 28 Jul 2023 10:32:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690565531; cv=none; d=google.com; s=arc-20160816; b=0J+9seqUVj2Q6izZfJxDW1JugxysPn4GBOeci2cSmbCVRpcCMVM4yV15oG9V7aPbZv rORxuvIF4hrjXcEjQjFdGIffj11Fk1MEowO+DwTw2dALcIgXGwNIU6Yiz03J7tkTw54B UzEitS6N1VkjDfiWiVcmrlFXwN8hPjglM0wCGKfF2dFtSUldfu87DTcKTD5/HcqCWtWA VuzszkpiTaiRWxtyov4df92zsTXFkMuE2kUXqZ/vFgsyRNZzAeZ4f8mMSPFGsde8SQPW DSueEwn3qdcDJhcZ6IaOicMXhlEPjJQaldxjNvx9xKRWzERlxEp2ynbRioqpzc3ey5oq bYkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=w0oGhDyW9VdO2m5FSV0ApOWQSQ6yHZfu9JMXkORo2A4=; fh=L5j6Emal2dtXMqWRQLr8zMtpvCj92lhcF3Unf0GVAw0=; b=IZGdzxuWi/+F9lj/7fTBj1i3oENTxevRsuoannWz31jCd85MOB3iwKu6pFQIHqahsa Cwvr4g5nkwC/s1b7pH2tWSh0yFf3nepbjwoaoEJY+T389tUqi3QmcwmT7DGJV6JBNkTy dCCHbWXYyxpxB9vFWscHfOBVFU10u8F5yr7ivx7oRoJYk0MM+sBrnNq5iFn/xeTesVHV LQLXRH2m41LG3Wf1EZPuJfmNga2bMYJh8XnuBm0Xch0j1UmE4FMQTHt1pGYfbucPVYCr R7dXmbOU2xZIsODvNq+Vi62kNgZTJxf0Ni6hSDSMafJoYat8ZlEtyJhPzzXQ2CYmgiRW gTQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Vi1n7mSV; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m18-20020a170902d19200b001b8bb6d9ba6si105328plb.311.2023.07.28.10.31.59; Fri, 28 Jul 2023 10:32:11 -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=@quicinc.com header.s=qcppdkim1 header.b=Vi1n7mSV; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230409AbjG1Q20 (ORCPT + 99 others); Fri, 28 Jul 2023 12:28:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjG1Q2Y (ORCPT ); Fri, 28 Jul 2023 12:28:24 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 136D73AAC; Fri, 28 Jul 2023 09:28:23 -0700 (PDT) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36SEIM4C005087; Fri, 28 Jul 2023 16:28:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=qcppdkim1; bh=w0oGhDyW9VdO2m5FSV0ApOWQSQ6yHZfu9JMXkORo2A4=; b=Vi1n7mSVETaFyQ2vYTLrQNirsdWhi2Dz5wvecVRq81uVi/b8WQMzCsKduTyUb+StB49O Kn8RqUisfZdw43W8bRHYrjyyBip2We1ud1oIXvPimaVYl3r986xwDRWf7pnH9L4ysj8o BvySdfzgR1kUIili/Hccnl2LnMqYJcx+CWLBW7BBkzB3Zq1htNRKAhXAU1Ug0MJFvq4O Qwo18K4tY2ABcVnT8tibMxK5EMkjC9LBGY71zGC6qLarZqG5W0e583AvMLsjhrDGLOGy +UZhEjuDMMDqMQcnqoEmRZU/f4PIya4Y9N/PgMnTTwaJV4tPylggLwj1PdFxR9Gir+na gg== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3s403vj1dg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Jul 2023 16:28:19 +0000 Received: from nalasex01c.na.qualcomm.com (nalasex01c.na.qualcomm.com [10.47.97.35]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 36SGSIW1013242 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Jul 2023 16:28:18 GMT Received: from hu-bjorande-lv.qualcomm.com (10.49.16.6) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 28 Jul 2023 09:28:18 -0700 Date: Fri, 28 Jul 2023 09:28:17 -0700 From: Bjorn Andersson To: Vikash Garodia CC: , , , , , , , , , Subject: Re: [PATCH 11/33] iris: vidc: add helpers for memory management Message-ID: <20230728162817.GE1428172@hu-bjorande-lv.qualcomm.com> References: <1690550624-14642-1-git-send-email-quic_vgarodia@quicinc.com> <1690550624-14642-12-git-send-email-quic_vgarodia@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1690550624-14642-12-git-send-email-quic_vgarodia@quicinc.com> X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) To nalasex01c.na.qualcomm.com (10.47.97.35) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: FlWOmzjyQT2xxyu7ikpawU1qJjPo6G5V X-Proofpoint-ORIG-GUID: FlWOmzjyQT2xxyu7ikpawU1qJjPo6G5V X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-27_10,2023-07-26_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 priorityscore=1501 adultscore=0 impostorscore=0 phishscore=0 mlxlogscore=771 mlxscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307280149 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 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. Regards, Bjorn