intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Check for get_pages instead of shmem (filp)
@ 2016-02-06  1:48 Ben Widawsky
  2016-02-08 12:58 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Ben Widawsky @ 2016-02-06  1:48 UTC (permalink / raw)
  To: Intel GFX; +Cc: Ben Widawsky

This behavior of checking for a shmem backed GEM object was introduced here:
commit 4c914c0c7c787b8f730128a8cdcca9c50b0784ab
Author: Brad Volkin <bradley.d.volkin@intel.com>
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 <chris@chris-wilson.co.uk>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 66b1705..a198928 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -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)) {
-- 
2.7.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-02-15 17:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-06  1:48 [PATCH] drm/i915: Check for get_pages instead of shmem (filp) Ben Widawsky
2016-02-08 12:58 ` ✓ Fi.CI.BAT: success for " Patchwork
2016-02-08 23:02 ` [PATCH] " Jordan Justen
2016-02-09  0:20 ` Kristian Høgsberg
2016-02-09 11:30   ` Dave Gordon
2016-02-09 17:37     ` Ben Widawsky
2016-02-09 19:44 ` [PATCH] [v2] " Ben Widawsky
2016-02-10 15:42   ` Ben Widawsky
2016-02-10 16:23     ` Chris Wilson
2016-02-10 17:39       ` Ben Widawsky
2016-02-15 17:26         ` Daniel Vetter
2016-02-15 17:56         ` Dave Gordon
2016-02-10  7:14 ` ✗ Fi.CI.BAT: warning for drm/i915: Check for get_pages instead of shmem (filp) (rev2) Patchwork
2016-02-15 17:25   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).