public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Rodrigo Vivi <rodrigo.vivi@kernel.org>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 05/24] drm/i915/vma: fix struct i915_vma_bindinfo kernel-doc
Date: Thu, 04 May 2023 12:43:05 +0300	[thread overview]
Message-ID: <87a5ykzb2u.fsf@intel.com> (raw)
In-Reply-To: <ZFJsFsBPp/HS8I0k@rdvivi-mobl4>

On Wed, 03 May 2023, Rodrigo Vivi <rodrigo.vivi@kernel.org> wrote:
> On Tue, May 02, 2023 at 06:37:22PM +0300, Jani Nikula wrote:
>> You can't document both a sub-struct type and a struct member at the
>> same time. Separate them.
>
> another way would be to kill the 'i915_vma_bindinfo' name entirely and
> document only as '@bi:' and then move the individual documentations near
> their definitions.

I don't think that will work, because AFAIK kernel-doc does not descend
into struct members recursively.

You can either declare and document the sub-structs as separate types
(the patch at hand), or you can document sub-struct members directly
from the embedding struct as shown below. I don't think the latter is
very nice.

BR,
Jani.


index 2053c037dbfb..ee767cc4de43 100644
--- a/drivers/gpu/drm/i915/i915_vma_resource.h
+++ b/drivers/gpu/drm/i915/i915_vma_resource.h
@@ -48,6 +48,12 @@ struct i915_page_sizes {
  * @rb: Rb node for the vm's pending unbind interval tree.
  * @__subtree_last: Interval tree private member.
  * @wakeref: wakeref.
+ * @bi.pages: The pages sg-table.
+ * @bi.page_sizes: Page sizes of the pages.
+ * @bi.pages_rsgt: Refcounted sg-table when delayed object destruction
+ * is supported. May be NULL.
+ * @bi.readonly: Whether the vma should be bound read-only.
+ * @bi.lmem: Whether the vma points to lmem.
  * @vm: non-refcounted pointer to the vm. This is for internal use only and
  * this member is cleared after vm_resource unbind.
  * @mr: The memory region of the object pointed to by the vma.
@@ -89,17 +95,11 @@ struct i915_vma_resource {
        intel_wakeref_t wakeref;
 
        /**
-        * struct i915_vma_bindinfo - Information needed for async bind
-        * only but that can be dropped after the bind has taken place.
-        * Consider making this a separate argument to the bind_vma
-        * op, coalescing with other arguments like vm, stash, cache_level
-        * and flags
-        * @pages: The pages sg-table.
-        * @page_sizes: Page sizes of the pages.
-        * @pages_rsgt: Refcounted sg-table when delayed object destruction
-        * is supported. May be NULL.
-        * @readonly: Whether the vma should be bound read-only.
-        * @lmem: Whether the vma points to lmem.
+        * @bi: Information needed for async bind only but that can be dropped
+        * after the bind has taken place.
+        *
+        * Consider making this a separate argument to the bind_vma op,
+        * coalescing with other arguments like vm, stash, cache_level and flags
         */
        struct i915_vma_bindinfo {
                struct sg_table *pages;


>
>> 
>> drivers/gpu/drm/i915/i915_vma_resource.h:91: warning: Incorrect use of kernel-doc format:          * struct i915_vma_bindinfo - Information needed for async bind
>> drivers/gpu/drm/i915/i915_vma_resource.h:129: warning: Function parameter or member 'bi' not described in 'i915_vma_resource'
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  drivers/gpu/drm/i915/i915_vma_resource.h | 45 ++++++++++++++----------
>>  1 file changed, 27 insertions(+), 18 deletions(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/i915_vma_resource.h b/drivers/gpu/drm/i915/i915_vma_resource.h
>> index 2053c037dbfb..ca2b0f7f59bc 100644
>> --- a/drivers/gpu/drm/i915/i915_vma_resource.h
>> +++ b/drivers/gpu/drm/i915/i915_vma_resource.h
>> @@ -33,6 +33,27 @@ struct i915_page_sizes {
>>  	unsigned int sg;
>>  };
>>  
>> +/**
>> + * struct i915_vma_bindinfo - Information needed for async bind
>> + * only but that can be dropped after the bind has taken place.
>> + * Consider making this a separate argument to the bind_vma
>> + * op, coalescing with other arguments like vm, stash, cache_level
>> + * and flags
>> + * @pages: The pages sg-table.
>> + * @page_sizes: Page sizes of the pages.
>> + * @pages_rsgt: Refcounted sg-table when delayed object destruction
>> + * is supported. May be NULL.
>> + * @readonly: Whether the vma should be bound read-only.
>> + * @lmem: Whether the vma points to lmem.
>> + */
>> +struct i915_vma_bindinfo {
>> +	struct sg_table *pages;
>> +	struct i915_page_sizes page_sizes;
>> +	struct i915_refct_sgt *pages_rsgt;
>> +	bool readonly:1;
>> +	bool lmem:1;
>
> btw, I believe we should move all the individual docs near to its
> declarations. easier to forget updating the documentation when updating
> fields here.
>
>> +};
>> +
>>  /**
>>   * struct i915_vma_resource - Snapshotted unbind information.
>>   * @unbind_fence: Fence to mark unbinding complete. Note that this fence
>> @@ -89,25 +110,13 @@ struct i915_vma_resource {
>>  	intel_wakeref_t wakeref;
>>  
>>  	/**
>> -	 * struct i915_vma_bindinfo - Information needed for async bind
>> -	 * only but that can be dropped after the bind has taken place.
>> -	 * Consider making this a separate argument to the bind_vma
>> -	 * op, coalescing with other arguments like vm, stash, cache_level
>> -	 * and flags
>> -	 * @pages: The pages sg-table.
>> -	 * @page_sizes: Page sizes of the pages.
>> -	 * @pages_rsgt: Refcounted sg-table when delayed object destruction
>> -	 * is supported. May be NULL.
>> -	 * @readonly: Whether the vma should be bound read-only.
>> -	 * @lmem: Whether the vma points to lmem.
>> +	 * @bi: Information needed for async bind only but that can be dropped
>> +	 * after the bind has taken place.
>> +	 *
>> +	 * Consider making this a separate argument to the bind_vma op,
>> +	 * coalescing with other arguments like vm, stash, cache_level and flags
>>  	 */
>> -	struct i915_vma_bindinfo {
>> -		struct sg_table *pages;
>> -		struct i915_page_sizes page_sizes;
>> -		struct i915_refct_sgt *pages_rsgt;
>> -		bool readonly:1;
>> -		bool lmem:1;
>> -	} bi;
>> +	struct i915_vma_bindinfo bi;
>>  
>>  #if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR)
>>  	struct intel_memory_region *mr;
>> -- 
>> 2.39.2
>> 

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2023-05-04  9:43 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-02 15:37 [Intel-gfx] [PATCH 00/24] drm/i915: fix kernel-doc warnings, enable kernel-doc -Werror Jani Nikula
2023-05-02 15:37 ` [Intel-gfx] [PATCH 01/24] drm/i915/gvt: fix intel_vgpu_alloc_resource() kernel-doc parameter Jani Nikula
2023-05-03 14:07   ` Rodrigo Vivi
2023-05-04  9:15     ` Jani Nikula
2023-05-02 15:37 ` [Intel-gfx] [PATCH 02/24] drm/i915/vma: fix kernel-doc function name for i915_vma_size() Jani Nikula
2023-05-03 14:08   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 03/24] drm/i915/utils: drop kernel-doc from __wait_for() Jani Nikula
2023-05-03 14:09   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 04/24] drm/i915/vma: document struct i915_vma_resource wakeref member Jani Nikula
2023-05-03 14:16   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 05/24] drm/i915/vma: fix struct i915_vma_bindinfo kernel-doc Jani Nikula
2023-05-03 14:13   ` Rodrigo Vivi
2023-05-04  9:43     ` Jani Nikula [this message]
2023-05-04 14:54       ` Rodrigo Vivi
2023-05-04 21:51         ` Jani Nikula
2023-05-05 10:30         ` Jani Nikula
2023-05-02 15:37 ` [Intel-gfx] [PATCH 06/24] drm/i915/perf: fix i915_perf_ioctl_version() kernel-doc Jani Nikula
2023-05-03 14:14   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 07/24] drm/i915/error: fix i915_capture_error_state() kernel-doc Jani Nikula
2023-05-03 14:15   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 08/24] drm/i915/request: drop kernel-doc Jani Nikula
2023-05-03 14:19   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 09/24] drm/i915/gem: fix i915_gem_object_lookup_rcu() kernel-doc parameter name Jani Nikula
2023-05-03 14:20   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 10/24] drm/i915/gem: fix function pointer member kernel-doc Jani Nikula
2023-05-03 14:24   ` Rodrigo Vivi
2023-05-04  9:20     ` Jani Nikula
2023-05-04 14:55       ` Rodrigo Vivi
2023-05-04 21:53         ` Jani Nikula
2023-05-05 10:30         ` Jani Nikula
2023-05-02 15:37 ` [Intel-gfx] [PATCH 11/24] drm/i915/ttm: fix i915_ttm_to_gem() kernel-doc Jani Nikula
2023-05-03 14:27   ` Rodrigo Vivi
2023-05-04  9:24     ` Jani Nikula
2023-05-02 15:37 ` [Intel-gfx] [PATCH 12/24] drm/i915/engine: fix kernel-doc function name for intel_engine_cleanup_common() Jani Nikula
2023-05-03 14:28   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 13/24] drm/i915/context: fix kernel-doc parameter descriptions Jani Nikula
2023-05-03 14:29   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 14/24] drm/i915/gtt: fix i915_vm_resv_put() kernel-doc parameter name Jani Nikula
2023-05-03 14:29   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 15/24] drm/i915/engine: hide preempt_hang selftest member from kernel-doc Jani Nikula
2023-05-03 14:34   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 16/24] drm/i915/guc: add dbgfs_node member kernel-doc Jani Nikula
2023-05-03 14:34   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 17/24] drm/i915/guc: drop lots of kernel-doc markers Jani Nikula
2023-05-03 14:37   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 18/24] drm/i915/guc: add intel_guc_state_capture member docs for ads_null_cache and max_mmio_per_node Jani Nikula
2023-05-03 14:38   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 19/24] drm/i915/active: fix kernel-doc for function parameters Jani Nikula
2023-05-03 14:38   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 20/24] drm/i915/pmu: drop kernel-doc Jani Nikula
2023-05-03 14:39   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 21/24] drm/i915/pxp: fix kernel-doc for member dev_link Jani Nikula
2023-05-03 14:40   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 22/24] drm/i915/scatterlist: fix kernel-doc Jani Nikula
2023-05-04 14:56   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 23/24] drm/i915/scatterlist: fix kernel-doc parameter documentation Jani Nikula
2023-05-03 14:40   ` Rodrigo Vivi
2023-05-02 15:37 ` [Intel-gfx] [PATCH 24/24] drm/i915: use kernel-doc -Werror when CONFIG_DRM_I915_WERROR=y Jani Nikula
2023-05-03 14:41   ` Rodrigo Vivi
2023-05-02 16:39 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: fix kernel-doc warnings, enable kernel-doc -Werror Patchwork
2023-05-02 16:49 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-05-02 18:37 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-05-04 18:19 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: fix kernel-doc warnings, enable kernel-doc -Werror (rev2) Patchwork

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=87a5ykzb2u.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@kernel.org \
    /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