All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH libdrm] amdgpu: allow to query GPU sensor related information
@ 2017-04-04  8:37 Samuel Pitoiset
       [not found] ` <20170404083746.984-1-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Samuel Pitoiset @ 2017-04-04  8:37 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Samuel Pitoiset

This exposes amdgpu_query_sensor_info().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
 amdgpu/amdgpu.h          | 18 ++++++++++++++++++
 amdgpu/amdgpu_gpu_info.c | 15 +++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
index 6b2ded83..55884b24 100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -1059,6 +1059,24 @@ int amdgpu_query_gds_info(amdgpu_device_handle dev,
 			struct amdgpu_gds_resource_info *gds_info);
 
 /**
+ * Query information about sensor.
+ *
+ * The return size is query-specific and depends on the "sensor_type"
+ * parameter. No more than "size" bytes is returned.
+ *
+ * \param   dev         - \c [in] Device handle. See #amdgpu_device_initialize()
+ * \param   sensor_type - \c [in] AMDGPU_INFO_SENSOR_*
+ * \param   size        - \c [in] Size of the returned value.
+ * \param   value       - \c [out] Pointer to the return value.
+ *
+ * \return   0 on success\n
+ *          <0 - Negative POSIX Error code
+ *
+*/
+int amdgpu_query_sensor_info(amdgpu_device_handle dev, unsigned sensor_type,
+			     unsigned size, void *value);
+
+/**
  * Read a set of consecutive memory-mapped registers.
  * Not all registers are allowed to be read by userspace.
  *
diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c
index c5f5f6f4..f4b94c9e 100644
--- a/amdgpu/amdgpu_gpu_info.c
+++ b/amdgpu/amdgpu_gpu_info.c
@@ -318,3 +318,18 @@ int amdgpu_query_gds_info(amdgpu_device_handle dev,
 
 	return 0;
 }
+
+int amdgpu_query_sensor_info(amdgpu_device_handle dev, unsigned sensor_type,
+			     unsigned size, void *value)
+{
+	struct drm_amdgpu_info request;
+
+	memset(&request, 0, sizeof(request));
+	request.return_pointer = (uintptr_t)value;
+	request.return_size = size;
+	request.query = AMDGPU_INFO_SENSOR;
+	request.sensor_info.type = sensor_type;
+
+	return drmCommandWrite(dev->fd, DRM_AMDGPU_INFO, &request,
+			       sizeof(struct drm_amdgpu_info));
+}
-- 
2.12.2

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH libdrm] amdgpu: allow to query GPU sensor related information
       [not found] ` <20170404083746.984-1-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-04-04 13:11   ` Andreas Boll
       [not found]     ` <CACiKqBcg4ee8iJp5oOuKG5xfCTSy0V_RJMxHoMFqV1vaUKaA0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2017-04-04 14:34   ` [PATCH libdrm v2] " Samuel Pitoiset
  1 sibling, 1 reply; 5+ messages in thread
From: Andreas Boll @ 2017-04-04 13:11 UTC (permalink / raw)
  To: Samuel Pitoiset; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Please make sure that make check still passes with this patch applied.
I guess amdgpu/amdgpu-symbol-check needs to be updated with the new symbol.

Thanks,
Andreas

2017-04-04 10:37 GMT+02:00 Samuel Pitoiset <samuel.pitoiset@gmail.com>:
> This exposes amdgpu_query_sensor_info().
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
> ---
>  amdgpu/amdgpu.h          | 18 ++++++++++++++++++
>  amdgpu/amdgpu_gpu_info.c | 15 +++++++++++++++
>  2 files changed, 33 insertions(+)
>
> diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
> index 6b2ded83..55884b24 100644
> --- a/amdgpu/amdgpu.h
> +++ b/amdgpu/amdgpu.h
> @@ -1059,6 +1059,24 @@ int amdgpu_query_gds_info(amdgpu_device_handle dev,
>                         struct amdgpu_gds_resource_info *gds_info);
>
>  /**
> + * Query information about sensor.
> + *
> + * The return size is query-specific and depends on the "sensor_type"
> + * parameter. No more than "size" bytes is returned.
> + *
> + * \param   dev         - \c [in] Device handle. See #amdgpu_device_initialize()
> + * \param   sensor_type - \c [in] AMDGPU_INFO_SENSOR_*
> + * \param   size        - \c [in] Size of the returned value.
> + * \param   value       - \c [out] Pointer to the return value.
> + *
> + * \return   0 on success\n
> + *          <0 - Negative POSIX Error code
> + *
> +*/
> +int amdgpu_query_sensor_info(amdgpu_device_handle dev, unsigned sensor_type,
> +                            unsigned size, void *value);
> +
> +/**
>   * Read a set of consecutive memory-mapped registers.
>   * Not all registers are allowed to be read by userspace.
>   *
> diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c
> index c5f5f6f4..f4b94c9e 100644
> --- a/amdgpu/amdgpu_gpu_info.c
> +++ b/amdgpu/amdgpu_gpu_info.c
> @@ -318,3 +318,18 @@ int amdgpu_query_gds_info(amdgpu_device_handle dev,
>
>         return 0;
>  }
> +
> +int amdgpu_query_sensor_info(amdgpu_device_handle dev, unsigned sensor_type,
> +                            unsigned size, void *value)
> +{
> +       struct drm_amdgpu_info request;
> +
> +       memset(&request, 0, sizeof(request));
> +       request.return_pointer = (uintptr_t)value;
> +       request.return_size = size;
> +       request.query = AMDGPU_INFO_SENSOR;
> +       request.sensor_info.type = sensor_type;
> +
> +       return drmCommandWrite(dev->fd, DRM_AMDGPU_INFO, &request,
> +                              sizeof(struct drm_amdgpu_info));
> +}
> --
> 2.12.2
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH libdrm] amdgpu: allow to query GPU sensor related information
       [not found]     ` <CACiKqBcg4ee8iJp5oOuKG5xfCTSy0V_RJMxHoMFqV1vaUKaA0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2017-04-04 14:31       ` Samuel Pitoiset
  0 siblings, 0 replies; 5+ messages in thread
From: Samuel Pitoiset @ 2017-04-04 14:31 UTC (permalink / raw)
  To: Andreas Boll; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW



On 04/04/2017 03:11 PM, Andreas Boll wrote:
> Please make sure that make check still passes with this patch applied.
> I guess amdgpu/amdgpu-symbol-check needs to be updated with the new symbol.

Correct. Thanks for noticing this, I will update the patch.

>
> Thanks,
> Andreas
>
> 2017-04-04 10:37 GMT+02:00 Samuel Pitoiset <samuel.pitoiset@gmail.com>:
>> This exposes amdgpu_query_sensor_info().
>>
>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
>> ---
>>  amdgpu/amdgpu.h          | 18 ++++++++++++++++++
>>  amdgpu/amdgpu_gpu_info.c | 15 +++++++++++++++
>>  2 files changed, 33 insertions(+)
>>
>> diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
>> index 6b2ded83..55884b24 100644
>> --- a/amdgpu/amdgpu.h
>> +++ b/amdgpu/amdgpu.h
>> @@ -1059,6 +1059,24 @@ int amdgpu_query_gds_info(amdgpu_device_handle dev,
>>                         struct amdgpu_gds_resource_info *gds_info);
>>
>>  /**
>> + * Query information about sensor.
>> + *
>> + * The return size is query-specific and depends on the "sensor_type"
>> + * parameter. No more than "size" bytes is returned.
>> + *
>> + * \param   dev         - \c [in] Device handle. See #amdgpu_device_initialize()
>> + * \param   sensor_type - \c [in] AMDGPU_INFO_SENSOR_*
>> + * \param   size        - \c [in] Size of the returned value.
>> + * \param   value       - \c [out] Pointer to the return value.
>> + *
>> + * \return   0 on success\n
>> + *          <0 - Negative POSIX Error code
>> + *
>> +*/
>> +int amdgpu_query_sensor_info(amdgpu_device_handle dev, unsigned sensor_type,
>> +                            unsigned size, void *value);
>> +
>> +/**
>>   * Read a set of consecutive memory-mapped registers.
>>   * Not all registers are allowed to be read by userspace.
>>   *
>> diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c
>> index c5f5f6f4..f4b94c9e 100644
>> --- a/amdgpu/amdgpu_gpu_info.c
>> +++ b/amdgpu/amdgpu_gpu_info.c
>> @@ -318,3 +318,18 @@ int amdgpu_query_gds_info(amdgpu_device_handle dev,
>>
>>         return 0;
>>  }
>> +
>> +int amdgpu_query_sensor_info(amdgpu_device_handle dev, unsigned sensor_type,
>> +                            unsigned size, void *value)
>> +{
>> +       struct drm_amdgpu_info request;
>> +
>> +       memset(&request, 0, sizeof(request));
>> +       request.return_pointer = (uintptr_t)value;
>> +       request.return_size = size;
>> +       request.query = AMDGPU_INFO_SENSOR;
>> +       request.sensor_info.type = sensor_type;
>> +
>> +       return drmCommandWrite(dev->fd, DRM_AMDGPU_INFO, &request,
>> +                              sizeof(struct drm_amdgpu_info));
>> +}
>> --
>> 2.12.2
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH libdrm v2] amdgpu: allow to query GPU sensor related information
       [not found] ` <20170404083746.984-1-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2017-04-04 13:11   ` Andreas Boll
@ 2017-04-04 14:34   ` Samuel Pitoiset
       [not found]     ` <20170404143456.27466-1-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  1 sibling, 1 reply; 5+ messages in thread
From: Samuel Pitoiset @ 2017-04-04 14:34 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Samuel Pitoiset

This exposes amdgpu_query_sensor_info().

v2: - add amdgpu_query_sensor_info() to the symbols list

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
---
 amdgpu/amdgpu-symbol-check |  1 +
 amdgpu/amdgpu.h            | 18 ++++++++++++++++++
 amdgpu/amdgpu_gpu_info.c   | 15 +++++++++++++++
 3 files changed, 34 insertions(+)

diff --git a/amdgpu/amdgpu-symbol-check b/amdgpu/amdgpu-symbol-check
index 8e06474d..4d1ae65c 100755
--- a/amdgpu/amdgpu-symbol-check
+++ b/amdgpu/amdgpu-symbol-check
@@ -46,6 +46,7 @@ amdgpu_query_heap_info
 amdgpu_query_hw_ip_count
 amdgpu_query_hw_ip_info
 amdgpu_query_info
+amdgpu_query_sensor_info
 amdgpu_read_mm_registers
 amdgpu_va_range_alloc
 amdgpu_va_range_free
diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
index 6b2ded83..55884b24 100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -1059,6 +1059,24 @@ int amdgpu_query_gds_info(amdgpu_device_handle dev,
 			struct amdgpu_gds_resource_info *gds_info);
 
 /**
+ * Query information about sensor.
+ *
+ * The return size is query-specific and depends on the "sensor_type"
+ * parameter. No more than "size" bytes is returned.
+ *
+ * \param   dev         - \c [in] Device handle. See #amdgpu_device_initialize()
+ * \param   sensor_type - \c [in] AMDGPU_INFO_SENSOR_*
+ * \param   size        - \c [in] Size of the returned value.
+ * \param   value       - \c [out] Pointer to the return value.
+ *
+ * \return   0 on success\n
+ *          <0 - Negative POSIX Error code
+ *
+*/
+int amdgpu_query_sensor_info(amdgpu_device_handle dev, unsigned sensor_type,
+			     unsigned size, void *value);
+
+/**
  * Read a set of consecutive memory-mapped registers.
  * Not all registers are allowed to be read by userspace.
  *
diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c
index c5f5f6f4..f4b94c9e 100644
--- a/amdgpu/amdgpu_gpu_info.c
+++ b/amdgpu/amdgpu_gpu_info.c
@@ -318,3 +318,18 @@ int amdgpu_query_gds_info(amdgpu_device_handle dev,
 
 	return 0;
 }
+
+int amdgpu_query_sensor_info(amdgpu_device_handle dev, unsigned sensor_type,
+			     unsigned size, void *value)
+{
+	struct drm_amdgpu_info request;
+
+	memset(&request, 0, sizeof(request));
+	request.return_pointer = (uintptr_t)value;
+	request.return_size = size;
+	request.query = AMDGPU_INFO_SENSOR;
+	request.sensor_info.type = sensor_type;
+
+	return drmCommandWrite(dev->fd, DRM_AMDGPU_INFO, &request,
+			       sizeof(struct drm_amdgpu_info));
+}
-- 
2.12.2

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH libdrm v2] amdgpu: allow to query GPU sensor related information
       [not found]     ` <20170404143456.27466-1-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-04-07 14:21       ` Marek Olšák
  0 siblings, 0 replies; 5+ messages in thread
From: Marek Olšák @ 2017-04-07 14:21 UTC (permalink / raw)
  To: Samuel Pitoiset; +Cc: amd-gfx mailing list

Reviewed-by: Marek Olšák <marek.olsak@amd.com>

Marek

On Tue, Apr 4, 2017 at 4:34 PM, Samuel Pitoiset
<samuel.pitoiset@gmail.com> wrote:
> This exposes amdgpu_query_sensor_info().
>
> v2: - add amdgpu_query_sensor_info() to the symbols list
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
> ---
>  amdgpu/amdgpu-symbol-check |  1 +
>  amdgpu/amdgpu.h            | 18 ++++++++++++++++++
>  amdgpu/amdgpu_gpu_info.c   | 15 +++++++++++++++
>  3 files changed, 34 insertions(+)
>
> diff --git a/amdgpu/amdgpu-symbol-check b/amdgpu/amdgpu-symbol-check
> index 8e06474d..4d1ae65c 100755
> --- a/amdgpu/amdgpu-symbol-check
> +++ b/amdgpu/amdgpu-symbol-check
> @@ -46,6 +46,7 @@ amdgpu_query_heap_info
>  amdgpu_query_hw_ip_count
>  amdgpu_query_hw_ip_info
>  amdgpu_query_info
> +amdgpu_query_sensor_info
>  amdgpu_read_mm_registers
>  amdgpu_va_range_alloc
>  amdgpu_va_range_free
> diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
> index 6b2ded83..55884b24 100644
> --- a/amdgpu/amdgpu.h
> +++ b/amdgpu/amdgpu.h
> @@ -1059,6 +1059,24 @@ int amdgpu_query_gds_info(amdgpu_device_handle dev,
>                         struct amdgpu_gds_resource_info *gds_info);
>
>  /**
> + * Query information about sensor.
> + *
> + * The return size is query-specific and depends on the "sensor_type"
> + * parameter. No more than "size" bytes is returned.
> + *
> + * \param   dev         - \c [in] Device handle. See #amdgpu_device_initialize()
> + * \param   sensor_type - \c [in] AMDGPU_INFO_SENSOR_*
> + * \param   size        - \c [in] Size of the returned value.
> + * \param   value       - \c [out] Pointer to the return value.
> + *
> + * \return   0 on success\n
> + *          <0 - Negative POSIX Error code
> + *
> +*/
> +int amdgpu_query_sensor_info(amdgpu_device_handle dev, unsigned sensor_type,
> +                            unsigned size, void *value);
> +
> +/**
>   * Read a set of consecutive memory-mapped registers.
>   * Not all registers are allowed to be read by userspace.
>   *
> diff --git a/amdgpu/amdgpu_gpu_info.c b/amdgpu/amdgpu_gpu_info.c
> index c5f5f6f4..f4b94c9e 100644
> --- a/amdgpu/amdgpu_gpu_info.c
> +++ b/amdgpu/amdgpu_gpu_info.c
> @@ -318,3 +318,18 @@ int amdgpu_query_gds_info(amdgpu_device_handle dev,
>
>         return 0;
>  }
> +
> +int amdgpu_query_sensor_info(amdgpu_device_handle dev, unsigned sensor_type,
> +                            unsigned size, void *value)
> +{
> +       struct drm_amdgpu_info request;
> +
> +       memset(&request, 0, sizeof(request));
> +       request.return_pointer = (uintptr_t)value;
> +       request.return_size = size;
> +       request.query = AMDGPU_INFO_SENSOR;
> +       request.sensor_info.type = sensor_type;
> +
> +       return drmCommandWrite(dev->fd, DRM_AMDGPU_INFO, &request,
> +                              sizeof(struct drm_amdgpu_info));
> +}
> --
> 2.12.2
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2017-04-07 14:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04  8:37 [PATCH libdrm] amdgpu: allow to query GPU sensor related information Samuel Pitoiset
     [not found] ` <20170404083746.984-1-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-04 13:11   ` Andreas Boll
     [not found]     ` <CACiKqBcg4ee8iJp5oOuKG5xfCTSy0V_RJMxHoMFqV1vaUKaA0Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-04 14:31       ` Samuel Pitoiset
2017-04-04 14:34   ` [PATCH libdrm v2] " Samuel Pitoiset
     [not found]     ` <20170404143456.27466-1-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-07 14:21       ` Marek Olšák

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.