summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2013-06-13 10:10:17 +0800
committerChia-I Wu <olvaffe@gmail.com>2013-06-13 12:58:47 +0800
commit6057d7b7b58102bf7c3c4ecb08c1b7261f299efa (patch)
tree0771bf3a2a11f23a39fd414537aecb5ca0f4fe6c /src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
parentb65bdc61bd3d694d26ccae165b12f7d6d41327f9 (diff)
downloadexternal_mesa3d-6057d7b7b58102bf7c3c4ecb08c1b7261f299efa.zip
external_mesa3d-6057d7b7b58102bf7c3c4ecb08c1b7261f299efa.tar.gz
external_mesa3d-6057d7b7b58102bf7c3c4ecb08c1b7261f299efa.tar.bz2
ilo: re-emit states that involve resources
Even with hardware contexts, since we do not pin resources, we have to re-emit the states so that the resources are referenced (by cp->bo) and their offsets are updated in case they are moved. This also allows us to elimiate cp flush in is_bo_busy().
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c')
-rw-r--r--src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c b/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
index e4315df..c60fc01 100644
--- a/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
+++ b/src/gallium/drivers/ilo/ilo_3d_pipeline_gen6.c
@@ -210,7 +210,8 @@ gen6_pipeline_common_base_address(struct ilo_3d_pipeline *p,
struct gen6_pipeline_session *session)
{
/* STATE_BASE_ADDRESS */
- if (session->state_bo_changed || session->instruction_bo_changed) {
+ if (session->state_bo_changed || session->instruction_bo_changed ||
+ session->batch_bo_changed) {
if (p->dev->gen == ILO_GEN(6))
gen6_wa_pipe_control_post_sync(p, false);
@@ -396,13 +397,14 @@ gen6_pipeline_vf(struct ilo_3d_pipeline *p,
struct gen6_pipeline_session *session)
{
/* 3DSTATE_INDEX_BUFFER */
- if (DIRTY(INDEX_BUFFER)) {
+ if (DIRTY(INDEX_BUFFER) || session->batch_bo_changed) {
p->gen6_3DSTATE_INDEX_BUFFER(p->dev,
&ilo->ib.state, session->info->primitive_restart, p->cp);
}
/* 3DSTATE_VERTEX_BUFFERS */
- if (DIRTY(VERTEX_BUFFERS) || DIRTY(VERTEX_ELEMENTS)) {
+ if (DIRTY(VERTEX_BUFFERS) || DIRTY(VERTEX_ELEMENTS) ||
+ session->batch_bo_changed) {
p->gen6_3DSTATE_VERTEX_BUFFERS(p->dev,
ilo->vb.states, ilo->vb.enabled_mask, ilo->ve, p->cp);
}
@@ -714,7 +716,7 @@ gen6_pipeline_wm_depth(struct ilo_3d_pipeline *p,
struct gen6_pipeline_session *session)
{
/* 3DSTATE_DEPTH_BUFFER and 3DSTATE_CLEAR_PARAMS */
- if (DIRTY(FRAMEBUFFER)) {
+ if (DIRTY(FRAMEBUFFER) || session->batch_bo_changed) {
if (p->dev->gen == ILO_GEN(6)) {
gen6_wa_pipe_control_post_sync(p, false);
gen6_wa_pipe_control_wm_depth_flush(p);
@@ -1298,11 +1300,24 @@ gen6_pipeline_prepare(const struct ilo_3d_pipeline *p,
if (session->hw_ctx_changed) {
/* these should be enough to make everything uploaded */
+ session->batch_bo_changed = true;
session->state_bo_changed = true;
session->instruction_bo_changed = true;
session->prim_changed = true;
}
else {
+ /*
+ * Any state that involves resources needs to be re-emitted when the
+ * batch bo changed. This is because we do not pin the resources and
+ * their offsets (or existence) may change between batch buffers.
+ *
+ * Since we messed around with ILO_3D_PIPELINE_INVALIDATE_BATCH_BO in
+ * handle_invalid_batch_bo(), use ILO_3D_PIPELINE_INVALIDATE_STATE_BO as
+ * a temporary workaround.
+ */
+ session->batch_bo_changed =
+ (p->invalidate_flags & ILO_3D_PIPELINE_INVALIDATE_STATE_BO);
+
session->state_bo_changed =
(p->invalidate_flags & ILO_3D_PIPELINE_INVALIDATE_STATE_BO);
session->instruction_bo_changed =