From: Daniel Vetter <daniel@ffwll.ch>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 01/19] drm/doc: Clarify the dumb object interfaces
Date: Thu, 23 Jan 2014 14:46:40 +0100 [thread overview]
Message-ID: <20140123134640.GX9772@phenom.ffwll.local> (raw)
In-Reply-To: <1805347.h4MtSGFZv1@avalon>
On Thu, Jan 23, 2014 at 01:56:51PM +0100, Laurent Pinchart wrote:
> > > > <para>
> > > > Drivers must first validate the requested frame buffer
> > > > parameters passed
> > > > @@ -1052,6 +998,71 @@ int max_width, max_height;</synopsis>
> > > > <function>drm_framebuffer_unregister_private</function>.
> > > > </sect2>
> > > > <sect2>
> > > > + <title>Dumb GEM Objects</title>
> > > > + <para>
> > > > + The KMS API doesn't standardize backing storage object creation and
> > >
> > > Strictly speaking isn't it the DRM API that's responsible for memory
> > > management, not the KMS API ?
> >
> > The driver's private api is responsible for memory management, but the
> > crucial thing here is that the KMS ioctls don't mandate anything specific
> > (beyong that it needs to use uint32_t for handles).
>
> Sure, but my point was that I believe memory management is the responsibility
> of DRM, not KMS. It of course needs to be driver-specific.
Well imo the dumb ioctls are part of kms. DRM itself doesn't have any
memory management interfaces (at least if you ignore all the horror
stories around legacy ums/dri1 drivers). My reasons are:
- If you implement a kms driver you really should implement the dumb
interfaces. Even when you have almost no memory management like the
simpledrm driver.
- If you have a driver with memory management and command submission but
no KMS, there's no reason at all to implement the dumb interfaces.
- ARM people abused dumb buffers for accelaration "because it worked", so
imo moving it's documentation as far away as possible from the memory
management section is a feature.
So the dumb stuff is a KMS interface to abstract away the lowest common
denominator between all kms drivers. Actually memory manament needs a real
interface, and is obviously separate.
> > > > + leaves it to driver-specific ioctls. Furthermore actually creating a
> > > > + buffer object even for GEM-based drivers is done through a
> > > > + driver-specific ioctl - GEM only has a common userspace interface for
> > > > + sharing and destroying objects. While not an issue for full-fledged
> > > > + graphics stacks that include device-specific userspace components (in
> > > > + libdrm for instance), this limit makes DRM-based early boot graphics
> > > > + unnecessarily complex.
> > > > + </para>
> > >
> > > This feels a bit out of place, can't we leave the section where it was ?
> >
> > Imo the justification for why we have the dumb ioctls should be here. And
> > I wanted to mention both that KMS doesn't mandate a particular bo
> > interface like GEM and that on top GEM wouldn't even provide a common
> > allocation function anyway.
>
> I agree that a justification here is a good idea, but I would just add one
> paragraph that references the dumb GEM objects section instead of scattering
> GEM documentation around.
I've pretty much removed all mention of dumb gem objects ;-) There's one
mention of dumb_create left in the GEM/memory management section, but that
one is just an example for the lifetime and reference counting rules. So
not relevant.
>
> > But besides that I think there's some room for improvement in the GEM
> > section to clarify what is the actual core interfaces, what is more helper
> > library in nature and what in GEM is more just a common design pattern for
> > driver ioctls but not specified in a mandatory way anywhere. E.g. atm all
> > drivers which implement a GEM interface (radeon, i915, ...) have a mostly
> > implicitly synchronizing buffer access interface, but there's nothing in
> > GEM mandating this. Or the usual confusing between TTM directly exposed to
> > userspace and TTM hidden behind a GEM-based ioctl interface.
>
> I agree, the GEM section should be improved, and TTM documentation would be
> nice as well. I'm lacking time though (as well as knowledge about TTM).
I have a few ideas, but I think I'll postpone this until I get around to
documenting the i915 GEM code a bit. Having a concrete driver to talk
about should help greatly to separate common concepts from artifacts of
the i915 implementation. I guess that review will also lead to some abi
cleanups to remove i915-ism from core gem.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2014-01-23 13:46 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-23 8:52 [PATCH 00/19] DRM developer's guide polish, part 1 Daniel Vetter
2014-01-23 8:52 ` [PATCH 01/19] drm/doc: Clarify the dumb object interfaces Daniel Vetter
2014-01-23 9:14 ` David Herrmann
2014-01-23 11:30 ` Laurent Pinchart
2014-01-23 12:48 ` [PATCH] " Daniel Vetter
2014-01-23 13:30 ` Laurent Pinchart
2014-01-23 13:50 ` Daniel Vetter
2014-01-24 11:13 ` Laurent Pinchart
2014-01-24 16:53 ` Daniel Vetter
2014-01-24 16:58 ` Daniel Vetter
2014-01-24 19:56 ` Dieter Nützel
2014-01-26 22:59 ` Laurent Pinchart
2014-01-23 11:21 ` [PATCH 01/19] " Laurent Pinchart
2014-01-23 12:47 ` Daniel Vetter
2014-01-23 12:56 ` Laurent Pinchart
2014-01-23 13:46 ` Daniel Vetter [this message]
2014-01-24 11:08 ` Laurent Pinchart
2014-01-24 16:49 ` Daniel Vetter
2014-01-23 8:52 ` [PATCH 02/19] drm/doc: Fix up kerneldoc in drm_edid.c Daniel Vetter
2014-01-23 8:52 ` [PATCH 03/19] drm/doc: Clean up and integrate kerneldoc for drm_gem.c Daniel Vetter
2014-01-23 9:21 ` David Herrmann
2014-01-23 9:39 ` Daniel Vetter
2014-01-23 8:52 ` [PATCH 04/19] drm/doc: Remove <term> from rendernode docs Daniel Vetter
2014-01-23 8:52 ` [PATCH 05/19] drm/doc: Reorganize driver documentation Daniel Vetter
2014-01-23 8:52 ` [PATCH 06/19] drm/doc: Move the vma offset manager to the right spot Daniel Vetter
2014-01-23 8:52 ` [PATCH 07/19] drm/doc: Remove the "command submissin and fencing" section Daniel Vetter
2014-01-23 8:52 ` [PATCH 08/19] drm/doc: No more drm perf counters Daniel Vetter
2014-01-23 8:52 ` [PATCH 09/19] drm/doc: Document drm_helper_resume_force_mode Daniel Vetter
2014-01-23 8:52 ` [PATCH 10/19] drm/doc: Hide legacy horrors better Daniel Vetter
2014-01-23 8:52 ` [PATCH 11/19] drm/docs: Include hdmi infoframe helper reference Daniel Vetter
2014-01-23 8:52 ` [PATCH 12/19] drm/doc: Clarify PRIME documentation Daniel Vetter
2014-01-23 8:52 ` [PATCH 13/19] drm/doc: Add PRIME function references Daniel Vetter
2014-01-23 9:28 ` David Herrmann
2014-01-23 9:37 ` Daniel Vetter
2014-01-23 9:45 ` David Herrmann
2014-01-23 9:58 ` Daniel Vetter
2014-01-23 8:52 ` [PATCH 14/19] drm/doc: Update copyright Daniel Vetter
2014-01-23 8:52 ` [PATCH 15/19] drm/mm: Remove MM_UNUSED_TARGET Daniel Vetter
2014-01-23 8:52 ` [PATCH 16/19] drm/doc: Overview documentation for drm_mm.c Daniel Vetter
2014-01-23 8:52 ` [PATCH 17/19] drm/doc: Add fucntion reference " Daniel Vetter
2014-01-23 8:52 ` [PATCH 18/19] drm/kms: rip out drm_mode_connector_detach_encoder Daniel Vetter
2014-01-23 8:52 ` [PATCH 19/19] drm/kms: don't export drm_mode_group_init_legacy_group Daniel Vetter
2014-01-23 9:42 ` David Herrmann
2014-01-23 10:00 ` Daniel Vetter
2014-01-23 10:05 ` Russell King - ARM Linux
2014-01-23 12:51 ` Daniel Vetter
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=20140123134640.GX9772@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox