From nobody Thu Oct 9 20:24:37 2025 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3219D1E98E3 for ; Mon, 16 Jun 2025 15:00:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750086019; cv=none; b=IBHAACNL+kghP8izGVHV5TQsOTvQRO5ayq4l0ua8GNeK1SN+olA/jE7judq3Vu5hXGyZwx5bPKSiZDoDocLMNvwtUDgekTu/wazk1QGIwiaoZZLmgtzVs4WcFkW2ZUY9sB/cYksPJt+4CnoxeDm4+Sobwgt9C+Nar+WMJfa65WI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750086019; c=relaxed/simple; bh=nXgUqQdyDTDmUCSlus96vQ7zp/8O8nNWvr6C6TQ8+ag=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=C+MX8upNWWRzPXQEbOHl/Ep/aRrcfUzWIBtq/LUOK0pXQVv1wDc3adS2kzD3xAnyof25Cee8BZV74ZYyuiEnV+PCb/9DQOqpDGfw8NaAsbjilrIXawGtzCMAWwsD76suOZ7ZpcvK6EjKp1I+IRZwnJGoNHBytH8alYrqI2Wp5Ik= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=ZxbYSMFr; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="ZxbYSMFr" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55G8SL3P010074 for ; Mon, 16 Jun 2025 15:00:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=C2Mw8hDedlh HIu8wE01JvXGicmu3xM3Nu6IiIJHmMkU=; b=ZxbYSMFrn7l7CisnPoThSRW7Vr1 6wo/B1bmVhyPYilbv6eAQ8x0DTGbHzQ3+P3PlfK6VD3uRlaBfkI7c9f2I45rYcCY /5+R0PYNux+VnLhw2uzm/2+wEEmDMtXAhWu5W1Xq4xBuJo44ua76aso1xfJ/Nu2d 0vVCQPTTOy3vNv2AXPDpSzBJDqSKAYha34GRF6Ie5nvK9dBp/NTlHaJEkTxPodVG Yfq2h56XLfCGzdafhhf6PTeY8xnNFOmXCd7hvXO/X8ovJhkS4XvQiBtT3etYsNST Jgzg2ChR0cT4swJVH2uA52XK/JOel4yTa08r2FL1oQfagLZOtX5zoA5gLZw== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4791hfd0ha-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 16 Jun 2025 15:00:17 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-3141f9ce4e2so642319a91.1 for ; Mon, 16 Jun 2025 08:00:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750086005; x=1750690805; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C2Mw8hDedlhHIu8wE01JvXGicmu3xM3Nu6IiIJHmMkU=; b=D9lL0OdQBBf/IpJbOvcnqlc+enS/F/iZkdiVfDkD0m5eh3qPcGB/7b73UHLTF/vFYi IjeALlU1kzq1UEKU5fweyfcstQCfKRTbiJegZCs4bhZ+MNwK8mE1srMpF0Lzl09lgkQ4 hWMEDWVieiGT7nt2XNz0BqNzXRzxUjO8p65RpmxlYg9bc9ltqtAumuneJzRRUS4y+a4E zv3+QSfRvsqZuJ7X9s/3g4UOPBzeyC0WlaQwkGBKYGORVftayo1ww5CbZu7u+GvfToQ7 5TkXncmGhQwooGsJkDQ8dWeq4LbNvOSBnzK0kcrc99PEoQesmCnW4YOAegJSvUto7mQE 4fbQ== X-Forwarded-Encrypted: i=1; AJvYcCUHfcaYe6miOJ8L59tdJJiWWt1qvPDoKYCReJzyv9e+yCWOG98N8s0CF4MsjoY7wf7kZP58TTKA3zntiAo=@vger.kernel.org X-Gm-Message-State: AOJu0YzTpKu8eawOU0CWs0gDWpd3Wyc/hTyJYBmnx5bl6EgGa1oSajRp oE5FOV1wVNODY/9CLPJCHE2PJJ8WSxaz9/fWMHK/3mGpruO0lh0Z7if4fNYvZGruNM0jLimCuLG VGkXCb7+de1WhvQOsiMatEQzSEoLPwv8NYm5N+g1HtmosNKVBriHmYewz3YtK4HFpZjs= X-Gm-Gg: ASbGncssCLtRGZaD/n5Lhgw4Kv/VHiXlAVTwfo8RI9Za8j1anVh0rOATKKMSmes7fMl XDG3h8ORb7N1sbGFgZcGG+NO7KKT4rj/NIbydBH5fm0hhaf0bWaRJZ8NgVj1tg8MkbsXZsmy4DF 1el3qQs2pRM8JVrCqVyVsD6E3jiSY0v1xmfR54XRWNe5wd0fr8S7bn6vswJe4gg0/J8HytVu5k/ ZSDucZmmK9J04e2utPTWvHUk3/4/0mehVYT3k88jnoz5zJqIcEnc3eEnSmsS5Rc7ekGrcf+R1YW Z7gOeeBgpnEMOgqzr8rwageireHOjSnu X-Received: by 2002:a17:90b:1b10:b0:313:28f1:fc33 with SMTP id 98e67ed59e1d1-313f1cd5a81mr16293971a91.10.1750086004605; Mon, 16 Jun 2025 08:00:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHhSwyYJbkfuG+cowVkLmWP7rTUfqw9+6BV4SQmAMwgYeSuRZuWklUdQ7zzXGTIOcmBX5tInA== X-Received: by 2002:a17:90b:1b10:b0:313:28f1:fc33 with SMTP id 98e67ed59e1d1-313f1cd5a81mr16293906a91.10.1750086004136; Mon, 16 Jun 2025 08:00:04 -0700 (PDT) Received: from localhost ([2601:1c0:5000:d5c:5b3e:de60:4fda:e7b1]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-313c1b6d4c8sm8716826a91.48.2025.06.16.08.00.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jun 2025 08:00:03 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Danilo Krummrich , Rob Clark , Danilo Krummrich , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 1/2] drm/gpuvm: Fix doc comments Date: Mon, 16 Jun 2025 07:59:56 -0700 Message-ID: <20250616145958.167351-2-robin.clark@oss.qualcomm.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250616145958.167351-1-robin.clark@oss.qualcomm.com> References: <20250616145958.167351-1-robin.clark@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjE2MDA5NiBTYWx0ZWRfXxKnspa2aBb/c 1HBdEuQpPkPYDi/adbO6Zc7Tlp8D/VIojpLobhdlWNn+inE6FtlOKhWUYtVL5jDksNgbCBtfoaq 4WHMgOdTizEm0pmjiMqUC5dg/vAbHSonDUBw5FNSjZNFIezlabgfppAwUEtzrhxJ8WrtEZOD6IY Bjl0rUYOkqvuoENrlWPj6Bcd9US3ufxHq2FwFJxH6eSEvRqw9ySiaUrbFUFMdka3Omnt62V6V0K q90K47mZEI2JKqXG21f8a6dMFx5030O0snDJTRzgPBKuKN+FbaF2+cX8iQvJmeg22Z/Kla9pqbu RaeuthbtGUidYhkuJUdHQ6W+/g/vCH95dt01O0gtssoHAPKt3gO01Gf8XwnurukH3ChbIXJL+E+ 8sy1ZrxHvlwRzP1LI2Nv1Pu4cArTBbR5fiIlH5ZKAui/klJqY9eEM8xHBRDKMWcpNGwgWvR0 X-Authority-Analysis: v=2.4 cv=VvEjA/2n c=1 sm=1 tr=0 ts=68503181 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=xqWC_Br6kY4A:10 a=6IFa9wvqVegA:10 a=EUspDBNiAAAA:8 a=VwQbUJbxAAAA:8 a=5Yek0j1-lJT91Je3aSMA:9 a=+jEqtf1s3R9VXZ0wqowq2kgwd+I=:19 a=0bXxn9q0MV6snEgNplNhOjQmxlI=:19 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-GUID: MrhXGaLWJlWV0whYbhStb5nbqw6xiFFe X-Proofpoint-ORIG-GUID: MrhXGaLWJlWV0whYbhStb5nbqw6xiFFe X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-16_07,2025-06-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 lowpriorityscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 impostorscore=0 clxscore=1015 bulkscore=0 suspectscore=0 priorityscore=1501 phishscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506160096 Content-Type: text/plain; charset="utf-8" Correctly summerize drm_gpuvm_sm_map/unmap, and fix the parameter order and names. Just something I noticed in passing. v2: Don't rename the arg names in prototypes to match function declarations [Danilo] Signed-off-by: Rob Clark Acked-by: Danilo Krummrich --- drivers/gpu/drm/drm_gpuvm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gpu/drm/drm_gpuvm.c index f9eb56f24bef..0ca717130541 100644 --- a/drivers/gpu/drm/drm_gpuvm.c +++ b/drivers/gpu/drm/drm_gpuvm.c @@ -2299,13 +2299,13 @@ __drm_gpuvm_sm_unmap(struct drm_gpuvm *gpuvm, } =20 /** - * drm_gpuvm_sm_map() - creates the &drm_gpuva_op split/merge steps + * drm_gpuvm_sm_map() - calls the &drm_gpuva_op split/merge steps * @gpuvm: the &drm_gpuvm representing the GPU VA space + * @priv: pointer to a driver private data structure * @req_addr: the start address of the new mapping * @req_range: the range of the new mapping * @req_obj: the &drm_gem_object to map * @req_offset: the offset within the &drm_gem_object - * @priv: pointer to a driver private data structure * * This function iterates the given range of the GPU VA space. It utilizes= the * &drm_gpuvm_ops to call back into the driver providing the split and mer= ge @@ -2349,7 +2349,7 @@ drm_gpuvm_sm_map(struct drm_gpuvm *gpuvm, void *priv, EXPORT_SYMBOL_GPL(drm_gpuvm_sm_map); =20 /** - * drm_gpuvm_sm_unmap() - creates the &drm_gpuva_ops to split on unmap + * drm_gpuvm_sm_unmap() - calls the &drm_gpuva_ops to split on unmap * @gpuvm: the &drm_gpuvm representing the GPU VA space * @priv: pointer to a driver private data structure * @req_addr: the start address of the range to unmap --=20 2.49.0 From nobody Thu Oct 9 20:24:37 2025 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5CD9215F6C for ; Mon, 16 Jun 2025 15:00:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750086020; cv=none; b=NScBKxU5sVMopIln4aSsIv3QbPrqd3HQEGE2bw8wpd9sy9NHKQefuiDTYgu8diWbv3Gp+9CGnD/MlegG1UGGvBz7fh9s5R8APfuOXDGXPgHWuShqUA1ugz11DwVPOAAak1KjYbh46ZQ9MfuHDudEmb4GjOwhWdyqiU2VwZK535g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750086020; c=relaxed/simple; bh=AQnz321Cbkz9+V5DaGF97fSoVS8odeOv59+RE5dDUFQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sepnKXv2x1cvaBKNLN+km7iKhFwCCdE0mNMOAGdgmHQnnINlDASQBH2qNYCKu4f9FiCkalBKd+x/XV7DUyplEz6MvEPWUeGHKIE2LP2yfqndccp5IL3mV2F/AyepY4fHLG9Q0/I9q9UIrb6X1S2bZFSlJ7dWRUTh7fBLRn/MPDg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Kq1w1Y6j; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Kq1w1Y6j" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 55G8TJMt031861 for ; Mon, 16 Jun 2025 15:00:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=oC5JJQBiULx rFeqVoqoX6M/zLXWPGk3+0yhR9TIZ/ZU=; b=Kq1w1Y6jV+ZLj34FxNYF7nLVk1m +FmKeSKqop67aenrJbLSs6hwSg3afjeXg0tt6hvRFefVbsZaL/QvHUHcV4e+wEiq QlaPX5kOwgw7Ijz3KMfKau3HkRM2GCH4n5tGhod5+0G1cyMVlQgkvOzUSLYsm7vv b/pKzK7fwuiqUS6sUR7YHaLv72bcTHLO85xp7KVTE+qy0ty9L+AFX10nweQcz64I M1bzJx4yKT7ngh4nAqZC3M3+luHxD6sCBWx0cEcihHX2rQohPjoLWLKQ4BHlM6S7 DZpvK5RFGmrOx1wxsId8LZd0E5H6VCyN+OUlfTwnb5w3mE4fM9pkNI9b+rQ== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4791encxr4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Mon, 16 Jun 2025 15:00:17 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2356ce55d33so60223705ad.0 for ; Mon, 16 Jun 2025 08:00:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750086006; x=1750690806; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oC5JJQBiULxrFeqVoqoX6M/zLXWPGk3+0yhR9TIZ/ZU=; b=MjmasOwGscS6nvWDNkrVJzZK9ok27kZpDjzeSCQ+JrfuxHbZftZEpqFS+jgN5bzvKo xoXJdY1tMkFT+u78CroH6JgPuQXgYQPX6+rp9ua5vQUP/+YfM8HAuQisq/TleXmPgC+i GAjO32z/yUBE4hw/tnc+Gp317QKZ/z02KD+h7W4MYt2l3pObcuFJN+zZbEOCj4fF+WLn MRUWlpngKB/QhQjbmcNUOfgXE+NgJCRKhSCP7Ykpqwv882uQbq6S9A9rdbpZurr6V37N nRpRzrJoh4Vo0nCglZJOSKVT7xG5sRDDob/8pdwZrw2jo3bYlrw/AB4jmMft4+gCcruf DuPw== X-Forwarded-Encrypted: i=1; AJvYcCVYeGWhQ3MJTOqfZjORG2QESibh5NCMMMZoA8Uu9uIhHu3FiU3TjUp48FfXWKym08k8zS7foHRNfRrdrvc=@vger.kernel.org X-Gm-Message-State: AOJu0Yx37FELt+pCe8WndDDLVqNrOPCvxELvfA5BErKpC7O4NECHZd+W NVqyXlFeZJHbwu2lfU5kMuuHQ+Byi1m+Vm4U4YPg40J7ep0l++0wcVmA9XEJ97IPj6XlFzDzDu9 6i90Qo4vXG09DqQ5xWqwQJF0eUDpB7i//VjfYc78/Mf2vM9LlvUz2b0YYn+8dtPqRfWo= X-Gm-Gg: ASbGncs5cg6NTBY3wBydOnT9o8MFOK4pn2oLEnXJM6cQnxBQSwREO4eE4J2AqfPUbBz ZqKbKyvoD2LpalTydl+AhGohsx+RzSxGpVeQZ2CnTKTwqciutAmgb1ed1mvYdm5JyLMQZa5tZV5 0vcQoAsHci/Epzomimq6wHHyfeddb4B0jfNC9pIt/xFxzAtHc4lXZuiaCFcr+P76xYqZ4X1XTwq rQ5br5NQ9VATkc9gRJbnxSH28+fYKFQVBQ+rEUJBxnUuJJYVqIYubIS1O36LNgQuNCusLVRs8ze 9/MDMuMluccIWr/Me3Ro+/Bul6AfMuM7 X-Received: by 2002:a17:903:22c3:b0:234:c549:da14 with SMTP id d9443c01a7336-2366b3de71emr137982595ad.29.1750086005968; Mon, 16 Jun 2025 08:00:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGnfSQJYXmMmDrm6U+uoX2a4jwex23BTSF9bmaN4Y4FWllhK7O5JeT0I0bKsdQT1hF7bDaSpA== X-Received: by 2002:a17:903:22c3:b0:234:c549:da14 with SMTP id d9443c01a7336-2366b3de71emr137981935ad.29.1750086005443; Mon, 16 Jun 2025 08:00:05 -0700 (PDT) Received: from localhost ([2601:1c0:5000:d5c:5b3e:de60:4fda:e7b1]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2365e0d44c4sm61807305ad.252.2025.06.16.08.00.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jun 2025 08:00:05 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Danilo Krummrich , Rob Clark , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 2/2] drm/gpuvm: Add locking helpers Date: Mon, 16 Jun 2025 07:59:57 -0700 Message-ID: <20250616145958.167351-3-robin.clark@oss.qualcomm.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250616145958.167351-1-robin.clark@oss.qualcomm.com> References: <20250616145958.167351-1-robin.clark@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: reFVReuueJxKtSEjK-xyc1NRschwhu2Y X-Authority-Analysis: v=2.4 cv=D6RHKuRj c=1 sm=1 tr=0 ts=68503181 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=xqWC_Br6kY4A:10 a=6IFa9wvqVegA:10 a=EUspDBNiAAAA:8 a=J2tNMqIfyHcHeXEe9QMA:9 a=uG9DUKGECoFWVXl0Dc02:22 X-Proofpoint-GUID: reFVReuueJxKtSEjK-xyc1NRschwhu2Y X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjE2MDA5NiBTYWx0ZWRfX+FIoHjEcnk6W t4Lx9wmy0/Syl9e9bLuZyWNIrHuHx9HMl164u5sP6gl5yfTYftGp1PQUybsSzMVn5/xq2o6x9Qs FzHkW9Mdvm01OM+0N3oEhb2w7JVxCeSRzax60D4obdL/3aXrM1h298q7Chz2MW9fXR9HSMQLqop kKqXR14U9eq08z0FkFRNfU1J/ngXh9jCXqIXD6Ml50lxAj4xlTZxlRX4kjIqTRWqOA5v8NL0mnK rAqC4M1DMNZW3d53q0XktGRgCWkKW5Z46m1Pk7p8yhOe3q6rQVoZf6mIpgkOvbZmckGFGkPEuB+ ohtS2oDDGI/Ad5OgiQ7u0ZseIPkCS1E4MCTn623LpsSKob63LCCGEeZL9AfgmSgoSLL+bEVXN56 MfzicHEtPDKvyljS2gsVNPl2c1NISr1Sc75pKUAmOmDNyQNudL2tU7O9PGOorOYPOVdWGn+O X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-16_07,2025-06-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 impostorscore=0 phishscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 clxscore=1015 mlxscore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505280000 definitions=main-2506160096 Content-Type: text/plain; charset="utf-8" For UNMAP/REMAP steps we could be needing to lock objects that are not explicitly listed in the VM_BIND ioctl in order to tear-down unmapped VAs. These helpers handle locking/preparing the needed objects. Note that these functions do not strictly require the VM changes to be applied before the next drm_gpuvm_sm_map_lock()/_unmap_lock() call. In the case that VM changes from an earlier drm_gpuvm_sm_map()/_unmap() call result in a differing sequence of steps when the VM changes are actually applied, it will be the same set of GEM objects involved, so the locking is still correct. v2: Rename to drm_gpuvm_sm_*_exec_locked() [Danilo] Signed-off-by: Rob Clark --- drivers/gpu/drm/drm_gpuvm.c | 81 +++++++++++++++++++++++++++++++++++++ include/drm/drm_gpuvm.h | 8 ++++ 2 files changed, 89 insertions(+) diff --git a/drivers/gpu/drm/drm_gpuvm.c b/drivers/gpu/drm/drm_gpuvm.c index 0ca717130541..b8b0c7f028e2 100644 --- a/drivers/gpu/drm/drm_gpuvm.c +++ b/drivers/gpu/drm/drm_gpuvm.c @@ -2390,6 +2390,87 @@ drm_gpuvm_sm_unmap(struct drm_gpuvm *gpuvm, void *pr= iv, } EXPORT_SYMBOL_GPL(drm_gpuvm_sm_unmap); =20 +static int +drm_gpuva_sm_step_lock(struct drm_gpuva_op *op, void *priv) +{ + struct drm_exec *exec =3D priv; + + switch (op->op) { + case DRM_GPUVA_OP_REMAP: + if (op->remap.unmap->va->gem.obj) + return drm_exec_lock_obj(exec, op->remap.unmap->va->gem.obj); + return 0; + case DRM_GPUVA_OP_UNMAP: + if (op->unmap.va->gem.obj) + return drm_exec_lock_obj(exec, op->unmap.va->gem.obj); + return 0; + default: + return 0; + } +} + +static const struct drm_gpuvm_ops lock_ops =3D { + .sm_step_map =3D drm_gpuva_sm_step_lock, + .sm_step_remap =3D drm_gpuva_sm_step_lock, + .sm_step_unmap =3D drm_gpuva_sm_step_lock, +}; + +/** + * drm_gpuvm_sm_map_exec_lock() - locks the objects touched by a drm_gpuvm= _sm_map() + * @gpuvm: the &drm_gpuvm representing the GPU VA space + * @exec: the &drm_exec locking context + * @num_fences: for newly mapped objects, the # of fences to reserve + * @req_addr: the start address of the range to unmap + * @req_range: the range of the mappings to unmap + * @req_obj: the &drm_gem_object to map + * @req_offset: the offset within the &drm_gem_object + * + * This function locks (drm_exec_lock_obj()) objects that will be unmapped/ + * remapped, and locks+prepares (drm_exec_prepare_object()) objects that + * will be newly mapped. + * + * Returns: 0 on success or a negative error code + */ +int +drm_gpuvm_sm_map_exec_lock(struct drm_gpuvm *gpuvm, + struct drm_exec *exec, unsigned int num_fences, + u64 req_addr, u64 req_range, + struct drm_gem_object *req_obj, u64 req_offset) +{ + if (req_obj) { + int ret =3D drm_exec_prepare_obj(exec, req_obj, num_fences); + if (ret) + return ret; + } + + return __drm_gpuvm_sm_map(gpuvm, &lock_ops, exec, + req_addr, req_range, + req_obj, req_offset); + +} +EXPORT_SYMBOL_GPL(drm_gpuvm_sm_map_exec_lock); + +/** + * drm_gpuvm_sm_unmap_exec_lock() - locks the objects touched by drm_gpuvm= _sm_unmap() + * @gpuvm: the &drm_gpuvm representing the GPU VA space + * @exec: the &drm_exec locking context + * @req_addr: the start address of the range to unmap + * @req_range: the range of the mappings to unmap + * + * This function locks (drm_exec_lock_obj()) objects that will be unmapped/ + * remapped by drm_gpuvm_sm_unmap(). + * + * Returns: 0 on success or a negative error code + */ +int +drm_gpuvm_sm_unmap_exec_lock(struct drm_gpuvm *gpuvm, struct drm_exec *exe= c, + u64 req_addr, u64 req_range) +{ + return __drm_gpuvm_sm_unmap(gpuvm, &lock_ops, exec, + req_addr, req_range); +} +EXPORT_SYMBOL_GPL(drm_gpuvm_sm_unmap_exec_lock); + static struct drm_gpuva_op * gpuva_op_alloc(struct drm_gpuvm *gpuvm) { diff --git a/include/drm/drm_gpuvm.h b/include/drm/drm_gpuvm.h index 2a9629377633..274532facfd6 100644 --- a/include/drm/drm_gpuvm.h +++ b/include/drm/drm_gpuvm.h @@ -1211,6 +1211,14 @@ int drm_gpuvm_sm_map(struct drm_gpuvm *gpuvm, void *= priv, int drm_gpuvm_sm_unmap(struct drm_gpuvm *gpuvm, void *priv, u64 addr, u64 range); =20 +int drm_gpuvm_sm_map_exec_lock(struct drm_gpuvm *gpuvm, + struct drm_exec *exec, unsigned int num_fences, + u64 req_addr, u64 req_range, + struct drm_gem_object *obj, u64 offset); + +int drm_gpuvm_sm_unmap_exec_lock(struct drm_gpuvm *gpuvm, struct drm_exec = *exec, + u64 req_addr, u64 req_range); + void drm_gpuva_map(struct drm_gpuvm *gpuvm, struct drm_gpuva *va, struct drm_gpuva_op_map *op); --=20 2.49.0