Skip to contentSkip to conversation

drm/amdgpu:set preemption flag bit

PATCH In review Monk Liu 3 participants 4 messages Oct 21, 2016 – Oct 24, 2016 3 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

Monk Liu

author
#0 lore raw

PATCH 1/1 drm/amdgpu:set preemption flag bit

UMD need this bit if preemption want supported

Change-Id Ic657b3e6f46a148ed3cf0e932ccf46f2c5230d7f

Conflicts:
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 8 ++++++++
 include/uapi/drm/amdgpu_drm.h           | 4 ++++
 2 files changed, 12 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +8 -0
index 58a0b59..85b4c5f 100644
@@ -540,6 +540,14 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
 		return copy_to_user(out, &vce_clk_table,
 				    min((size_t)size, sizeof(vce_clk_table))) ? -EFAULT : 0;
 	}
+
+	case AMDGPU_INFO_PREEMPTION: {
+		if (amdgpu_sriov_vf(adev))
+			ui32 |= AMDGPU_INFO_PREEMPTION_ENALBED;
+		return copy_to_user(out, &ui32, min(size, 4u)) ? -EFAULT: 0;
+		break;
+	}
+
 	default:
 		DRM_DEBUG_KMS("Invalid request %d\n", info->query);
 		return -EINVAL;
