[Mesa-dev] [PATCH v2 05/12] radeonsi: Create CE IB.

Emil Velikov emil.l.velikov at gmail.com
Sun Apr 17 16:53:22 UTC 2016


On 17 April 2016 at 00:43, Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl> wrote:
> Based on work by Marek Olšák.
>
> v2: Add preamble IB.
>
> Leaves the load packet in the space calculation as the
> radeon winsys might not be able to support a premable.
>
> The added space calculation may look expensive, but
> is converted to a constant with (at least) -O2 and -O3.
>
Fwiw one can also use (or convert it to) a macro. Function does look a
lot better though :-)

> Signed-off-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
> ---
>  src/gallium/drivers/radeon/r600_pipe_common.c |  1 +
>  src/gallium/drivers/radeon/r600_pipe_common.h |  1 +
>  src/gallium/drivers/radeonsi/si_hw_context.c  | 32 ++++++++++++++++++++++++++-
>  src/gallium/drivers/radeonsi/si_pipe.c        | 12 ++++++++++
>  src/gallium/drivers/radeonsi/si_pipe.h        |  3 +++
>  5 files changed, 48 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
> index a7477ab..a8660f2 100644
> --- a/src/gallium/drivers/radeon/r600_pipe_common.c
> +++ b/src/gallium/drivers/radeon/r600_pipe_common.c
> @@ -402,6 +402,7 @@ static const struct debug_named_value common_debug_options[] = {
>         { "norbplus", DBG_NO_RB_PLUS, "Disable RB+ on Stoney." },
>         { "sisched", DBG_SI_SCHED, "Enable LLVM SI Machine Instruction Scheduler." },
>         { "mono", DBG_MONOLITHIC_SHADERS, "Use old-style monolithic shaders compiled on demand" },
> +       { "noce", DBG_NO_CE, "Disable the constant engine"},
>
>         DEBUG_NAMED_VALUE_END /* must be last */
>  };
> diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
> index b23a780..91f8d5e 100644
> --- a/src/gallium/drivers/radeon/r600_pipe_common.h
> +++ b/src/gallium/drivers/radeon/r600_pipe_common.h
> @@ -95,6 +95,7 @@
>  #define DBG_NO_RB_PLUS         (1llu << 45)
>  #define DBG_SI_SCHED           (1llu << 46)
>  #define DBG_MONOLITHIC_SHADERS (1llu << 47)
> +#define DBG_NO_CE              (1llu << 48)
>
>  #define R600_MAP_BUFFER_ALIGNMENT 64
>  #define R600_MAX_VIEWPORTS        16
> diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c
> index b621b55..60f2b58 100644
> --- a/src/gallium/drivers/radeonsi/si_hw_context.c
> +++ b/src/gallium/drivers/radeonsi/si_hw_context.c
> @@ -26,10 +26,38 @@
>
>  #include "si_pipe.h"
>
> +static unsigned si_descriptor_list_cs_space(unsigned count, unsigned element_size)
> +{
> +       /* 5 dwords for possible load to reinitialize + 5 dwords for write to
> +        * L2 + 3 bytes for every range written to CE RAM.
> +        */
> +       return 5 + 5 + 3 + count * MAX2(3, element_size);
> +}
> +
> +static unsigned si_ce_needed_cs_space() {
C compilers tends to complain when the arguments list (upon
declaration/definition) is empty. Please add "void" and move the
opening curly bracket to the next line.

-Emil


More information about the mesa-dev mailing list