Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp813566rwb; Thu, 4 Aug 2022 11:19:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR7RxdJMcx0jRb8l6Ktj1TvGmvJAsx274tHzWZJagcJGMmYLxaUHUeFp+4+8iZZ8GAknJUJ9 X-Received: by 2002:a17:907:7615:b0:730:e1ad:b132 with SMTP id jx21-20020a170907761500b00730e1adb132mr799562ejc.744.1659637176115; Thu, 04 Aug 2022 11:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659637176; cv=none; d=google.com; s=arc-20160816; b=EEQkOM4vkDccgz9PJCuscdIV1Tiiv8uhSZuMqXjXJKlwXFI0JjqcGMh/jX1w90a+T2 ONjHr9otMg4gPyg6I+SgqR+7kdYMhJ5N2G0S0yvLB30xtZKgaM+T6MlafNwzTvzKJucr QWKzUVfmTQTgAOQOcwLSd9fDObVdy209AJCjC2iPVE3zBrgwg4jeQOsuF5v4hwURvmIO 4z0SC0BHkI6Vtj0urMWpbRg5hPYdM9UUXVmK1HApDGCkDZHpmgbjkKWcpCz0NY2LJ0rV Bxrh4c2A/DOENorDSspctdiFfMsaRQHYHiG5mmOyPSlW6tYSGqDf5fTBUkt20yEyWaF+ y0Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=geQKvVgUIrbIYqUyW/DcQqiSd9imQnwOiLDTjM9ijiM=; b=SLz/zvRTm21KNB2L69AWRMnpM6gfND/mChfhY7i3Me8XWEYiH1UP1d8U0j0fyUWqzm JVpiLjbgfAIXgo4pPdhnEd3dhizPhXcvbndxhPyCjhAZduAI74NxjRU4spKDQBIODkns xwCl4vbQGOzhfX9JrMZZLyruen/Ok32ZTi3QI9Jjd5IuGCrgo5h6g2wz8Kb5fUhTyfkb 27v1gZ5bsgA77U/6VzpTwZXnV1MvktnFO2PWWEOwaP5AeQiKE327XNMtBLeuYHjhFpRw SUMCu2a9DIbE3ZF04LMv2QvMFsFUw0NJXGD/b9RZ+CMYsc3S5mz4bjxmyY5O24rHQ3Ub GLTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="EEuFgw/l"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg12-20020a170907970c00b00717f2a08a2csi1624446ejc.169.2022.08.04.11.19.10; Thu, 04 Aug 2022 11:19:36 -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=@gmail.com header.s=20210112 header.b="EEuFgw/l"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237680AbiHDRxh (ORCPT + 99 others); Thu, 4 Aug 2022 13:53:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231712AbiHDRxf (ORCPT ); Thu, 4 Aug 2022 13:53:35 -0400 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [IPv6:2607:f8b0:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACCA2252BB for ; Thu, 4 Aug 2022 10:53:34 -0700 (PDT) Received: by mail-oi1-x230.google.com with SMTP id bb16so196876oib.11 for ; Thu, 04 Aug 2022 10:53:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=geQKvVgUIrbIYqUyW/DcQqiSd9imQnwOiLDTjM9ijiM=; b=EEuFgw/lIJQA/31pdk+fOk++kLMbRbd9jGZAr/sPZdCKoZaK9L9bJZ6pJqLvfvkblm hXhLKeIe6Vpqt2Iz3ofypgNATKNk7cOQAsbbI3hIscEuApeb+xdDyZJ/VNODlAzdStSm kw1e6bt0PdUqFPhepSmCp9w26ACgmITzUlDdgo2zhLNuFpqCw6xPgWWZyB0engV4+TuP o/KwoG4uMp4oBuRjMDqIH0xf7bu+3EUgZx3nFCEPd2WbEiXgusg1H7O0J7maxLFhGmFQ m3+11Em/XXPOeJTdAMrGfvK0gTPvVY+lddfbzFBAcYCmYohK2Jb1K6vnjhKBxL2FpYX/ nIqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=geQKvVgUIrbIYqUyW/DcQqiSd9imQnwOiLDTjM9ijiM=; b=4SIhDKh0sF3JcCEpoFYFUs7lJSxrKQNOmEVomA5uUIyNqMemnZVXTTkV2WpMUhlrkZ MjiaVQbki1qqSXsRwPillZQjw7Ii3JAg+zJoG9Jqtu8MOwI4pYyN5PWTyccsNFiw2YHb vHtGcEnrwCUdMCRg5PuS5Vm7FAdCrXDAduxiu1jeg8xbaBXPmo0N9e6Zq61URN5q19EV i1WcPojoZs5HIDem29noWm/7PklEkfSCfLdeLPMB1ujuYmDaf6RzqDWwFy8TE+8YMNAH gqw+rF8n9JwKim3tdXazZezehaiVt5LL9ElQmA4B57Q/dRhbOUMYPrIwCjjt5VQbArNE 4Lwg== X-Gm-Message-State: ACgBeo3WrP5yF9qES3Xqpc9+GoTHqtZoKPkg+h47uROf9ITqtXj6I5xZ ykgQ34bGEdJn0AQ/jwaSl1a3K0thxnHKSFcVSMg= X-Received: by 2002:a05:6808:11cc:b0:32e:7fc5:3a49 with SMTP id p12-20020a05680811cc00b0032e7fc53a49mr1341752oiv.166.1659635613886; Thu, 04 Aug 2022 10:53:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Oded Gabbay Date: Thu, 4 Aug 2022 20:53:06 +0300 Message-ID: Subject: Re: New subsystem for acceleration devices To: Jeffrey Hugo Cc: Tvrtko Ursulin , Dave Airlie , dri-devel , Greg Kroah-Hartman , Yuji Ishikawa , "Linux-Kernel@Vger. Kernel. Org" , Arnd Bergmann , Jiho Chu Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Thu, Aug 4, 2022 at 6:04 PM Jeffrey Hugo wrote: > > On 8/4/2022 6:00 AM, Tvrtko Ursulin wrote: > > > > On 04/08/2022 00:54, Dave Airlie wrote: > >> On Thu, 4 Aug 2022 at 06:21, Oded Gabbay wrote: > >>> > >>> On Wed, Aug 3, 2022 at 10:04 PM Dave Airlie wrote: > >>>> > >>>> On Sun, 31 Jul 2022 at 22:04, Oded Gabbay > >>>> wrote: > >>>>> > >>>>> Hi, > >>>>> Greg and I talked a couple of months ago about preparing a new accel > >>>>> subsystem for compute/acceleration devices that are not GPUs and I > >>>>> think your drivers that you are now trying to upstream fit it as well. > >>>> > >>>> We've had some submissions for not-GPUs to the drm subsystem recently. > >>>> > >>>> Intel GNA, Intel VPU, NVDLA, rpmsg AI processor unit. > >>>> > >>>> why is creating a new subsystem at this time necessary? > >>>> > >>>> Are we just creating a subsystem to avoid the open source userspace > >>>> consumer rules? Or do we have some concrete reasoning behind it? > >>>> > >>>> Dave. > >>> > >>> Hi Dave. > >>> The reason it happened now is because I saw two drivers, which are > >>> doing h/w acceleration for AI, trying to be accepted to the misc > >>> subsystem. > >>> Add to that the fact I talked with Greg a couple of months ago about > >>> doing a subsystem for any compute accelerators, which he was positive > >>> about, I thought it is a good opportunity to finally do it. > >>> > >>> I also honestly think that I can contribute much to these drivers from > >>> my experience with the habana driver (which is now deployed in mass at > >>> AWS) and contribute code from the habana driver to a common framework > >>> for AI drivers. > >> > >> Why not port the habana driver to drm now instead? I don't get why it > >> wouldn't make sense? > >> > >> Stepping up to create a new subsystem is great, but we need rules > >> around what belongs where, we can't just spawn new subsystems when we > >> have no clear guidelines on where drivers should land. > >> > >> What are the rules for a new accel subsystem? Do we have to now > >> retarget the 3 drivers that are queued up to use drm for accelerators, > >> because 2 drivers don't? > > > > Isn't there three on the "don't prefer drm" side as well? Habana, > > Toshiba and Samsung? Just so the numbers argument is not misrepresented. > > Perhaps a poll like a) prefer DRM, b) prefer a new subsystem, c) don't > > care in principle; is in order? > > I'll chime in with my opinions. Take them for what you will. > > I would say I fall into the C category, but I'm targeting DRM and will > be the 5th(?) accel device to do so. > > I'll say that the ksummit (from what I see in the LWN article) made me > very happy. Finally, the community had clear rules for accel drivers. > When I targeted misc in the past, it seemed like Greg moved the goal > post just for me, which stalled our attempt. It was even more > frustrating to see that the high bar Greg set for us was not applied to > other devices of the same "class" in following submissions. > > However, the past is the past, and based on ksummit, we've spent a > number of months retargeting DRM. In a week (or two), I plan to post > something to start up the discussions again. > > As far as the DRM userspace requirements, unless we've misunderstood > something, they've been easier to satisfy (pending review I suppose) > than what misc has set. I think it is quite the opposite. In misc originally there was very minimal userspace requirements, but when my driver started to use dma-buf, Dave asked for more. e.g. a driver that wants to get accepted to DRM and use a fork of LLVM must not only open-source his code, but also to upstream his fork to the mainline LLVM tree. In misc there is nothing that closely comes to that requirement afaik. > > I would say that Dave Airlie's feedback on this discussion resonates > with me. From the perspective of a vendor wanting to be a part of the > community, clear rules are important and ksummit seemed to set that. > Oded's announcement has thrown all of that into the wind. Without a That wasn't my intention. I simply wanted to: 1. Offload Greg with these types of drivers. 2. Offer to the new drivers a standard char device handling 3. Start a community of kernel hackers that are writing device drivers for compute accelerators. > proposal to evaluate (eg show me the code with clear guidelines), I > cannot seriously consider Oded's idea, and I'm not sure I want to sit by > another few years to see it settle out. I thought of posting something quick (but not dirty) but this backlash has made me rethink that. > > I expect to move forward with what we were planning prior to seeing this > thread which is targeting DRM. We'll see what the DRM folks say when > they have something to look at. If our device doesn't fit in DRM per an > assessment of the DRM folks, then I sure hope they can suggest where we > do fit because then we'll have tried misc and DRM, and not found a home. > Since "drivers/accel" doesn't exist, and realistically won't for a > long time if ever, I don't see why we should consider it. > > Why DRM? We consume dma_buf and might look to p2pdma in the future. > ksummit appears clear - we are a DRM device. Also, someone could > probably run openCL on our device if they were so inclined to wire it > up. Over time, I've come to the thinking that we are a GPU, just > without display. Yes, it would have helped if DRM and/or drivers/gpu > were renamed, but I think I'm past that point. Once you have everything > written, it doesn't seem like it matters if the uAPI device is called > /dev/drmX, /dev/miscX, or /dev/magic. > > I will not opine on other devices as I am no expert on them. Today, my > opinion is that DRM is the best place for me. We'll see where that goes. > > > More to the point, code sharing is a very compelling argument if it can > > be demonstrated to be significant, aka not needing to reinvent the same > > wheel. > > > > Perhaps one route forward could be a) to consider is to rename DRM to > > something more appropriate, removing rendering from the name and > > replacing with accelerators, co-processors, I don't know... Although I > > am not sure renaming the codebase, character device node names and > > userspace headers is all that feasible. Thought to mention it > > nevertheless, maybe it gives an idea to someone how it could be done. > > > > And b) allow the userspace rules to be considered per driver, or per > > class (is it a gpu or not should be a question that can be answered). > > Shouldn't be a blocker if it still matches the rules present elsewhere > > in the kernel. > > > > Those two would remove the two most contentions points as far as I > > understood the thread. > > > > Regards, > > > > Tvrtko > > >