From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (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 14AB92505C5 for ; Mon, 24 Mar 2025 14:10:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742825456; cv=none; b=iXdIuYLnL2tmdi4CFmUzUOyVQbeaJ/bOEs/186/CLjI3SLBh7WrRleNzKzbCThSzRoLsgdyllE/gO4ln5LKwX4Y8uu4DTC9I9S3jtPDuQHGpULbTMo+C8rcyYJ7OQLhVsril9Ne2OoMzS6AL+c7QUiJq6uZl1CPRKfC2aGV3giw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742825456; c=relaxed/simple; bh=NqNPPpCkaZkUwbNQKKvy64w/LnM2Bd6Jjp5jMp418XA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hpENRKpg93TX1G/D7CuWajSsM0x+IOusuuDpIj58ROIuOAqbCQACUEF/+8VP1uh6ZOA5ZMwZzkloKXRlYEZaUmHf0cDFsCjAxjKxQXOSONYr04wvlPPkfcyEgFBvRj5I91B0TISWT7gAaHSB+TaUCDd9FEIsb3t1aLJSbet4F8I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rosenzweig.io; spf=pass smtp.mailfrom=rosenzweig.io; dkim=pass (2048-bit key) header.d=rosenzweig.io header.i=@rosenzweig.io header.b=dgM8qoQK; arc=none smtp.client-ip=95.215.58.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=rosenzweig.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rosenzweig.io Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rosenzweig.io header.i=@rosenzweig.io header.b="dgM8qoQK" Date: Mon, 24 Mar 2025 10:10:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rosenzweig.io; s=key1; t=1742825449; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5QavDf4YfF4g6incDfR8g3M+4C53fdbJxU8hmz4md/c=; b=dgM8qoQKNJIEi0dY32L6hBabt7HjG8XUm1NhIZaImSKprfR8JXsfBfhH9cTCPrcLg9wfGD o23+bo8cMWxTi36khM1fvKGG4apkYQpsaXdP8sgYZRtIQ6jZU1waJ/RfnEJxDXhZnj6hMt l4zSCzE8vSv3ylcINppjWvFaV7fjmBwjcieTx3E9R4I0dwULWMbcw+IcB7uU72j8Pi/ESl 15pJTFdt9S+sGypIz635REFAIlyLDRUk/TZpfAg/E3oncgVQLclL0tPPh5xQu2kDhPTHMJ CFfNp00ClfbxNtP9JaOZCdso+fJ06mjS+jj+Drg6EAouBFLpdKHMNTre/Gp2cA== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Alyssa Rosenzweig To: Daniel Almeida Cc: Faith Ekstrand , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Janne Grunau , Sven Peter , Jonathan Corbet , Sergio Lopez Pascual , Ryan Houdek , linux-kernel , dri-devel , rust-for-linux , asahi , linux-arm-kernel , linux-doc , Asahi Lina Subject: Re: [PATCH v3] drm: Add UAPI for the Asahi driver Message-ID: References: <20250314-agx-uapi-v3-1-3abf7e74ea2f@rosenzweig.io> <195b507d4b3.b25d0dad175771.7566427576910952468@collabora.com> <195b582682b.121ba4d5e219032.3109114844776468245@collabora.com> <260D98E1-7204-4535-A84F-D55A4527FF7E@collabora.com> Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <260D98E1-7204-4535-A84F-D55A4527FF7E@collabora.com> X-Migadu-Flow: FLOW_OUT > >>>> + /** > >>>> + * @DRM_ASAHI_BIND_SINGLE_PAGE: Map a single page of the BO repeatedly > >>>> + * across the VA range. > >>>> + * > >>>> + * This is useful to fill a VA range with scratch pages or zero pages. > >>>> + * It is intended as a mechanism to accelerate sparse. > >>>> + */ > >>>> + DRM_ASAHI_BIND_SINGLE_PAGE = (1L << 2), > >> > >> Does this require the BO to be a single page? If so, does it require offset==0? Or does it just take whatever page is at the specified offset? > > > > I believe the intention is that it takes whatever page is at the > > specified offset and just maps that a bunch of times. HK doesn't use > > this yet though it probably should (this was added to help reduce > > overhead when emulating sparse with scratch/zero pages, which is still > > very new functionality in hk). > > > > Accelerating this properly involves GPUVM patches - although even without > > that, moving the loop into the kernel so it's only a single ioctl > > (user-kernel roundtrip) seems worth keeping the flag for. > > FYI: I will be posting a patch for the GPUVM abstraction soon. Great to hear :) Although in this case, I meant that accelerating DRM_ASAHI_BIND_SINGLE_PAGE requires patches to extend the actual C implementation of drm/gpuvm, not just the Rust abstraction. Which is a bit annoying for non-essential functionality with regards to upstreaming things...