Skip to contentSkip to conversation

drm/i915: Check for get_pages instead of shmem (filp)

PATCH Applied Ben Widawsky 7 participants 14 messages Feb 6, 2016 – Feb 15, 2016

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

PATCH 1/1 drm/i915: Check for get_pages instead of shmem (filp)

This behavior of checking for a shmem backed GEM object was introduced here:
commit 4c914c0c7c787b8f730128a8cdcca9c50b0784ab

Author: Brad Volkin <[email protected]>
Date:   Tue Feb 18 10:15:45 2014 -0800

drm/i915: Refactor shmem pread setup

It is possible for an object to not be a shmem backed GEM object (for example userptr objects). An example of how we hit this failure can be found through copy_batch() in the command parser because we allocate a userptr object for the batch which contains privileged instructions. Userptr calls drm_gem_private_object_init() which explicitly sets the filp to none.

It is equally feasible to simply remove the check altogether. You'll probably oops with get_pages somewhere, but that's okay IMO because this condition should be a driver bug, and not trigger-able by userspace. On this note, the function name could probably benefit from a change, but whatever.

NOTE: I manually retyped this from a test machine. So I haven't even compiled this exact patch.

Cc Chris Wilson <[email protected]>
Cc Kristian Høgsberg <[email protected]>
Cc Jordan Justen <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +1 -1
index 66b1705..a198928 100644
@@ -489,7 +489,7 @@ int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj,
 
 	*needs_clflush = 0;
 
