All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] drm/i915/selftests: Increase size for mock ringbuffer
@ 2017-11-14 21:30 Chris Wilson
  2017-11-14 21:30 ` [PATCH 2/8] drm/i915: Make request's wait-for-space explicit Chris Wilson
                   ` (9 more replies)
  0 siblings, 10 replies; 20+ messages in thread
From: Chris Wilson @ 2017-11-14 21:30 UTC (permalink / raw)
  To: intel-gfx

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@chris-wilson.co.uk>
---
 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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-11-17 13:29 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-14 21:30 [PATCH 1/8] drm/i915/selftests: Increase size for mock ringbuffer Chris Wilson
2017-11-14 21:30 ` [PATCH 2/8] drm/i915: Make request's wait-for-space explicit Chris Wilson
     [not found]   ` <87shdfps4u.fsf@gaia.fi.intel.com>
2017-11-15 14:07     ` Chris Wilson
2017-11-15 14:30       ` Mika Kuoppala
2017-11-14 21:30 ` [PATCH 3/8] drm/i915: Automatic i915_switch_context for legacy Chris Wilson
2017-11-16 14:00   ` Mika Kuoppala
2017-11-16 14:44     ` Chris Wilson
2017-11-17 11:58       ` Mika Kuoppala
2017-11-14 21:30 ` [PATCH 4/8] drm/i915: Remove i915.enable_execlists module parameter Chris Wilson
2017-11-14 21:30 ` [PATCH 5/8] drm/i915: Remove obsolete ringbuffer emission for gen8+ Chris Wilson
2017-11-17 13:29   ` Mika Kuoppala
2017-11-14 21:30 ` [PATCH 6/8] drm/i915: Disable semaphores on Sandybridge Chris Wilson
2017-11-16 12:52   ` Joonas Lahtinen
2017-11-14 21:30 ` [PATCH 7/8] drm/i915: Move debugfs/i915_semaphore_status to i915_engine_info Chris Wilson
2017-11-16 13:01   ` Joonas Lahtinen
2017-11-14 21:30 ` [PATCH 8/8] drm/i915: Remove i915.semaphores modparam Chris Wilson
2017-11-16 13:13   ` Joonas Lahtinen
2017-11-14 21:58 ` ✓ Fi.CI.BAT: success for series starting with [1/8] drm/i915/selftests: Increase size for mock ringbuffer Patchwork
2017-11-15  0:49 ` ✓ Fi.CI.IGT: " Patchwork
2017-11-15 12:14 ` [PATCH 1/8] " Mika Kuoppala

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.