dri-devel Archive mirror
 help / color / mirror / Atom feed
From: Pekka Paalanen <ppaalanen@gmail.com>
To: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Cc: airlied@linux.ie, kernel@collabora.com, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4 1/2] drm/doc: document how userspace should find out CRTC index
Date: Thu, 10 Jun 2021 11:27:42 +0300	[thread overview]
Message-ID: <20210610112742.17d21f7c@eldfell> (raw)
In-Reply-To: <20210609230039.73307-2-leandro.ribeiro@collabora.com>

[-- 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 --]

  reply	other threads:[~2021-06-10  8:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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ä

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=20210610112742.17d21f7c@eldfell \
    --to=ppaalanen@gmail.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel@collabora.com \
    --cc=leandro.ribeiro@collabora.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).