diff options
-rw-r--r-- | drivers/gpu/drm/i915/i915_request.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_engine_cs.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.c | 28 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.h | 2 |
5 files changed, 11 insertions, 34 deletions
diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c index f941e40fd373..ddc35e9dc0c0 100644 --- a/drivers/gpu/drm/i915/i915_request.c +++ b/drivers/gpu/drm/i915/i915_request.c | |||
@@ -650,7 +650,7 @@ i915_request_alloc(struct intel_engine_cs *engine, struct i915_gem_context *ctx) | |||
650 | * around inside i915_request_add() there is sufficient space at | 650 | * around inside i915_request_add() there is sufficient space at |
651 | * the beginning of the ring as well. | 651 | * the beginning of the ring as well. |
652 | */ | 652 | */ |
653 | rq->reserved_space = 2 * engine->emit_breadcrumb_sz * sizeof(u32); | 653 | rq->reserved_space = 2 * engine->emit_breadcrumb_dw * sizeof(u32); |
654 | 654 | ||
655 | /* | 655 | /* |
656 | * Record the position of the start of the request so that | 656 | * Record the position of the start of the request so that |
@@ -901,7 +901,7 @@ void i915_request_add(struct i915_request *request) | |||
901 | * GPU processing the request, we never over-estimate the | 901 | * GPU processing the request, we never over-estimate the |
902 | * position of the ring's HEAD. | 902 | * position of the ring's HEAD. |
903 | */ | 903 | */ |
904 | cs = intel_ring_begin(request, engine->emit_breadcrumb_sz); | 904 | cs = intel_ring_begin(request, engine->emit_breadcrumb_dw); |
905 | GEM_BUG_ON(IS_ERR(cs)); | 905 | GEM_BUG_ON(IS_ERR(cs)); |
906 | request->postfix = intel_ring_offset(request, cs); | 906 | request->postfix = intel_ring_offset(request, cs); |
907 | 907 | ||
diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c index 8f738a7cd117..ef4c8c50a4ba 100644 --- a/drivers/gpu/drm/i915/intel_engine_cs.c +++ b/drivers/gpu/drm/i915/intel_engine_cs.c | |||
@@ -611,7 +611,7 @@ struct measure_breadcrumb { | |||
611 | u32 cs[1024]; | 611 | u32 cs[1024]; |
612 | }; | 612 | }; |
613 | 613 | ||
614 | static int measure_breadcrumb_sz(struct intel_engine_cs *engine) | 614 | static int measure_breadcrumb_dw(struct intel_engine_cs *engine) |
615 | { | 615 | { |
616 | struct measure_breadcrumb *frame; | 616 | struct measure_breadcrumb *frame; |
617 | unsigned int dw; | 617 | unsigned int dw; |
@@ -637,7 +637,6 @@ static int measure_breadcrumb_sz(struct intel_engine_cs *engine) | |||
637 | frame->rq.timeline = &frame->timeline; | 637 | frame->rq.timeline = &frame->timeline; |
638 | 638 | ||
639 | dw = engine->emit_breadcrumb(&frame->rq, frame->cs) - frame->cs; | 639 | dw = engine->emit_breadcrumb(&frame->rq, frame->cs) - frame->cs; |
640 | GEM_BUG_ON(dw != engine->emit_breadcrumb_sz); | ||
641 | 640 | ||
642 | i915_timeline_fini(&frame->timeline); | 641 | i915_timeline_fini(&frame->timeline); |
643 | kfree(frame); | 642 | kfree(frame); |
@@ -698,11 +697,11 @@ int intel_engine_init_common(struct intel_engine_cs *engine) | |||
698 | if (ret) | 697 | if (ret) |
699 | goto err_breadcrumbs; | 698 | goto err_breadcrumbs; |
700 | 699 | ||
701 | ret = measure_breadcrumb_sz(engine); | 700 | ret = measure_breadcrumb_dw(engine); |
702 | if (ret < 0) | 701 | if (ret < 0) |
703 | goto err_status_page; | 702 | goto err_status_page; |
704 | 703 | ||
705 | engine->emit_breadcrumb_sz = ret; | 704 | engine->emit_breadcrumb_dw = ret; |
706 | 705 | ||
707 | return 0; | 706 | return 0; |
708 | 707 | ||
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index d2299425cf2f..5551dd2ec0e6 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c | |||
@@ -2075,7 +2075,6 @@ static u32 *gen8_emit_breadcrumb(struct i915_request *request, u32 *cs) | |||
2075 | 2075 | ||
2076 | return gen8_emit_wa_tail(request, cs); | 2076 | return gen8_emit_wa_tail(request, cs); |
2077 | } | 2077 | } |
2078 | static const int gen8_emit_breadcrumb_sz = 6 + WA_TAIL_DWORDS; | ||
2079 | 2078 | ||
2080 | static u32 *gen8_emit_breadcrumb_rcs(struct i915_request *request, u32 *cs) | 2079 | static u32 *gen8_emit_breadcrumb_rcs(struct i915_request *request, u32 *cs) |
2081 | { | 2080 | { |
@@ -2099,7 +2098,6 @@ static u32 *gen8_emit_breadcrumb_rcs(struct i915_request *request, u32 *cs) | |||
2099 | 2098 | ||
2100 | return gen8_emit_wa_tail(request, cs); | 2099 | return gen8_emit_wa_tail(request, cs); |
2101 | } | 2100 | } |
2102 | static const int gen8_emit_breadcrumb_rcs_sz = 8 + WA_TAIL_DWORDS; | ||
2103 | 2101 | ||
2104 | static int gen8_init_rcs_context(struct i915_request *rq) | 2102 | static int gen8_init_rcs_context(struct i915_request *rq) |
2105 | { | 2103 | { |
@@ -2192,7 +2190,6 @@ logical_ring_default_vfuncs(struct intel_engine_cs *engine) | |||
2192 | 2190 | ||
2193 | engine->emit_flush = gen8_emit_flush; | 2191 | engine->emit_flush = gen8_emit_flush; |
2194 | engine->emit_breadcrumb = gen8_emit_breadcrumb; | 2192 | engine->emit_breadcrumb = gen8_emit_breadcrumb; |
2195 | engine->emit_breadcrumb_sz = gen8_emit_breadcrumb_sz; | ||
2196 | 2193 | ||
2197 | engine->set_default_submission = intel_execlists_set_default_submission; | 2194 | engine->set_default_submission = intel_execlists_set_default_submission; |
2198 | 2195 | ||
@@ -2298,7 +2295,6 @@ int logical_render_ring_init(struct intel_engine_cs *engine) | |||
2298 | engine->init_context = gen8_init_rcs_context; | 2295 | engine->init_context = gen8_init_rcs_context; |
2299 | engine->emit_flush = gen8_emit_flush_render; | 2296 | engine->emit_flush = gen8_emit_flush_render; |
2300 | engine->emit_breadcrumb = gen8_emit_breadcrumb_rcs; | 2297 | engine->emit_breadcrumb = gen8_emit_breadcrumb_rcs; |
2301 | engine->emit_breadcrumb_sz = gen8_emit_breadcrumb_rcs_sz; | ||
2302 | 2298 | ||
2303 | ret = logical_ring_init(engine); | 2299 | ret = logical_ring_init(engine); |
2304 | if (ret) | 2300 | if (ret) |
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 107c4934e2fa..09c90475168a 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
@@ -330,7 +330,6 @@ static u32 *gen6_rcs_emit_breadcrumb(struct i915_request *rq, u32 *cs) | |||
330 | 330 | ||
331 | return cs; | 331 | return cs; |
332 | } | 332 | } |
333 | static const int gen6_rcs_emit_breadcrumb_sz = 14; | ||
334 | 333 | ||
335 | static int | 334 | static int |
336 | gen7_render_ring_cs_stall_wa(struct i915_request *rq) | 335 | gen7_render_ring_cs_stall_wa(struct i915_request *rq) |
@@ -432,7 +431,6 @@ static u32 *gen7_rcs_emit_breadcrumb(struct i915_request *rq, u32 *cs) | |||
432 | 431 | ||
433 | return cs; | 432 | return cs; |
434 | } | 433 | } |
435 | static const int gen7_rcs_emit_breadcrumb_sz = 6; | ||
436 | 434 | ||
437 | static u32 *gen6_xcs_emit_breadcrumb(struct i915_request *rq, u32 *cs) | 435 | static u32 *gen6_xcs_emit_breadcrumb(struct i915_request *rq, u32 *cs) |
438 | { | 436 | { |
@@ -446,7 +444,6 @@ static u32 *gen6_xcs_emit_breadcrumb(struct i915_request *rq, u32 *cs) | |||
446 | 444 | ||
447 | return cs; | 445 | return cs; |
448 | } | 446 | } |
449 | static const int gen6_xcs_emit_breadcrumb_sz = 4; | ||
450 | 447 | ||
451 | #define GEN7_XCS_WA 32 | 448 | #define GEN7_XCS_WA 32 |
452 | static u32 *gen7_xcs_emit_breadcrumb(struct i915_request *rq, u32 *cs) | 449 | static u32 *gen7_xcs_emit_breadcrumb(struct i915_request *rq, u32 *cs) |
@@ -475,7 +472,6 @@ static u32 *gen7_xcs_emit_breadcrumb(struct i915_request *rq, u32 *cs) | |||
475 | 472 | ||
476 | return cs; | 473 | return cs; |
477 | } | 474 | } |
478 | static const int gen7_xcs_emit_breadcrumb_sz = 8 + GEN7_XCS_WA * 3; | ||
479 | #undef GEN7_XCS_WA | 475 | #undef GEN7_XCS_WA |
480 | 476 | ||
481 | static void set_hwstam(struct intel_engine_cs *engine, u32 mask) | 477 | static void set_hwstam(struct intel_engine_cs *engine, u32 mask) |
@@ -885,7 +881,6 @@ static u32 *i9xx_emit_breadcrumb(struct i915_request *rq, u32 *cs) | |||
885 | 881 | ||
886 | return cs; | 882 | return cs; |
887 | } | 883 | } |
888 | static const int i9xx_emit_breadcrumb_sz = 6; | ||
889 | 884 | ||
890 | #define GEN5_WA_STORES 8 /* must be at least 1! */ | 885 | #define GEN5_WA_STORES 8 /* must be at least 1! */ |
891 | static u32 *gen5_emit_breadcrumb(struct i915_request *rq, u32 *cs) | 886 | static u32 *gen5_emit_breadcrumb(struct i915_request *rq, u32 *cs) |
@@ -908,7 +903,6 @@ static u32 *gen5_emit_breadcrumb(struct i915_request *rq, u32 *cs) | |||
908 | 903 | ||
909 | return cs; | 904 | return cs; |
910 | } | 905 | } |
911 | static const int gen5_emit_breadcrumb_sz = GEN5_WA_STORES * 3 + 2; | ||
912 | #undef GEN5_WA_STORES | 906 | #undef GEN5_WA_STORES |
913 | 907 | ||
914 | static void | 908 | static void |
@@ -2206,11 +2200,8 @@ static void intel_ring_default_vfuncs(struct drm_i915_private *dev_priv, | |||
2206 | engine->request_alloc = ring_request_alloc; | 2200 | engine->request_alloc = ring_request_alloc; |
2207 | 2201 | ||
2208 | engine->emit_breadcrumb = i9xx_emit_breadcrumb; | 2202 | engine->emit_breadcrumb = i9xx_emit_breadcrumb; |
2209 | engine->emit_breadcrumb_sz = i9xx_emit_breadcrumb_sz; | 2203 | if (IS_GEN(dev_priv, 5)) |
2210 | if (IS_GEN(dev_priv, 5)) { | ||
2211 | engine->emit_breadcrumb = gen5_emit_breadcrumb; | 2204 | engine->emit_breadcrumb = gen5_emit_breadcrumb; |
2212 | engine->emit_breadcrumb_sz = gen5_emit_breadcrumb_sz; | ||
2213 | } | ||
2214 | 2205 | ||
2215 | engine->set_default_submission = i9xx_set_default_submission; | 2206 | engine->set_default_submission = i9xx_set_default_submission; |
2216 | 2207 | ||
@@ -2240,12 +2231,10 @@ int intel_init_render_ring_buffer(struct intel_engine_cs *engine) | |||
2240 | engine->init_context = intel_rcs_ctx_init; | 2231 | engine->init_context = intel_rcs_ctx_init; |
2241 | engine->emit_flush = gen7_render_ring_flush; | 2232 | engine->emit_flush = gen7_render_ring_flush; |
2242 | engine->emit_breadcrumb = gen7_rcs_emit_breadcrumb; | 2233 | engine->emit_breadcrumb = gen7_rcs_emit_breadcrumb; |
2243 | engine->emit_breadcrumb_sz = gen7_rcs_emit_breadcrumb_sz; | ||
2244 | } else if (IS_GEN(dev_priv, 6)) { | 2234 | } else if (IS_GEN(dev_priv, 6)) { |
2245 | engine->init_context = intel_rcs_ctx_init; | 2235 | engine->init_context = intel_rcs_ctx_init; |
2246 | engine->emit_flush = gen6_render_ring_flush; | 2236 | engine->emit_flush = gen6_render_ring_flush; |
2247 | engine->emit_breadcrumb = gen6_rcs_emit_breadcrumb; | 2237 | engine->emit_breadcrumb = gen6_rcs_emit_breadcrumb; |
2248 | engine->emit_breadcrumb_sz = gen6_rcs_emit_breadcrumb_sz; | ||
2249 | } else if (IS_GEN(dev_priv, 5)) { | 2238 | } else if (IS_GEN(dev_priv, 5)) { |
2250 | engine->emit_flush = gen4_render_ring_flush; | 2239 | engine->emit_flush = gen4_render_ring_flush; |
2251 | } else { | 2240 | } else { |
@@ -2281,13 +2270,10 @@ int intel_init_bsd_ring_buffer(struct intel_engine_cs *engine) | |||
2281 | engine->emit_flush = gen6_bsd_ring_flush; | 2270 | engine->emit_flush = gen6_bsd_ring_flush; |
2282 | engine->irq_enable_mask = GT_BSD_USER_INTERRUPT; | 2271 | engine->irq_enable_mask = GT_BSD_USER_INTERRUPT; |
2283 | 2272 | ||
2284 | if (IS_GEN(dev_priv, 6)) { | 2273 | if (IS_GEN(dev_priv, 6)) |
2285 | engine->emit_breadcrumb = gen6_xcs_emit_breadcrumb; | 2274 | engine->emit_breadcrumb = gen6_xcs_emit_breadcrumb; |
2286 | engine->emit_breadcrumb_sz = gen6_xcs_emit_breadcrumb_sz; | 2275 | else |
2287 | } else { | ||
2288 | engine->emit_breadcrumb = gen7_xcs_emit_breadcrumb; | 2276 | engine->emit_breadcrumb = gen7_xcs_emit_breadcrumb; |
2289 | engine->emit_breadcrumb_sz = gen7_xcs_emit_breadcrumb_sz; | ||
2290 | } | ||
2291 | } else { | 2277 | } else { |
2292 | engine->emit_flush = bsd_ring_flush; | 2278 | engine->emit_flush = bsd_ring_flush; |
2293 | if (IS_GEN(dev_priv, 5)) | 2279 | if (IS_GEN(dev_priv, 5)) |
@@ -2310,13 +2296,10 @@ int intel_init_blt_ring_buffer(struct intel_engine_cs *engine) | |||
2310 | engine->emit_flush = gen6_ring_flush; | 2296 | engine->emit_flush = gen6_ring_flush; |
2311 | engine->irq_enable_mask = GT_BLT_USER_INTERRUPT; | 2297 | engine->irq_enable_mask = GT_BLT_USER_INTERRUPT; |
2312 | 2298 | ||
2313 | if (IS_GEN(dev_priv, 6)) { | 2299 | if (IS_GEN(dev_priv, 6)) |
2314 | engine->emit_breadcrumb = gen6_xcs_emit_breadcrumb; | 2300 | engine->emit_breadcrumb = gen6_xcs_emit_breadcrumb; |
2315 | engine->emit_breadcrumb_sz = gen6_xcs_emit_breadcrumb_sz; | 2301 | else |
2316 | } else { | ||
2317 | engine->emit_breadcrumb = gen7_xcs_emit_breadcrumb; | 2302 | engine->emit_breadcrumb = gen7_xcs_emit_breadcrumb; |
2318 | engine->emit_breadcrumb_sz = gen7_xcs_emit_breadcrumb_sz; | ||
2319 | } | ||
2320 | 2303 | ||
2321 | return intel_init_ring_buffer(engine); | 2304 | return intel_init_ring_buffer(engine); |
2322 | } | 2305 | } |
@@ -2335,7 +2318,6 @@ int intel_init_vebox_ring_buffer(struct intel_engine_cs *engine) | |||
2335 | engine->irq_disable = hsw_vebox_irq_disable; | 2318 | engine->irq_disable = hsw_vebox_irq_disable; |
2336 | 2319 | ||
2337 | engine->emit_breadcrumb = gen7_xcs_emit_breadcrumb; | 2320 | engine->emit_breadcrumb = gen7_xcs_emit_breadcrumb; |
2338 | engine->emit_breadcrumb_sz = gen7_xcs_emit_breadcrumb_sz; | ||
2339 | 2321 | ||
2340 | return intel_init_ring_buffer(engine); | 2322 | return intel_init_ring_buffer(engine); |
2341 | } | 2323 | } |
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h index 479bd53d4ac6..0834e91d4ace 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.h +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h | |||
@@ -471,7 +471,7 @@ struct intel_engine_cs { | |||
471 | #define I915_DISPATCH_SECURE BIT(0) | 471 | #define I915_DISPATCH_SECURE BIT(0) |
472 | #define I915_DISPATCH_PINNED BIT(1) | 472 | #define I915_DISPATCH_PINNED BIT(1) |
473 | u32 *(*emit_breadcrumb)(struct i915_request *rq, u32 *cs); | 473 | u32 *(*emit_breadcrumb)(struct i915_request *rq, u32 *cs); |
474 | int emit_breadcrumb_sz; | 474 | int emit_breadcrumb_dw; |
475 | 475 | ||
476 | /* Pass the request to the hardware queue (e.g. directly into | 476 | /* Pass the request to the hardware queue (e.g. directly into |
477 | * the legacy ringbuffer or to the end of an execlist). | 477 | * the legacy ringbuffer or to the end of an execlist). |