diff options
author | Damien Lespiau <damien.lespiau@intel.com> | 2015-02-10 14:32:19 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-02-13 17:28:28 -0500 |
commit | cef437ad22848afa68f02973a57473cc45b25f01 (patch) | |
tree | b7c1c771a8faa7d4cac4167718ac591bf8255377 | |
parent | a01c7162ca1116dc95c5363e6d77078a61797fc5 (diff) |
drm/i915: Make intel_lr_context_render_state_init() static
This function is only used in intel_lrc.c, so restrict it to that file. The
function was moved around to avoid a forward declaration and group it with its
user.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.c | 66 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.h | 2 |
2 files changed, 33 insertions, 35 deletions
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index c4db49ef4d19..8872a809bb87 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c | |||
@@ -1323,6 +1323,39 @@ static int gen8_emit_request(struct intel_ringbuffer *ringbuf, | |||
1323 | return 0; | 1323 | return 0; |
1324 | } | 1324 | } |
1325 | 1325 | ||
1326 | static int intel_lr_context_render_state_init(struct intel_engine_cs *ring, | ||
1327 | struct intel_context *ctx) | ||
1328 | { | ||
1329 | struct intel_ringbuffer *ringbuf = ctx->engine[ring->id].ringbuf; | ||
1330 | struct render_state so; | ||
1331 | struct drm_i915_file_private *file_priv = ctx->file_priv; | ||
1332 | struct drm_file *file = file_priv ? file_priv->file : NULL; | ||
1333 | int ret; | ||
1334 | |||
1335 | ret = i915_gem_render_state_prepare(ring, &so); | ||
1336 | if (ret) | ||
1337 | return ret; | ||
1338 | |||
1339 | if (so.rodata == NULL) | ||
1340 | return 0; | ||
1341 | |||
1342 | ret = ring->emit_bb_start(ringbuf, | ||
1343 | ctx, | ||
1344 | so.ggtt_offset, | ||
1345 | I915_DISPATCH_SECURE); | ||
1346 | if (ret) | ||
1347 | goto out; | ||
1348 | |||
1349 | i915_vma_move_to_active(i915_gem_obj_to_ggtt(so.obj), ring); | ||
1350 | |||
1351 | ret = __i915_add_request(ring, file, so.obj); | ||
1352 | /* intel_logical_ring_add_request moves object to inactive if it | ||
1353 | * fails */ | ||
1354 | out: | ||
1355 | i915_gem_render_state_fini(&so); | ||
1356 | return ret; | ||
1357 | } | ||
1358 | |||
1326 | static int gen8_init_rcs_context(struct intel_engine_cs *ring, | 1359 | static int gen8_init_rcs_context(struct intel_engine_cs *ring, |
1327 | struct intel_context *ctx) | 1360 | struct intel_context *ctx) |
1328 | { | 1361 | { |
@@ -1588,39 +1621,6 @@ cleanup_render_ring: | |||
1588 | return ret; | 1621 | return ret; |
1589 | } | 1622 | } |
1590 | 1623 | ||
1591 | int intel_lr_context_render_state_init(struct intel_engine_cs *ring, | ||
1592 | struct intel_context *ctx) | ||
1593 | { | ||
1594 | struct intel_ringbuffer *ringbuf = ctx->engine[ring->id].ringbuf; | ||
1595 | struct render_state so; | ||
1596 | struct drm_i915_file_private *file_priv = ctx->file_priv; | ||
1597 | struct drm_file *file = file_priv ? file_priv->file : NULL; | ||
1598 | int ret; | ||
1599 | |||
1600 | ret = i915_gem_render_state_prepare(ring, &so); | ||
1601 | if (ret) | ||
1602 | return ret; | ||
1603 | |||
1604 | if (so.rodata == NULL) | ||
1605 | return 0; | ||
1606 | |||
1607 | ret = ring->emit_bb_start(ringbuf, | ||
1608 | ctx, | ||
1609 | so.ggtt_offset, | ||
1610 | I915_DISPATCH_SECURE); | ||
1611 | if (ret) | ||
1612 | goto out; | ||
1613 | |||
1614 | i915_vma_move_to_active(i915_gem_obj_to_ggtt(so.obj), ring); | ||
1615 | |||
1616 | ret = __i915_add_request(ring, file, so.obj); | ||
1617 | /* intel_logical_ring_add_request moves object to inactive if it | ||
1618 | * fails */ | ||
1619 | out: | ||
1620 | i915_gem_render_state_fini(&so); | ||
1621 | return ret; | ||
1622 | } | ||
1623 | |||
1624 | static int | 1624 | static int |
1625 | populate_lr_context(struct intel_context *ctx, struct drm_i915_gem_object *ctx_obj, | 1625 | populate_lr_context(struct intel_context *ctx, struct drm_i915_gem_object *ctx_obj, |
1626 | struct intel_engine_cs *ring, struct intel_ringbuffer *ringbuf) | 1626 | struct intel_engine_cs *ring, struct intel_ringbuffer *ringbuf) |
diff --git a/drivers/gpu/drm/i915/intel_lrc.h b/drivers/gpu/drm/i915/intel_lrc.h index ced191f73b0e..46c5e10710e0 100644 --- a/drivers/gpu/drm/i915/intel_lrc.h +++ b/drivers/gpu/drm/i915/intel_lrc.h | |||
@@ -72,8 +72,6 @@ int intel_logical_ring_begin(struct intel_ringbuffer *ringbuf, | |||
72 | int num_dwords); | 72 | int num_dwords); |
73 | 73 | ||
74 | /* Logical Ring Contexts */ | 74 | /* Logical Ring Contexts */ |
75 | int intel_lr_context_render_state_init(struct intel_engine_cs *ring, | ||
76 | struct intel_context *ctx); | ||
77 | void intel_lr_context_free(struct intel_context *ctx); | 75 | void intel_lr_context_free(struct intel_context *ctx); |
78 | int intel_lr_context_deferred_create(struct intel_context *ctx, | 76 | int intel_lr_context_deferred_create(struct intel_context *ctx, |
79 | struct intel_engine_cs *ring); | 77 | struct intel_engine_cs *ring); |