gen9: fix gem_render_copy 3d state setup
Subsystems (3)
PATCH 1/1 gen9: fix gem_render_copy 3d state setup
Without emitting the default 3DSTATE_WM_DEPTH_STENCIL state the test will fail.
--- lib/rendercopy_gen9.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
lib/rendercopy_gen9.c +8 -2
@@ -821,7 +821,13 @@ gen8_emit_ps(struct intel_batchbuffer *batch, uint32_t kernel) { }static void -gen8_emit_depth (struct intel_batchbuffer *batch) { +gen9_emit_depth (struct intel_batchbuffer *batch) +{ +OUT_BATCH (GEN8_3DSTATE_WM_DEPTH_STENCIL | (4 -2 )); +OUT_BATCH (0 ); +OUT_BATCH (0 ); +OUT_BATCH (0 ); +OUT_BATCH (GEN7_3DSTATE_DEPTH_BUFFER | (8 -2 ));OUT_BATCH (0 );OUT_BATCH (0 );
@@ -999,7 +1005,7 @@ void gen9_render_copyfunc(struct intel_batchbuffer *batch,OUT_BATCH (GEN6_3DSTATE_SCISSOR_STATE_POINTERS );OUT_BATCH (scissor_state); -gen8_emit_depth (batch); +gen9_emit_depth (batch);gen7_emit_clear (batch);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 4 lines · Imre Deak
Without emitting the default 3DSTATE_WM_DEPTH_STENCIL state the test will fail.
Signed-off-by Imre Deak <[email protected]>
Question: Wasn't the golden context supposed to paper over those?
Signature · 1 line
Damien
Quoted 39 lines
--- lib/rendercopy_gen9.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)lib/rendercopy_gen9.c +8
-2@@ -821,7 +821,13 @@ gen8_emit_ps(struct intel_batchbuffer *batch, uint32_t kernel) { }static void -gen8_emit_depth (struct intel_batchbuffer *batch) { +gen9_emit_depth (struct intel_batchbuffer *batch) +{ +OUT_BATCH (GEN8_3DSTATE_WM_DEPTH_STENCIL | (4 -2 )); +OUT_BATCH (0 ); +OUT_BATCH (0 ); +OUT_BATCH (0 ); +OUT_BATCH (GEN7_3DSTATE_DEPTH_BUFFER | (8 -2 ));OUT_BATCH (0 );OUT_BATCH (0 );@@ -999,7 +1005,7 @@ void gen9_render_copyfunc(struct intel_batchbuffer *batch,OUT_BATCH (GEN6_3DSTATE_SCISSOR_STATE_POINTERS );OUT_BATCH (scissor_state); -gen8_emit_depth (batch); +gen9_emit_depth (batch);gen7_emit_clear (batch);Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 7 lines · Damien Lespiau
Quoted 4 lines · Imre Deak
Without emitting the default 3DSTATE_WM_DEPTH_STENCIL state the test will fail.
Signed-off-by Imre Deak <[email protected]>Question: Wasn't the golden context supposed to paper over those?
Perhaps, currently the golden context doesn't include this. I put it here to match what GEN8 copy_render does, but I agree that eventually we should move it to the golden context. I noticed that a bunch of other 3DSTATE commands are missing, which could explain the failures I see with other tests (at least piglit-mesa). I'm experimenting now with an updated golden context to see if it solves those failures.
--Imre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 10 lines · Imre Deak
Quoted 7 lines · Damien Lespiau
Quoted 4 lines · Imre Deak
Without emitting the default 3DSTATE_WM_DEPTH_STENCIL state the test will fail.
Signed-off-by Imre Deak <[email protected]>Question: Wasn't the golden context supposed to paper over those?
Perhaps, currently the golden context doesn't include this.
Today, you cannot rely on the initial contents of the context even with the golden render state. There is no pristine context, every client is responsible for configuring the hardware exactly as they intend to use - at least as regards the untrusted commands (e.g. 3DSTATE). -Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 8 lines · Chris Wilson
Quoted 7 lines · Imre Deak
Quoted 6 lines · Damien Lespiau
Quoted 4 lines · Imre Deak
Without emitting the default 3DSTATE_WM_DEPTH_STENCIL state the test will fail.
Signed-off-by Imre Deak <[email protected]>
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Question: Wasn't the golden context supposed to paper over those?
Perhaps, currently the golden context doesn't include this.
Today, you cannot rely on the initial contents of the context even with the golden render state. There is no pristine context, every client is responsible for configuring the hardware exactly as they intend to use - at least as regards the untrusted commands (e.g. 3DSTATE).
Right. Now the question is, do we want to change that and have the golden context with sane defaults?
Signature · 5 lines
Damien _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 13 lines · Damien Lespiau
Quoted 12 lines · Chris Wilson
Quoted 10 lines · Imre Deak
Quoted 7 lines · Damien Lespiau
Quoted 4 lines · Imre Deak
Without emitting the default 3DSTATE_WM_DEPTH_STENCIL state the test will fail.
Signed-off-by Imre Deak <[email protected]>Question: Wasn't the golden context supposed to paper over those?
Perhaps, currently the golden context doesn't include this.
Quoted 7 lines
Quoted 4 lines
Today, you cannot rely on the initial contents of the context even with the golden render state. There is no pristine context, every client is responsible for configuring the hardware exactly as they intend to use - at least as regards the untrusted commands (e.g. 3DSTATE).
Right. Now the question is, do we want to change that and have the golden context with sane defaults?
You missed the point. The point is that we don't keep initialise every context from scratch. And there still doesn't seem to be any reason to be papering over userspace bugs.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 19 lines · Chris Wilson
Quoted 18 lines · Damien Lespiau
Quoted 16 lines · Chris Wilson
Quoted 10 lines · Imre Deak
Quoted 7 lines · Damien Lespiau
Quoted 4 lines · Imre Deak
Without emitting the default 3DSTATE_WM_DEPTH_STENCIL state the test will fail.
Signed-off-by Imre Deak <[email protected]>Question: Wasn't the golden context supposed to paper over those?
Perhaps, currently the golden context doesn't include this.
Today, you cannot rely on the initial contents of the context even with the golden render state. There is no pristine context, every client is responsible for configuring the hardware exactly as they intend to use - at least as regards the untrusted commands (e.g. 3DSTATE).
Quoted 6 lines
Quoted 2 lines
Right. Now the question is, do we want to change that and have the golden context with sane defaults?
You missed the point. The point is that we don't keep initialise every context from scratch. And there still doesn't seem to be any reason to be papering over userspace bugs.
That's because I still think the end of the journey is a fully initialized golden context image + copy of that context on context creation.
Signature · 5 lines
Damien _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 23 lines · Damien Lespiau
Quoted 22 lines · Chris Wilson
Quoted 20 lines · Damien Lespiau
Quoted 8 lines · Chris Wilson
Quoted 7 lines · Imre Deak
Quoted 6 lines · Damien Lespiau
Quoted 4 lines · Imre Deak
Without emitting the default 3DSTATE_WM_DEPTH_STENCIL state the test will fail.
Signed-off-by Imre Deak <[email protected]>Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Question: Wasn't the golden context supposed to paper over those?
Perhaps, currently the golden context doesn't include this.
Today, you cannot rely on the initial contents of the context even with the golden render state. There is no pristine context, every client is responsible for configuring the hardware exactly as they intend to use - at least as regards the untrusted commands (e.g. 3DSTATE).
Right. Now the question is, do we want to change that and have the golden context with sane defaults?
Quoted 8 lines
Quoted 3 lines
You missed the point. The point is that we don't keep initialise every context from scratch. And there still doesn't seem to be any reason to be papering over userspace bugs.
That's because I still think the end of the journey is a fully initialized golden context image + copy of that context on context creation.
For me the end journey has looked like this:
For first (default) context:
- run golden/null batch
- emit workarounds
- take a master copy from ctx_obj
Then:
- copy from master (with gpu or cpu) for every new fd/ctx
-Mika
Quoted 6 lines
Signature · 5 lines
Damien _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 36 lines · Mika Kuoppala
Quoted 23 lines · Damien Lespiau
Quoted 22 lines · Chris Wilson
Quoted 20 lines · Damien Lespiau
Quoted 8 lines · Chris Wilson
Quoted 7 lines · Imre Deak
Quoted 6 lines · Damien Lespiau
Quoted 4 lines · Imre Deak
Without emitting the default 3DSTATE_WM_DEPTH_STENCIL state the test will fail.
Signed-off-by Imre Deak <[email protected]>Quoted 8 lines
Quoted 3 lines
Quoted 1 line
Question: Wasn't the golden context supposed to paper over those?
Perhaps, currently the golden context doesn't include this.
Today, you cannot rely on the initial contents of the context even with the golden render state. There is no pristine context, every client is responsible for configuring the hardware exactly as they intend to use - at least as regards the untrusted commands (e.g. 3DSTATE).
Right. Now the question is, do we want to change that and have the golden context with sane defaults?
Quoted 8 lines
Quoted 3 lines
You missed the point. The point is that we don't keep initialise every context from scratch. And there still doesn't seem to be any reason to be papering over userspace bugs.
That's because I still think the end of the journey is a fully initialized golden context image + copy of that context on context creation.
For me the end journey has looked like this:
Quoted 7 lines
For first (default) context:
- run golden/null batch
- emit workarounds
- take a master copy fromctx_objThen:
- copy from master (with gpu or cpu) for every new fd/ctx
Can we just have it? I think we only need to do this here:
drivers/gpu/drm/i915/i915_gem_context.c +1 -1
@@ -633,7 +633,7 @@ static int do_switch(struct intel_engine_cs *ring, goto unpin_out; } -if (!to->legacy_hw_ctx.initialized ||i915_gem_context_is_default (to)) +if (!to->legacy_hw_ctx.initialized) hw_flags |=MI_RESTORE_INHIBIT ; ret =mi_set_context (ring, to, hw_flags);
Chris doesn't like it though for the perf implications. I've sent this out a while ago but never got around to doing the microbenchmark Chris requested. So testing (and if it works, volunteers for the microbenchmark) highly welcome ...
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx