All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] Document drm_mode_get_plane
@ 2021-06-09 23:00 Leandro Ribeiro
  2021-06-09 23:00 ` [PATCH v4 1/2] drm/doc: document how userspace should find out CRTC index Leandro Ribeiro
  2021-06-09 23:00 ` [PATCH v4 2/2] drm/doc: document drm_mode_get_plane Leandro Ribeiro
  0 siblings, 2 replies; 8+ messages in thread
From: Leandro Ribeiro @ 2021-06-09 23:00 UTC (permalink / raw)
  To: dri-devel; +Cc: airlied, pekka.paalanen, kernel

v2: possible_crtcs field is a bitmask, not a pointer. Suggested by
Ville Syrjälä <ville.syrjala@linux.intel.com>

v3: document how userspace should find out CRTC index. Also,
document that field 'gamma_size' represents the number of
entries in the lookup table. Suggested by Pekka Paalanen
<ppaalanen@gmail.com> and Daniel Vetter <daniel@ffwll.ch>

v4: document IN and OUT fields and make the description more
concise. Suggested by Pekka Paalanen <ppaalanen@gmail.com>

Leandro Ribeiro (2):
  drm/doc: document how userspace should find out CRTC index
  drm/doc: document drm_mode_get_plane

 Documentation/gpu/drm-uapi.rst    | 13 +++++++++++
 drivers/gpu/drm/drm_debugfs_crc.c |  8 +++----
 include/uapi/drm/drm.h            |  4 ++--
 include/uapi/drm/drm_mode.h       | 36 +++++++++++++++++++++++++++++++
 4 files changed, 55 insertions(+), 6 deletions(-)

--
2.31.1


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

* [PATCH v4 1/2] drm/doc: document how userspace should find out CRTC index
  2021-06-09 23:00 [PATCH v4 0/2] Document drm_mode_get_plane Leandro Ribeiro
@ 2021-06-09 23:00 ` Leandro Ribeiro
  2021-06-10  8:27   ` Pekka Paalanen
  2021-06-09 23:00 ` [PATCH v4 2/2] drm/doc: document drm_mode_get_plane Leandro Ribeiro
  1 sibling, 1 reply; 8+ messages in thread
From: Leandro Ribeiro @ 2021-06-09 23:00 UTC (permalink / raw)
  To: dri-devel; +Cc: airlied, pekka.paalanen, kernel

In this patch we add a section to document what userspace should do to
find out the CRTC index. This is important as they may be many places in
the documentation that need this, so it's better to just point to this
section and avoid repetition.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
---
 Documentation/gpu/drm-uapi.rst    | 13 +++++++++++++
 drivers/gpu/drm/drm_debugfs_crc.c |  8 ++++----
 include/uapi/drm/drm.h            |  4 ++--
 3 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/Documentation/gpu/drm-uapi.rst b/Documentation/gpu/drm-uapi.rst
index 04bdc7a91d53..7e51dd40bf6e 100644
--- a/Documentation/gpu/drm-uapi.rst
+++ b/Documentation/gpu/drm-uapi.rst
@@ -457,6 +457,19 @@ Userspace API Structures
 .. kernel-doc:: include/uapi/drm/drm_mode.h
    :doc: overview

+.. _crtc_index:
+
+CRTC index
+----------
+
+CRTC's have both an object ID and an index, and they are not the same thing.
+The index is used in cases where a densely packed identifier for a CRTC is
+needed, for instance a bitmask of CRTC's. The member possible_crtcs of struct
+drm_mode_get_plane is an example.
+
+DRM_IOCTL_MODE_GETRESOURCES populates a structure with an array of CRTC ID's,
+and the CRTC index is its position in this array.
+
 .. kernel-doc:: include/uapi/drm/drm.h
    :internal:

diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c
index 3dd70d813f69..bbc3bc4ba844 100644
--- a/drivers/gpu/drm/drm_debugfs_crc.c
+++ b/drivers/gpu/drm/drm_debugfs_crc.c
@@ -46,10 +46,10 @@
  * it reached a given hardware component (a CRC sampling "source").
  *
  * Userspace can control generation of CRCs in a given CRTC by writing to the
- * file dri/0/crtc-N/crc/control in debugfs, with N being the index of the CRTC.
- * Accepted values are source names (which are driver-specific) and the "auto"
- * keyword, which will let the driver select a default source of frame CRCs
- * for this CRTC.
+ * file dri/0/crtc-N/crc/control in debugfs, with N being the :ref:`index of
+ * the CRTC<crtc_index>`. Accepted values are source names (which are
+ * driver-specific) and the "auto" keyword, which will let the driver select a
+ * default source of frame CRCs for this CRTC.
  *
  * Once frame CRC generation is enabled, userspace can capture them by reading
  * the dri/0/crtc-N/crc/data file. Each line in that file contains the frame
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 67b94bc3c885..bbf4e76daa55 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -635,8 +635,8 @@ struct drm_gem_open {
 /**
  * DRM_CAP_VBLANK_HIGH_CRTC
  *
- * If set to 1, the kernel supports specifying a CRTC index in the high bits of
- * &drm_wait_vblank_request.type.
+ * If set to 1, the kernel supports specifying a :ref:`CRTC index<crtc_index>`
+ * in the high bits of &drm_wait_vblank_request.type.
  *
  * Starting kernel version 2.6.39, this capability is always set to 1.
  */
--
2.31.1


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

* [PATCH v4 2/2] drm/doc: document drm_mode_get_plane
  2021-06-09 23:00 [PATCH v4 0/2] Document drm_mode_get_plane Leandro Ribeiro
  2021-06-09 23:00 ` [PATCH v4 1/2] drm/doc: document how userspace should find out CRTC index Leandro Ribeiro
@ 2021-06-09 23:00 ` Leandro Ribeiro
  2021-06-09 23:05   ` Leandro Ribeiro
  2021-06-10 12:53   ` Ville Syrjälä
  1 sibling, 2 replies; 8+ messages in thread
From: Leandro Ribeiro @ 2021-06-09 23:00 UTC (permalink / raw)
  To: dri-devel; +Cc: airlied, pekka.paalanen, kernel

Add a small description and document struct fields of
drm_mode_get_plane.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
---
 include/uapi/drm/drm_mode.h | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index a5e76aa06ad5..67bcd8e1931c 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -312,16 +312,52 @@ struct drm_mode_set_plane {
 	__u32 src_w;
 };

+/**
+ * struct drm_mode_get_plane - Get plane metadata.
+ *
+ * Userspace can perform a GETPLANE ioctl to retrieve information about a
+ * plane.
+ *
+ * To retrieve the number of formats supported, set @count_format_types to zero
+ * and call the ioctl. @count_format_types will be updated with the value.
+ *
+ * To retrieve these formats, allocate an array with the memory needed to store
+ * @count_format_types formats. Point @format_type_ptr to this array and call
+ * the ioctl again (with @count_format_types still set to the value returned in
+ * the first ioctl call).
+ *
+ * Between one ioctl and the other, the number of formats may change.
+ * Userspace should retry the last ioctl until this number stabilizes. The
+ * kernel won't fill any array which doesn't have the expected length.
+ */
 struct drm_mode_get_plane {
+	/**
+	 * @plane_id: Object ID of the plane whose information should be
+	 * retrieved. Set by caller.
+	 */
 	__u32 plane_id;

+	/** @crtc_id: Object ID of the current CRTC. */
 	__u32 crtc_id;
+	/** @fb_id: Object ID of the current fb. */
 	__u32 fb_id;

+	/**
+	 * @possible_crtcs: Bitmask of CRTC's compatible with the plane. CRTC's
+	 * are created and they receive an index, which corresponds to their
+	 * position in the bitmask. Bit N corresponds to
+	 * :ref:`CRTC index<crtc_index>` N.
+	 */
 	__u32 possible_crtcs;
+	/** @gamma_size: Number of entries of the legacy gamma lookup table. */
 	__u32 gamma_size;

+	/** @count_format_types: Number of formats. */
 	__u32 count_format_types;
+	/**
+	 * @format_type_ptr: Pointer to ``__u32`` array of formats that are
+	 * supported by the plane. These formats do not require modifiers.
+	 */
 	__u64 format_type_ptr;
 };

--
2.31.1


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

* Re: [PATCH v4 2/2] drm/doc: document drm_mode_get_plane
  2021-06-09 23:00 ` [PATCH v4 2/2] drm/doc: document drm_mode_get_plane Leandro Ribeiro
