From: Jason Gunthorpe <jgg@nvidia.com>
To: Oded Gabbay <ogabbay@kernel.org>
Cc: dri-devel@lists.freedesktop.org,
Maciej Kwapulinski <maciej.kwapulinski@linux.intel.com>,
Kevin Hilman <khilman@baylibre.com>,
Christoph Hellwig <hch@infradead.org>,
Jagan Teki <jagan@amarulasolutions.com>,
John Hubbard <jhubbard@nvidia.com>,
stanislaw.gruszka@intel.com,
Jeffrey Hugo <quic_jhugo@quicinc.com>,
Arnd Bergmann <arnd@arndb.de>, Jiho Chu <jiho.chu@samsung.com>,
Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>,
Yuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>,
Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org,
Thomas Zimmermann <tzimmermann@suse.de>,
Alex Deucher <alexander.deucher@amd.com>
Subject: Re: [RFC PATCH v2 1/3] drivers/accel: define kconfig and register a new major
Date: Mon, 7 Nov 2022 10:10:07 -0400 [thread overview]
Message-ID: <Y2kRvyR8VrZrO/1H@nvidia.com> (raw)
In-Reply-To: <CAFCwf10A=-bj2nR8WasNxyQQ07D24Je04tzKxqv2X_XnA0BUSQ@mail.gmail.com>
On Mon, Nov 07, 2022 at 04:02:01PM +0200, Oded Gabbay wrote:
> On Mon, Nov 7, 2022 at 3:10 PM Jason Gunthorpe <jgg@nvidia.com> wrote:
> >
> > On Mon, Nov 07, 2022 at 03:01:08PM +0200, Oded Gabbay wrote:
> > > I don't agree with your statement that it should be "a layer over top of DRM".
> > > Anything on top of DRM is a device driver.
> > > Accel is not a device driver, it is a new type of drm minor / drm driver.
> >
> > Yeah, I still think this is not the right way, you are getting almost
> > nothing from DRM and making everything more complicated in the
> > process.
> >
> > > The only alternative imo to that is to abandon the idea of reusing
> > > drm, and just make an independant accel core code.
> >
> > Not quite really, layer it properly and librarize parts of DRM into
> > things accel can re-use so they are not intimately tied to the DRM
> > struct device notion.
> >
> > IMHO this is much better, because accel has very little need of DRM to
> > manage a struct device/cdev in the first place.
> >
> > Jason
> I'm not following. How can an accel device be a new type of drm_minor,
> if it doesn't have access to all its functions and members ?
"drm_minor" is not necessary anymore. Strictly managing minor numbers
lost its value years ago when /dev/ was reorganized. Just use
dynamic minors fully.
> How will accel device leverage, for example, the GEM code without
> being a drm_minor ?
Split GEM into a library so it doesn't require that.
> Librarizing parts of DRM sounds nice in theory but the reality is that
> everything there is interconnected, all the structures are
> interdependent.
Yes, the kernel is full of stuff that needs improving. Let's not take
shortcuts.
> I would have to re-write the entire DRM library to make such a thing
> work. I don't think this was the intention.
Not necessarily you, whoever someday needs GEM would have to do some
work.
> The current design makes the accel device an integral part of drm,
> with very minimal code duplication and without re-writing DRM.
And it smells bad, you can't even make it into a proper module. Who
knows what other problems will come.
Jason
WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgg@nvidia.com>
To: Oded Gabbay <ogabbay@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Arnd Bergmann <arnd@arndb.de>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
John Hubbard <jhubbard@nvidia.com>,
Alex Deucher <alexander.deucher@amd.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
Yuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>,
Jiho Chu <jiho.chu@samsung.com>,
Daniel Stone <daniel@fooishbar.org>,
Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
Jeffrey Hugo <quic_jhugo@quicinc.com>,
Christoph Hellwig <hch@infradead.org>,
Kevin Hilman <khilman@baylibre.com>,
Jagan Teki <jagan@amarulasolutions.com>,
Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>,
Maciej Kwapulinski <maciej.kwapulinski@linux.intel.com>,
stanislaw.gruszka@intel.com
Subject: Re: [RFC PATCH v2 1/3] drivers/accel: define kconfig and register a new major
Date: Mon, 7 Nov 2022 10:10:07 -0400 [thread overview]
Message-ID: <Y2kRvyR8VrZrO/1H@nvidia.com> (raw)
In-Reply-To: <CAFCwf10A=-bj2nR8WasNxyQQ07D24Je04tzKxqv2X_XnA0BUSQ@mail.gmail.com>
On Mon, Nov 07, 2022 at 04:02:01PM +0200, Oded Gabbay wrote:
> On Mon, Nov 7, 2022 at 3:10 PM Jason Gunthorpe <jgg@nvidia.com> wrote:
> >
> > On Mon, Nov 07, 2022 at 03:01:08PM +0200, Oded Gabbay wrote:
> > > I don't agree with your statement that it should be "a layer over top of DRM".
> > > Anything on top of DRM is a device driver.
> > > Accel is not a device driver, it is a new type of drm minor / drm driver.
> >
> > Yeah, I still think this is not the right way, you are getting almost
> > nothing from DRM and making everything more complicated in the
> > process.
> >
> > > The only alternative imo to that is to abandon the idea of reusing
> > > drm, and just make an independant accel core code.
> >
> > Not quite really, layer it properly and librarize parts of DRM into
> > things accel can re-use so they are not intimately tied to the DRM
> > struct device notion.
> >
> > IMHO this is much better, because accel has very little need of DRM to
> > manage a struct device/cdev in the first place.
> >
> > Jason
> I'm not following. How can an accel device be a new type of drm_minor,
> if it doesn't have access to all its functions and members ?
"drm_minor" is not necessary anymore. Strictly managing minor numbers
lost its value years ago when /dev/ was reorganized. Just use
dynamic minors fully.
> How will accel device leverage, for example, the GEM code without
> being a drm_minor ?
Split GEM into a library so it doesn't require that.
> Librarizing parts of DRM sounds nice in theory but the reality is that
> everything there is interconnected, all the structures are
> interdependent.
Yes, the kernel is full of stuff that needs improving. Let's not take
shortcuts.
> I would have to re-write the entire DRM library to make such a thing
> work. I don't think this was the intention.
Not necessarily you, whoever someday needs GEM would have to do some
work.
> The current design makes the accel device an integral part of drm,
> with very minimal code duplication and without re-writing DRM.
And it smells bad, you can't even make it into a proper module. Who
knows what other problems will come.
Jason
next prev parent reply other threads:[~2022-11-07 14:10 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-02 20:34 [RFC PATCH v2 0/3] new subsystem for compute accelerator devices Oded Gabbay
2022-11-02 20:34 ` Oded Gabbay
2022-11-02 20:34 ` [RFC PATCH v2 1/3] drivers/accel: define kconfig and register a new major Oded Gabbay
2022-11-02 20:34 ` Oded Gabbay
2022-11-02 21:04 ` Jeffrey Hugo
2022-11-02 21:04 ` Jeffrey Hugo
2022-11-03 13:28 ` Oded Gabbay
2022-11-03 13:28 ` Oded Gabbay
2022-11-02 22:58 ` Randy Dunlap
2022-11-02 22:58 ` Randy Dunlap
2022-11-03 13:29 ` Oded Gabbay
2022-11-03 13:29 ` Oded Gabbay
2022-11-03 0:32 ` Greg Kroah-Hartman
2022-11-03 0:32 ` Greg Kroah-Hartman
2022-11-03 13:31 ` Oded Gabbay
2022-11-03 13:31 ` Oded Gabbay
2022-11-03 20:39 ` Oded Gabbay
2022-11-03 20:39 ` Oded Gabbay
2022-11-03 23:01 ` Randy Dunlap
2022-11-03 23:01 ` Randy Dunlap
2022-11-04 7:23 ` Stanislaw Gruszka
2022-11-04 7:23 ` Stanislaw Gruszka
2022-11-07 12:56 ` Jason Gunthorpe
2022-11-07 12:56 ` Jason Gunthorpe
2022-11-07 13:01 ` Oded Gabbay
2022-11-07 13:01 ` Oded Gabbay
2022-11-07 13:10 ` Jason Gunthorpe
2022-11-07 13:10 ` Jason Gunthorpe
2022-11-07 13:25 ` Stanislaw Gruszka
2022-11-07 13:25 ` Stanislaw Gruszka
2022-11-07 14:02 ` Oded Gabbay
2022-11-07 14:02 ` Oded Gabbay
2022-11-07 14:10 ` Jason Gunthorpe [this message]
2022-11-07 14:10 ` Jason Gunthorpe
2022-11-07 15:53 ` Oded Gabbay
2022-11-07 15:53 ` Oded Gabbay
2022-11-07 16:30 ` Jason Gunthorpe
2022-11-07 16:30 ` Jason Gunthorpe
2022-11-07 19:27 ` Oded Gabbay
2022-11-07 19:27 ` Oded Gabbay
2022-11-07 20:33 ` Dave Airlie
2022-11-07 20:33 ` Dave Airlie
2022-11-08 12:28 ` Jason Gunthorpe
2022-11-08 12:28 ` Jason Gunthorpe
2022-11-09 7:22 ` Dave Airlie
2022-11-09 7:22 ` Dave Airlie
2022-11-07 20:18 ` Dave Airlie
2022-11-07 20:18 ` Dave Airlie
2022-11-02 20:34 ` [RFC PATCH v2 2/3] accel: add dedicated minor for accelerator devices Oded Gabbay
2022-11-02 20:34 ` Oded Gabbay
2022-11-02 21:17 ` Jeffrey Hugo
2022-11-02 21:17 ` Jeffrey Hugo
2022-11-06 10:51 ` Oded Gabbay
2022-11-06 10:51 ` Oded Gabbay
2022-11-03 5:25 ` Jiho Chu
2022-11-03 5:25 ` Jiho Chu
2022-11-06 10:54 ` Oded Gabbay
2022-11-06 10:54 ` Oded Gabbay
2022-11-06 14:15 ` Oded Gabbay
2022-11-06 14:15 ` Oded Gabbay
2022-11-02 20:34 ` [RFC PATCH v2 3/3] drm: initialize accel framework Oded Gabbay
2022-11-02 20:34 ` Oded Gabbay
2022-11-02 21:30 ` Jeffrey Hugo
2022-11-02 21:30 ` Jeffrey Hugo
2022-11-06 10:55 ` Oded Gabbay
2022-11-06 10:55 ` Oded Gabbay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y2kRvyR8VrZrO/1H@nvidia.com \
--to=jgg@nvidia.com \
--cc=alexander.deucher@amd.com \
--cc=arnd@arndb.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=hch@infradead.org \
--cc=jacek.lawrynowicz@linux.intel.com \
--cc=jagan@amarulasolutions.com \
--cc=jhubbard@nvidia.com \
--cc=jiho.chu@samsung.com \
--cc=khilman@baylibre.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.kwapulinski@linux.intel.com \
--cc=ogabbay@kernel.org \
--cc=quic_jhugo@quicinc.com \
--cc=stanislaw.gruszka@intel.com \
--cc=tvrtko.ursulin@linux.intel.com \
--cc=tzimmermann@suse.de \
--cc=yuji2.ishikawa@toshiba.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.