From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) (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 E6FC614A600; Thu, 25 Apr 2024 15:46:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.40.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714059987; cv=none; b=bdHLhNSv/NML4pT/ecpmKLSiiZ+ypXL21HKC80MpCoA5AFxKz6Q4oFdJB5pvO4o4NOlvm4F/GWy5CWtr+ylWeNkFYIdNkMi3a+UdC/LRkbwL7VvzniRUf/GcqRJK4OtaMv3xHnUNdg1IH/TAGdqDFRmFMpRg+vAQDbe9CP8wySg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714059987; c=relaxed/simple; bh=BdnPwz8X5VjIlyxGHTHB1xmygmV3v31FLtNCSVMN0D4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=a8IzXX26VG5FoljMm0PUZhyg5jwdhUYBL+FcmU1jCUoTM+keO8JN34qdnDbzaEGNvVUsjUIqfZqQ00evQ5lFcBu9WfQlD61qVVVMoRwMjXXIMmIuLCi2ZoU3tFCToKs8R+Sp/gO4tgYtq/731Kw1x6Sov6sARVpptcq6wsg7L8w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b=HMZCcv4d; arc=none smtp.client-ip=185.70.40.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="HMZCcv4d" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1714059977; x=1714319177; bh=7jYU4x9SG+HzxaQPBZY9kv9tKEO30Ph+k3fkjG3u5NU=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=HMZCcv4d0BzKDpblcZGIwbOk3RmoAhA/+tFRH63hwaUiN4O86P6ylvMu1HKbeE+AU zHAQgUzL8N5vjrvfWjPFkgEYnyyhHV5d6r04PJAym1bBsX9T7e8adQy0u4bSQtu3BX bpZbFiu5Hzc4KnKODFcP9smXpANOcclBMQDmNDF0TfxBuHRMxD4szqeHKx8PJXi5nu C7AO959VexM/iJIJ5YeoFsfGh+kErnwPHeR3Or8pvg0aOkf/BygIY9DER4fGM1Z4Dr S6ha4tT7WwlKX5BemzU210QuVwlmAV+qregOx2x9knfQ0UdbnngE7U5pJSapoBQShZ m+IUKkNmNsVGg== Date: Thu, 25 Apr 2024 15:46:14 +0000 To: Lyude Paul , dri-devel@lists.freedesktop.org From: Benno Lossin Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Andreas Hindborg , Alice Ryhl , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org Subject: Re: [PATCH 2/4] WIP: drm: Introduce rvkms Message-ID: In-Reply-To: <6a16f0023b62beba4658677bebcc4786da1ea4be.camel@redhat.com> References: <20240322221305.1403600-1-lyude@redhat.com> <20240322221305.1403600-3-lyude@redhat.com> <6a16f0023b62beba4658677bebcc4786da1ea4be.camel@redhat.com> Feedback-ID: 71780778:user:proton X-Pm-Message-ID: 045ae0f74a45c39b91a85c78c275bb36ea47dee4 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=utf-8 Content-Transfer-Encoding: quoted-printable On 22.04.24 03:54, Lyude Paul wrote: > On Wed, 2024-03-27 at 21:06 +0000, Benno Lossin wrote: >> On 22.03.24 23:03, Lyude Paul wrote: >>> + >>> +pub(crate) type Connector =3D connector::Connector; >>> + >>> +impl connector::DriverConnector for DriverConnector { >>> + type Initializer =3D impl PinInit; >>> + >>> + type State =3D ConnectorState; >>> + >>> + type Driver =3D RvkmsDriver; >>> + >>> + type Args =3D (); >>> + >>> + fn new(dev: &Device, args: Self::Args) -> >>> Self::Initializer { >> >> And then here just return `Self`. >> >> This works, since there is a blanket impl `PinInit for T`. >> >> Looking at how you use this API, I am not sure if you actually need >> pin-init for the type that implements `DriverConnector`. >> Do you need to store eg `Mutex` or something else that needs >> pin-init in here in a more complex driver? >=20 > Most likely yes - a lot of drivers have various private locks contained > within their subclassed mode objects. I'm not sure we will in rvkms's > connector since vkms doesn't really do much with connectors - but we at > a minimum be using pinned types (spinlocks and hrtimers) in our > DriverCrtc implementation once I've started implementing support for > vblanks[1] >=20 > [1] > https://www.kernel.org/doc/html/v6.9-rc5/gpu/drm-kms.html?highlight=3Dvbl= ank#vertical-blanking >=20 > In nova (the main reason I'm working on rvkms in the first place), > we'll definitely have locks in our connectors and possibly other types. I see, in that case it would be a good idea to either have an RFC of the nova driver (or something else that needs pinned types) as motivation for why it needs to be pin-initialized. --=20 Cheers, Benno