@ 2021-06-09 23:05   ` Leandro Ribeiro
  2021-06-10  8:36     ` Pekka Paalanen
  2021-06-10 12:53   ` Ville Syrjälä
  1 sibling, 1 reply; 8+ messages in thread
From: Leandro Ribeiro @ 2021-06-09 23:05 UTC (permalink / raw)
  To: dri-devel; +Cc: airlied, pekka.paalanen, kernel



On 6/9/21 8:00 PM, Leandro Ribeiro wrote:
> Add a small description and document struct fields of
> drm_mode_get_plane.
> 
> Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
> ---
>  include/uapi/drm/drm_mode.h | 36 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
> 
> diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
> index a5e76aa06ad5..67bcd8e1931c 100644
> --- a/include/uapi/drm/drm_mode.h
> +++ b/include/uapi/drm/drm_mode.h
> @@ -312,16 +312,52 @@ struct drm_mode_set_plane {
>  	__u32 src_w;
>  };
> 
> +/**
> + * struct drm_mode_get_plane - Get plane metadata.
> + *
> + * Userspace can perform a GETPLANE ioctl to retrieve information about a
> + * plane.
> + *
> + * To retrieve the number of formats supported, set @count_format_types to zero
> + * and call the ioctl. @count_format_types will be updated with the value.
> + *
> + * To retrieve these formats, allocate an array with the memory needed to store
> + * @count_format_types formats. Point @format_type_ptr to this array and call
> + * the ioctl again (with @count_format_types still set to the value returned in
> + * the first ioctl call).
> + *
> + * Between one ioctl and the other, the number of formats may change.
> + * Userspace should retry the last ioctl until this number stabilizes. The
> + * kernel won't fill any array which doesn't have the expected length.
> + */

Actually I don't know if this last paragraph applies. For connectors,
for instance, I can see this happening because of hot-plugging. But for
plane formats I have no idea. As in libdrm we have this algorithm, I've
decided to describe it here.

>  struct drm_mode_get_plane {
> +	/**
> +	 * @plane_id: Object ID of the plane whose information should be
> +	 * retrieved. Set by caller.
> +	 */
>  	__u32 plane_id;
> 
> +	/** @crtc_id: Object ID of the current CRTC. */
>  	__u32 crtc_id;
> +	/** @fb_id: Object ID of the current fb. */
>  	__u32 fb_id;
> 
> +	/**
> +	 * @possible_crtcs: Bitmask of CRTC's compatible with the plane. CRTC's
> +	 * are created and they receive an index, which corresponds to their
> +	 * position in the bitmask. Bit N corresponds to
> +	 * :ref:`CRTC index<crtc_index>` N.
> +	 */
>  	__u32 possible_crtcs;
> +	/** @gamma_size: Number of entries of the legacy gamma lookup table. */
>  	__u32 gamma_size;
> 
> +	/** @count_format_types: Number of formats. */
>  	__u32 count_format_types;
> +	/**
> +	 * @format_type_ptr: Pointer to ``__u32`` array of formats that are
> +	 * supported by the plane. These formats do not require modifiers.
> +	 */
>  	__u64 format_type_ptr;
>  };
> 
> --
> 2.31.1
> 
> 

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

* Re: [PATCH v4 1/2] drm/doc: document how userspace should find out CRTC index
  2021-06-09 23:00 ` [PATCH v4 1/2] drm/doc: document how userspace should find out CRTC index Leandro Ribeiro
@ 2021-06-10  8:27   ` Pekka Paalanen
  2021-06-10 17:17     ` Daniel Vetter
  0 siblings, 1 reply; 8+ messages in thread
