[Mesa-dev] [PATCH] nvc0/ir: Fix assert accessing null pointer

2019-07-19 Thread Mark Menzynski
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=111007 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=67 Signed-off-by: Mark Menzynski --- src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium

[Mesa-dev] [PATCH] gm107/ir: Add stg, ldg instructions and function for checking offset length

2019-07-19 Thread Mark Menzynski
Nvidia actively uses these instructions, maybe they are better in something. Long offset checking function was made because these functions only have 24 bit address offsets. Signed-off-by: Mark Menzynski --- .../nouveau/codegen/nv50_ir_emit_gm107.cpp| 36 +++ 1 file changed

Re: [Mesa-dev] [PATCH] gm107/ir: Add stg, ldg instructions and function for checking offset length

2019-07-19 Thread Mark Menzynski
On Fri, Jul 19, 2019 at 5:04 PM Ilia Mirkin wrote: > > On Fri, Jul 19, 2019 at 10:57 AM Mark Menzynski wrote: > > > > Nvidia actively uses these instructions, maybe they are better in > > something. > > Long offset checking function was made because these f

Re: [Mesa-dev] [PATCH] gm107/ir: Add stg, ldg instructions and function for checking offset length

2019-07-23 Thread Mark Menzynski
> > @@ -2414,6 +2428,17 @@ CodeEmitterGM107::emitLDS() > > emitGPR (0x00, insn->def(0)); > > } > > > > +void > > +CodeEmitterGM107::emitLDG() > > +{ > > + emitInsn (0xeed0); > > + emitLDSTs(0x30, insn->dType); > > + emitLDSTc(0x2e); > > + emitField(0x2d, 1, insn->src(0).getIndirec

[Mesa-dev] [PATCH v2] gm107/ir: Add stg, ldg instructions and function for checking offset length

2019-07-23 Thread Mark Menzynski
Nvidia actively uses these instructions, maybe they are better in something. Long offset checking function was made because these functions only have 24 bit address offsets. v2: removed long offset funnction Signed-off-by: Mark Menzynski --- .../nouveau/codegen/nv50_ir_emit_gm107.cpp| 24

[Mesa-dev] [PATCH] nv50/ir: Add mul and mod constant optimizations

2019-07-23 Thread Mark Menzynski
Optimizations for 0/n, 1/n and 0%n. No changes in shader db tests, because it is never used here, but it should become handy. Signed-off-by: Mark Menzynski --- .../nouveau/codegen/nv50_ir_peephole.cpp | 30 +-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a

[Mesa-dev] [PATCH 6/8] tgsi/util: Change boolean for bool

2020-02-17 Thread Mark Menzynski
I was getting errors with "boolean" when compiling. This patch changes boolean to bool from . Signed-off-by: Mark Menzynski --- src/gallium/auxiliary/tgsi/tgsi_util.c | 2 +- src/gallium/auxiliary/tgsi/tgsi_util.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff -

[Mesa-dev] [PATCH 1/8] nv50/ir: add nv50_ir_prog_info_out

2020-02-17 Thread Mark Menzynski
From: Karol Herbst Split out the output relevant fields from the nv50_ir_prog_info struct in order to have a cleaner separation between the input and output of the compilation. Signed-off-by: Karol Herbst --- .../drivers/nouveau/codegen/nv50_ir.cpp | 49 ++-- src/gallium/drivers/nouveau

[Mesa-dev] [PATCH 3/8] nv50/ir: Add nv50_ir_prog_info_out serialize and deserialize

2020-02-17 Thread Mark Menzynski
Adds functions for serializing and deserializing nv50_ir_prog_info_out structure, which are needed for shader caching. Signed-off-by: Mark Menzynski --- .../drivers/nouveau/codegen/nv50_ir_driver.h | 44 .../nouveau/codegen/nv50_ir_emit_gk110.cpp| 14 +- .../nouveau/codegen

[Mesa-dev] [PATCH 5/8] nv50/ir: Add nv50_ir_prog_info serialize

2020-02-17 Thread Mark Menzynski
Adds a function for serializing a nv50_ir_prog_info structure, which is needed for shader caching. Signed-off-by: Mark Menzynski --- .../drivers/nouveau/codegen/nv50_ir_driver.h | 4 + .../nouveau/codegen/nv50_ir_serialize.cpp | 81 +++ 2 files changed, 85 insertions

[Mesa-dev] [PATCH 7/8] nv50/ir: Move separateFragData

2020-02-17 Thread Mark Menzynski
Nv50_ir_prog_info (input) was in the wrong place, moved it to nv50_ir_prog_info_out. Signed-off-by: Mark Menzynski --- src/gallium/drivers/nouveau/codegen/nv50_ir_driver.h | 2 +- src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp | 2 +- src/gallium/drivers/nouveau/codegen

[Mesa-dev] [PATCH 2/8] util/blob: Add overwrite function for uint8

2020-02-17 Thread Mark Menzynski
Overwrite function for this type was missing and I needed it for my project. Signed-off-by: Mark Menzynski --- src/util/blob.c | 9 + src/util/blob.h | 15 +++ 2 files changed, 24 insertions(+) diff --git a/src/util/blob.c b/src/util/blob.c index 94d5a9dea74..5bf4b924c91

[Mesa-dev] [PATCH 4/8] nv50/ir: Add prog_info_out print

2020-02-17 Thread Mark Menzynski
Adds a function for printing nv50_ir_prog_info_out structure in JSON-like format, which could be used in debugging. Signed-off-by: Mark Menzynski --- .../drivers/nouveau/codegen/nv50_ir_driver.h | 3 + .../drivers/nouveau/codegen/nv50_ir_print.cpp | 155 ++ 2 files changed

[Mesa-dev] [PATCH 8/8] nvc0: Add shader disk caching

2020-02-17 Thread Mark Menzynski
: Mark Menzynski --- .../drivers/nouveau/nvc0/nvc0_context.h | 1 + .../drivers/nouveau/nvc0/nvc0_program.c | 49 --- .../drivers/nouveau/nvc0/nvc0_shader_state.c | 3 +- src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 2 + 4 files changed, 46 insertions(+), 9

[Mesa-dev] [PATCH v2 1/7] nv50/ir: add nv50_ir_prog_info_out

2020-02-21 Thread Mark Menzynski
From: Karol Herbst Split out the output relevant fields from the nv50_ir_prog_info struct in order to have a cleaner separation between the input and output of the compilation. Signed-off-by: Karol Herbst --- .../drivers/nouveau/codegen/nv50_ir.cpp | 49 ++-- src/gallium/drivers/nouveau

[Mesa-dev] [PATCH v2 3/7] nv50/ir: Add nv50_ir_prog_info_out serialize and deserialize

2020-02-21 Thread Mark Menzynski
Adds functions for serializing and deserializing nv50_ir_prog_info_out structure, which are needed for shader caching. Signed-off-by: Mark Menzynski --- .../drivers/nouveau/codegen/nv50_ir_driver.h | 44 .../nouveau/codegen/nv50_ir_emit_gk110.cpp| 14 +- .../nouveau/codegen

[Mesa-dev] [PATCH v2 2/7] util/blob: Add overwrite function for uint8

2020-02-21 Thread Mark Menzynski
Overwrite function for this type was missing and I needed it for my project. Signed-off-by: Mark Menzynski --- src/util/blob.c | 9 + src/util/blob.h | 15 +++ 2 files changed, 24 insertions(+) diff --git a/src/util/blob.c b/src/util/blob.c index 94d5a9dea74..5bf4b924c91

[Mesa-dev] [PATCH v2 4/7] nv50/ir: Add prog_info_out print

2020-02-21 Thread Mark Menzynski
Adds a function for printing nv50_ir_prog_info_out structure in JSON-like format, which could be used in debugging. Signed-off-by: Mark Menzynski --- .../drivers/nouveau/codegen/nv50_ir_driver.h | 3 + .../drivers/nouveau/codegen/nv50_ir_print.cpp | 153 ++ 2 files changed

[Mesa-dev] [PATCH v2 7/7] nvc0: Add shader disk caching

2020-02-21 Thread Mark Menzynski
shaders: cache off real2m58.574s user21m34.018s sys 0m8.055s cache on, first run real3m32.617s user24m52.701s sys 0m20.400s cache on, second run real0m23.745s user2m43.566s sys 0m4.532s Signed-off-by: Mark Menzynski --- .../drivers/nouveau/nvc0/nvc0_context.h

[Mesa-dev] [PATCH v2 6/7] tgsi/util: Change boolean for bool

2020-02-21 Thread Mark Menzynski
I was getting errors with "boolean" when compiling. This patch changes boolean to bool from . Signed-off-by: Mark Menzynski --- src/gallium/auxiliary/tgsi/tgsi_util.c | 2 +- src/gallium/auxiliary/tgsi/tgsi_util.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff -

[Mesa-dev] [PATCH v2 5/7] nv50/ir: Add nv50_ir_prog_info serialize

2020-02-21 Thread Mark Menzynski
Adds a function for serializing a nv50_ir_prog_info structure, which is needed for shader caching. Signed-off-by: Mark Menzynski --- .../drivers/nouveau/codegen/nv50_ir_driver.h | 4 + .../nouveau/codegen/nv50_ir_serialize.cpp | 81 +++ 2 files changed, 85 insertions

[Mesa-dev] [RFC PATCH 1/2] nv50: Add separate functions for varying bits

2020-03-19 Thread Mark Menzynski
code. I will be glad for every review. Signed-off-by: Mark Menzynski --- .../drivers/nouveau/nv50/nv50_program.c | 344 ++ 1 file changed, 344 insertions(+) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_program.c b/src/gallium/drivers/nouveau/nv50/nv50_program.c

[Mesa-dev] [RFC PATCH 2/2] nv50: Add shader disk caching

2020-03-19 Thread Mark Menzynski
compare between the original nv50_ir_prog_info and the one saved in the cache. If keys match and also the byte compare returns they are equal, shaders are same, and the compiled nv50_ir_prog_info_out from the cache can be used instead of compiling input info. Signed-off-by: Mark Menzynski

[Mesa-dev] [RFC PATCH v2 3/6] nv50/ir: Add prog_info_out print

2020-03-19 Thread Mark Menzynski
Adds a function for printing nv50_ir_prog_info_out structure in JSON-like format, which could be used in debugging. Signed-off-by: Mark Menzynski --- .../nouveau/codegen/.nv50_ir_from_nir.cpp.swp | Bin 0 -> 16384 bytes .../drivers/nouveau/codegen/nv50_ir_driver.h | 3 + .../drivers/nouv

[Mesa-dev] [RFC PATCH v2 5/6] nv50: Add separate functions for varying bits

2020-03-19 Thread Mark Menzynski
code. I will be glad for every review. Signed-off-by: Mark Menzynski --- .../drivers/nouveau/nv50/nv50_program.c | 344 ++ 1 file changed, 344 insertions(+) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_program.c b/src/gallium/drivers/nouveau/nv50/nv50_program.c

[Mesa-dev] [RFC PATCH v2 2/6] nv50/ir: Add nv50_ir_prog_info_out serialize and deserialize

2020-03-19 Thread Mark Menzynski
Adds functions for serializing and deserializing nv50_ir_prog_info_out structure, which are needed for shader caching. Signed-off-by: Mark Menzynski --- .../drivers/nouveau/codegen/nv50_ir_driver.h | 44 .../nouveau/codegen/nv50_ir_emit_gk110.cpp| 14 +- .../nouveau/codegen

[Mesa-dev] [RFC PATCH v2 1/6] nv50/ir: add nv50_ir_prog_info_out

2020-03-19 Thread Mark Menzynski
From: Karol Herbst Split out the output relevant fields from the nv50_ir_prog_info struct in order to have a cleaner separation between the input and output of the compilation. Signed-off-by: Karol Herbst --- .../drivers/nouveau/codegen/nv50_ir.cpp | 49 ++-- src/gallium/drivers/nouveau

[Mesa-dev] [RFC PATCH v2 4/6] nv50/ir: Add nv50_ir_prog_info serialize

2020-03-19 Thread Mark Menzynski
Adds a function for serializing a nv50_ir_prog_info structure, which is needed for shader caching. Signed-off-by: Mark Menzynski --- .../drivers/nouveau/codegen/nv50_ir_driver.h | 4 + .../nouveau/codegen/nv50_ir_serialize.cpp | 81 +++ .../drivers/nouveau/nvc0

[Mesa-dev] [RFC PATCH v2 6/6] nv50: Add shader disk caching

2020-03-19 Thread Mark Menzynski
one saved in the cache. If keys match and also the byte compare returns they are equal, shaders are same, and the compiled nv50_ir_prog_info_out from the cache can be used instead of compiling input info. Signed-off-by: Mark Menzynski --- .../drivers/nouveau/nv50/nv50_program.c | 276

[Mesa-dev] [PATCH v3 1/8] nv50/ir: remove symbol table support for compute shaders

2020-03-27 Thread Mark Menzynski
From: Karol Herbst The initial plan was to use this for OpenCL kernels, but back then the plan was to convert from LLVM to TGSI. As it turns out, we didn't went that way. Right now for OpenCL we don't reqiure supporting multiple entry points inside the same binary and if we want to support it la

[Mesa-dev] [PATCH v3 2/8] nv50/ir: add nv50_ir_prog_info_out

2020-03-27 Thread Mark Menzynski
From: Karol Herbst Split out the output relevant fields from the nv50_ir_prog_info struct in order to have a cleaner separation between the input and output of the compilation. Signed-off-by: Karol Herbst --- .../drivers/nouveau/codegen/nv50_ir.cpp | 49 ++-- src/gallium/drivers/nouveau

[Mesa-dev] [PATCH v3 5/8] nv50/ir: Add nv50_ir_prog_info serialize

2020-03-27 Thread Mark Menzynski
Adds a function for serializing a nv50_ir_prog_info structure, which is needed for shader caching. Signed-off-by: Mark Menzynski --- .../drivers/nouveau/codegen/nv50_ir_driver.h | 4 ++ .../nouveau/codegen/nv50_ir_serialize.cpp | 42 +++ 2 files changed, 46 insertions

[Mesa-dev] [PATCH v3 6/8] nvc0: Add shader disk caching

2020-03-27 Thread Mark Menzynski
shaders: cache off real2m58.574s user21m34.018s sys 0m8.055s cache on, first run real3m32.617s user24m52.701s sys 0m20.400s cache on, second run real0m23.745s user2m43.566s sys 0m4.532s Signed-off-by: Mark Menzynski --- .../drivers/nouveau/nvc0/nvc0_context.h

[Mesa-dev] [PATCH v3 4/8] nv50/ir: Add prog_info_out print

2020-03-27 Thread Mark Menzynski
Adds a function for printing nv50_ir_prog_info_out structure in JSON-like format, which could be used in debugging. Signed-off-by: Mark Menzynski --- .../drivers/nouveau/codegen/nv50_ir_driver.h | 3 + .../drivers/nouveau/codegen/nv50_ir_print.cpp | 154 ++ 2 files changed

[Mesa-dev] [PATCH v3 7/8] nv50: Add separate functions for varying bits

2020-03-27 Thread Mark Menzynski
code. I will be glad for every review. Signed-off-by: Mark Menzynski --- .../drivers/nouveau/nv50/nv50_program.c | 344 ++ 1 file changed, 344 insertions(+) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_program.c b/src/gallium/drivers/nouveau/nv50/nv50_program.c

[Mesa-dev] [PATCH v3 8/8] nv50: Add shader disk caching

2020-03-27 Thread Mark Menzynski
one saved in the cache. If keys match and also the byte compare returns they are equal, shaders are same, and the compiled nv50_ir_prog_info_out from the cache can be used instead of compiling input info. Signed-off-by: Mark Menzynski --- .../drivers/nouveau/nv50/nv50_program.c | 283

[Mesa-dev] [PATCH v3 3/8] nv50/ir: Add nv50_ir_prog_info_out serialize and deserialize

2020-03-27 Thread Mark Menzynski
Adds functions for serializing and deserializing nv50_ir_prog_info_out structure, which are needed for shader caching. Signed-off-by: Mark Menzynski --- .../drivers/nouveau/codegen/nv50_ir_driver.h | 44 + .../nouveau/codegen/nv50_ir_emit_gk110.cpp| 14 +- .../nouveau/codegen