dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/etnaviv: Allow DRAW_INSTANCED commands
@ 2016-11-11 16:57 Wladimir J. van der Laan
  2016-11-12 13:30 ` Daniel Vetter
  2016-11-22 17:38 ` Lucas Stach
  0 siblings, 2 replies; 6+ messages in thread
From: Wladimir J. van der Laan @ 2016-11-11 16:57 UTC (permalink / raw)
  To: dri-devel; +Cc: Chris Healy

Vivante GPUs with HALTI0 feature support a DRAW_INSTANCED command in the
command stream to draw a number of instances of the same geometry.

The information that has been figured out about the command can be found
here: https://github.com/etnaviv/etna_viv/blob/master/rnndb/cmdstream.xml#L270

This command is not allowed currently by the DRM driver because it
was not known before. This patch enables parsing it in command
streams and allows using it by userspace drivers.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
---
 drivers/gpu/drm/etnaviv/cmdstream.xml.h      | 60 ++++++++++++++++++++++++++--
 drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c |  1 +
 2 files changed, 57 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/cmdstream.xml.h b/drivers/gpu/drm/etnaviv/cmdstream.xml.h
index 8c44ba9..65f1ba1 100644
--- a/drivers/gpu/drm/etnaviv/cmdstream.xml.h
+++ b/drivers/gpu/drm/etnaviv/cmdstream.xml.h
@@ -8,10 +8,34 @@ This file was generated by the rules-ng-ng headergen tool in this git repository
 git clone git://0x04.net/rules-ng-ng
 
 The rules-ng-ng source files this header was generated from are:
-- cmdstream.xml (  12589 bytes, from 2014-02-17 14:57:56)
-- common.xml    (  18437 bytes, from 2015-03-25 11:27:41)
-
-Copyright (C) 2014
+- cmdstream.xml (  14094 bytes, from 2016-11-11 06:55:14)
+- copyright.xml (   1597 bytes, from 2016-10-29 07:29:22)
+- common.xml    (  23344 bytes, from 2016-11-10 15:14:07)
+
+Copyright (C) 2012-2016 by the following authors:
+- Wladimir J. van der Laan <laanwj@gmail.com>
+- Christian Gmeiner <christian.gmeiner@gmail.com>
+- Lucas Stach <l.stach@pengutronix.de>
+- Russell King <rmk@arm.linux.org.uk>
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sub license,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
 */
 
 
@@ -26,6 +50,7 @@ Copyright (C) 2014
 #define FE_OPCODE_STALL						0x00000009
 #define FE_OPCODE_CALL						0x0000000a
 #define FE_OPCODE_RETURN					0x0000000b
+#define FE_OPCODE_DRAW_INSTANCED				0x0000000c
 #define FE_OPCODE_CHIP_SELECT					0x0000000d
 #define PRIMITIVE_TYPE_POINTS					0x00000001
 #define PRIMITIVE_TYPE_LINES					0x00000002
@@ -214,5 +239,32 @@ Copyright (C) 2014
 #define VIV_FE_CHIP_SELECT_HEADER_ENABLE_CHIP1			0x00000002
 #define VIV_FE_CHIP_SELECT_HEADER_ENABLE_CHIP0			0x00000001
 
+#define VIV_FE_DRAW_INSTANCED					0x00000000
+
+#define VIV_FE_DRAW_INSTANCED_HEADER				0x00000000
+#define VIV_FE_DRAW_INSTANCED_HEADER_OP__MASK			0xf8000000
+#define VIV_FE_DRAW_INSTANCED_HEADER_OP__SHIFT			27
+#define VIV_FE_DRAW_INSTANCED_HEADER_OP_DRAW_INSTANCED		0x60000000
+#define VIV_FE_DRAW_INSTANCED_HEADER_INDEXED			0x00100000
+#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE__MASK			0x000f0000
+#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE__SHIFT		16
+#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE(x)			(((x) << VIV_FE_DRAW_INSTANCED_HEADER_TYPE__SHIFT) & VIV_FE_DRAW_INSTANCED_HEADER_TYPE__MASK)
+#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__MASK	0x0000ffff
+#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__SHIFT	0
+#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO(x)	(((x) << VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__SHIFT) & VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__MASK)
+
+#define VIV_FE_DRAW_INSTANCED_COUNT				0x00000004
+#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__MASK	0xff000000
+#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__SHIFT	24
+#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI(x)	(((x) << VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__SHIFT) & VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__MASK)
+#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__MASK		0x00ffffff
+#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__SHIFT		0
+#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT(x)		(((x) << VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__SHIFT) & VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__MASK)
+
+#define VIV_FE_DRAW_INSTANCED_START				0x00000008
+#define VIV_FE_DRAW_INSTANCED_START_INDEX__MASK			0xffffffff
+#define VIV_FE_DRAW_INSTANCED_START_INDEX__SHIFT		0
+#define VIV_FE_DRAW_INSTANCED_START_INDEX(x)			(((x) << VIV_FE_DRAW_INSTANCED_START_INDEX__SHIFT) & VIV_FE_DRAW_INSTANCED_START_INDEX__MASK)
+
 
 #endif /* CMDSTREAM_XML */
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c b/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
index dcfd565..2a2e5e3 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
@@ -143,6 +143,7 @@ static bool etnaviv_validate_load_state(struct etna_validation_state *state,
 static uint8_t cmd_length[32] = {
 	[FE_OPCODE_DRAW_PRIMITIVES] = 4,
 	[FE_OPCODE_DRAW_INDEXED_PRIMITIVES] = 6,
+	[FE_OPCODE_DRAW_INSTANCED] = 4,
 	[FE_OPCODE_NOP] = 2,
 	[FE_OPCODE_STALL] = 2,
 };
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/etnaviv: Allow DRAW_INSTANCED commands
  2016-11-11 16:57 [PATCH] drm/etnaviv: Allow DRAW_INSTANCED commands Wladimir J. van der Laan
@ 2016-11-12 13:30 ` Daniel Vetter
  2016-11-12 14:01   ` Rob Clark
  2016-11-22 17:38 ` Lucas Stach
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel Vetter @ 2016-11-12 13:30 UTC (permalink / raw)
  To: Wladimir J. van der Laan; +Cc: Chris Healy, dri-devel

On Fri, Nov 11, 2016 at 05:57:54PM +0100, Wladimir J. van der Laan wrote:
> Vivante GPUs with HALTI0 feature support a DRAW_INSTANCED command in the
> command stream to draw a number of instances of the same geometry.
> 
> The information that has been figured out about the command can be found
> here: https://github.com/etnaviv/etna_viv/blob/master/rnndb/cmdstream.xml#L270
> 
> This command is not allowed currently by the DRM driver because it
> was not known before. This patch enables parsing it in command
> streams and allows using it by userspace drivers.
> 
> Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>

On that note, can we finally get the etnaviv driver merged to upstream,
like it should have been months ago? I know there's the excuse that the
display vs. render node thing in egl isn't fixed yet, but afaiui Xorg
prime and gpu-only providers have this all working, so really this isn't a
reason, just a very weak excuse. And even on the egl side the driver
should be perfectly useable as a rendering-only thing (for piglitting or
whatever). Uabi is supposed to be merged only when the userspace side is
ready, so really admit that it _is_ ready and just land it in mesa. Out of
tree drivers are nonsense imo, no matter whether it's the kernel or mesa
tree.

Adding Dave too.
-Daniel

> ---
>  drivers/gpu/drm/etnaviv/cmdstream.xml.h      | 60 ++++++++++++++++++++++++++--
>  drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c |  1 +
>  2 files changed, 57 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/etnaviv/cmdstream.xml.h b/drivers/gpu/drm/etnaviv/cmdstream.xml.h
> index 8c44ba9..65f1ba1 100644
> --- a/drivers/gpu/drm/etnaviv/cmdstream.xml.h
> +++ b/drivers/gpu/drm/etnaviv/cmdstream.xml.h
> @@ -8,10 +8,34 @@ This file was generated by the rules-ng-ng headergen tool in this git repository
>  git clone git://0x04.net/rules-ng-ng
>  
>  The rules-ng-ng source files this header was generated from are:
> -- cmdstream.xml (  12589 bytes, from 2014-02-17 14:57:56)
> -- common.xml    (  18437 bytes, from 2015-03-25 11:27:41)
> -
> -Copyright (C) 2014
> +- cmdstream.xml (  14094 bytes, from 2016-11-11 06:55:14)
> +- copyright.xml (   1597 bytes, from 2016-10-29 07:29:22)
> +- common.xml    (  23344 bytes, from 2016-11-10 15:14:07)
> +
> +Copyright (C) 2012-2016 by the following authors:
> +- Wladimir J. van der Laan <laanwj@gmail.com>
> +- Christian Gmeiner <christian.gmeiner@gmail.com>
> +- Lucas Stach <l.stach@pengutronix.de>
> +- Russell King <rmk@arm.linux.org.uk>
> +
> +Permission is hereby granted, free of charge, to any person obtaining a
> +copy of this software and associated documentation files (the "Software"),
> +to deal in the Software without restriction, including without limitation
> +the rights to use, copy, modify, merge, publish, distribute, sub license,
> +and/or sell copies of the Software, and to permit persons to whom the
> +Software is furnished to do so, subject to the following conditions:
> +
> +The above copyright notice and this permission notice (including the
> +next paragraph) shall be included in all copies or substantial portions
> +of the Software.
> +
> +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
> +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> +DEALINGS IN THE SOFTWARE.
>  */
>  
>  
> @@ -26,6 +50,7 @@ Copyright (C) 2014
>  #define FE_OPCODE_STALL						0x00000009
>  #define FE_OPCODE_CALL						0x0000000a
>  #define FE_OPCODE_RETURN					0x0000000b
> +#define FE_OPCODE_DRAW_INSTANCED				0x0000000c
>  #define FE_OPCODE_CHIP_SELECT					0x0000000d
>  #define PRIMITIVE_TYPE_POINTS					0x00000001
>  #define PRIMITIVE_TYPE_LINES					0x00000002
> @@ -214,5 +239,32 @@ Copyright (C) 2014
>  #define VIV_FE_CHIP_SELECT_HEADER_ENABLE_CHIP1			0x00000002
>  #define VIV_FE_CHIP_SELECT_HEADER_ENABLE_CHIP0			0x00000001
>  
> +#define VIV_FE_DRAW_INSTANCED					0x00000000
> +
> +#define VIV_FE_DRAW_INSTANCED_HEADER				0x00000000
> +#define VIV_FE_DRAW_INSTANCED_HEADER_OP__MASK			0xf8000000
> +#define VIV_FE_DRAW_INSTANCED_HEADER_OP__SHIFT			27
> +#define VIV_FE_DRAW_INSTANCED_HEADER_OP_DRAW_INSTANCED		0x60000000
> +#define VIV_FE_DRAW_INSTANCED_HEADER_INDEXED			0x00100000
> +#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE__MASK			0x000f0000
> +#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE__SHIFT		16
> +#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE(x)			(((x) << VIV_FE_DRAW_INSTANCED_HEADER_TYPE__SHIFT) & VIV_FE_DRAW_INSTANCED_HEADER_TYPE__MASK)
> +#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__MASK	0x0000ffff
> +#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__SHIFT	0
> +#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO(x)	(((x) << VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__SHIFT) & VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__MASK)
> +
> +#define VIV_FE_DRAW_INSTANCED_COUNT				0x00000004
> +#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__MASK	0xff000000
> +#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__SHIFT	24
> +#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI(x)	(((x) << VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__SHIFT) & VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__MASK)
> +#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__MASK		0x00ffffff
> +#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__SHIFT		0
> +#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT(x)		(((x) << VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__SHIFT) & VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__MASK)
> +
> +#define VIV_FE_DRAW_INSTANCED_START				0x00000008
> +#define VIV_FE_DRAW_INSTANCED_START_INDEX__MASK			0xffffffff
> +#define VIV_FE_DRAW_INSTANCED_START_INDEX__SHIFT		0
> +#define VIV_FE_DRAW_INSTANCED_START_INDEX(x)			(((x) << VIV_FE_DRAW_INSTANCED_START_INDEX__SHIFT) & VIV_FE_DRAW_INSTANCED_START_INDEX__MASK)
> +
>  
>  #endif /* CMDSTREAM_XML */
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c b/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
> index dcfd565..2a2e5e3 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
> @@ -143,6 +143,7 @@ static bool etnaviv_validate_load_state(struct etna_validation_state *state,
>  static uint8_t cmd_length[32] = {
>  	[FE_OPCODE_DRAW_PRIMITIVES] = 4,
>  	[FE_OPCODE_DRAW_INDEXED_PRIMITIVES] = 6,
> +	[FE_OPCODE_DRAW_INSTANCED] = 4,
>  	[FE_OPCODE_NOP] = 2,
>  	[FE_OPCODE_STALL] = 2,
>  };
> -- 
> 2.7.4
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/etnaviv: Allow DRAW_INSTANCED commands
  2016-11-12 13:30 ` Daniel Vetter
@ 2016-11-12 14:01   ` Rob Clark
  2016-11-12 14:02     ` Daniel Vetter
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Clark @ 2016-11-12 14:01 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Wladimir J. van der Laan, dri-devel@lists.freedesktop.org,
	Chris Healy

On Sat, Nov 12, 2016 at 8:30 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Fri, Nov 11, 2016 at 05:57:54PM +0100, Wladimir J. van der Laan wrote:
>> Vivante GPUs with HALTI0 feature support a DRAW_INSTANCED command in the
>> command stream to draw a number of instances of the same geometry.
>>
>> The information that has been figured out about the command can be found
>> here: https://github.com/etnaviv/etna_viv/blob/master/rnndb/cmdstream.xml#L270
>>
>> This command is not allowed currently by the DRM driver because it
>> was not known before. This patch enables parsing it in command
>> streams and allows using it by userspace drivers.
>>
>> Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
>
> On that note, can we finally get the etnaviv driver merged to upstream,
> like it should have been months ago? I know there's the excuse that the
> display vs. render node thing in egl isn't fixed yet, but afaiui Xorg
> prime and gpu-only providers have this all working, so really this isn't a
> reason, just a very weak excuse. And even on the egl side the driver
> should be perfectly useable as a rendering-only thing (for piglitting or
> whatever). Uabi is supposed to be merged only when the userspace side is
> ready, so really admit that it _is_ ready and just land it in mesa. Out of
> tree drivers are nonsense imo, no matter whether it's the kernel or mesa
> tree.

+1

BR,
-R

> Adding Dave too.
> -Daniel
>
>> ---
>>  drivers/gpu/drm/etnaviv/cmdstream.xml.h      | 60 ++++++++++++++++++++++++++--
>>  drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c |  1 +
>>  2 files changed, 57 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/etnaviv/cmdstream.xml.h b/drivers/gpu/drm/etnaviv/cmdstream.xml.h
>> index 8c44ba9..65f1ba1 100644
>> --- a/drivers/gpu/drm/etnaviv/cmdstream.xml.h
>> +++ b/drivers/gpu/drm/etnaviv/cmdstream.xml.h
>> @@ -8,10 +8,34 @@ This file was generated by the rules-ng-ng headergen tool in this git repository
>>  git clone git://0x04.net/rules-ng-ng
>>
>>  The rules-ng-ng source files this header was generated from are:
>> -- cmdstream.xml (  12589 bytes, from 2014-02-17 14:57:56)
>> -- common.xml    (  18437 bytes, from 2015-03-25 11:27:41)
>> -
>> -Copyright (C) 2014
>> +- cmdstream.xml (  14094 bytes, from 2016-11-11 06:55:14)
>> +- copyright.xml (   1597 bytes, from 2016-10-29 07:29:22)
>> +- common.xml    (  23344 bytes, from 2016-11-10 15:14:07)
>> +
>> +Copyright (C) 2012-2016 by the following authors:
>> +- Wladimir J. van der Laan <laanwj@gmail.com>
>> +- Christian Gmeiner <christian.gmeiner@gmail.com>
>> +- Lucas Stach <l.stach@pengutronix.de>
>> +- Russell King <rmk@arm.linux.org.uk>
>> +
>> +Permission is hereby granted, free of charge, to any person obtaining a
>> +copy of this software and associated documentation files (the "Software"),
>> +to deal in the Software without restriction, including without limitation
>> +the rights to use, copy, modify, merge, publish, distribute, sub license,
>> +and/or sell copies of the Software, and to permit persons to whom the
>> +Software is furnished to do so, subject to the following conditions:
>> +
>> +The above copyright notice and this permission notice (including the
>> +next paragraph) shall be included in all copies or substantial portions
>> +of the Software.
>> +
>> +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
>> +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
>> +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
>> +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
>> +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>> +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>> +DEALINGS IN THE SOFTWARE.
>>  */
>>
>>
>> @@ -26,6 +50,7 @@ Copyright (C) 2014
>>  #define FE_OPCODE_STALL                                              0x00000009
>>  #define FE_OPCODE_CALL                                               0x0000000a
>>  #define FE_OPCODE_RETURN                                     0x0000000b
>> +#define FE_OPCODE_DRAW_INSTANCED                             0x0000000c
>>  #define FE_OPCODE_CHIP_SELECT                                        0x0000000d
>>  #define PRIMITIVE_TYPE_POINTS                                        0x00000001
>>  #define PRIMITIVE_TYPE_LINES                                 0x00000002
>> @@ -214,5 +239,32 @@ Copyright (C) 2014
>>  #define VIV_FE_CHIP_SELECT_HEADER_ENABLE_CHIP1                       0x00000002
>>  #define VIV_FE_CHIP_SELECT_HEADER_ENABLE_CHIP0                       0x00000001
>>
>> +#define VIV_FE_DRAW_INSTANCED                                        0x00000000
>> +
>> +#define VIV_FE_DRAW_INSTANCED_HEADER                         0x00000000
>> +#define VIV_FE_DRAW_INSTANCED_HEADER_OP__MASK                        0xf8000000
>> +#define VIV_FE_DRAW_INSTANCED_HEADER_OP__SHIFT                       27
>> +#define VIV_FE_DRAW_INSTANCED_HEADER_OP_DRAW_INSTANCED               0x60000000
>> +#define VIV_FE_DRAW_INSTANCED_HEADER_INDEXED                 0x00100000
>> +#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE__MASK                      0x000f0000
>> +#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE__SHIFT             16
>> +#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE(x)                 (((x) << VIV_FE_DRAW_INSTANCED_HEADER_TYPE__SHIFT) & VIV_FE_DRAW_INSTANCED_HEADER_TYPE__MASK)
>> +#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__MASK 0x0000ffff
>> +#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__SHIFT        0
>> +#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO(x)    (((x) << VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__SHIFT) & VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__MASK)
>> +
>> +#define VIV_FE_DRAW_INSTANCED_COUNT                          0x00000004
>> +#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__MASK  0xff000000
>> +#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__SHIFT 24
>> +#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI(x)     (((x) << VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__SHIFT) & VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__MASK)
>> +#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__MASK               0x00ffffff
>> +#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__SHIFT              0
>> +#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT(x)          (((x) << VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__SHIFT) & VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__MASK)
>> +
>> +#define VIV_FE_DRAW_INSTANCED_START                          0x00000008
>> +#define VIV_FE_DRAW_INSTANCED_START_INDEX__MASK                      0xffffffff
>> +#define VIV_FE_DRAW_INSTANCED_START_INDEX__SHIFT             0
>> +#define VIV_FE_DRAW_INSTANCED_START_INDEX(x)                 (((x) << VIV_FE_DRAW_INSTANCED_START_INDEX__SHIFT) & VIV_FE_DRAW_INSTANCED_START_INDEX__MASK)
>> +
>>
>>  #endif /* CMDSTREAM_XML */
>> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c b/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
>> index dcfd565..2a2e5e3 100644
>> --- a/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
>> +++ b/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
>> @@ -143,6 +143,7 @@ static bool etnaviv_validate_load_state(struct etna_validation_state *state,
>>  static uint8_t cmd_length[32] = {
>>       [FE_OPCODE_DRAW_PRIMITIVES] = 4,
>>       [FE_OPCODE_DRAW_INDEXED_PRIMITIVES] = 6,
>> +     [FE_OPCODE_DRAW_INSTANCED] = 4,
>>       [FE_OPCODE_NOP] = 2,
>>       [FE_OPCODE_STALL] = 2,
>>  };
>> --
>> 2.7.4
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/etnaviv: Allow DRAW_INSTANCED commands
  2016-11-12 14:01   ` Rob Clark
@ 2016-11-12 14:02     ` Daniel Vetter
  2016-11-12 14:38       ` Christian Gmeiner
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Vetter @ 2016-11-12 14:02 UTC (permalink / raw)
  To: Rob Clark, Mesa Dev, Lucas Stach, Christian Gmeiner, Russell King
  Cc: Wladimir J. van der Laan, dri-devel@lists.freedesktop.org,
	Chris Healy

On Sat, Nov 12, 2016 at 3:01 PM, Rob Clark <robdclark@gmail.com> wrote:
> On Sat, Nov 12, 2016 at 8:30 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
>> On Fri, Nov 11, 2016 at 05:57:54PM +0100, Wladimir J. van der Laan wrote:
>>> Vivante GPUs with HALTI0 feature support a DRAW_INSTANCED command in the
>>> command stream to draw a number of instances of the same geometry.
>>>
>>> The information that has been figured out about the command can be found
>>> here: https://github.com/etnaviv/etna_viv/blob/master/rnndb/cmdstream.xml#L270
>>>
>>> This command is not allowed currently by the DRM driver because it
>>> was not known before. This patch enables parsing it in command
>>> streams and allows using it by userspace drivers.
>>>
>>> Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
>>
>> On that note, can we finally get the etnaviv driver merged to upstream,
>> like it should have been months ago? I know there's the excuse that the
>> display vs. render node thing in egl isn't fixed yet, but afaiui Xorg
>> prime and gpu-only providers have this all working, so really this isn't a
>> reason, just a very weak excuse. And even on the egl side the driver
>> should be perfectly useable as a rendering-only thing (for piglitting or
>> whatever). Uabi is supposed to be merged only when the userspace side is
>> ready, so really admit that it _is_ ready and just land it in mesa. Out of
>> tree drivers are nonsense imo, no matter whether it's the kernel or mesa
>> tree.
>
> +1

Coffee started kicking in, and I realized that mesa and a bunch more
folks should be on cc here.
-Daniel


>
> BR,
> -R
>
>> Adding Dave too.
>> -Daniel
>>
>>> ---
>>>  drivers/gpu/drm/etnaviv/cmdstream.xml.h      | 60 ++++++++++++++++++++++++++--
>>>  drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c |  1 +
>>>  2 files changed, 57 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/etnaviv/cmdstream.xml.h b/drivers/gpu/drm/etnaviv/cmdstream.xml.h
>>> index 8c44ba9..65f1ba1 100644
>>> --- a/drivers/gpu/drm/etnaviv/cmdstream.xml.h
>>> +++ b/drivers/gpu/drm/etnaviv/cmdstream.xml.h
>>> @@ -8,10 +8,34 @@ This file was generated by the rules-ng-ng headergen tool in this git repository
>>>  git clone git://0x04.net/rules-ng-ng
>>>
>>>  The rules-ng-ng source files this header was generated from are:
>>> -- cmdstream.xml (  12589 bytes, from 2014-02-17 14:57:56)
>>> -- common.xml    (  18437 bytes, from 2015-03-25 11:27:41)
>>> -
>>> -Copyright (C) 2014
>>> +- cmdstream.xml (  14094 bytes, from 2016-11-11 06:55:14)
>>> +- copyright.xml (   1597 bytes, from 2016-10-29 07:29:22)
>>> +- common.xml    (  23344 bytes, from 2016-11-10 15:14:07)
>>> +
>>> +Copyright (C) 2012-2016 by the following authors:
>>> +- Wladimir J. van der Laan <laanwj@gmail.com>
>>> +- Christian Gmeiner <christian.gmeiner@gmail.com>
>>> +- Lucas Stach <l.stach@pengutronix.de>
>>> +- Russell King <rmk@arm.linux.org.uk>
>>> +
>>> +Permission is hereby granted, free of charge, to any person obtaining a
>>> +copy of this software and associated documentation files (the "Software"),
>>> +to deal in the Software without restriction, including without limitation
>>> +the rights to use, copy, modify, merge, publish, distribute, sub license,
>>> +and/or sell copies of the Software, and to permit persons to whom the
>>> +Software is furnished to do so, subject to the following conditions:
>>> +
>>> +The above copyright notice and this permission notice (including the
>>> +next paragraph) shall be included in all copies or substantial portions
>>> +of the Software.
>>> +
>>> +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
>>> +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
>>> +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
>>> +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
>>> +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>>> +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>>> +DEALINGS IN THE SOFTWARE.
>>>  */
>>>
>>>
>>> @@ -26,6 +50,7 @@ Copyright (C) 2014
>>>  #define FE_OPCODE_STALL                                              0x00000009
>>>  #define FE_OPCODE_CALL                                               0x0000000a
>>>  #define FE_OPCODE_RETURN                                     0x0000000b
>>> +#define FE_OPCODE_DRAW_INSTANCED                             0x0000000c
>>>  #define FE_OPCODE_CHIP_SELECT                                        0x0000000d
>>>  #define PRIMITIVE_TYPE_POINTS                                        0x00000001
>>>  #define PRIMITIVE_TYPE_LINES                                 0x00000002
>>> @@ -214,5 +239,32 @@ Copyright (C) 2014
>>>  #define VIV_FE_CHIP_SELECT_HEADER_ENABLE_CHIP1                       0x00000002
>>>  #define VIV_FE_CHIP_SELECT_HEADER_ENABLE_CHIP0                       0x00000001
>>>
>>> +#define VIV_FE_DRAW_INSTANCED                                        0x00000000
>>> +
>>> +#define VIV_FE_DRAW_INSTANCED_HEADER                         0x00000000
>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_OP__MASK                        0xf8000000
>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_OP__SHIFT                       27
>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_OP_DRAW_INSTANCED               0x60000000
>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_INDEXED                 0x00100000
>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE__MASK                      0x000f0000
>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE__SHIFT             16
>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE(x)                 (((x) << VIV_FE_DRAW_INSTANCED_HEADER_TYPE__SHIFT) & VIV_FE_DRAW_INSTANCED_HEADER_TYPE__MASK)
>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__MASK 0x0000ffff
>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__SHIFT        0
>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO(x)    (((x) << VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__SHIFT) & VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__MASK)
>>> +
>>> +#define VIV_FE_DRAW_INSTANCED_COUNT                          0x00000004
>>> +#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__MASK  0xff000000
>>> +#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__SHIFT 24
>>> +#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI(x)     (((x) << VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__SHIFT) & VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__MASK)
>>> +#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__MASK               0x00ffffff
>>> +#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__SHIFT              0
>>> +#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT(x)          (((x) << VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__SHIFT) & VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__MASK)
>>> +
>>> +#define VIV_FE_DRAW_INSTANCED_START                          0x00000008
>>> +#define VIV_FE_DRAW_INSTANCED_START_INDEX__MASK                      0xffffffff
>>> +#define VIV_FE_DRAW_INSTANCED_START_INDEX__SHIFT             0
>>> +#define VIV_FE_DRAW_INSTANCED_START_INDEX(x)                 (((x) << VIV_FE_DRAW_INSTANCED_START_INDEX__SHIFT) & VIV_FE_DRAW_INSTANCED_START_INDEX__MASK)
>>> +
>>>
>>>  #endif /* CMDSTREAM_XML */
>>> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c b/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
>>> index dcfd565..2a2e5e3 100644
>>> --- a/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
>>> +++ b/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
>>> @@ -143,6 +143,7 @@ static bool etnaviv_validate_load_state(struct etna_validation_state *state,
>>>  static uint8_t cmd_length[32] = {
>>>       [FE_OPCODE_DRAW_PRIMITIVES] = 4,
>>>       [FE_OPCODE_DRAW_INDEXED_PRIMITIVES] = 6,
>>> +     [FE_OPCODE_DRAW_INSTANCED] = 4,
>>>       [FE_OPCODE_NOP] = 2,
>>>       [FE_OPCODE_STALL] = 2,
>>>  };
>>> --
>>> 2.7.4
>>>
>>> _______________________________________________
>>> dri-devel mailing list
>>> dri-devel@lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>> --
>> Daniel Vetter
>> Software Engineer, Intel Corporation
>> http://blog.ffwll.ch
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel



-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/etnaviv: Allow DRAW_INSTANCED commands
  2016-11-12 14:02     ` Daniel Vetter
@ 2016-11-12 14:38       ` Christian Gmeiner
  0 siblings, 0 replies; 6+ messages in thread
From: Christian Gmeiner @ 2016-11-12 14:38 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Wladimir J. van der Laan, Russell King,
	dri-devel@lists.freedesktop.org, Mesa Dev, Chris Healy

2016-11-12 15:02 GMT+01:00 Daniel Vetter <daniel@ffwll.ch>:
> On Sat, Nov 12, 2016 at 3:01 PM, Rob Clark <robdclark@gmail.com> wrote:
>> On Sat, Nov 12, 2016 at 8:30 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
>>> On Fri, Nov 11, 2016 at 05:57:54PM +0100, Wladimir J. van der Laan wrote:
>>>> Vivante GPUs with HALTI0 feature support a DRAW_INSTANCED command in the
>>>> command stream to draw a number of instances of the same geometry.
>>>>
>>>> The information that has been figured out about the command can be found
>>>> here: https://github.com/etnaviv/etna_viv/blob/master/rnndb/cmdstream.xml#L270
>>>>
>>>> This command is not allowed currently by the DRM driver because it
>>>> was not known before. This patch enables parsing it in command
>>>> streams and allows using it by userspace drivers.
>>>>
>>>> Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
>>>
>>> On that note, can we finally get the etnaviv driver merged to upstream,
>>> like it should have been months ago? I know there's the excuse that the
>>> display vs. render node thing in egl isn't fixed yet, but afaiui Xorg
>>> prime and gpu-only providers have this all working, so really this isn't a
>>> reason, just a very weak excuse. And even on the egl side the driver
>>> should be perfectly useable as a rendering-only thing (for piglitting or
>>> whatever). Uabi is supposed to be merged only when the userspace side is
>>> ready, so really admit that it _is_ ready and just land it in mesa. Out of
>>> tree drivers are nonsense imo, no matter whether it's the kernel or mesa
>>> tree.
>>
>> +1
>
> Coffee started kicking in, and I realized that mesa and a bunch more
> folks should be on cc here.

Expect mesa patches for next week.

greets
--
Christian Gmeiner, MSc

https://soundcloud.com/christian-gmeiner


> -Daniel
>
>
>>
>> BR,
>> -R
>>
>>> Adding Dave too.
>>> -Daniel
>>>
>>>> ---
>>>>  drivers/gpu/drm/etnaviv/cmdstream.xml.h      | 60 ++++++++++++++++++++++++++--
>>>>  drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c |  1 +
>>>>  2 files changed, 57 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/etnaviv/cmdstream.xml.h b/drivers/gpu/drm/etnaviv/cmdstream.xml.h
>>>> index 8c44ba9..65f1ba1 100644
>>>> --- a/drivers/gpu/drm/etnaviv/cmdstream.xml.h
>>>> +++ b/drivers/gpu/drm/etnaviv/cmdstream.xml.h
>>>> @@ -8,10 +8,34 @@ This file was generated by the rules-ng-ng headergen tool in this git repository
>>>>  git clone git://0x04.net/rules-ng-ng
>>>>
>>>>  The rules-ng-ng source files this header was generated from are:
>>>> -- cmdstream.xml (  12589 bytes, from 2014-02-17 14:57:56)
>>>> -- common.xml    (  18437 bytes, from 2015-03-25 11:27:41)
>>>> -
>>>> -Copyright (C) 2014
>>>> +- cmdstream.xml (  14094 bytes, from 2016-11-11 06:55:14)
>>>> +- copyright.xml (   1597 bytes, from 2016-10-29 07:29:22)
>>>> +- common.xml    (  23344 bytes, from 2016-11-10 15:14:07)
>>>> +
>>>> +Copyright (C) 2012-2016 by the following authors:
>>>> +- Wladimir J. van der Laan <laanwj@gmail.com>
>>>> +- Christian Gmeiner <christian.gmeiner@gmail.com>
>>>> +- Lucas Stach <l.stach@pengutronix.de>
>>>> +- Russell King <rmk@arm.linux.org.uk>
>>>> +
>>>> +Permission is hereby granted, free of charge, to any person obtaining a
>>>> +copy of this software and associated documentation files (the "Software"),
>>>> +to deal in the Software without restriction, including without limitation
>>>> +the rights to use, copy, modify, merge, publish, distribute, sub license,
>>>> +and/or sell copies of the Software, and to permit persons to whom the
>>>> +Software is furnished to do so, subject to the following conditions:
>>>> +
>>>> +The above copyright notice and this permission notice (including the
>>>> +next paragraph) shall be included in all copies or substantial portions
>>>> +of the Software.
>>>> +
>>>> +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
>>>> +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
>>>> +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
>>>> +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
>>>> +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>>>> +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>>>> +DEALINGS IN THE SOFTWARE.
>>>>  */
>>>>
>>>>
>>>> @@ -26,6 +50,7 @@ Copyright (C) 2014
>>>>  #define FE_OPCODE_STALL                                              0x00000009
>>>>  #define FE_OPCODE_CALL                                               0x0000000a
>>>>  #define FE_OPCODE_RETURN                                     0x0000000b
>>>> +#define FE_OPCODE_DRAW_INSTANCED                             0x0000000c
>>>>  #define FE_OPCODE_CHIP_SELECT                                        0x0000000d
>>>>  #define PRIMITIVE_TYPE_POINTS                                        0x00000001
>>>>  #define PRIMITIVE_TYPE_LINES                                 0x00000002
>>>> @@ -214,5 +239,32 @@ Copyright (C) 2014
>>>>  #define VIV_FE_CHIP_SELECT_HEADER_ENABLE_CHIP1                       0x00000002
>>>>  #define VIV_FE_CHIP_SELECT_HEADER_ENABLE_CHIP0                       0x00000001
>>>>
>>>> +#define VIV_FE_DRAW_INSTANCED                                        0x00000000
>>>> +
>>>> +#define VIV_FE_DRAW_INSTANCED_HEADER                         0x00000000
>>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_OP__MASK                        0xf8000000
>>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_OP__SHIFT                       27
>>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_OP_DRAW_INSTANCED               0x60000000
>>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_INDEXED                 0x00100000
>>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE__MASK                      0x000f0000
>>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE__SHIFT             16
>>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE(x)                 (((x) << VIV_FE_DRAW_INSTANCED_HEADER_TYPE__SHIFT) & VIV_FE_DRAW_INSTANCED_HEADER_TYPE__MASK)
>>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__MASK 0x0000ffff
>>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__SHIFT        0
>>>> +#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO(x)    (((x) << VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__SHIFT) & VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__MASK)
>>>> +
>>>> +#define VIV_FE_DRAW_INSTANCED_COUNT                          0x00000004
>>>> +#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__MASK  0xff000000
>>>> +#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__SHIFT 24
>>>> +#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI(x)     (((x) << VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__SHIFT) & VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__MASK)
>>>> +#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__MASK               0x00ffffff
>>>> +#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__SHIFT              0
>>>> +#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT(x)          (((x) << VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__SHIFT) & VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__MASK)
>>>> +
>>>> +#define VIV_FE_DRAW_INSTANCED_START                          0x00000008
>>>> +#define VIV_FE_DRAW_INSTANCED_START_INDEX__MASK                      0xffffffff
>>>> +#define VIV_FE_DRAW_INSTANCED_START_INDEX__SHIFT             0
>>>> +#define VIV_FE_DRAW_INSTANCED_START_INDEX(x)                 (((x) << VIV_FE_DRAW_INSTANCED_START_INDEX__SHIFT) & VIV_FE_DRAW_INSTANCED_START_INDEX__MASK)
>>>> +
>>>>
>>>>  #endif /* CMDSTREAM_XML */
>>>> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c b/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
>>>> index dcfd565..2a2e5e3 100644
>>>> --- a/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
>>>> +++ b/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
>>>> @@ -143,6 +143,7 @@ static bool etnaviv_validate_load_state(struct etna_validation_state *state,
>>>>  static uint8_t cmd_length[32] = {
>>>>       [FE_OPCODE_DRAW_PRIMITIVES] = 4,
>>>>       [FE_OPCODE_DRAW_INDEXED_PRIMITIVES] = 6,
>>>> +     [FE_OPCODE_DRAW_INSTANCED] = 4,
>>>>       [FE_OPCODE_NOP] = 2,
>>>>       [FE_OPCODE_STALL] = 2,
>>>>  };
>>>> --
>>>> 2.7.4
>>>>
>>>> _______________________________________________
>>>> dri-devel mailing list
>>>> dri-devel@lists.freedesktop.org
>>>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>>>
>>> --
>>> Daniel Vetter
>>> Software Engineer, Intel Corporation
>>> http://blog.ffwll.ch
>>> _______________________________________________
>>> dri-devel mailing list
>>> dri-devel@lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/etnaviv: Allow DRAW_INSTANCED commands
  2016-11-11 16:57 [PATCH] drm/etnaviv: Allow DRAW_INSTANCED commands Wladimir J. van der Laan
  2016-11-12 13:30 ` Daniel Vetter
@ 2016-11-22 17:38 ` Lucas Stach
  1 sibling, 0 replies; 6+ messages in thread
From: Lucas Stach @ 2016-11-22 17:38 UTC (permalink / raw)
  To: Wladimir J. van der Laan; +Cc: Chris Healy, dri-devel

Am Freitag, den 11.11.2016, 17:57 +0100 schrieb Wladimir J. van der
Laan:
> Vivante GPUs with HALTI0 feature support a DRAW_INSTANCED command in the
> command stream to draw a number of instances of the same geometry.
> 
> The information that has been figured out about the command can be found
> here: https://github.com/etnaviv/etna_viv/blob/master/rnndb/cmdstream.xml#L270
> 
> This command is not allowed currently by the DRM driver because it
> was not known before. This patch enables parsing it in command
> streams and allows using it by userspace drivers.
> 
> Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>

I've applied this to my tree, it will show up in the 4.10 feature pull.

Regards,
Lucas
> ---
>  drivers/gpu/drm/etnaviv/cmdstream.xml.h      | 60 ++++++++++++++++++++++++++--
>  drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c |  1 +
>  2 files changed, 57 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/etnaviv/cmdstream.xml.h b/drivers/gpu/drm/etnaviv/cmdstream.xml.h
> index 8c44ba9..65f1ba1 100644
> --- a/drivers/gpu/drm/etnaviv/cmdstream.xml.h
> +++ b/drivers/gpu/drm/etnaviv/cmdstream.xml.h
> @@ -8,10 +8,34 @@ This file was generated by the rules-ng-ng headergen tool in this git repository
>  git clone git://0x04.net/rules-ng-ng
>  
>  The rules-ng-ng source files this header was generated from are:
> -- cmdstream.xml (  12589 bytes, from 2014-02-17 14:57:56)
> -- common.xml    (  18437 bytes, from 2015-03-25 11:27:41)
> -
> -Copyright (C) 2014
> +- cmdstream.xml (  14094 bytes, from 2016-11-11 06:55:14)
> +- copyright.xml (   1597 bytes, from 2016-10-29 07:29:22)
> +- common.xml    (  23344 bytes, from 2016-11-10 15:14:07)
> +
> +Copyright (C) 2012-2016 by the following authors:
> +- Wladimir J. van der Laan <laanwj@gmail.com>
> +- Christian Gmeiner <christian.gmeiner@gmail.com>
> +- Lucas Stach <l.stach@pengutronix.de>
> +- Russell King <rmk@arm.linux.org.uk>
> +
> +Permission is hereby granted, free of charge, to any person obtaining a
> +copy of this software and associated documentation files (the "Software"),
> +to deal in the Software without restriction, including without limitation
> +the rights to use, copy, modify, merge, publish, distribute, sub license,
> +and/or sell copies of the Software, and to permit persons to whom the
> +Software is furnished to do so, subject to the following conditions:
> +
> +The above copyright notice and this permission notice (including the
> +next paragraph) shall be included in all copies or substantial portions
> +of the Software.
> +
> +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
> +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> +DEALINGS IN THE SOFTWARE.
>  */
>  
> 
> @@ -26,6 +50,7 @@ Copyright (C) 2014
>  #define FE_OPCODE_STALL						0x00000009
>  #define FE_OPCODE_CALL						0x0000000a
>  #define FE_OPCODE_RETURN					0x0000000b
> +#define FE_OPCODE_DRAW_INSTANCED				0x0000000c
>  #define FE_OPCODE_CHIP_SELECT					0x0000000d
>  #define PRIMITIVE_TYPE_POINTS					0x00000001
>  #define PRIMITIVE_TYPE_LINES					0x00000002
> @@ -214,5 +239,32 @@ Copyright (C) 2014
>  #define VIV_FE_CHIP_SELECT_HEADER_ENABLE_CHIP1			0x00000002
>  #define VIV_FE_CHIP_SELECT_HEADER_ENABLE_CHIP0			0x00000001
>  
> +#define VIV_FE_DRAW_INSTANCED					0x00000000
> +
> +#define VIV_FE_DRAW_INSTANCED_HEADER				0x00000000
> +#define VIV_FE_DRAW_INSTANCED_HEADER_OP__MASK			0xf8000000
> +#define VIV_FE_DRAW_INSTANCED_HEADER_OP__SHIFT			27
> +#define VIV_FE_DRAW_INSTANCED_HEADER_OP_DRAW_INSTANCED		0x60000000
> +#define VIV_FE_DRAW_INSTANCED_HEADER_INDEXED			0x00100000
> +#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE__MASK			0x000f0000
> +#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE__SHIFT		16
> +#define VIV_FE_DRAW_INSTANCED_HEADER_TYPE(x)			(((x) << VIV_FE_DRAW_INSTANCED_HEADER_TYPE__SHIFT) & VIV_FE_DRAW_INSTANCED_HEADER_TYPE__MASK)
> +#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__MASK	0x0000ffff
> +#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__SHIFT	0
> +#define VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO(x)	(((x) << VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__SHIFT) & VIV_FE_DRAW_INSTANCED_HEADER_INSTANCE_COUNT_LO__MASK)
> +
> +#define VIV_FE_DRAW_INSTANCED_COUNT				0x00000004
> +#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__MASK	0xff000000
> +#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__SHIFT	24
> +#define VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI(x)	(((x) << VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__SHIFT) & VIV_FE_DRAW_INSTANCED_COUNT_INSTANCE_COUNT_HI__MASK)
> +#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__MASK		0x00ffffff
> +#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__SHIFT		0
> +#define VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT(x)		(((x) << VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__SHIFT) & VIV_FE_DRAW_INSTANCED_COUNT_VERTEX_COUNT__MASK)
> +
> +#define VIV_FE_DRAW_INSTANCED_START				0x00000008
> +#define VIV_FE_DRAW_INSTANCED_START_INDEX__MASK			0xffffffff
> +#define VIV_FE_DRAW_INSTANCED_START_INDEX__SHIFT		0
> +#define VIV_FE_DRAW_INSTANCED_START_INDEX(x)			(((x) << VIV_FE_DRAW_INSTANCED_START_INDEX__SHIFT) & VIV_FE_DRAW_INSTANCED_START_INDEX__MASK)
> +
>  
>  #endif /* CMDSTREAM_XML */
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c b/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
> index dcfd565..2a2e5e3 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_cmd_parser.c
> @@ -143,6 +143,7 @@ static bool etnaviv_validate_load_state(struct etna_validation_state *state,
>  static uint8_t cmd_length[32] = {
>  	[FE_OPCODE_DRAW_PRIMITIVES] = 4,
>  	[FE_OPCODE_DRAW_INDEXED_PRIMITIVES] = 6,
> +	[FE_OPCODE_DRAW_INSTANCED] = 4,
>  	[FE_OPCODE_NOP] = 2,
>  	[FE_OPCODE_STALL] = 2,
>  };


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-11-22 17:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-11 16:57 [PATCH] drm/etnaviv: Allow DRAW_INSTANCED commands Wladimir J. van der Laan
2016-11-12 13:30 ` Daniel Vetter
2016-11-12 14:01   ` Rob Clark
2016-11-12 14:02     ` Daniel Vetter
2016-11-12 14:38       ` Christian Gmeiner
2016-11-22 17:38 ` Lucas Stach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).