dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm: document DRM_IOCTL_MODE_RMFB
@ 2021-07-26  7:50 Simon Ser
  2021-07-27  8:09 ` Pekka Paalanen
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Ser @ 2021-07-26  7:50 UTC (permalink / raw)
  To: dri-devel; +Cc: Daniel Vetter, Pekka Paalanen, Leandro Ribeiro

Since there's no struct to attach the docs to, document the IOCTL
definition.

Signed-off-by: Simon Ser <contact@emersion.fr>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Pekka Paalanen <pekka.paalanen@collabora.com>
Cc: Leandro Ribeiro <leandro.ribeiro@collabora.com>
---
 include/uapi/drm/drm.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index e1f49dd241f7..283d61d5a243 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -1050,6 +1050,16 @@ extern "C" {
 #define DRM_IOCTL_MODE_GETPROPBLOB	DRM_IOWR(0xAC, struct drm_mode_get_blob)
 #define DRM_IOCTL_MODE_GETFB		DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
 #define DRM_IOCTL_MODE_ADDFB		DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
+/**
+ * DRM_IOCTL_MODE_RMFB - Remove a framebuffer.
+ *
+ * This removes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL
+ * argument is a framebuffer object ID.
+ *
+ * Warning: removing a framebuffer currently in-use on an enabled plane will
+ * disable that plane. If the plane is primary, the CRTC may also be disabled
+ * (depending on driver capabilities).
+ */
 #define DRM_IOCTL_MODE_RMFB		DRM_IOWR(0xAF, unsigned int)
 #define DRM_IOCTL_MODE_PAGE_FLIP	DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip)
 #define DRM_IOCTL_MODE_DIRTYFB		DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd)
-- 
2.32.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: document DRM_IOCTL_MODE_RMFB
  2021-07-26  7:50 [PATCH] drm: document DRM_IOCTL_MODE_RMFB Simon Ser
@ 2021-07-27  8:09 ` Pekka Paalanen
  2021-07-27  9:42   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Pekka Paalanen @ 2021-07-27  8:09 UTC (permalink / raw)
  To: Simon Ser; +Cc: Daniel Vetter, Leandro Ribeiro, dri-devel

[-- Attachment #1: Type: text/plain, Size: 1992 bytes --]

On Mon, 26 Jul 2021 07:50:32 +0000
Simon Ser <contact@emersion.fr> wrote:

> Since there's no struct to attach the docs to, document the IOCTL
> definition.
> 
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Pekka Paalanen <pekka.paalanen@collabora.com>
> Cc: Leandro Ribeiro <leandro.ribeiro@collabora.com>
> ---
>  include/uapi/drm/drm.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> index e1f49dd241f7..283d61d5a243 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -1050,6 +1050,16 @@ extern "C" {
>  #define DRM_IOCTL_MODE_GETPROPBLOB	DRM_IOWR(0xAC, struct drm_mode_get_blob)
>  #define DRM_IOCTL_MODE_GETFB		DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
>  #define DRM_IOCTL_MODE_ADDFB		DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
> +/**
> + * DRM_IOCTL_MODE_RMFB - Remove a framebuffer.
> + *
> + * This removes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL
> + * argument is a framebuffer object ID.
> + *
> + * Warning: removing a framebuffer currently in-use on an enabled plane will
> + * disable that plane. If the plane is primary, the CRTC may also be disabled
> + * (depending on driver capabilities).

Hi,

I recall some discussions around having a CRTC running with only a
non-primary plane active. Maybe we should just drop the "If the plane
is primary," part to leave it more open.

I believe no-one should take advantage of RmFB turning a CRTC off. It's
just something that can happen, so userspace needs to be aware to avoid
it.

With or without that change:

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>


Thanks,
pq

> + */
>  #define DRM_IOCTL_MODE_RMFB		DRM_IOWR(0xAF, unsigned int)
>  #define DRM_IOCTL_MODE_PAGE_FLIP	DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip)
>  #define DRM_IOCTL_MODE_DIRTYFB		DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: document DRM_IOCTL_MODE_RMFB
  2021-07-27  8:09 ` Pekka Paalanen
@ 2021-07-27  9:42   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2021-07-27  9:42 UTC (permalink / raw)
  To: Pekka Paalanen; +Cc: Leandro Ribeiro, dri-devel, Daniel Vetter

On Tue, Jul 27, 2021 at 11:09:13AM +0300, Pekka Paalanen wrote:
> On Mon, 26 Jul 2021 07:50:32 +0000
> Simon Ser <contact@emersion.fr> wrote:
> 
> > Since there's no struct to attach the docs to, document the IOCTL
> > definition.
> > 
> > Signed-off-by: Simon Ser <contact@emersion.fr>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Cc: Pekka Paalanen <pekka.paalanen@collabora.com>
> > Cc: Leandro Ribeiro <leandro.ribeiro@collabora.com>
> > ---
> >  include/uapi/drm/drm.h | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> > index e1f49dd241f7..283d61d5a243 100644
> > --- a/include/uapi/drm/drm.h
> > +++ b/include/uapi/drm/drm.h
> > @@ -1050,6 +1050,16 @@ extern "C" {
> >  #define DRM_IOCTL_MODE_GETPROPBLOB	DRM_IOWR(0xAC, struct drm_mode_get_blob)
> >  #define DRM_IOCTL_MODE_GETFB		DRM_IOWR(0xAD, struct drm_mode_fb_cmd)
> >  #define DRM_IOCTL_MODE_ADDFB		DRM_IOWR(0xAE, struct drm_mode_fb_cmd)
> > +/**
> > + * DRM_IOCTL_MODE_RMFB - Remove a framebuffer.
> > + *
> > + * This removes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL
> > + * argument is a framebuffer object ID.
> > + *
> > + * Warning: removing a framebuffer currently in-use on an enabled plane will
> > + * disable that plane. If the plane is primary, the CRTC may also be disabled
> > + * (depending on driver capabilities).
> 
> Hi,
> 
> I recall some discussions around having a CRTC running with only a
> non-primary plane active. Maybe we should just drop the "If the plane
> is primary," part to leave it more open.

Yeah this wording is only correct for legacy drivers, for atomic ones we
can nuke the CRTC in any case if the plane disable fails to connect.
Legacy drivers just shrug (but there's none left with universal planes
anyway I think).

Also the atomic here isn't the userspace visible part, this is about
whether the driver is internally considered atomic.

tldr; Drop the primary plane qualifier like Pekka suggests, with that:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

-Daniel

> 
> I believe no-one should take advantage of RmFB turning a CRTC off. It's
> just something that can happen, so userspace needs to be aware to avoid
> it.
> 
> With or without that change:
> 
> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>
> 
> 
> Thanks,
> pq
> 
> > + */
> >  #define DRM_IOCTL_MODE_RMFB		DRM_IOWR(0xAF, unsigned int)
> >  #define DRM_IOCTL_MODE_PAGE_FLIP	DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip)
> >  #define DRM_IOCTL_MODE_DIRTYFB		DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd)
> 



-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-27  9:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-26  7:50 [PATCH] drm: document DRM_IOCTL_MODE_RMFB Simon Ser
2021-07-27  8:09 ` Pekka Paalanen
2021-07-27  9:42   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).