Re: [PATCH 19/22] drm/i915: Move obj->active:5 to obj->flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On ke, 2016-07-27 at 12:14 +0100, Chris Wilson wrote:
> +static inline void
> +i915_gem_object_set_active(struct drm_i915_gem_object *obj, int engine)
> +{
> +	obj->flags |= 1 << (engine + I915_BO_ACTIVE_SHIFT);

BIT(engine) << I915_BO_ACTIVE_SHIFT would be more readable to my taste,
but I guess it's debatable.

>  /*
>   * Optimised SGL iterator for GEM objects
>   */
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index bc5bc5ccdde0..ca9741525bf4 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -1354,7 +1354,7 @@ i915_gem_object_wait_rendering(struct drm_i915_gem_object *obj,
>  
>  	if (!readonly) {
>  		active = obj->last_read;
> -		active_mask = obj->active;
> +		active_mask = i915_gem_object_is_active(obj);

_is_active() does not really fit to be assigned to _mask. maybe have
object_active_mask() and then

_is_idle/inactive/whatever() { return !object_active_mask() }

Because the negation is used lot more.

> @@ -993,7 +993,7 @@ static int
>  i915_gem_execbuffer_move_to_gpu(struct drm_i915_gem_request *req,
>  				struct list_head *vmas)
>  {
> -	const unsigned other_rings = ~intel_engine_flag(req->engine);
> +	const unsigned int other_rings = (~intel_engine_flag(req->engine) & I915_BO_ACTIVE_MASK) << I915_BO_ACTIVE_SHIFT;

Horribly long line, is this intermediary?

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux