@@ -1071,6 +1071,11 @@ struct drm_i915_gem_object {
atomic_t pending_flip;
};
+inline static bool i915_gem_object_is_prime(struct drm_i915_gem_object *obj)
+{
+ return obj->base.import_attach != NULL;
+}
+
#define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base)
/**
@@ -553,7 +553,7 @@ i915_gem_pread_ioctl(struct drm_device *dev, void *data,
/* prime objects have no backing filp to GEM pread/pwrite
* pages from.
*/
- if (!obj->base.filp) {
+ if (i915_gem_object_is_prime(obj)) {
ret = -EINVAL;
goto out;
}
@@ -902,7 +902,7 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data,
/* prime objects have no backing filp to GEM pread/pwrite
* pages from.
*/
- if (!obj->base.filp) {
+ if (i915_gem_object_is_prime(obj)) {
ret = -EINVAL;
goto out;
}