diff mbox

tools/null_state/gen9: Send atleast one valid component in VF state

Message ID 1438356427-26711-1-git-send-email-arun.siluvery@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

arun.siluvery@linux.intel.com July 31, 2015, 3:27 p.m. UTC
A programming restriction exists for this instruction, atleast one component
of one valid vertex element must be enabled.

Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
---
 tools/null_state_gen/intel_renderstate_gen9.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Mika Kuoppala Aug. 4, 2015, 2:03 p.m. UTC | #1
Arun Siluvery <arun.siluvery@linux.intel.com> writes:

> A programming restriction exists for this instruction, atleast one component
> of one valid vertex element must be enabled.
>
> Cc: Ben Widawsky <benjamin.widawsky@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>

> ---
>  tools/null_state_gen/intel_renderstate_gen9.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tools/null_state_gen/intel_renderstate_gen9.c b/tools/null_state_gen/intel_renderstate_gen9.c
> index 6f808f8..b3766ea 100644
> --- a/tools/null_state_gen/intel_renderstate_gen9.c
> +++ b/tools/null_state_gen/intel_renderstate_gen9.c
> @@ -440,7 +440,12 @@ int gen9_setup_null_render_state(struct intel_batchbuffer *batch)
>  	/* Vertex buffers */
>  	gen8_emit_vertex_buffers(batch);
>  	gen8_emit_vertex_elements(batch);
> -	OUT_CMD(GEN9_3DSTATE_COMPONENT_PACKING, 5);
> +
> +	OUT_BATCH(GEN9_3DSTATE_COMPONENT_PACKING | 3);
> +	OUT_BATCH(1);
> +	OUT_BATCH(0);
> +	OUT_BATCH(0);
> +	OUT_BATCH(0);
>  
>  	OUT_BATCH(GEN6_3DSTATE_VF_STATISTICS | 1 /* Enable */);
>  
> -- 
> 1.9.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ben Widawsky Aug. 5, 2015, 1:36 a.m. UTC | #2
On Fri, Jul 31, 2015 at 04:27:07PM +0100, Arun Siluvery wrote:
> A programming restriction exists for this instruction, atleast one component
> of one valid vertex element must be enabled.
> 
> Cc: Ben Widawsky <benjamin.widawsky@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
> ---
>  tools/null_state_gen/intel_renderstate_gen9.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/null_state_gen/intel_renderstate_gen9.c b/tools/null_state_gen/intel_renderstate_gen9.c
> index 6f808f8..b3766ea 100644
> --- a/tools/null_state_gen/intel_renderstate_gen9.c
> +++ b/tools/null_state_gen/intel_renderstate_gen9.c
> @@ -440,7 +440,12 @@ int gen9_setup_null_render_state(struct intel_batchbuffer *batch)
>  	/* Vertex buffers */
>  	gen8_emit_vertex_buffers(batch);
>  	gen8_emit_vertex_elements(batch);
> -	OUT_CMD(GEN9_3DSTATE_COMPONENT_PACKING, 5);
> +
> +	OUT_BATCH(GEN9_3DSTATE_COMPONENT_PACKING | 3);
> +	OUT_BATCH(1);
> +	OUT_BATCH(0);
> +	OUT_BATCH(0);
> +	OUT_BATCH(0);
>  
>  	OUT_BATCH(GEN6_3DSTATE_VF_STATISTICS | 1 /* Enable */);
>  

Like I said on IRC, I don't think this does anything unless you set bit 9 of
3DSTATE_VF.0. Also, I believe you should be setting 0xf, not 1 since you'd want
to use all 4 components.

So I'm not really sure what we're aiming to do. If you make it 0xf, and add a
comment about how this command doesn't do anything because we're not setting up
3DSTATE_VF packing, it's:
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>

I'm still more in favor of dropping the command altogether, that too would be:
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Mika Kuoppala Aug. 5, 2015, 8:13 a.m. UTC | #3
Ben Widawsky <benjamin.widawsky@intel.com> writes:

> On Fri, Jul 31, 2015 at 04:27:07PM +0100, Arun Siluvery wrote:
>> A programming restriction exists for this instruction, atleast one component
>> of one valid vertex element must be enabled.
>> 
>> Cc: Ben Widawsky <benjamin.widawsky@intel.com>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
>> ---
>>  tools/null_state_gen/intel_renderstate_gen9.c | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>> 
>> diff --git a/tools/null_state_gen/intel_renderstate_gen9.c b/tools/null_state_gen/intel_renderstate_gen9.c
>> index 6f808f8..b3766ea 100644
>> --- a/tools/null_state_gen/intel_renderstate_gen9.c
>> +++ b/tools/null_state_gen/intel_renderstate_gen9.c
>> @@ -440,7 +440,12 @@ int gen9_setup_null_render_state(struct intel_batchbuffer *batch)
>>  	/* Vertex buffers */
>>  	gen8_emit_vertex_buffers(batch);
>>  	gen8_emit_vertex_elements(batch);
>> -	OUT_CMD(GEN9_3DSTATE_COMPONENT_PACKING, 5);
>> +
>> +	OUT_BATCH(GEN9_3DSTATE_COMPONENT_PACKING | 3);
>> +	OUT_BATCH(1);
>> +	OUT_BATCH(0);
>> +	OUT_BATCH(0);
>> +	OUT_BATCH(0);
>>  
>>  	OUT_BATCH(GEN6_3DSTATE_VF_STATISTICS | 1 /* Enable */);
>>  
>
> Like I said on IRC, I don't think this does anything unless you set bit 9 of
> 3DSTATE_VF.0. Also, I believe you should be setting 0xf, not 1 since you'd want
> to use all 4 components.
>
> So I'm not really sure what we're aiming to do. If you make it 0xf, and add a
> comment about how this command doesn't do anything because we're not setting up
> 3DSTATE_VF packing, it's:
> Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
>
> I'm still more in favor of dropping the command altogether, that too would be:
> Reviewed-by: Ben Widawsky <ben@bwidawsk.net>

We are trying here just to satisfy the minimum requirements the bspec
states.

The bspec also states that with gen9+, the 3d pipeline state
doesn't need to be initialized. We should seek confirmation
about this and if it is so, remove the null state for gen9+.

-Mika

>
> -- 
> Ben Widawsky, Intel Open Source Technology Center
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ben Widawsky Aug. 5, 2015, 6:17 p.m. UTC | #4
On Wed, Aug 05, 2015 at 11:13:46AM +0300, Mika Kuoppala wrote:
> Ben Widawsky <benjamin.widawsky@intel.com> writes:
> 
> > On Fri, Jul 31, 2015 at 04:27:07PM +0100, Arun Siluvery wrote:
> >> A programming restriction exists for this instruction, atleast one component
> >> of one valid vertex element must be enabled.
> >> 
> >> Cc: Ben Widawsky <benjamin.widawsky@intel.com>
> >> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> >> Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
> >> ---
> >>  tools/null_state_gen/intel_renderstate_gen9.c | 7 ++++++-
> >>  1 file changed, 6 insertions(+), 1 deletion(-)
> >> 
> >> diff --git a/tools/null_state_gen/intel_renderstate_gen9.c b/tools/null_state_gen/intel_renderstate_gen9.c
> >> index 6f808f8..b3766ea 100644
> >> --- a/tools/null_state_gen/intel_renderstate_gen9.c
> >> +++ b/tools/null_state_gen/intel_renderstate_gen9.c
> >> @@ -440,7 +440,12 @@ int gen9_setup_null_render_state(struct intel_batchbuffer *batch)
> >>  	/* Vertex buffers */
> >>  	gen8_emit_vertex_buffers(batch);
> >>  	gen8_emit_vertex_elements(batch);
> >> -	OUT_CMD(GEN9_3DSTATE_COMPONENT_PACKING, 5);
> >> +
> >> +	OUT_BATCH(GEN9_3DSTATE_COMPONENT_PACKING | 3);
> >> +	OUT_BATCH(1);
> >> +	OUT_BATCH(0);
> >> +	OUT_BATCH(0);
> >> +	OUT_BATCH(0);
> >>  
> >>  	OUT_BATCH(GEN6_3DSTATE_VF_STATISTICS | 1 /* Enable */);
> >>  
> >
> > Like I said on IRC, I don't think this does anything unless you set bit 9 of
> > 3DSTATE_VF.0. Also, I believe you should be setting 0xf, not 1 since you'd want
> > to use all 4 components.
> >
> > So I'm not really sure what we're aiming to do. If you make it 0xf, and add a
> > comment about how this command doesn't do anything because we're not setting up
> > 3DSTATE_VF packing, it's:
> > Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
> >
> > I'm still more in favor of dropping the command altogether, that too would be:
> > Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
> 
> We are trying here just to satisfy the minimum requirements the bspec
> states.
> 

Right, except I am saying at least set minimal state which makes sense. Packing
1 component of the vertex element makes little sense (though doing this at all
makes even less sense).

> The bspec also states that with gen9+, the 3d pipeline state
> doesn't need to be initialized. We should seek confirmation
> about this and if it is so, remove the null state for gen9+.
> 

That would be super terrific.

> -Mika
> 
> >
> > -- 
> > Ben Widawsky, Intel Open Source Technology Center
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Mika Kuoppala Aug. 13, 2015, 12:30 p.m. UTC | #5
Ben Widawsky <benjamin.widawsky@intel.com> writes:

> On Fri, Jul 31, 2015 at 04:27:07PM +0100, Arun Siluvery wrote:
>> A programming restriction exists for this instruction, atleast one component
>> of one valid vertex element must be enabled.
>> 
>> Cc: Ben Widawsky <benjamin.widawsky@intel.com>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
>> ---
>>  tools/null_state_gen/intel_renderstate_gen9.c | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>> 
>> diff --git a/tools/null_state_gen/intel_renderstate_gen9.c b/tools/null_state_gen/intel_renderstate_gen9.c
>> index 6f808f8..b3766ea 100644
>> --- a/tools/null_state_gen/intel_renderstate_gen9.c
>> +++ b/tools/null_state_gen/intel_renderstate_gen9.c
>> @@ -440,7 +440,12 @@ int gen9_setup_null_render_state(struct intel_batchbuffer *batch)
>>  	/* Vertex buffers */
>>  	gen8_emit_vertex_buffers(batch);
>>  	gen8_emit_vertex_elements(batch);
>> -	OUT_CMD(GEN9_3DSTATE_COMPONENT_PACKING, 5);
>> +
>> +	OUT_BATCH(GEN9_3DSTATE_COMPONENT_PACKING | 3);
>> +	OUT_BATCH(1);
>> +	OUT_BATCH(0);
>> +	OUT_BATCH(0);
>> +	OUT_BATCH(0);
>>  
>>  	OUT_BATCH(GEN6_3DSTATE_VF_STATISTICS | 1 /* Enable */);
>>  
>
> Like I said on IRC, I don't think this does anything unless you set bit 9 of
> 3DSTATE_VF.0. Also, I believe you should be setting 0xf, not 1 since you'd want
> to use all 4 components.
>
> So I'm not really sure what we're aiming to do. If you make it 0xf, and add a
> comment about how this command doesn't do anything because we're not setting up
> 3DSTATE_VF packing, it's:
> Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
>

I messed with this one. The version with 0x1 went with your r-b.
The generator side change only so we can amend the version that
gets committed to kernel side still.

Sorry about this.
-Mika

> I'm still more in favor of dropping the command altogether, that too would be:
> Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
>
> -- 
> Ben Widawsky, Intel Open Source Technology Center
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/tools/null_state_gen/intel_renderstate_gen9.c b/tools/null_state_gen/intel_renderstate_gen9.c
index 6f808f8..b3766ea 100644
--- a/tools/null_state_gen/intel_renderstate_gen9.c
+++ b/tools/null_state_gen/intel_renderstate_gen9.c
@@ -440,7 +440,12 @@  int gen9_setup_null_render_state(struct intel_batchbuffer *batch)
 	/* Vertex buffers */
 	gen8_emit_vertex_buffers(batch);
 	gen8_emit_vertex_elements(batch);
-	OUT_CMD(GEN9_3DSTATE_COMPONENT_PACKING, 5);
+
+	OUT_BATCH(GEN9_3DSTATE_COMPONENT_PACKING | 3);
+	OUT_BATCH(1);
+	OUT_BATCH(0);
+	OUT_BATCH(0);
+	OUT_BATCH(0);
 
 	OUT_BATCH(GEN6_3DSTATE_VF_STATISTICS | 1 /* Enable */);