All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu:new ids flag for preempt
@ 2016-10-24  3:37 Monk Liu
       [not found] ` <1477280253-3180-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Monk Liu @ 2016-10-24  3:37 UTC (permalink / raw)
  To: amd-gfx-CC+yJ3UmIYqDUpFQwHEjaQ; +Cc: Monk Liu

Change-Id: Idae33c69198c30bd841fb555641729d3b6e06a2e
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 ++
 include/uapi/drm/amdgpu_drm.h           | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 58a0b59..0a1260e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -503,6 +503,8 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
 		dev_info.ids_flags = 0;
 		if (adev->flags & AMD_IS_APU)
 			dev_info.ids_flags |= AMDGPU_IDS_FLAGS_FUSION;
+		if (amdgpu_sriov_vf(adev))
+			dev_info.ids_flags |= AMDGPU_IDS_FLAGS_PREEMPTION;
 		dev_info.virtual_address_offset = AMDGPU_VA_RESERVED_SIZE;
 		dev_info.virtual_address_max = (uint64_t)adev->vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE;
 		dev_info.virtual_address_alignment = max((int)PAGE_SIZE, AMDGPU_GPU_PAGE_SIZE);
diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
index 667e9bc..49d2404 100644
--- a/include/uapi/drm/amdgpu_drm.h
+++ b/include/uapi/drm/amdgpu_drm.h
@@ -440,6 +440,7 @@ struct drm_amdgpu_cs_chunk_data {
  *
  */
 #define AMDGPU_IDS_FLAGS_FUSION         0x1
+#define AMDGPU_IDS_FLAGS_PREEMPTION     0x2
 
 /* indicate if acceleration can be working */
 #define AMDGPU_INFO_ACCEL_WORKING		0x00
-- 
1.9.1

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

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

* Re: [PATCH] drm/amdgpu:new ids flag for preempt
       [not found] ` <1477280253-3180-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
@ 2016-10-24  9:15   ` Christian König
  2016-10-24 13:53   ` Deucher, Alexander
  1 sibling, 0 replies; 3+ messages in thread
From: Christian König @ 2016-10-24  9:15 UTC (permalink / raw)
  To: Monk Liu, amd-gfx-CC+yJ3UmIYqDUpFQwHEjaQ

Am 24.10.2016 um 05:37 schrieb Monk Liu:
> Change-Id: Idae33c69198c30bd841fb555641729d3b6e06a2e
> Signed-off-by: Monk Liu <Monk.Liu@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 ++
>   include/uapi/drm/amdgpu_drm.h           | 1 +
>   2 files changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index 58a0b59..0a1260e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -503,6 +503,8 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
>   		dev_info.ids_flags = 0;
>   		if (adev->flags & AMD_IS_APU)
>   			dev_info.ids_flags |= AMDGPU_IDS_FLAGS_FUSION;
> +		if (amdgpu_sriov_vf(adev))
> +			dev_info.ids_flags |= AMDGPU_IDS_FLAGS_PREEMPTION;
>   		dev_info.virtual_address_offset = AMDGPU_VA_RESERVED_SIZE;
>   		dev_info.virtual_address_max = (uint64_t)adev->vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE;
>   		dev_info.virtual_address_alignment = max((int)PAGE_SIZE, AMDGPU_GPU_PAGE_SIZE);
> diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
> index 667e9bc..49d2404 100644
> --- a/include/uapi/drm/amdgpu_drm.h
> +++ b/include/uapi/drm/amdgpu_drm.h
> @@ -440,6 +440,7 @@ struct drm_amdgpu_cs_chunk_data {
>    *
>    */
>   #define AMDGPU_IDS_FLAGS_FUSION         0x1
> +#define AMDGPU_IDS_FLAGS_PREEMPTION     0x2
>   
>   /* indicate if acceleration can be working */
>   #define AMDGPU_INFO_ACCEL_WORKING		0x00


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

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

* RE: [PATCH] drm/amdgpu:new ids flag for preempt
       [not found] ` <1477280253-3180-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
  2016-10-24  9:15   ` Christian König
@ 2016-10-24 13:53   ` Deucher, Alexander
  1 sibling, 0 replies; 3+ messages in thread
From: Deucher, Alexander @ 2016-10-24 13:53 UTC (permalink / raw)
  To: amd-gfx-CC+yJ3UmIYqDUpFQwHEjaQ; +Cc: Liu, Monk

> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Monk Liu
> Sent: Sunday, October 23, 2016 11:38 PM
> To: amd-gfx@freedesktop.org
> Cc: Liu, Monk
> Subject: [PATCH] drm/amdgpu:new ids flag for preempt
> 
> Change-Id: Idae33c69198c30bd841fb555641729d3b6e06a2e
> Signed-off-by: Monk Liu <Monk.Liu@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 ++
>  include/uapi/drm/amdgpu_drm.h           | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index 58a0b59..0a1260e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -503,6 +503,8 @@ static int amdgpu_info_ioctl(struct drm_device *dev,
> void *data, struct drm_file
>  		dev_info.ids_flags = 0;
>  		if (adev->flags & AMD_IS_APU)
>  			dev_info.ids_flags |=
> AMDGPU_IDS_FLAGS_FUSION;
> +		if (amdgpu_sriov_vf(adev))
> +			dev_info.ids_flags |=
> AMDGPU_IDS_FLAGS_PREEMPTION;

Do we need a separate flag for SR-IOV specifically?  I.e., at some point in the future if we support pre-emption in general, would we set this flag even when SR-IOV is not enabled?  I.e., is userspace using this as a check for pre-emption or sr-iov?  If it's the latter, I'd suggest changing the name of the flag to something with SR-IOV.  If it's the former, then the patch is:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

>  		dev_info.virtual_address_offset =
> AMDGPU_VA_RESERVED_SIZE;
>  		dev_info.virtual_address_max = (uint64_t)adev-
> >vm_manager.max_pfn * AMDGPU_GPU_PAGE_SIZE;
>  		dev_info.virtual_address_alignment = max((int)PAGE_SIZE,
> AMDGPU_GPU_PAGE_SIZE);
> diff --git a/include/uapi/drm/amdgpu_drm.h
> b/include/uapi/drm/amdgpu_drm.h
> index 667e9bc..49d2404 100644
> --- a/include/uapi/drm/amdgpu_drm.h
> +++ b/include/uapi/drm/amdgpu_drm.h
> @@ -440,6 +440,7 @@ struct drm_amdgpu_cs_chunk_data {
>   *
>   */
>  #define AMDGPU_IDS_FLAGS_FUSION         0x1
> +#define AMDGPU_IDS_FLAGS_PREEMPTION     0x2
> 
>  /* indicate if acceleration can be working */
>  #define AMDGPU_INFO_ACCEL_WORKING		0x00
> --
> 1.9.1
> 
> _______________________________________________
> 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] 3+ messages in thread

end of thread, other threads:[~2016-10-24 13:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-24  3:37 [PATCH] drm/amdgpu:new ids flag for preempt Monk Liu
     [not found] ` <1477280253-3180-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org>
2016-10-24  9:15   ` Christian König
2016-10-24 13:53   ` Deucher, Alexander

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.