Skip to contentSkip to conversation

drm/amdgpu: fix 'ISO C90 forbids mixed declarations'

PATCH In review Chunming Zhou 3 participants 4 messages May 30, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdgpu: fix 'ISO C90 forbids mixed declarations'

Change-Id I412f5783e2839c53841e6ab665f939236bdc5bf1
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +3 -3
index 9ea8fb077aba..12f0d18c6ee8 100644
@@ -657,12 +657,12 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
 				     p->bytes_moved_vis);
 
 	if (p->bo_list) {
-		gds = p->bo_list->gds_obj;
-		gws = p->bo_list->gws_obj;
-		oa = p->bo_list->oa_obj;
 		struct amdgpu_vm *vm = &fpriv->vm;
 		unsigned i;
 
+		gds = p->bo_list->gds_obj;
+		gws = p->bo_list->gws_obj;
+		oa = p->bo_list->oa_obj;
 		for (i = 0; i < p->bo_list->num_entries; i++) {
 			struct amdgpu_bo *bo = p->bo_list->array[i].robj;
 
Signature · 6 lines
2.14.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): [email protected]

#2 lore raw

PATCH 2/2 drm/amdgpu: gds bo must not be per-vm-bo

In per-vm-bo case, there could be no bo list.
But gds bo created from user space must be passed to bo list. So adding a check to prevent creat per-vm gds bo.

Change-Id Idfa58c40447df0db2883413f9f7ccf56b47579f5
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +7 -0
index 556406a44da3..5fb156a01774 100644
@@ -236,6 +236,13 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
 	/* create a gem object to contain this object in */
 	if (args->in.domains & (AMDGPU_GEM_DOMAIN_GDS |
 	    AMDGPU_GEM_DOMAIN_GWS | AMDGPU_GEM_DOMAIN_OA)) {
+		if (flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID) {
+			/* if gds bo is created from user space, it must be
+			 * passed to bo list
+			 */
+			DRM_ERROR("GDS bo cannot be per-vm-bo\n");
+			return -EINVAL;
+		}
 		flags |= AMDGPU_GEM_CREATE_NO_CPU_ACCESS;
 		if (args->in.domains == AMDGPU_GEM_DOMAIN_GDS)
 			size = size << AMDGPU_GDS_SHIFT;
Signature · 6 lines
2.14.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by Emily Deng
#3 lore raw
In reply to a message not in the archive
Quoted 40 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Chunming Zhou
Sent: Wednesday, May 30, 2018 11:15 AM
To: [email protected]; [email protected]
Cc: Deng, Emily <[email protected]>; Zhou, David(ChunMing) <[email protected]>
Subject: [PATCH 1/2] drm/amdgpu: fix 'ISO C90 forbids mixed declarations'

Change-Id I412f5783e2839c53841e6ab665f939236bdc5bf1
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +3 -4
index 9ea8fb077aba..12f0d18c6ee8 100644
@@ -657,12 +657,12 @@ static int amdgpu_cs_parser_bos(struct
 amdgpu_cs_parser *p,
 				     p->bytes_moved_vis);
 
 	if (p->bo_list) {
-		gds = p->bo_list->gds_obj;
-		gws = p->bo_list->gws_obj;
-		oa = p->bo_list->oa_obj;
 		struct amdgpu_vm *vm = &fpriv->vm;
 		unsigned i;
 
+		gds = p->bo_list->gds_obj;
+		gws = p->bo_list->gws_obj;
+		oa = p->bo_list->oa_obj;
 		for (i = 0; i < p->bo_list->num_entries; i++) {
 			struct amdgpu_bo *bo = p->bo_list->array[i].robj;
 
--

2.14.1

Quoted 4 lines

_______________________________________________
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

#4 lore raw
In reply to Chunming Zhou

Please add something like "Fixing a compiler warning." as commit message.

With that done the series is Reviewed-by: Christian König <[email protected]>.

Thanks,
Christian.

Am 30.05.2018 um 05:14 schrieb Chunming Zhou:

Quoted 16 lines
Change-Id I412f5783e2839c53841e6ab665f939236bdc5bf1
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +0 -2
index 9ea8fb077aba..12f0d18c6ee8 100644
@@ -657,12 +657,12 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
  				     p->bytes_moved_vis);
 
  	if (p->bo_list) {
-		gds = p->bo_list->gds_obj;
-		gws = p->bo_list->gws_obj;

drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, · line 668

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +3 -1
-		oa = p->bo_list->oa_obj;
  		struct amdgpu_vm *vm = &fpriv->vm;
  		unsigned i;
 
+		gds = p->bo_list->gds_obj;
+		gws = p->bo_list->gws_obj;
+		oa = p->bo_list->oa_obj;
  		for (i = 0; i < p->bo_list->num_entries; i++) {
  			struct amdgpu_bo *bo = p->bo_list->array[i].robj;
 

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