Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1208399lqd; Thu, 25 Apr 2024 08:46:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVl6VNhd0QvT05pi1vWEhM+qLH+MLGn0WEyv6ZuFJTcs1E9A19n7LVkXKMe5wad2/gZIfO3VRIb2+m7/VYt95ZsUy7FC2eBap67f3FhNQ== X-Google-Smtp-Source: AGHT+IEhN2MdB4brKBpgbQaOipyygfKcWgo8JIFIXiTto1paL1HbRGdGFUQ9AFZ1h2a74G5jZ1dC X-Received: by 2002:a05:620a:2714:b0:78d:7802:16fc with SMTP id b20-20020a05620a271400b0078d780216fcmr7273343qkp.49.1714060006741; Thu, 25 Apr 2024 08:46:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714060006; cv=pass; d=google.com; s=arc-20160816; b=aUaeqqw7itwoRNsVJwwqO/0DOLZ9rcWmWBRlLSs8FqLmLw3zxmGfaWXJ80M6iCwfKG luS97KFT/0xS5xVTN6SNU3Q6SVsX2qpcZV5CZXN5nOsSZNw5BAHG7WN+FnX/dpw4lJVL wLaLhIeajmt1DBsoKdrf+D+TZn8nxxRbjxr3Lv0IrmVO2E+3BNdHZz3xg8rRFE1OgtxQ JFi2Ivqu9rPNLe9JiVvv2KlihV2bc0pBFIzzuueyQxxQu5ME9mNpSHi5jn/m1WIVGwK3 R64zvZ5ytynyScluXvB8jUcd6lsjM+1m8ZmxdpEBYpKa6mfRO5NibVt95R3IlpF+P8eY lzDw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=7jYU4x9SG+HzxaQPBZY9kv9tKEO30Ph+k3fkjG3u5NU=; fh=DEYGuEP5Uc9E+jrthp3YNr7+EWDipgz0btf/6h0A1uQ=; b=gp8zFg+Y9rZR7G9Iwum/9DUWWetTU3ttWnnKTNvQFzdC9dfXu3RcDdA8aRCABqnmlp yi/gGROGG8qS4TmnBKqKzRhxy+k6Rx3RSp+0oJL7LdPzEPfRktmlSuYzjEq6rsormvR6 ZOORAzevKDuIp3kEzRLbf40Rp2dvr+wDFO8DDYg/l2dZ+H9RuH+rIr6R9JkWAbIVBCJE i0TchMNxPlGj2wAT4mlrpyv5a8O/Bd/eW85DUMXPnRHjk7bi5bUjgllTisxXPLQDGuKr iE2RnZZHhbKnf1LJty8MgfxvWym0qcjCtHT5w9jDZjtWXZCy9xSsxHd0EaMQV3rIhSZv WPow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=HMZCcv4d; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-158836-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158836-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y8-20020a05620a44c800b0078d76c129easi21290623qkp.424.2024.04.25.08.46.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 08:46:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158836-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=HMZCcv4d; arc=pass (i=1 spf=pass spfdomain=proton.me dkim=pass dkdomain=proton.me dmarc=pass fromdomain=proton.me); spf=pass (google.com: domain of linux-kernel+bounces-158836-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158836-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 76D6A1C209D1 for ; Thu, 25 Apr 2024 15:46:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 62DB714BFA3; Thu, 25 Apr 2024 15:46:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="HMZCcv4d" 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 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: linux-kernel@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