Re: [PATCH 1/8] drm/i915/selftests: Increase size for mock ringbuffer

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

 



Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> writes:

> We don't actually emit any commands into the ringbuffer, so we set it
> very small. However, an upcoming change centralises the wait-for-space
> into i915_gem_request_alloc() and that imposes a minimum size upon all
> ringbuffers (mock or real) of MIN_SPACE_FOR_ADD_REQUEST. Grow the
> mock ringbuffer such that we allocate a single page for the struct+buffer,
> satisfying the new condition without wasting too much space.
>
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>

Reviewed-by: Mika Kuoppala <mika.kuoppala@xxxxxxxxxxxxxxx>

> ---
>  drivers/gpu/drm/i915/selftests/mock_engine.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/selftests/mock_engine.c b/drivers/gpu/drm/i915/selftests/mock_engine.c
> index 0aafa8a105b8..55c0e2c15782 100644
> --- a/drivers/gpu/drm/i915/selftests/mock_engine.c
> +++ b/drivers/gpu/drm/i915/selftests/mock_engine.c
> @@ -124,9 +124,11 @@ static void mock_submit_request(struct drm_i915_gem_request *request)
>  
>  static struct intel_ring *mock_ring(struct intel_engine_cs *engine)
>  {
> -	const unsigned long sz = roundup_pow_of_two(sizeof(struct intel_ring));
> +	const unsigned long sz = PAGE_SIZE / 2;
>  	struct intel_ring *ring;
>  
> +	BUILD_BUG_ON(MIN_SPACE_FOR_ADD_REQUEST > sz);
> +
>  	ring = kzalloc(sizeof(*ring) + sz, GFP_KERNEL);
>  	if (!ring)
>  		return NULL;
> -- 
> 2.15.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
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