From: Pekka Paalanen @ 2021-06-10  8:27 UTC (permalink / raw)
  To: Leandro Ribeiro; +Cc: airlied, kernel, dri-devel

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

On Wed,  9 Jun 2021 20:00:38 -0300
Leandro Ribeiro <leandro.ribeiro@collabora.com> wrote:

> In this patch we add a section to document what userspace should do to
> find out the CRTC index. This is important as they may be many places in
> the documentation that need this, so it's better to just point to this
> section and avoid repetition.
> 
> Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
> ---
>  Documentation/gpu/drm-uapi.rst    | 13 +++++++++++++
>  drivers/gpu/drm/drm_debugfs_crc.c |  8 ++++----
>  include/uapi/drm/drm.h            |  4 ++--
>  3 files changed, 19 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/gpu/drm-uapi.rst b/Documentation/gpu/drm-uapi.rst
> index 04bdc7a91d53..7e51dd40bf6e 100644
> --- a/Documentation/gpu/drm-uapi.rst
> +++ b/Documentation/gpu/drm-uapi.rst
> @@ -457,6 +457,19 @@ Userspace API Structures
>  .. kernel-doc:: include/uapi/drm/drm_mode.h
>     :doc: overview
> 
> +.. _crtc_index:
> +
> +CRTC index
> +----------
> +
> +CRTC's have both an object ID and an index, and they are not the same thing.
> +The index is used in cases where a densely packed identifier for a CRTC is
> +needed, for instance a bitmask of CRTC's. The member possible_crtcs of struct
> +drm_mode_get_plane is an example.
> +
> +DRM_IOCTL_MODE_GETRESOURCES populates a structure with an array of CRTC ID's,
> +and the CRTC index is its position in this array.
> +
>  .. kernel-doc:: include/uapi/drm/drm.h
>     :internal:
> 
> diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c
> index 3dd70d813f69..bbc3bc4ba844 100644
> --- a/drivers/gpu/drm/drm_debugfs_crc.c
> +++ b/drivers/gpu/drm/drm_debugfs_crc.c
> @@ -46,10 +46,10 @@
>   * it reached a given hardware component (a CRC sampling "source").
>   *
>   * Userspace can control generation of CRCs in a given CRTC by writing to the
> - * file dri/0/crtc-N/crc/control in debugfs, with N being the index of the CRTC.
> - * Accepted values are source names (which are driver-specific) and the "auto"
> - * keyword, which will let the driver select a default source of frame CRCs
> - * for this CRTC.
> + * file dri/0/crtc-N/crc/control in debugfs, with N being the :ref:`index of
> + * the CRTC<crtc_index>`. Accepted values are source names (which are
> + * driver-specific) and the "auto" keyword, which will let the driver select a
> + * default source of frame CRCs for this CRTC.
>   *
>   * Once frame CRC generation is enabled, userspace can capture them by reading
>   * the dri/0/crtc-N/crc/data file. Each line in that file contains the frame
> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> index 67b94bc3c885..bbf4e76daa55 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -635,8 +635,8 @@ struct drm_gem_open {
>  /**
>   * DRM_CAP_VBLANK_HIGH_CRTC
>   *
> - * If set to 1, the kernel supports specifying a CRTC index in the high bits of
> - * &drm_wait_vblank_request.type.
> + * If set to 1, the kernel supports specifying a :ref:`CRTC index<crtc_index>`
> + * in the high bits of &drm_wait_vblank_request.type.
>   *
>   * Starting kernel version 2.6.39, this capability is always set to 1.
>   */
> --
> 2.31.1
> 

Hi,

with the caveat that I didn't actually build the docs and see how they
look:

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


Thanks,
pq

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

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

* Re: [PATCH v4 2/2] drm/doc: document drm_mode_get_plane
  2021-06-09 23:05   ` Leandro Ribeiro
@ 2021-06-10  8:36     ` Pekka Paalanen
  0 siblings, 0 replies; 8+ messages in thread
From: Pekka Paalanen @ 2021-06-10  8:36 UTC (permalink / raw)
  To: Leandro Ribeiro; +Cc: airlied, kernel, dri-devel

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

On Wed, 9 Jun 2021 20:05:06 -0300
Leandro Ribeiro <leandro.ribeiro@collabora.com> wrote:

> On 6/9/21 8:00 PM, Leandro Ribeiro wrote:
> > Add a small description and document struct fields of
> > drm_mode_get_plane.
> > 
> > Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
> > ---
> >  include/uapi/drm/drm_mode.h | 36 ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 36 insertions(+)
> > 
> > diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
> > index a5e76aa06ad5..67bcd8e1931c 100644
> > --- a/include/uapi/drm/drm_mode.h
> > +++ b/include/uapi/drm/drm_mode.h
> > @@ -312,16 +312,52 @@ struct drm_mode_set_plane {
> >  	__u32 src_w;
> >  };
> > 
> > +/**
> > + * struct drm_mode_get_plane - Get plane metadata.
> > + *
> > + * Userspace can perform a GETPLANE ioctl to retrieve information about a
> > + * plane.
> > + *
> > + * To retrieve the number of formats supported, set @count_format_types to zero
> > + * and call the ioctl. @count_format_types will be updated with the value.
> > + *
> > + * To retrieve these formats, allocate an array with the memory needed to store
> > + * @count_format_types formats. Point @format_type_ptr to this array and call
> > + * the ioctl again (with @count_format_types still set to the value returned in
> > + * the first ioctl call).
> > + *
> > + * Between one ioctl and the other, the number of formats may change.
> > + * Userspace should retry the last ioctl until this number stabilizes. The
> > + * kernel won't fill any array which doesn't have the expected length.
> > + */  
> 
> Actually I don't know if this last paragraph applies. For connectors,
> for instance, I can see this happening because of hot-plugging. But for
> plane formats I have no idea. As in libdrm we have this algorithm, I've
> decided to describe it here.

Hi,

I think it's fine.

However, the sentence "The kernel won't fill any array which doesn't
have the expected length." seems to be inaccurate, reading the code of
drm_mode_getplane(). It looks like it is enough for the array to have
sufficient space, it does not need to be the exact size.

So the libdrm algorithm may be slightly too pedantic, but it shouldn't
hurt.

Otherwise looks really good.


Thanks,
pq


> >  struct drm_mode_get_plane {
> > +	/**
> > +	 * @plane_id: Object ID of the plane whose information should be
> > +	 * retrieved. Set by caller.
> > +	 */
> >  	__u32 plane_id;
> > 
> > +	/** @crtc_id: Object ID of the current CRTC. */
> >  	__u32 crtc_id;
> > +	/** @fb_id: Object ID of the current fb. */
> >  	__u32 fb_id;
> > 
> > +	/**
> > +	 * @possible_crtcs: Bitmask of CRTC's compatible with the plane. CRTC's
> > +	 * are created and they receive an index, which corresponds to their
> > +	 * position in the bitmask. Bit N corresponds to
> > +	 * :ref:`CRTC index<crtc_index>` N.
> > +	 */
> >  	__u32 possible_crtcs;
> > +	/** @gamma_size: Number of entries of the legacy gamma lookup table. */
> >  	__u32 gamma_size;
> > 
> > +	/** @count_format_types: Number of formats. */
> >  	__u32 count_format_types;
> > +	/**
> > +	 * @format_type_ptr: Pointer to ``__u32`` array of formats that are
> > +	 * supported by the plane. These formats do not require modifiers.
> > +	 */
> >  	__u64 format_type_ptr;
> >  };
> > 
> > --
> > 2.31.1
> > 
> >   


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

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

* Re: [PATCH v4 2/2] drm/doc: document drm_mode_get_plane
  2021-06-09 23:00 ` [PATCH v4 2/2] drm/doc: document drm_mode_get_plane Leandro Ribeiro
  2021-06-09 23:05   ` Leandro Ribeiro
@ 2021-06-10 12:53   ` Ville Syrjälä
  1 sibling, 0 replies; 8+ messages in thread
From: Ville Syrjälä @ 2021-06-10 12:53 UTC (permalink / raw)
  To: Leandro Ribeiro; +Cc: airlied, pekka.paalanen, kernel, dri-devel

On Wed, Jun 09, 2021 at 08:00:39PM -0300, Leandro Ribeiro wrote:
> Add a small description and document struct fields of
> drm_mode_get_plane.
> 
> Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
> ---
>  include/uapi/drm/drm_mode.h | 36 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
> 
> diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
> index a5e76aa06ad5..67bcd8e1931c 100644
> --- a/include/uapi/drm/drm_mode.h
> +++ b/include/uapi/drm/drm_mode.h
> @@ -312,16 +312,52 @@ struct drm_mode_set_plane {
>  	__u32 src_w;
>  };
> 
> +/**
> + * struct drm_mode_get_plane - Get plane metadata.
> + *
> + * Userspace can perform a GETPLANE ioctl to retrieve information about a
> + * plane.
> + *
> + * To retrieve the number of formats supported, set @count_format_types to zero
> + * and call the ioctl. @count_format_types will be updated with the value.
> + *
> + * To retrieve these formats, allocate an array with the memory needed to store
> + * @count_format_types formats. Point @format_type_ptr to this array and call
> + * the ioctl again (with @count_format_types still set to the value returned in
> + * the first ioctl call).
> + *
> + * Between one ioctl and the other, the number of formats may change.

Can't happen.

> + * Userspace should retry the last ioctl until this number stabilizes. The
> + * kernel won't fill any array which doesn't have the expected length.
> + */
>  struct drm_mode_get_plane {
> +	/**
> +	 * @plane_id: Object ID of the plane whose information should be
> +	 * retrieved. Set by caller.
> +	 */
>  	__u32 plane_id;
> 
> +	/** @crtc_id: Object ID of the current CRTC. */
>  	__u32 crtc_id;
> +	/** @fb_id: Object ID of the current fb. */
>  	__u32 fb_id;
> 
> +	/**
> +	 * @possible_crtcs: Bitmask of CRTC's compatible with the plane. CRTC's
> +	 * are created and they receive an index, which corresponds to their
> +	 * position in the bitmask. Bit N corresponds to
> +	 * :ref:`CRTC index<crtc_index>` N.
> +	 */
>  	__u32 possible_crtcs;
> +	/** @gamma_size: Number of entries of the legacy gamma lookup table. */
>  	__u32 gamma_size;

Should be marked deprecated. There is no plane gamma in the current uapi.

> 
> +	/** @count_format_types: Number of formats. */
>  	__u32 count_format_types;
> +	/**
> +	 * @format_type_ptr: Pointer to ``__u32`` array of formats that are
> +	 * supported by the plane. These formats do not require modifiers.
> +	 */
>  	__u64 format_type_ptr;
>  };
> 
> --
> 2.31.1

-- 
Ville Syrjälä
Intel

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

* Re: [PATCH v4 1/2] drm/doc: document how userspace should find out CRTC index
  2021-06-10  8:27   ` Pekka Paalanen
@ 2021-06-10 17:17     ` Daniel Vetter
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Vetter @ 2021-06-10 17:17 UTC (permalink / raw)
  To: Pekka Paalanen; +Cc: airlied, kernel, dri-devel, Leandro Ribeiro

On Thu, Jun 10, 2021 at 11:27:42AM +0300, Pekka Paalanen wrote:
> On Wed,  9 Jun 2021 20:00:38 -0300
> Leandro Ribeiro <leandro.ribeiro@collabora.com> wrote:
> 
> > In this patch we add a section to document what userspace should do to
> > find out the CRTC index. This is important as they may be many places in
> > the documentation that need this, so it's better to just point to this
> > section and avoid repetition.
> > 
> > Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
> > ---
> >  Documentation/gpu/drm-uapi.rst    | 13 +++++++++++++
> >  drivers/gpu/drm/drm_debugfs_crc.c |  8 ++++----
> >  include/uapi/drm/drm.h            |  4 ++--
> >  3 files changed, 19 insertions(+), 6 deletions(-)
> > 
> > diff --git a/Documentation/gpu/drm-uapi.rst b/Documentation/gpu/drm-uapi.rst
> > index 04bdc7a91d53..7e51dd40bf6e 100644
> > --- a/Documentation/gpu/drm-uapi.rst
> > +++ b/Documentation/gpu/drm-uapi.rst
> > @@ -457,6 +457,19 @@ Userspace API Structures
> >  .. kernel-doc:: include/uapi/drm/drm_mode.h
> >     :doc: overview
> > 
> > +.. _crtc_index:
> > +
> > +CRTC index
> > +----------
> > +
> > +CRTC's have both an object ID and an index, and they are not the same thing.
> > +The index is used in cases where a densely packed identifier for a CRTC is
> > +needed, for instance a bitmask of CRTC's. The member possible_crtcs of struct
> > +drm_mode_get_plane is an example.
> > +
> > +DRM_IOCTL_MODE_GETRESOURCES populates a structure with an array of CRTC ID's,
> > +and the CRTC index is its position in this array.
> > +
> >  .. kernel-doc:: include/uapi/drm/drm.h
> >     :internal:
> > 
> > diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c
> > index 3dd70d813f69..bbc3bc4ba844 100644
> > --- a/drivers/gpu/drm/drm_debugfs_crc.c
> > +++ b/drivers/gpu/drm/drm_debugfs_crc.c
> > @@ -46,10 +46,10 @@
> >   * it reached a given hardware component (a CRC sampling "source").
> >   *
> >   * Userspace can control generation of CRCs in a given CRTC by writing to the
> > - * file dri/0/crtc-N/crc/control in debugfs, with N being the index of the CRTC.
> > - * Accepted values are source names (which are driver-specific) and the "auto"
> > - * keyword, which will let the driver select a default source of frame CRCs
> > - * for this CRTC.
> > + * file dri/0/crtc-N/crc/control in debugfs, with N being the :ref:`index of
> > + * the CRTC<crtc_index>`. Accepted values are source names (which are
> > + * driver-specific) and the "auto" keyword, which will let the driver select a
> > + * default source of frame CRCs for this CRTC.
> >   *
> >   * Once frame CRC generation is enabled, userspace can capture them by reading
> >   * the dri/0/crtc-N/crc/data file. Each line in that file contains the frame
> > diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> > index 67b94bc3c885..bbf4e76daa55 100644
> > --- a/include/uapi/drm/drm.h
> > +++ b/include/uapi/drm/drm.h
> > @@ -635,8 +635,8 @@ struct drm_gem_open {
> >  /**
> >   * DRM_CAP_VBLANK_HIGH_CRTC
> >   *
> > - * If set to 1, the kernel supports specifying a CRTC index in the high bits of
> > - * &drm_wait_vblank_request.type.
> > + * If set to 1, the kernel supports specifying a :ref:`CRTC index<crtc_index>`
> > + * in the high bits of &drm_wait_vblank_request.type.
> >   *
> >   * Starting kernel version 2.6.39, this capability is always set to 1.
> >   */
> > --
> > 2.31.1
> > 
> 
> Hi,
> 
> with the caveat that I didn't actually build the docs and see how they
> look:
> 
> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>

Pushed to drm-misc-next, thanks for the patch&review.
-Daniel

> 
> 
> Thanks,
> pq



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

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

end of thread, other threads:[~2021-06-10 17:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 23:00 [PATCH v4 0/2] Document drm_mode_get_plane Leandro Ribeiro
2021-06-09 23:00 ` [PATCH v4 1/2] drm/doc: document how userspace should find out CRTC index Leandro Ribeiro
2021-06-10  8:27   ` Pekka Paalanen
2021-06-10 17:17     ` Daniel Vetter
2021-06-09 23:00 ` [PATCH v4 2/2] drm/doc: document drm_mode_get_plane Leandro Ribeiro
2021-06-09 23:05   ` Leandro Ribeiro
2021-06-10  8:36     ` Pekka Paalanen
2021-06-10 12:53   ` Ville Syrjälä

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.