include/uapi/drm/amdgpu_drm.h +4 -0
index 667e9bc..2f25c50 100644
@@ -501,6 +501,10 @@ struct drm_amdgpu_cs_chunk_data {
 #define AMDGPU_INFO_MMR_SH_INDEX_SHIFT	8
 #define AMDGPU_INFO_MMR_SH_INDEX_MASK	0xff
 
+/* Query info about preemption */
+#define AMDGPU_INFO_PREEMPTION          0x1B
+	#define AMDGPU_INFO_PREEMPTION_ENALBED	1
+
 struct drm_amdgpu_query_fw {
 	/** AMDGPU_INFO_FW_* */
 	__u32 fw_type;
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1477020857-2921-1-git-send-email-Monk.Liu-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Way to much overkill, just put that into the device info flags.

See AMDGPU_IDS_FLAGS_FUSION for reference.

Christian.

Am 21.10.2016 um 05:34 schrieb Monk Liu:

Quoted 36 lines

UMD need this bit if preemption want supported

Change-Id Ic657b3e6f46a148ed3cf0e932ccf46f2c5230d7f

Conflicts:
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 8 ++++++++
  include/uapi/drm/amdgpu_drm.h           | 4 ++++
  2 files changed, 12 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +8 -0
index 58a0b59..85b4c5f 100644
@@ -540,6 +540,14 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
  		return copy_to_user(out, &vce_clk_table,
  				    min((size_t)size, sizeof(vce_clk_table))) ? -EFAULT : 0;
  	}
+
+	case AMDGPU_INFO_PREEMPTION: {
+		if (amdgpu_sriov_vf(adev))
+			ui32 |= AMDGPU_INFO_PREEMPTION_ENALBED;
+		return copy_to_user(out, &ui32, min(size, 4u)) ? -EFAULT: 0;
+		break;
+	}
+
  	default:
  		DRM_DEBUG_KMS("Invalid request %d\n", info->query);
  		return -EINVAL;
include/uapi/drm/amdgpu_drm.h +0 -0
index 667e9bc..2f25c50 100644

include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_cs_chunk_data { · line 510

Quoted 10 lines
include/uapi/drm/amdgpu_drm.h +4 -0
@@ -501,6 +501,10 @@ struct drm_amdgpu_cs_chunk_data {
  #define AMDGPU_INFO_MMR_SH_INDEX_SHIFT	8
  #define AMDGPU_INFO_MMR_SH_INDEX_MASK	0xff
 
+/* Query info about preemption */
+#define AMDGPU_INFO_PREEMPTION          0x1B
+	#define AMDGPU_INFO_PREEMPTION_ENALBED	1
+
  struct drm_amdgpu_query_fw {
  	/** AMDGPU_INFO_FW_* */
  	__u32 fw_type;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 882294ec-ec3b-95c3-2caf-8e9e49bd6a08-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#4 lore raw
Quoted 3 lines · Christian König

Way to much overkill, just put that into the device info flags.

See AMDGPU_IDS_FLAGS_FUSION for reference.

Yeah, agreed.

Alex

Quoted 54 lines

Christian.

Am 21.10.2016 um 05:34 schrieb Monk Liu:

Quoted 49 lines

UMD need this bit if preemption want supported

Change-Id Ic657b3e6f46a148ed3cf0e932ccf46f2c5230d7f

Conflicts:
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 8 ++++++++
  include/uapi/drm/amdgpu_drm.h           | 4 ++++
  2 files changed, 12 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0 -0
index 58a0b59..85b4c5f 100644
@@ -540,6 +540,14 @@ static int amdgpu_info_ioctl(struct drm_device *dev,

void *data, struct drm_file
return copy_to_user(out, &vce_clk_table,
min((size_t)size,

sizeof(vce_clk_table))) ? -EFAULT : 0;
        }
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +5 -0
+
+       case AMDGPU_INFO_PREEMPTION: {
+               if (amdgpu_sriov_vf(adev))
+                       ui32 |= AMDGPU_INFO_PREEMPTION_ENALBED;
+               return copy_to_user(out, &ui32, min(size, 4u)) ? -EFAULT:

0;

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
+               break;
+       }
+
        default:
                DRM_DEBUG_KMS("Invalid request %d\n", info->query);
                return -EINVAL;
include/uapi/drm/amdgpu_drm.h +3 -0
index 667e9bc..2f25c50 100644
@@ -501,6 +501,10 @@ struct drm_amdgpu_cs_chunk_data {
  #define AMDGPU_INFO_MMR_SH_INDEX_SHIFT        8
  #define AMDGPU_INFO_MMR_SH_INDEX_MASK 0xff
  +/* Query info about preemption */
+#define AMDGPU_INFO_PREEMPTION          0x1B
+       #define AMDGPU_INFO_PREEMPTION_ENALBED  1
+
  struct drm_amdgpu_query_fw {
        /** AMDGPU_INFO_FW_* */
Quoted 8 lines

include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_cs_chunk_data { · line 510

Quoted 1 line
include/uapi/drm/amdgpu_drm.h +0 -0
        __u32 fw_type;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CADnq5_MY+NHBU7Xn9m6qOX4gC7sx2XhpUUe=Ls1whfq-Kwr0eA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

author
#6 lore raw

Okay, good advice

BR Monk

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Friday, October 21, 2016 10:55 PM
To: Christian König <[email protected]>
Cc: Liu, Monk <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH] drm/amdgpu:set preemption flag bit

Quoted 3 lines · Christian König

Way to much overkill, just put that into the device info flags.

See AMDGPU_IDS_FLAGS_FUSION for reference.

Yeah, agreed.

Alex

Quoted 54 lines

Christian.

Am 21.10.2016 um 05:34 schrieb Monk Liu:

Quoted 49 lines

UMD need this bit if preemption want supported

Change-Id Ic657b3e6f46a148ed3cf0e932ccf46f2c5230d7f

Conflicts:
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 8 ++++++++
  include/uapi/drm/amdgpu_drm.h           | 4 ++++
  2 files changed, 12 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +8 -0
index 58a0b59..85b4c5f 100644
@@ -540,6 +540,14 @@ static int amdgpu_info_ioctl(struct drm_device 
 *dev, void *data, struct drm_file
                return copy_to_user(out, &vce_clk_table,
                                    min((size_t)size,
 sizeof(vce_clk_table))) ? -EFAULT : 0;
        }
+
+       case AMDGPU_INFO_PREEMPTION: {
+               if (amdgpu_sriov_vf(adev))
+                       ui32 |= AMDGPU_INFO_PREEMPTION_ENALBED;
+               return copy_to_user(out, &ui32, min(size, 4u)) ? -EFAULT:
 0;
+               break;
+       }
+
        default:
                DRM_DEBUG_KMS("Invalid request %d\n", info->query);
                return -EINVAL;
(quoted diff) +0 -0

b/include/uapi/drm/amdgpu_drm.h index 667e9bc..2f25c50 100644

include/uapi/drm/amdgpu_drm.h +3 -0
@@ -501,6 +501,10 @@ struct drm_amdgpu_cs_chunk_data {
  #define AMDGPU_INFO_MMR_SH_INDEX_SHIFT        8
  #define AMDGPU_INFO_MMR_SH_INDEX_MASK 0xff
  +/* Query info about preemption */
+#define AMDGPU_INFO_PREEMPTION          0x1B
+       #define AMDGPU_INFO_PREEMPTION_ENALBED  1
+
  struct drm_amdgpu_query_fw {
        /** AMDGPU_INFO_FW_* */
Quoted 8 lines

include/uapi/drm/amdgpu_drm.h struct drm_amdgpu_cs_chunk_data { · line 510

Quoted 1 line
include/uapi/drm/amdgpu_drm.h +0 -0
        __u32 fw_type;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx