All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] lib/intel_memory_region: Constify info structures
Date: Thu, 12 Aug 2021 11:07:38 +0200	[thread overview]
Message-ID: <20210812090738.GB27582@zkempczy-mobl2> (raw)
In-Reply-To: <20210812090032.117930-1-janusz.krzysztofik@linux.intel.com>

On Thu, Aug 12, 2021 at 11:00:32AM +0200, Janusz Krzysztofik wrote:
> Functions which extract information from drm_i915_query_memory_regions
> structures passed via their pointer as an argument don't modify those
> structures, let them accept that content declared as constant.
> 
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>

Looks safe: 

Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>

--
Zbigniew
> ---
>  lib/i915/intel_memory_region.c | 12 ++++++------
>  lib/i915/intel_memory_region.h | 12 ++++++------
>  2 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/lib/i915/intel_memory_region.c b/lib/i915/intel_memory_region.c
> index 72e337af3..3de405493 100644
> --- a/lib/i915/intel_memory_region.c
> +++ b/lib/i915/intel_memory_region.c
> @@ -309,7 +309,7 @@ char *memregion_dynamic_subtest_name(struct igt_collection *set)
>   *
>   * Outputs memory regions and their sizes.
>   */
> -void intel_dump_gpu_meminfo(struct drm_i915_query_memory_regions *info)
> +void intel_dump_gpu_meminfo(const struct drm_i915_query_memory_regions *info)
>  {
>  	int i;
>  
> @@ -336,7 +336,7 @@ void intel_dump_gpu_meminfo(struct drm_i915_query_memory_regions *info)
>   *
>   * Returns: number of regions for type @memory_class
>   */
> -uint32_t gpu_meminfo_region_count(struct drm_i915_query_memory_regions *info,
> +uint32_t gpu_meminfo_region_count(const struct drm_i915_query_memory_regions *info,
>  				  uint16_t memory_class)
>  {
>  	uint32_t num = 0;
> @@ -359,7 +359,7 @@ uint32_t gpu_meminfo_region_count(struct drm_i915_query_memory_regions *info,
>   * Returns: total size of all regions which are type @memory_class, -1 when the
>   * size of at least one region is unknown
>   */
> -uint64_t gpu_meminfo_region_total_size(struct drm_i915_query_memory_regions *info,
> +uint64_t gpu_meminfo_region_total_size(const struct drm_i915_query_memory_regions *info,
>  				       uint16_t memory_class)
>  {
>  	uint64_t total = 0;
> @@ -386,7 +386,7 @@ uint64_t gpu_meminfo_region_total_size(struct drm_i915_query_memory_regions *inf
>   * Returns: available size of all regions which are type @memory_class, -1 when
>   * the size of at least one region cannot be estimated
>   */
> -uint64_t gpu_meminfo_region_total_available(struct drm_i915_query_memory_regions *info,
> +uint64_t gpu_meminfo_region_total_available(const struct drm_i915_query_memory_regions *info,
>  					    uint16_t memory_class)
>  {
>  	uint64_t avail = 0;
> @@ -414,7 +414,7 @@ uint64_t gpu_meminfo_region_total_available(struct drm_i915_query_memory_regions
>   * Returns: available size of @memory_instance which type is @memory_class, -1
>   * when the size is unknown
>   */
> -uint64_t gpu_meminfo_region_size(struct drm_i915_query_memory_regions *info,
> +uint64_t gpu_meminfo_region_size(const struct drm_i915_query_memory_regions *info,
>  				 uint16_t memory_class,
>  				 uint16_t memory_instance)
>  {
> @@ -439,7 +439,7 @@ uint64_t gpu_meminfo_region_size(struct drm_i915_query_memory_regions *info,
>   * Returns: available size of @memory_instance region which type is
>   * @memory_class, -1 when the size cannot be estimated
>   */
> -uint64_t gpu_meminfo_region_available(struct drm_i915_query_memory_regions *info,
> +uint64_t gpu_meminfo_region_available(const struct drm_i915_query_memory_regions *info,
>  				      uint16_t memory_class,
>  				      uint16_t memory_instance)
>  {
> diff --git a/lib/i915/intel_memory_region.h b/lib/i915/intel_memory_region.h
> index 8cd18ea0e..70b74944b 100644
> --- a/lib/i915/intel_memory_region.h
> +++ b/lib/i915/intel_memory_region.h
> @@ -113,19 +113,19 @@ __get_memory_region_set(struct drm_i915_query_memory_regions *regions,
>  
>  char *memregion_dynamic_subtest_name(struct igt_collection *set);
>  
> -void intel_dump_gpu_meminfo(struct drm_i915_query_memory_regions *info);
> +void intel_dump_gpu_meminfo(const struct drm_i915_query_memory_regions *info);
>  
> -uint32_t gpu_meminfo_region_count(struct drm_i915_query_memory_regions *info,
> +uint32_t gpu_meminfo_region_count(const struct drm_i915_query_memory_regions *info,
>  				  uint16_t region_class);
> -uint64_t gpu_meminfo_region_total_size(struct drm_i915_query_memory_regions *info,
> +uint64_t gpu_meminfo_region_total_size(const struct drm_i915_query_memory_regions *info,
>  				       uint16_t region_class);
> -uint64_t gpu_meminfo_region_total_available(struct drm_i915_query_memory_regions *info,
> +uint64_t gpu_meminfo_region_total_available(const struct drm_i915_query_memory_regions *info,
>  					    uint16_t region_type);
>  
> -uint64_t gpu_meminfo_region_size(struct drm_i915_query_memory_regions *info,
> +uint64_t gpu_meminfo_region_size(const struct drm_i915_query_memory_regions *info,
>  				 uint16_t memory_class,
>  				 uint16_t memory_instance);
> -uint64_t gpu_meminfo_region_available(struct drm_i915_query_memory_regions *info,
> +uint64_t gpu_meminfo_region_available(const struct drm_i915_query_memory_regions *info,
>  				      uint16_t memory_class,
>  				      uint16_t memory_instance);
>  
> -- 
> 2.25.1
> 

  reply	other threads:[~2021-08-12  9:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12  9:00 [igt-dev] [PATCH i-g-t] lib/intel_memory_region: Constify info structures Janusz Krzysztofik
2021-08-12  9:07 ` Zbigniew Kempczyński [this message]
2021-08-12 12:00   ` Janusz Krzysztofik
2021-08-12  9:45 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2021-08-12 11:47 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20210812090738.GB27582@zkempczy-mobl2 \
    --to=zbigniew.kempczynski@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=janusz.krzysztofik@linux.intel.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 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.