-	if (!obj->base.filp)
+	if (!obj->ops->get_pages)
 		return -EINVAL;
 
 	if (!(obj->base.read_domains & I915_GEM_DOMAIN_CPU)) {
Signature · 6 lines
2.7.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✓ Fi.CI.BAT: success for drm/i915: Check for get_pages instead of shmem (filp)

== Summary ==

== Summary ==

Series 3145v1 drm/i915: Check for get_pages instead of shmem (filp)
http://patchwork.freedesktop.org/api/1.0/series/3145/revisions/1/mbox/

bdw-nuci7        total:161  pass:152  dwarn:0   dfail:0   fail:0   skip:9  
bdw-ultra        total:164  pass:152  dwarn:0   dfail:0   fail:0   skip:12 
bsw-nuc-2        total:164  pass:136  dwarn:0   dfail:0   fail:0   skip:28 
byt-nuc          total:164  pass:141  dwarn:0   dfail:0   fail:0   skip:23 
hsw-brixbox      total:164  pass:151  dwarn:0   dfail:0   fail:0   skip:13 
hsw-gt2          total:164  pass:154  dwarn:0   dfail:0   fail:0   skip:10 
ilk-hp8440p      total:164  pass:116  dwarn:0   dfail:0   fail:0   skip:48 
ivb-t430s        total:164  pass:150  dwarn:0   dfail:0   fail:0   skip:14 
skl-i5k-2        total:164  pass:149  dwarn:1   dfail:0   fail:0   skip:14 
snb-dellxps      total:164  pass:142  dwarn:0   dfail:0   fail:0   skip:22 

Results at /archive/results/CI_IGT_test/Patchwork_1377/

9ae71c139227311e70dcc91d16d5acba34ce9a71 drm-intel-nightly: 2016y-02m-08d-09h-39m-29s UTC integration manifest 48a3f49aa2256f9e1a071ff4a52c5c226cf01ee2 drm/i915: Check for get_pages instead of shmem (filp)

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

Tested-by Reviewed-by on v1 1/1 Applied
#2 lore raw
In reply to Ben Widawsky

Applied to a 4.4.1 tree:

And, FWIW:

Quoted 45 lines · Ben Widawsky

This behavior of checking for a shmem backed GEM object was introduced here:
commit 4c914c0c7c787b8f730128a8cdcca9c50b0784ab

Author: Brad Volkin <[email protected]>
Date:   Tue Feb 18 10:15:45 2014 -0800

drm/i915: Refactor shmem pread setup

It is possible for an object to not be a shmem backed GEM object (for example userptr objects). An example of how we hit this failure can be found through copy_batch() in the command parser because we allocate a userptr object for the batch which contains privileged instructions. Userptr calls drm_gem_private_object_init() which explicitly sets the filp to none.

It is equally feasible to simply remove the check altogether. You'll probably oops with get_pages somewhere, but that's okay IMO because this condition should be a driver bug, and not trigger-able by userspace. On this note, the function name could probably benefit from a change, but whatever.

NOTE: I manually retyped this from a test machine. So I haven't even compiled this exact patch.

Cc Chris Wilson <[email protected]>
Cc Kristian Høgsberg <[email protected]>
Cc Jordan Justen <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +1 -1
index 66b1705..a198928 100644
@@ -489,7 +489,7 @@ int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj,
 
        *needs_clflush = 0;
 
-       if (!obj->base.filp)
+       if (!obj->ops->get_pages)
                return -EINVAL;
 
        if (!(obj->base.read_domains & I915_GEM_DOMAIN_CPU)) {
Signature · 1 line
2.7.0

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

#3 lore raw
In reply to Ben Widawsky
Quoted 34 lines · Ben Widawsky

This behavior of checking for a shmem backed GEM object was introduced here:
commit 4c914c0c7c787b8f730128a8cdcca9c50b0784ab

Author: Brad Volkin <[email protected]>
Date:   Tue Feb 18 10:15:45 2014 -0800

drm/i915: Refactor shmem pread setup

It is possible for an object to not be a shmem backed GEM object (for example userptr objects). An example of how we hit this failure can be found through copy_batch() in the command parser because we allocate a userptr object for the batch which contains privileged instructions. Userptr calls drm_gem_private_object_init() which explicitly sets the filp to none.

It is equally feasible to simply remove the check altogether. You'll probably oops with get_pages somewhere, but that's okay IMO because this condition should be a driver bug, and not trigger-able by userspace. On this note, the function name could probably benefit from a change, but whatever.

NOTE: I manually retyped this from a test machine. So I haven't even compiled this exact patch.

Cc Chris Wilson <[email protected]>
Cc Kristian Høgsberg <[email protected]>
Cc Jordan Justen <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +0 -0
index 66b1705..a198928 100644

drivers/gpu/drm/i915/i915_gem.c int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj, · line 492

Quoted 5 lines
drivers/gpu/drm/i915/i915_gem.c +1 -1
@@ -489,7 +489,7 @@ int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj,
 
        *needs_clflush = 0;
 
-       if (!obj->base.filp)
+       if (!obj->ops->get_pages)

Do we want to do what Chris did in a2a4f916c2f344d4e596c875dd1e66764afec8b8 (on drm-intel-fixes):

+ if (WARN_ON((obj->ops->flags & I915_GEM_OBJECT_HAS_STRUCT_PAGE) == 0))

?

Quoted 6 lines
drivers/gpu/drm/i915/i915_gem.c +0 -1
                return -EINVAL;
 
        if (!(obj->base.read_domains & I915_GEM_DOMAIN_CPU)) {
--

2.7.0

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

#4 lore raw
Quoted 37 lines · Kristian Høgsberg
Quoted 35 lines · Ben Widawsky

This behavior of checking for a shmem backed GEM object was introduced here:
commit 4c914c0c7c787b8f730128a8cdcca9c50b0784ab

Author: Brad Volkin <[email protected]>
Date:   Tue Feb 18 10:15:45 2014 -0800

drm/i915: Refactor shmem pread setup

It is possible for an object to not be a shmem backed GEM object (for example userptr objects). An example of how we hit this failure can be found through copy_batch() in the command parser because we allocate a userptr object for the batch which contains privileged instructions. Userptr calls drm_gem_private_object_init() which explicitly sets the filp to none.

It is equally feasible to simply remove the check altogether. You'll probably oops with get_pages somewhere, but that's okay IMO because this condition should be a driver bug, and not trigger-able by userspace. On this note, the function name could probably benefit from a change, but whatever.

NOTE: I manually retyped this from a test machine. So I haven't even compiled this exact patch.

Cc Chris Wilson <[email protected]>
Cc Kristian Høgsberg <[email protected]>
Cc Jordan Justen <[email protected]>
---
  drivers/gpu/drm/i915/i915_gem.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +0 -0
index 66b1705..a198928 100644
@@ -489,7 +489,7 @@ int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj,
 
Quoted 4 lines

drivers/gpu/drm/i915/i915_gem.c int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj, · line 492

Quoted 4 lines
drivers/gpu/drm/i915/i915_gem.c +1 -1
         *needs_clflush = 0;
 
-       if (!obj->base.filp)
+       if (!obj->ops->get_pages)

Don't all subclasses have a get_pages() function?

Quoted 6 lines

Do we want to do what Chris did in a2a4f916c2f344d4e596c875dd1e66764afec8b8 (on drm-intel-fixes):

+ if (WARN_ON((obj->ops->flags & I915_GEM_OBJECT_HAS_STRUCT_PAGE) == 0))

?

Yes, I think so; i915_gem_shmem_pread() is going to walk the sglist, so the object had better have a page array for it to iterate over.

.Dave.

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

#5 lore raw
Quoted 38 lines · Dave Gordon
Quoted 37 lines · Kristian Høgsberg
Quoted 35 lines · Ben Widawsky

This behavior of checking for a shmem backed GEM object was introduced here:
commit 4c914c0c7c787b8f730128a8cdcca9c50b0784ab

Author: Brad Volkin <[email protected]>
Date:   Tue Feb 18 10:15:45 2014 -0800

drm/i915: Refactor shmem pread setup

It is possible for an object to not be a shmem backed GEM object (for example userptr objects). An example of how we hit this failure can be found through copy_batch() in the command parser because we allocate a userptr object for the batch which contains privileged instructions. Userptr calls drm_gem_private_object_init() which explicitly sets the filp to none.

It is equally feasible to simply remove the check altogether. You'll probably oops with get_pages somewhere, but that's okay IMO because this condition should be a driver bug, and not trigger-able by userspace. On this note, the function name could probably benefit from a change, but whatever.

NOTE: I manually retyped this from a test machine. So I haven't even compiled this exact patch.

Cc Chris Wilson <[email protected]>
Cc Kristian Høgsberg <[email protected]>
Cc Jordan Justen <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +0 -0
index 66b1705..a198928 100644
@@ -489,7 +489,7 @@ int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj,
 
Quoted 6 lines
Quoted 4 lines

drivers/gpu/drm/i915/i915_gem.c int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj, · line 492

Quoted 4 lines
drivers/gpu/drm/i915/i915_gem.c +1 -1
        *needs_clflush = 0;
 
-       if (!obj->base.filp)
+       if (!obj->ops->get_pages)

Don't all subclasses have a get_pages() function?

Yeah, as I said in the commit message, I didn't think this was particularly appealing, but I figured people would say something if I removed everything. I wasn't aware of Chris' patch.

Quoted 4 lines
Quoted 4 lines

Do we want to do what Chris did in a2a4f916c2f344d4e596c875dd1e66764afec8b8 (on drm-intel-fixes):

Quoted 9 lines
Quoted 3 lines

+ if (WARN_ON((obj->ops->flags & I915_GEM_OBJECT_HAS_STRUCT_PAGE) == 0))

?

Yes, I think so; i915_gem_shmem_pread() is going to walk the sglist, so the object had better have a page array for it to iterate over.

.Dave.

Okay. I'll send v2. Thanks.

Signature · 5 lines
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

PATCH v2 1/1 drm/i915: Check for get_pages instead of shmem (filp)

In reply to Ben Widawsky

This behavior of checking for a shmem backed GEM object was introduced here:
commit 4c914c0c7c787b8f730128a8cdcca9c50b0784ab

Author: Brad Volkin <[email protected]>
Date:   Tue Feb 18 10:15:45 2014 -0800

drm/i915: Refactor shmem pread setup

It is possible for an object to not be a shmem backed GEM object (for example userptr objects). An example of how we hit this failure can be found through copy_batch() in the command parser because we allocate a userptr object for the batch which contains privileged instructions. Userptr calls drm_gem_private_object_init() which explicitly sets the filp to none.

NOTE: I manually retyped this from a test machine. So I haven't even compiled this exact patch.

v2: Use same logic as from a2a4f916c2f (Kristian, Dave Gordon)

---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +1 -1
index e9b19bc..7fd79b0 100644
@@ -489,7 +489,7 @@ int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj,
 
 	*needs_clflush = 0;
 
-	if (!obj->base.filp)
+	if (WARN_ON((obj->ops->flags & I915_GEM_OBJECT_HAS_STRUCT_PAGE) == 0))
 		return -EINVAL;
 
 	if (!(obj->base.read_domains & I915_GEM_DOMAIN_CPU)) {
Signature · 6 lines
2.7.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#12 lore raw

✗ Fi.CI.BAT: warning for drm/i915: Check for get_pages instead of shmem (filp) (rev2)

In reply to Ben Widawsky
== Summary ==

== Summary ==

Series 3145v2 drm/i915: Check for get_pages instead of shmem (filp)
http://patchwork.freedesktop.org/api/1.0/series/3145/revisions/2/mbox/

Test pm_rpm:

        Subgroup basic-pci-d3-state:
                fail       -> PASS       (hsw-gt2)
                pass       -> DMESG-WARN (byt-nuc)
        Subgroup basic-rte:
                dmesg-warn -> PASS       (bsw-nuc-2)
                dmesg-warn -> PASS       (byt-nuc) UNSTABLE
bdw-nuci7        total:161  pass:152  dwarn:0   dfail:0   fail:0   skip:9  
bdw-ultra        total:164  pass:152  dwarn:0   dfail:0   fail:0   skip:12 
bsw-nuc-2        total:164  pass:136  dwarn:0   dfail:0   fail:0   skip:28 
byt-nuc          total:164  pass:140  dwarn:1   dfail:0   fail:0   skip:23 
hsw-brixbox      total:164  pass:151  dwarn:0   dfail:0   fail:0   skip:13 
hsw-gt2          total:164  pass:154  dwarn:0   dfail:0   fail:0   skip:10 
ilk-hp8440p      total:164  pass:116  dwarn:0   dfail:0   fail:0   skip:48 
ivb-t430s        total:164  pass:150  dwarn:0   dfail:0   fail:0   skip:14 
snb-dellxps      total:164  pass:142  dwarn:0   dfail:0   fail:0   skip:22 
snb-x220t        total:164  pass:142  dwarn:0   dfail:0   fail:1   skip:21 

Results at /archive/results/CI_IGT_test/Patchwork_1385/

d9bd337b4b2d46f73005fcdf0e7049e7f8ed5c04 drm-intel-nightly: 2016y-02m-09d-15h-42m-46s UTC integration manifest cb1f5a551af8b6b2f3f75a322a70df5891eee393 drm/i915: Check for get_pages instead of shmem (filp)

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

#7 lore raw
In reply to Ben Widawsky

Do you guys get the CI mails? This version has regressions. v1 did not. I don't know what to trust.

Quoted 44 lines · Ben Widawsky

This behavior of checking for a shmem backed GEM object was introduced here:
commit 4c914c0c7c787b8f730128a8cdcca9c50b0784ab

Author: Brad Volkin <[email protected]>
Date:   Tue Feb 18 10:15:45 2014 -0800

drm/i915: Refactor shmem pread setup

It is possible for an object to not be a shmem backed GEM object (for example userptr objects). An example of how we hit this failure can be found through copy_batch() in the command parser because we allocate a userptr object for the batch which contains privileged instructions. Userptr calls drm_gem_private_object_init() which explicitly sets the filp to none.

NOTE: I manually retyped this from a test machine. So I haven't even compiled this exact patch.

v2: Use same logic as from a2a4f916c2f (Kristian, Dave Gordon)

---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +1 -1
index e9b19bc..7fd79b0 100644
@@ -489,7 +489,7 @@ int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj,
 
 	*needs_clflush = 0;
 
-	if (!obj->base.filp)
+	if (WARN_ON((obj->ops->flags & I915_GEM_OBJECT_HAS_STRUCT_PAGE) == 0))
 		return -EINVAL;
 
 	if (!(obj->base.read_domains & I915_GEM_DOMAIN_CPU)) {
Signature · 1 line
2.7.0
Signature · 5 lines
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw
Quoted 2 lines · Ben Widawsky

Do you guys get the CI mails? This version has regressions. v1 did not. I don't know what to trust.

I didn't even see v2 itself!

Quoted 36 lines · Ben Widawsky
Quoted 35 lines

This behavior of checking for a shmem backed GEM object was introduced here:
commit 4c914c0c7c787b8f730128a8cdcca9c50b0784ab

Author: Brad Volkin <[email protected]>
Date:   Tue Feb 18 10:15:45 2014 -0800

drm/i915: Refactor shmem pread setup

It is possible for an object to not be a shmem backed GEM object (for example userptr objects). An example of how we hit this failure can be found through copy_batch() in the command parser because we allocate a userptr object for the batch which contains privileged instructions. Userptr calls drm_gem_private_object_init() which explicitly sets the filp to none.

NOTE: I manually retyped this from a test machine. So I haven't even compiled this exact patch.

v2: Use same logic as from a2a4f916c2f (Kristian, Dave Gordon)

---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +0 -0
index e9b19bc..7fd79b0 100644
@@ -489,7 +489,7 @@ int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj,
 
Quoted 4 lines

drivers/gpu/drm/i915/i915_gem.c int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj, · line 492

Quoted 4 lines
drivers/gpu/drm/i915/i915_gem.c +1 -1
 	*needs_clflush = 0;
 
-	if (!obj->base.filp)
+	if (WARN_ON((obj->ops->flags & I915_GEM_OBJECT_HAS_STRUCT_PAGE) == 0))

Don't use WARN_ON, there is code (or will be) where we use prepare_shmem_read/write to determine if we can use the shmem paths.

Also i915_gem_obj_prepare_shmem_write() requires the same treatment.

My apologies I had this patch but appear to have accidentally squashed it whilst rebasing. Thanks!
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw
Quoted 50 lines · Chris Wilson
Quoted 2 lines · Ben Widawsky

Do you guys get the CI mails? This version has regressions. v1 did not. I don't know what to trust.

I didn't even see v2 itself!

Quoted 36 lines · Ben Widawsky
Quoted 35 lines

This behavior of checking for a shmem backed GEM object was introduced here:
commit 4c914c0c7c787b8f730128a8cdcca9c50b0784ab

Author: Brad Volkin <[email protected]>
Date:   Tue Feb 18 10:15:45 2014 -0800

drm/i915: Refactor shmem pread setup

It is possible for an object to not be a shmem backed GEM object (for example userptr objects). An example of how we hit this failure can be found through copy_batch() in the command parser because we allocate a userptr object for the batch which contains privileged instructions. Userptr calls drm_gem_private_object_init() which explicitly sets the filp to none.

NOTE: I manually retyped this from a test machine. So I haven't even compiled this exact patch.

v2: Use same logic as from a2a4f916c2f (Kristian, Dave Gordon)

---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +0 -0
index e9b19bc..7fd79b0 100644
@@ -489,7 +489,7 @@ int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj,
 
Quoted 4 lines

drivers/gpu/drm/i915/i915_gem.c int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj, · line 492

Quoted 4 lines
drivers/gpu/drm/i915/i915_gem.c +1 -1
 	*needs_clflush = 0;
 
-	if (!obj->base.filp)
+	if (WARN_ON((obj->ops->flags & I915_GEM_OBJECT_HAS_STRUCT_PAGE) == 0))

Don't use WARN_ON, there is code (or will be) where we use prepare_shmem_read/write to determine if we can use the shmem paths.

Quoted 6 lines

Also i915_gem_obj_prepare_shmem_write() requires the same treatment.

My apologies I had this patch but appear to have accidentally squashed it whilst rebasing. Thanks!
-Chris

So... is someone going to land this fix? We need it.

Signature · 5 lines
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#13 lore raw

Re: ✗ Fi.CI.BAT: warning for drm/i915: Check for get_pages instead of shmem (filp) (rev2)

In reply to Patchwork
Quoted 9 lines · Patchwork

== Summary ==

Series 3145v2 drm/i915: Check for get_pages instead of shmem (filp)
http://patchwork.freedesktop.org/api/1.0/series/3145/revisions/2/mbox/

Test pm_rpm:

        Subgroup basic-pci-d3-state:
                fail       -> PASS       (hsw-gt2)
                pass       -> DMESG-WARN (byt-nuc)

Known fail: https://bugs.freedesktop.org/show_bug.cgi?id=93121

I really should simply merge the patch to shut this all up. -Daniel

Quoted 24 lines
        Subgroup basic-rte:
                dmesg-warn -> PASS       (bsw-nuc-2)
                dmesg-warn -> PASS       (byt-nuc) UNSTABLE
bdw-nuci7        total:161  pass:152  dwarn:0   dfail:0   fail:0   skip:9  
bdw-ultra        total:164  pass:152  dwarn:0   dfail:0   fail:0   skip:12 
bsw-nuc-2        total:164  pass:136  dwarn:0   dfail:0   fail:0   skip:28 
byt-nuc          total:164  pass:140  dwarn:1   dfail:0   fail:0   skip:23 
hsw-brixbox      total:164  pass:151  dwarn:0   dfail:0   fail:0   skip:13 
hsw-gt2          total:164  pass:154  dwarn:0   dfail:0   fail:0   skip:10 
ilk-hp8440p      total:164  pass:116  dwarn:0   dfail:0   fail:0   skip:48 
ivb-t430s        total:164  pass:150  dwarn:0   dfail:0   fail:0   skip:14 
snb-dellxps      total:164  pass:142  dwarn:0   dfail:0   fail:0   skip:22 
snb-x220t        total:164  pass:142  dwarn:0   dfail:0   fail:1   skip:21 

Results at /archive/results/CI_IGT_test/Patchwork_1385/

d9bd337b4b2d46f73005fcdf0e7049e7f8ed5c04 drm-intel-nightly: 2016y-02m-09d-15h-42m-46s UTC integration manifest cb1f5a551af8b6b2f3f75a322a70df5891eee393 drm/i915: Check for get_pages instead of shmem (filp)

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

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw
In reply to Ben Widawsky
Quoted 51 lines · Ben Widawsky
Quoted 50 lines · Chris Wilson
Quoted 2 lines · Ben Widawsky

Do you guys get the CI mails? This version has regressions. v1 did not. I don't know what to trust.

I didn't even see v2 itself!

Quoted 36 lines · Ben Widawsky
Quoted 35 lines

This behavior of checking for a shmem backed GEM object was introduced here:
commit 4c914c0c7c787b8f730128a8cdcca9c50b0784ab

Author: Brad Volkin <[email protected]>
Date:   Tue Feb 18 10:15:45 2014 -0800

drm/i915: Refactor shmem pread setup

It is possible for an object to not be a shmem backed GEM object (for example userptr objects). An example of how we hit this failure can be found through copy_batch() in the command parser because we allocate a userptr object for the batch which contains privileged instructions. Userptr calls drm_gem_private_object_init() which explicitly sets the filp to none.

NOTE: I manually retyped this from a test machine. So I haven't even compiled this exact patch.

v2: Use same logic as from a2a4f916c2f (Kristian, Dave Gordon)

---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +0 -0
index e9b19bc..7fd79b0 100644
@@ -489,7 +489,7 @@ int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj,
 
Quoted 4 lines

drivers/gpu/drm/i915/i915_gem.c int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj, · line 492

Quoted 4 lines
drivers/gpu/drm/i915/i915_gem.c +1 -1
 	*needs_clflush = 0;
 
-	if (!obj->base.filp)
+	if (WARN_ON((obj->ops->flags & I915_GEM_OBJECT_HAS_STRUCT_PAGE) == 0))

Don't use WARN_ON, there is code (or will be) where we use prepare_shmem_read/write to determine if we can use the shmem paths.

Quoted 8 lines
Quoted 6 lines

Also i915_gem_obj_prepare_shmem_write() requires the same treatment.

My apologies I had this patch but appear to have accidentally squashed it whilst rebasing. Thanks!
-Chris

So... is someone going to land this fix? We need it.

Queued for -next, thanks for the patch. Aside: We have about 15 committers by now, Chris being one of them. No need to hang in there waiting for lazy me to undig myself from the latest CI fire.
-Daniel

Quoted 7 lines
Signature · 6 lines
-- 
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#11 lore raw
In reply to Ben Widawsky
Quoted 43 lines · Ben Widawsky
Quoted 42 lines · Chris Wilson
Quoted 2 lines · Ben Widawsky

Do you guys get the CI mails? This version has regressions. v1 did not. I don't know what to trust.

I didn't even see v2 itself!

Quoted 36 lines · Ben Widawsky
Quoted 35 lines

This behavior of checking for a shmem backed GEM object was introduced here:
commit 4c914c0c7c787b8f730128a8cdcca9c50b0784ab

Author: Brad Volkin <[email protected]>
Date:   Tue Feb 18 10:15:45 2014 -0800

drm/i915: Refactor shmem pread setup

It is possible for an object to not be a shmem backed GEM object (for example userptr objects). An example of how we hit this failure can be found through copy_batch() in the command parser because we allocate a userptr object for the batch which contains privileged instructions. Userptr calls drm_gem_private_object_init() which explicitly sets the filp to none.

NOTE: I manually retyped this from a test machine. So I haven't even compiled this exact patch.

v2: Use same logic as from a2a4f916c2f (Kristian, Dave Gordon)

---
  drivers/gpu/drm/i915/i915_gem.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem.c +0 -0
index e9b19bc..7fd79b0 100644
@@ -489,7 +489,7 @@ int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj,
 
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

drivers/gpu/drm/i915/i915_gem.c int i915_gem_obj_prepare_shmem_read(struct drm_i915_gem_object *obj, · line 492

Quoted 4 lines
drivers/gpu/drm/i915/i915_gem.c +1 -1
  	*needs_clflush = 0;
 
-	if (!obj->base.filp)
+	if (WARN_ON((obj->ops->flags & I915_GEM_OBJECT_HAS_STRUCT_PAGE) == 0))

It looks like the above code can't be reached? 'filp' is tested in i915_gem_pread_ioctl(), before i915_gem_obj_prepare_shmem_read() is called!

Quoted 4 lines
Quoted 4 lines

Don't use WARN_ON, there is code (or will be) where we use prepare_shmem_read/write to determine if we can use the shmem paths.

Also i915_gem_obj_prepare_shmem_write() requires the same treatment.

No such function, but there's a 'filp' test in i915_gem_pwrite_ioctl().

Also, what about i915_gem_mmap_ioctl() ? Is mmap() also going to be legitimate without a file pointer?

Quoted 5 lines
Quoted 3 lines

My apologies I had this patch but appear to have accidentally squashed it whilst rebasing. Thanks!
-Chris

So... is someone going to land this fix? We need it.

Looks like Chris wants this to read

    if (!(obj->ops->flags & I915_GEM_OBJECT_HAS_STRUCT_PAGE))
        return -EINVAL;

leaving it to the caller to decide whether to log a complaint. I'm happy with that.

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