* [PATCH] drm/i915/gem: Refactor tests on obj->ops->flags
@ 2019-10-02 12:30 Chris Wilson
2019-10-02 12:50 ` Matthew Auld
2019-10-02 16:31 ` ✗ Fi.CI.BAT: failure for " Patchwork
0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2019-10-02 12:30 UTC (permalink / raw)
To: intel-gfx; +Cc: Matthew Auld
We repeat obj->ops->flags in our object checks, so pull that into its
own little helper for clarity.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
---
drivers/gpu/drm/i915/gem/i915_gem_object.h | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h b/drivers/gpu/drm/i915/gem/i915_gem_object.h
index aec05f967d9d..53c7069ba3e8 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_object.h
+++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h
@@ -134,34 +134,41 @@ i915_gem_object_is_readonly(const struct drm_i915_gem_object *obj)
return obj->base.vma_node.readonly;
}
+static inline bool
+i915_gem_object_type_has(const struct drm_i915_gem_object *obj,
+ unsigned long flags)
+{
+ return obj->ops->flags & flags;
+}
+
static inline bool
i915_gem_object_has_struct_page(const struct drm_i915_gem_object *obj)
{
- return obj->ops->flags & I915_GEM_OBJECT_HAS_STRUCT_PAGE;
+ return i915_gem_object_type_has(obj, I915_GEM_OBJECT_HAS_STRUCT_PAGE);
}
static inline bool
i915_gem_object_is_shrinkable(const struct drm_i915_gem_object *obj)
{
- return obj->ops->flags & I915_GEM_OBJECT_IS_SHRINKABLE;
+ return i915_gem_object_type_has(obj, I915_GEM_OBJECT_IS_SHRINKABLE);
}
static inline bool
i915_gem_object_is_proxy(const struct drm_i915_gem_object *obj)
{
- return obj->ops->flags & I915_GEM_OBJECT_IS_PROXY;
+ return i915_gem_object_type_has(obj, I915_GEM_OBJECT_IS_PROXY);
}
static inline bool
i915_gem_object_never_bind_ggtt(const struct drm_i915_gem_object *obj)
{
- return obj->ops->flags & I915_GEM_OBJECT_NO_GGTT;
+ return i915_gem_object_type_has(obj, I915_GEM_OBJECT_NO_GGTT);
}
static inline bool
i915_gem_object_needs_async_cancel(const struct drm_i915_gem_object *obj)
{
- return obj->ops->flags & I915_GEM_OBJECT_ASYNC_CANCEL;
+ return i915_gem_object_type_has(obj, I915_GEM_OBJECT_ASYNC_CANCEL);
}
static inline bool
--
2.23.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915/gem: Refactor tests on obj->ops->flags
2019-10-02 12:30 [PATCH] drm/i915/gem: Refactor tests on obj->ops->flags Chris Wilson
@ 2019-10-02 12:50 ` Matthew Auld
2019-10-02 16:31 ` ✗ Fi.CI.BAT: failure for " Patchwork
1 sibling, 0 replies; 3+ messages in thread
From: Matthew Auld @ 2019-10-02 12:50 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
On 02/10/2019 13:30, Chris Wilson wrote:
> We repeat obj->ops->flags in our object checks, so pull that into its
> own little helper for clarity.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
* ✗ Fi.CI.BAT: failure for drm/i915/gem: Refactor tests on obj->ops->flags
2019-10-02 12:30 [PATCH] drm/i915/gem: Refactor tests on obj->ops->flags Chris Wilson
2019-10-02 12:50 ` Matthew Auld
@ 2019-10-02 16:31 ` Patchwork
1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2019-10-02 16:31 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/gem: Refactor tests on obj->ops->flags
URL : https://patchwork.freedesktop.org/series/67491/
State : failure
== Summary ==
Applying: drm/i915/gem: Refactor tests on obj->ops->flags
Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/gem/i915_gem_object.h
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-10-02 16:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-02 12:30 [PATCH] drm/i915/gem: Refactor tests on obj->ops->flags Chris Wilson
2019-10-02 12:50 ` Matthew Auld
2019-10-02 16:31 ` ✗ Fi.CI.BAT: failure for " Patchwork
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.