[Mesa-dev] [PATCH] mesa: Make CopyImage check against BaseLevel, not 0, for mipmapping.

2017-01-02 Thread Kenneth Graunke
The intention here is to allow "base complete" instead of "mipmap complete" as long as we're only copying from the base level (which is usually 0, but not always). Signed-off-by: Kenneth Graunke --- src/mesa/main/copyimage.c | 2 +- 1 file changed, 1 insertion(+), 1

[Mesa-dev] [PATCH 53/53] mesa: remove unused gl_shader_info field from gl_linked_shader

2017-01-02 Thread Timothy Arceri
--- src/mesa/main/mtypes.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 1159ca5..1dfdb4e 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2356,8 +2356,6 @@ struct gl_linked_shader struct exec_list

[Mesa-dev] [PATCH 52/53] mesa/glsl: set and get cs layouts to and from shader_info

2017-01-02 Thread Timothy Arceri
--- src/compiler/glsl/linker.cpp | 35 +++ src/mesa/main/mtypes.h | 10 -- src/mesa/main/shaderapi.c| 6 ++ src/mesa/main/shaderobj.c| 2 -- 4 files changed, 17 insertions(+), 36 deletions(-) diff --git a/src/compiler/glsl/linker.cpp

[Mesa-dev] [PATCH 51/53] mesa/glsl: set and get gs layouts directly to and from shader_info

2017-01-02 Thread Timothy Arceri
--- src/compiler/glsl/linker.cpp | 70 +++- src/mesa/main/shaderapi.c| 12 +++- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index a708e98..cae6fb5 100644 ---

[Mesa-dev] [PATCH 48/53] glsl: exit loop early if we find xfb layout qualifers

2017-01-02 Thread Timothy Arceri
--- src/compiler/glsl/link_varyings.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp index da51fd8..398e1da 100644 --- a/src/compiler/glsl/link_varyings.cpp +++ b/src/compiler/glsl/link_varyings.cpp @@ -120,6 +120,7

[Mesa-dev] [PATCH 47/53] glsl: set InnerCoverage directly in gl_program

2017-01-02 Thread Timothy Arceri
Also move out of the shared gl_shader_info. --- src/compiler/glsl/glsl_parser_extras.cpp | 2 +- src/compiler/glsl/linker.cpp | 3 +-- src/mesa/main/mtypes.h | 3 +-- src/mesa/main/shaderapi.c| 1 - 4 files changed, 3 insertions(+), 6 deletions(-)

[Mesa-dev] [PATCH 49/53] mesa/glsl: move TransformFeedbackBufferStride to gl_shader

2017-01-02 Thread Timothy Arceri
Here we remove the single use of this field in gl_linked_shader which allows us to move the field out of gl_shader_info While we are at it we rewrite link_xfb_stride_layout_qualifiers() to be more clear. --- src/compiler/glsl/glsl_parser_extras.cpp | 2 +- src/compiler/glsl/link_varyings.cpp

[Mesa-dev] [PATCH 44/53] mesa/glsl: move origin_upper_left to gl_shader

2017-01-02 Thread Timothy Arceri
This is only used by gl_linked_shader as a temp during linking so use a temp there instead. --- src/compiler/glsl/glsl_parser_extras.cpp | 2 +- src/compiler/glsl/linker.cpp | 8 +++- src/mesa/main/mtypes.h | 9 + 3 files changed, 9 insertions(+), 10

[Mesa-dev] [PATCH 45/53] mesa/glsl: move pixel_center_integer to gl_shader

2017-01-02 Thread Timothy Arceri
This is only used by gl_linked_shader as a temp during linking so use a temp there instead. --- src/compiler/glsl/glsl_parser_extras.cpp | 2 +- src/compiler/glsl/linker.cpp | 8 +++- src/mesa/main/mtypes.h | 3 +-- 3 files changed, 5 insertions(+), 8

[Mesa-dev] [PATCH 46/53] glsl: tidy up PostDepthCoverage shader field

2017-01-02 Thread Timothy Arceri
There is no reason for this to be in the shared gl_shader_info or to copy it to gl_program at the end of linking (its already there). --- src/compiler/glsl/glsl_parser_extras.cpp | 2 +- src/compiler/glsl/linker.cpp | 2 +- src/mesa/main/mtypes.h | 3 ++-

[Mesa-dev] [PATCH 50/53] mesa/glsl/i965: set and get tes layouts directly to and from shader_info

2017-01-02 Thread Timothy Arceri
--- src/compiler/glsl/linker.cpp| 60 ++--- src/mesa/drivers/dri/i965/brw_tcs.c | 6 ++-- src/mesa/main/shaderapi.c | 15 +++--- 3 files changed, 37 insertions(+), 44 deletions(-) diff --git a/src/compiler/glsl/linker.cpp

[Mesa-dev] [PATCH 43/53] mesa/glsl: move uses_gl_fragcoord to gl_shader

2017-01-02 Thread Timothy Arceri
This is only used by gl_linked_shader as a temp during linking so use a temp there instead. --- src/compiler/glsl/glsl_parser_extras.cpp | 2 +- src/compiler/glsl/linker.cpp | 12 +--- src/mesa/main/mtypes.h | 2 +- 3 files changed, 7 insertions(+), 9

[Mesa-dev] [PATCH 42/53] mesa/glsl: move redeclares_gl_fragcoord to gl_shader

2017-01-02 Thread Timothy Arceri
This is never used in gl_linked_shader other than as a temp during linking so just use a temp instead. --- src/compiler/glsl/glsl_parser_extras.cpp | 3 +-- src/compiler/glsl/linker.cpp | 21 - src/mesa/main/mtypes.h | 3 ++- 3 files changed, 11

[Mesa-dev] [PATCH 41/53] mesa/glsl: move ARB_fragment_coord_conventions_enable field

2017-01-02 Thread Timothy Arceri
This is only used by gl_shader not gl_linked_shader so move it there. --- src/compiler/glsl/glsl_parser_extras.cpp | 2 +- src/compiler/glsl/linker.cpp | 2 +- src/mesa/main/mtypes.h | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git

[Mesa-dev] [PATCH 40/53] st/mesa/glsl: set early_fragment_tests directly in shader_info

2017-01-02 Thread Timothy Arceri
We also move EarlyFragmentTests out of the gl_shader_info struct as it is now only used by gl_shader. --- src/compiler/glsl/glsl_parser_extras.cpp | 2 +- src/compiler/glsl/linker.cpp | 4 ++-- src/mesa/main/mtypes.h | 12 ++--

[Mesa-dev] [PATCH 39/53] mesa/glsl/i965: set and use tcs vertices_out directly

2017-01-02 Thread Timothy Arceri
--- src/compiler/glsl/linker.cpp| 25 - src/mesa/drivers/dri/i965/brw_tcs.c | 6 ++ src/mesa/main/shaderapi.c | 6 +- 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp

[Mesa-dev] [PATCH 35/53] st/mesa/glsl: change xfb_program field to last_vert_prog

2017-01-02 Thread Timothy Arceri
Now that the i965 backend doesn't depend on this field we can make it more generic and short circuit a bunch of code paths. The new field will be used in a following patch for another clean-up. --- src/compiler/glsl/link_varyings.cpp| 5 +++- src/compiler/glsl/linker.cpp |

[Mesa-dev] [PATCH 36/53] mesa/glsl: set {clip, cull}_distance_array_size directly in gl_program

2017-01-02 Thread Timothy Arceri
There are some line wrapping violations here but those lines will get deleted in the following patch. --- src/compiler/glsl/glsl_to_nir.cpp | 2 -- src/compiler/glsl/linker.cpp| 32 +++ src/mesa/drivers/dri/i965/brw_vs.c | 2 +- src/mesa/main/mtypes.h

[Mesa-dev] [PATCH 32/53] mesa: use gl_program for CurrentProgram rather than gl_shader_program

2017-01-02 Thread Timothy Arceri
This makes much more sense and should be more performant in some critical paths such as SSO validation which is called at draw time. Previously the CurrentProgram array could have contained multiple pointers to the same struct which was confusing and we would often need to fish out the

[Mesa-dev] [PATCH 38/53] i965: get outputs_written from gl_program

2017-01-02 Thread Timothy Arceri
There is no need to go via the pointer in nir_shader. This change is required for the shader cache as we don't create a nir_shader. --- src/mesa/drivers/dri/i965/brw_vs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_vs.c

[Mesa-dev] [PATCH 34/53] mesa: update active relinked program

2017-01-02 Thread Timothy Arceri
This likely fixes a subroutine bug were _mesa_shader_program_init_subroutine_defaults() would never have been called for the relinked program as we previously just set _NEW_PROGRAM as dirty and never called the _mesa_use* functions. We also switch to using gl_program for the CurrentProgram array

[Mesa-dev] [PATCH 33/53] mesa/meta: rewrite _mesa_shader_program_use() and _mesa_program_use()

2017-01-02 Thread Timothy Arceri
These are rewritten to do what the function name suggests, that is _mesa_shader_program_use() sets the use of all stage and _mesa_program_use() sets the use of a single stage. This patch is split out to make review easier but will be squashed into mesa: use gl_program for CurrentProgram rather

[Mesa-dev] [PATCH 31/53] mesa: change init subroutine defaults helper to work per gl_program

2017-01-02 Thread Timothy Arceri
A later patch will result in SSO programs calling this helper per gl_program rather than per gl_shader_program. --- src/mesa/main/pipelineobj.c | 10 -- src/mesa/main/shaderapi.c | 30 ++ src/mesa/main/shaderapi.h | 4 ++-- 3 files changed, 20

[Mesa-dev] [PATCH 37/53] glsl: use last_vert_prog to get last {clip, cull}_distance_array_size

2017-01-02 Thread Timothy Arceri
--- src/compiler/glsl/link_varyings.cpp | 6 -- src/compiler/glsl/linker.cpp| 14 -- src/mesa/main/mtypes.h | 7 --- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/src/compiler/glsl/link_varyings.cpp

[Mesa-dev] [PATCH 30/53] mesa: don't always set _NEW_PROGRAM when linking

2017-01-02 Thread Timothy Arceri
We only need to set it when linking was successful and the program being linked is currently active. The programs_in_use mask is just used as a flag for now but in a following patch we will use it to update the CurrentProgram array. --- src/mesa/main/shaderapi.c | 22 +- 1

[Mesa-dev] [PATCH 29/53] mesa/glsl: move ProgramResourceList to gl_shader_program_data

2017-01-02 Thread Timothy Arceri
We also move NumProgramResourceList at the same time. GLES does interface validation on SSO at runtime so we need to move this to be able to switch to storing gl_program pointers in CurrentProgram. --- src/compiler/glsl/linker.cpp | 20 +-- src/mesa/main/mtypes.h |

[Mesa-dev] [PATCH 21/53] mesa/glsl: set sampler units directly in gl_program

2017-01-02 Thread Timothy Arceri
Now that we create gl_program earlier there is no need to mess about copying things to gl_linked_shader then to gl_program. Reviewed-by: Eric Anholt --- src/compiler/glsl/link_uniform_initializers.cpp | 5 +++-- src/mesa/main/mtypes.h | 8

[Mesa-dev] [PATCH 27/53] st/mesa: pass gl_program to st_bind_images()

2017-01-02 Thread Timothy Arceri
We no longer need anything from gl_linked_shader. Reviewed-by: Nicolai Hähnle --- src/mesa/state_tracker/st_atom_image.c | 34 -- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/mesa/state_tracker/st_atom_image.c

[Mesa-dev] [PATCH 22/53] st/mesa/glsl: set SamplersUsed directly in gl_program

2017-01-02 Thread Timothy Arceri
Reviewed-by: Eric Anholt --- src/compiler/glsl/link_uniforms.cpp | 3 ++- src/mesa/drivers/dri/i965/brw_link.cpp| 1 - src/mesa/main/mtypes.h| 3 +-- src/mesa/program/ir_to_mesa.cpp | 1 - src/mesa/state_tracker/st_glsl_to_nir.cpp | 1 - 5

[Mesa-dev] [PATCH 28/53] st/mesa: pass gl_program to st_bind_ubos()

2017-01-02 Thread Timothy Arceri
We no longer need anything from gl_linked_shader. Reviewed-by: Eric Anholt --- src/mesa/state_tracker/st_atom_constbuf.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/mesa/state_tracker/st_atom_constbuf.c

[Mesa-dev] [PATCH 24/53] st/mesa: pass gl_program to st_bind_ssbos()

2017-01-02 Thread Timothy Arceri
We no longer need to pass gl_shader_program. Reviewed-by: Nicolai Hähnle --- src/mesa/state_tracker/st_atom_storagebuf.c | 30 ++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/mesa/state_tracker/st_atom_storagebuf.c

[Mesa-dev] [PATCH 23/53] st/mesa/glsl: move SamplerTargets to gl_program

2017-01-02 Thread Timothy Arceri
This will help allow us to simplify the handling of samplers by storing them in a single location rather than duplicating them in both gl_linked_shader and gl_program. Reviewed-by: Eric Anholt --- src/compiler/glsl/link_uniforms.cpp | 7 --- src/mesa/main/mtypes.h

[Mesa-dev] [PATCH 26/53] st/mesa: stop passing gl_linked_shader to set_affected_state_flags()

2017-01-02 Thread Timothy Arceri
We now get everything we need from the gl_program param. Reviewed-by: Nicolai Hähnle --- src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp

[Mesa-dev] [PATCH 25/53] st/mesa/glsl: set num_images directly in shader_info

2017-01-02 Thread Timothy Arceri
This change also removes the now duplicate NumImages field. Reviewed-by: Nicolai Hähnle --- src/compiler/glsl/link_uniforms.cpp| 2 +- src/compiler/glsl/linker.cpp | 7 --- src/mesa/main/mtypes.h | 7 ---

[Mesa-dev] [PATCH 19/53] mesa/glsl: set num_textures per stage directly in shader_info

2017-01-02 Thread Timothy Arceri
Reviewed-by: Eric Anholt --- src/compiler/glsl/glsl_to_nir.cpp | 1 - src/compiler/glsl/link_uniforms.cpp| 2 +- src/compiler/glsl/linker.cpp | 3 ++- src/mesa/main/mtypes.h | 1 - src/mesa/main/uniform_query.cpp| 2

[Mesa-dev] [PATCH 15/53] i965: make use of new is_arb_asm flag

2017-01-02 Thread Timothy Arceri
Reviewed-by: Eric Anholt --- src/mesa/drivers/dri/i965/brw_vs.c | 11 +-- src/mesa/drivers/dri/i965/brw_wm.c | 13 ++--- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c

[Mesa-dev] [PATCH 20/53] mesa: simplify sampler setting code

2017-01-02 Thread Timothy Arceri
There is no need to loop over active samplers the code above this would have already exited if the sampler was inactive, or errored if the count was larger than the uniforms array size. Reviewed-by: Eric Anholt --- src/mesa/main/uniform_query.cpp | 33

[Mesa-dev] [PATCH 11/53] i965: pass gl_program to brw_upload_ubo_surfaces()

2017-01-02 Thread Timothy Arceri
There is no need to pass gl_linked_shader anymore. --- src/mesa/drivers/dri/i965/brw_context.h | 3 +-- src/mesa/drivers/dri/i965/brw_gs_surface_state.c | 4 ++-- src/mesa/drivers/dri/i965/brw_tcs_surface_state.c | 4 ++-- src/mesa/drivers/dri/i965/brw_tes_surface_state.c | 4 ++--

[Mesa-dev] [PATCH 12/53] i965: stop passing gl_shader_program to brw_nir_setup_glsl_uniforms()

2017-01-02 Thread Timothy Arceri
We can now just get the data needed from the gl_shader_program_data pointer in gl_program. --- src/mesa/drivers/dri/i965/brw_cs.c | 4 ++-- src/mesa/drivers/dri/i965/brw_gs.c | 2 +- src/mesa/drivers/dri/i965/brw_nir.h| 1 -

[Mesa-dev] [PATCH 10/53] i965: stop passing gl_shader_program to brw_assign_common_binding_table_offsets()

2017-01-02 Thread Timothy Arceri
We now get eventhing we need directly from gl_program so there is no need for this. --- src/mesa/drivers/dri/i965/brw_cs.c | 5 ++--- src/mesa/drivers/dri/i965/brw_gs.c | 6 ++ src/mesa/drivers/dri/i965/brw_shader.cpp | 5 - src/mesa/drivers/dri/i965/brw_shader.h | 1 -

[Mesa-dev] [PATCH 09/53] st/mesa/glsl/i965: move ShaderStorageBlocks to gl_program

2017-01-02 Thread Timothy Arceri
Having it here rather than in gl_linked_shader allows us to simplify the code. Also it is error prone to depend on the gl_linked_shader for programs in current use because a failed linking attempt will free infomation about the current program. In i965 we could be trying to recompile a shader

[Mesa-dev] [PATCH 13/53] i965: pass gl_program directly to brw_compile_tes()

2017-01-02 Thread Timothy Arceri
This is the only thing we use from gl_shader_program so pass it directly. --- src/mesa/drivers/dri/i965/brw_compiler.h | 2 +- src/mesa/drivers/dri/i965/brw_shader.cpp | 6 ++ src/mesa/drivers/dri/i965/brw_tes.c | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git

[Mesa-dev] [PATCH 18/53] mesa: make _CurrentFragmentProgram a gl_program struct pointer

2017-01-02 Thread Timothy Arceri
Making this point to a gl_program struct rather than a gl_shader_program struct will allow use to later also make the CurrentProgram array hold gl_program structs which in turn will allow for code simpilifcation. Reviewed-by: Eric Anholt ---

[Mesa-dev] [PATCH 16/53] mesa/glsl: remove hack to reset sampler units to zero

2017-01-02 Thread Timothy Arceri
Now that we have the is_arb_asm flag we can just skip the initialisation. V2: remove hack from standalone compiler where it was never needed since it only compiles glsl shaders. Reviewed-by: Eric Anholt --- src/compiler/glsl/link_uniforms.cpp | 11 ---

[Mesa-dev] [PATCH 17/53] i965: stop passing gl_shader_program to the precompile and codegen functions

2017-01-02 Thread Timothy Arceri
We no longer need it. While we are at it we mark the vs, gs, and wm codegen functions as static. Reviewed-by: Eric Anholt --- src/mesa/drivers/dri/i965/brw_cs.c | 12 +++- src/mesa/drivers/dri/i965/brw_gs.c | 14 --

[Mesa-dev] [PATCH 14/53] st/mesa/glsl: add new is_arb_asm flag in gl_program

2017-01-02 Thread Timothy Arceri
Set the flag via the _mesa_init_gl_program() and NewProgram() helpers. In i965 we currently check for the existance of gl_shader_program to decide if this is an ARB assembly style program or not. Adding a flag makes the code clearer and will help removes a dependency on gl_shader_program in the

[Mesa-dev] [PATCH 08/53] st/mesa/glsl/i965: set num_ssbos directly in shader_info

2017-01-02 Thread Timothy Arceri
Here we also remove the duplicate field in gl_linked_shader and always get the value from shader_info instead. --- src/compiler/glsl/glsl_to_nir.cpp| 1 - src/compiler/glsl/link_uniforms.cpp | 2 +- src/compiler/glsl/linker.cpp | 14

[Mesa-dev] [PATCH 07/53] st/mesa/glsl/i965: move per stage UniformBlocks to gl_program

2017-01-02 Thread Timothy Arceri
This will help allow us to store pointers to gl_program structs in the CurrentProgram array resulting in a bunch of code simplifications. --- src/compiler/glsl/link_uniforms.cpp | 4 ++-- src/compiler/glsl/linker.cpp | 8

[Mesa-dev] [PATCH 03/53] i965: get shared_size from shader_info rather than gl_shader_program

2017-01-02 Thread Timothy Arceri
--- src/mesa/drivers/dri/i965/brw_cs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_cs.c b/src/mesa/drivers/dri/i965/brw_cs.c index e4d82cf..522ddb9 100644 --- a/src/mesa/drivers/dri/i965/brw_cs.c +++ b/src/mesa/drivers/dri/i965/brw_cs.c

[Mesa-dev] [PATCH 02/53] i965: stop depending on gl_shader_program for brw_compute_vue_map() params

2017-01-02 Thread Timothy Arceri
This removes another dependency on gl_shader_program from the codegen functions, this will help allow us to use gl_program for the CurrentProgram array rather than gl_shader_program. --- src/mesa/drivers/dri/i965/brw_gs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Mesa-dev] [PATCH 06/53] st/mesa/glsl/i965: set num_ubos directly in shader_info

2017-01-02 Thread Timothy Arceri
This also removes the duplicate field in gl_linked_shader, and gets num_ubos from shader_info instead. --- src/compiler/glsl/glsl_to_nir.cpp| 1 - src/compiler/glsl/link_uniforms.cpp | 4 ++-- src/compiler/glsl/linker.cpp | 14 +++---

[Mesa-dev] [PATCH 05/53] st/mesa/glsl/i965: move ImageUnits and ImageAccess fields to gl_program

2017-01-02 Thread Timothy Arceri
Having it here rather than in gl_linked_shader allows us to simplify the code. Also it is error prone to depend on the gl_linked_shader for programs in current use because a failed linking attempt will free infomation about the current program. In i965 we could be trying to recompile a shader

[Mesa-dev] [PATCH 04/53] i965: get InfoLog and LinkStatus via the pointer in gl_program

2017-01-02 Thread Timothy Arceri
--- src/mesa/drivers/dri/i965/brw_cs.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_cs.c b/src/mesa/drivers/dri/i965/brw_cs.c index 522ddb9..f220846 100644 --- a/src/mesa/drivers/dri/i965/brw_cs.c +++

[Mesa-dev] [PATCH 01/53] i965: pass gl_program to the brw_*_debug_recompile() functions

2017-01-02 Thread Timothy Arceri
Rather then passing gl_shader_program. The only field use was Name which is the same as the Id field in gl_program. For wm and vs we also make the functions static and move them before the codegen functions. This change reduces the codegen functions dependency on gl_shader_program. ---

[Mesa-dev] Clean-ups and bug fixes (rebased and resent again)

2017-01-02 Thread Timothy Arceri
14-28 have been reviewed. Big ping to the Intel guys on patches 1-14 :) V3: - rebased - previously reviewed patches pushed V2: - some make check fixes - rebase on master - previously reviewed patches pushed (Thanks Emil) - patch 56-58 are new I started out with a goal of freeing _LinkedShaders

[Mesa-dev] [PATCH 31/32] i965: Remove scanout restriction from lossless compression

2017-01-02 Thread Ben Widawsky
v2: Try to keep the assert as recommended by Topi. This requires modifying the num_samples check to be <= 1 because internally created buffers set num_samples = 0. Cc: Topi Pohjolainen Signed-off-by: Ben Widawsky Acked-by: Daniel Stone

[Mesa-dev] [PATCH 28/32] i965: Plumb resolve hints from miptrees to blorp

2017-01-02 Thread Ben Widawsky
Signed-off-by: Ben Widawsky Acked-by: Daniel Stone --- src/mesa/drivers/dri/i965/brw_blorp.c | 3 ++- src/mesa/drivers/dri/i965/brw_blorp.h | 3 ++- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 4 ++-- 3 files changed, 6

[Mesa-dev] [PATCH 32/32] i965: Handle compression modifier

2017-01-02 Thread Ben Widawsky
FINISHME: Use the kernel's final choice for the fb modifier bwidawsk@norris2:~/intel-gfx/kmscube (modifiers $) ~/scripts/measure_bandwidth.sh ./kmscube none Read bandwidth: 603.91 MiB/s Write bandwidth: 615.28 MiB/s bwidawsk@norris2:~/intel-gfx/kmscube (modifiers $)

[Mesa-dev] [PATCH 30/32] i965: Use partial resolves for CCS buffers being scanned out

2017-01-02 Thread Ben Widawsky
On Gen9 hardware, the display engine is able to scanout a compressed framebuffer by providing an offset to auxiliary compression information. Unfortunately, the hardware is incapable of doing the same thing for the fast clear color. To mitigate this, the hardware introduced a new resolve type

[Mesa-dev] [PATCH 27/32] i965: Change resolve flags to enum

2017-01-02 Thread Ben Widawsky
In the foreseeable future it doesn't seem to make sense to have multiple resolve flags. What does make sense is to have the caller give an indication to the lower layers what it things should be done for resolve. The enum change distinguishes this binary selection. v2: Make setting the hint more

[Mesa-dev] [PATCH 29/32] i965: Add new resolve hints full and partial

2017-01-02 Thread Ben Widawsky
Upper layers of the code will have the need to specify full or partial resolves (more on this in the next patch). This code simply adds the new enums and plumbs it in as minimally as necessary. Signed-off-by: Ben Widawsky Acked-by: Daniel Stone ---

[Mesa-dev] [PATCH 18/32] i965/miptree: Add a helper functions for image creation

2017-01-02 Thread Ben Widawsky
This provides a common function or creating miptrees when there is an existing DRIimage to use. That provides an easy way to add CCS allocation. Signed-off-by: Ben Widawsky Acked-by: Daniel Stone --- src/mesa/drivers/dri/i965/intel_fbo.c | 17

[Mesa-dev] [PATCH 19/32] i965/miptree: Allocate mcs_buf for an image's CCS_E

2017-01-02 Thread Ben Widawsky
This code will disable actually creating these buffers for the scanout, but it puts the allocation in place. Primarily this patch is split out for review, it can be squashed in later if preferred. assert(mt->offset == 0) in ccs creation (as requested by Topi) Cc: Topi Pohjolainen

[Mesa-dev] [PATCH 22/32] i965: Create correctly sized mcs for an image

2017-01-02 Thread Ben Widawsky
v2: Leave "image+mod" (Topi) Signed-off-by: Ben Widawsky Acked-by: Daniel Stone --- src/mesa/drivers/dri/i965/intel_screen.c | 33 1 file changed, 29 insertions(+), 4 deletions(-) diff --git

[Mesa-dev] [PATCH 25/32] i965: Pretend that CCS modified images are two planes

2017-01-02 Thread Ben Widawsky
Signed-off-by: Ben Widawsky Acked-by: Daniel Stone --- src/mesa/drivers/dri/i965/intel_screen.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_screen.c

[Mesa-dev] [PATCH 24/32] i965/miptree: Allocate mt earlier in update winsys

2017-01-02 Thread Ben Widawsky
Allows us to continue utilizing common miptree creation using __DRIimage without creating a new DRIimage (for the intel_process_dri2_buffer() case). This is a bit ugly, but I think it's the best one can do. Signed-off-by: Ben Widawsky Acked-by: Daniel Stone

[Mesa-dev] [PATCH 26/32] i965: Make CCS stride match kernel's expectations

2017-01-02 Thread Ben Widawsky
v2: Put the commit message as a comment (Topi) Cc: Topi Pohjolainen Cc: Ville Syrjälä Cc: Jason Ekstrand Signed-off-by: Ben Widawsky Acked-by: Daniel Stone ---

[Mesa-dev] [PATCH 21/32] i965: Allocate tile aligned height

2017-01-02 Thread Ben Widawsky
This patch shouldn't actually do anything because the libdrm function should already do this alignment. However, it preps us for a future patch where we add in the CCS AUX size, and in the process it serves as a good place to find bisectable issues if libdrm or kernel does something incorrectly.

[Mesa-dev] [PATCH 20/32] i965: Support all known modifiers

2017-01-02 Thread Ben Widawsky
This patch adds support for handling X tiled modifier. This isn't particularly useful but it makes our code complete. Signed-off-by: Ben Widawsky Acked-by: Daniel Stone --- src/mesa/drivers/dri/i965/intel_screen.c | 12 +--- 1 file changed, 9

[Mesa-dev] [PATCH 23/32] i965/miptree: Add a return for updating of winsys

2017-01-02 Thread Ben Widawsky
There is nothing particularly useful to do currently if the update fails, but there is no point carrying on either. As a result, this has a behavior change. v2: Make the return type a bool (Topi) Cc: Topi Pohjolainen Signed-off-by: Ben Widawsky

[Mesa-dev] [PATCH 15/32] i965: Bring back always Y-tiled on SKL+

2017-01-02 Thread Ben Widawsky
commit 6a0d036483caf87d43ebe2edd1905873446c9589 Author: Ben Widawsky Date: Thu Apr 21 20:14:58 2016 -0700 i965: Always use Y-tiled buffers on SKL+ Aside from the benchmark gains that were initially posted, I was able to collect memory bandwidth data running kmscube

[Mesa-dev] [PATCH 17/32] i965: Support images with offset aux buffers

2017-01-02 Thread Ben Widawsky
Previously our aux buffers (MCS, and HiZ) never had an offset because they were in their own buffer object. When using the CCS lossless compression feature, it's desirable to store the data at an offset from the main framebuffer, ie. share a buffer object. This patch just makes having an aux

[Mesa-dev] [PATCH 11/32] gbm: Introduce modifiers into surface/bo creation

2017-01-02 Thread Ben Widawsky
The idea behind modifiers like this is that the user of GBM will have some mechanism to query what properties the hardware supports for its BO or surface. This information is directly passed in (and stored) so that the DRI implementation can create an image with the appropriate attributes. A

[Mesa-dev] [PATCH 16/32] i965: Separate image allocation with modifiers

2017-01-02 Thread Ben Widawsky
Since the code doesn't support modifiers yet, this patch should do nothing other than prepare for more patches. Signed-off-by: Ben Widawsky Acked-by: Daniel Stone --- src/mesa/drivers/dri/i965/intel_screen.c | 73 ++-- 1

[Mesa-dev] [PATCH 06/32] gbm: Create a gbm_device getter for stride

2017-01-02 Thread Ben Widawsky
This will be used so we can query information per plane. Signed-off-by: Ben Widawsky Reviewed-by: Eric Engestrom Acked-by: Daniel Stone --- src/gbm/backends/dri/gbm_dri.c | 7 +++ src/gbm/main/gbm.c | 2 +-

[Mesa-dev] [PATCH 13/32] i965: Handle X tiled modifier

2017-01-02 Thread Ben Widawsky
This doesn't really "do" anything because the default tiling for the winsys buffer is X tiled. We do however want the X tiled modifier to work correctly from the API perspective, which would imply that if you set this modifier, and later do a get_modifier, you get back at least X tiled. Cc:

[Mesa-dev] [PATCH 12/32] i965: Handle Y-tile modifier

2017-01-02 Thread Ben Widawsky
This doesn't actually enable Y-tiling, it simply parses it and moves on. Signed-off-by: Ben Widawsky Reviewed-by: Eric Engestrom Acked-by: Daniel Stone --- src/mesa/drivers/dri/i965/intel_image.h | 1 +

[Mesa-dev] [PATCH 14/32] gbm: Get modifiers from DRI

2017-01-02 Thread Ben Widawsky
v2: Use stored modifiers from create instead of queryImage v3: Make sure not to query modifiers for dumb buffers (Daniel) Discussion with Kristian yielded that there is no need for per plane modifiers. Cc: Daniel Stone Signed-off-by: Ben Widawsky

[Mesa-dev] [PATCH 09/32] i965/dri: Store the screen associated with the image

2017-01-02 Thread Ben Widawsky
I intend to need to get to the devinfo structure, and storing the screen is an easy way to do that. It seems to be the consensus that you cannot share an image between multiple screens. Scape-goat: Rob Clark Signed-off-by: Ben Widawsky Reviewed-by: Eric

[Mesa-dev] [PATCH 05/32] gbm: Export a getter for per plane handles

2017-01-02 Thread Ben Widawsky
Cc: Daniel Stone Signed-off-by: Ben Widawsky Acked-by: Daniel Stone --- src/gbm/backends/dri/gbm_dri.c | 28 src/gbm/gbm-symbols-check | 1 + src/gbm/main/gbm.c | 18

[Mesa-dev] [PATCH 10/32] dri: Add an image creation with modifiers

2017-01-02 Thread Ben Widawsky
Modifiers will be obtains or guessed by the client and passed in during image creation/import. This requires bumping the DRIimage version. As of this patch, the modifiers aren't plumbed all the way down, this patch simply makes sure the interface level stuff is correct. v2: Don't allow usage +

[Mesa-dev] [PATCH 04/32] gbm: Export a plane getter function

2017-01-02 Thread Ben Widawsky
This will be used by clients that need to know the number of planes allocated for them on behalf of the GL or other API. The best current example of this is when an extra "plane" is allocated to store compression data for the primary plane. Cc: Daniel Stone Signed-off-by:

[Mesa-dev] [PATCH 08/32] gbm: Export a per plane getter for offset

2017-01-02 Thread Ben Widawsky
Unlike stride, there was no previous offset getter, so it can be right on the first try. Signed-off-by: Ben Widawsky Reviewed-by: Eric Engestrom Acked-by: Daniel Stone --- src/gbm/backends/dri/gbm_dri.c | 27

[Mesa-dev] [PATCH 07/32] gbm: Export a per plane getter for stride

2017-01-02 Thread Ben Widawsky
Signed-off-by: Ben Widawsky Reviewed-by: Eric Engestrom Acked-by: Daniel Stone --- src/gbm/backends/dri/gbm_dri.c | 26 +- src/gbm/gbm-symbols-check | 1 + src/gbm/main/gbm.c | 15

[Mesa-dev] [PATCH 02/32] gbm: Move getters to match order in header file (trivial)

2017-01-02 Thread Ben Widawsky
Other things are out of order, but I need to add a getter so I'm just fixing those. This helps people adding to GBM know where the right place to put things is. Signed-off-by: Ben Widawsky Reviewed-by: Eric Engestrom Acked-by: Daniel Stone

[Mesa-dev] [PATCH 00/32] [v2] Renderbuffer Decompression (and GBM modifiers)

2017-01-02 Thread Ben Widawsky
Same as v1 with the requested fixes and tags added. v1 is here: https://lists.freedesktop.org/archives/intel-gfx/2016-December/113639.html I haven't yet updated kmscube to use Kristian's GET_PLANE2, but I will be doing it this week, I hope. Now all patches but the last should be safe to merge

[Mesa-dev] [PATCH 03/32] gbm: Fix width height getters return type (trivial)

2017-01-02 Thread Ben Widawsky
v2: Other way round... to make consistent, make both return type have the fixed width - uint32_t. Cc: Daniel Stone Signed-off-by: Ben Widawsky Reviewed-by: Eric Engestrom Acked-by: Daniel Stone ---

[Mesa-dev] [PATCH 01/32] i965: Fix SURFACE_STATE to handle non-zero aux offsets

2017-01-02 Thread Ben Widawsky
Signed-off-by: Ben Widawsky Reviewed-by: Kenneth Graunke Reviewed-by: Jason Ekstrand Acked-by: Daniel Stone --- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 3 +-- 1 file changed, 1 insertion(+), 2

Re: [Mesa-dev] [PATCH 08/27] dri: Add an image creation with modifiers

2017-01-02 Thread Ben Widawsky
On 16-12-02 18:01:02, Eric Engestrom wrote: On Thursday, 2016-12-01 14:09:49 -0800, Ben Widawsky wrote: From: Ben Widawsky Modifiers will be obtains or guessed by the client and passed in during image creation/import. This requires bumping the DRIimage version.

Re: [Mesa-dev] [PATCH 04/27] gbm: Create a gbm_device getter for stride

2017-01-02 Thread Ben Widawsky
On 16-12-02 17:58:40, Eric Engestrom wrote: On Thursday, 2016-12-01 14:09:45 -0800, Ben Widawsky wrote: From: Ben Widawsky This will be used so we can query information per plane. Signed-off-by: Ben Widawsky --- src/gbm/backends/dri/gbm_dri.c | 7

Re: [Mesa-dev] [PATCH 03/27] gbm: Export a plane getter function

2017-01-02 Thread Ben Widawsky
On 16-12-02 17:57:40, Eric Engestrom wrote: On Thursday, 2016-12-01 14:09:44 -0800, Ben Widawsky wrote: From: Ben Widawsky This will be used by clients that need to know the number of planes allocated for them on behalf of the GL or other API. The best current example of

Re: [Mesa-dev] [PATCH 2/9] radeonsi: clean up more HAVE_LLVM #ifdefs

2017-01-02 Thread Bas Nieuwenhuizen
On Tue, Jan 3, 2017 at 12:01 AM, Marek Olšák wrote: > On Mon, Jan 2, 2017 at 11:26 PM, Bas Nieuwenhuizen > wrote: >> Can you move this one before patch 1, so that HAVE_LLVM is always defined? > > I don't understand. HAVE_LLVM has been defined in this

[Mesa-dev] [PATCH] dri3: Fix MakeCurrent without a default framebuffer

2017-01-02 Thread Fredrik Höglund
In OpenGL 3.0 and later it is legal to make a context current without a default framebuffer. This has been broken since DRI3 support was introduced. Cc: "13.0 12.0" --- src/glx/dri3_glx.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-)

Re: [Mesa-dev] [PATCH 2/9] radeonsi: clean up more HAVE_LLVM #ifdefs

2017-01-02 Thread Marek Olšák
On Mon, Jan 2, 2017 at 11:26 PM, Bas Nieuwenhuizen wrote: > Can you move this one before patch 1, so that HAVE_LLVM is always defined? I don't understand. HAVE_LLVM has been defined in this file for several years at least. Marek

Re: [Mesa-dev] [PATCH 6/9] radeonsi: don't count fast clears and prefetches into CP DMA stats

2017-01-02 Thread Marek Olšák
On Mon, Jan 2, 2017 at 11:17 PM, Bas Nieuwenhuizen wrote: > On Mon, Jan 2, 2017 at 9:17 PM, Marek Olšák wrote: >> From: Marek Olšák >> >> --- >> src/gallium/drivers/radeonsi/si_cp_dma.c | 8 ++-- >> 1 file changed, 6

Re: [Mesa-dev] [PATCH 00/12] RadeonSI: SDMA ClearBuffer support and other SDMA improvements

2017-01-02 Thread Marek Olšák
On Mon, Jan 2, 2017 at 11:54 PM, Marek Olšák wrote: > Hi, > > These patches optimize our SDMA usage and implement buffer clearing. > They also turn SDMA IBs into de-facto preambles of GFX IB, because any > clear that is also the first buffer use is pushed ... to the SDMA IB.

[Mesa-dev] [PATCH 12/12] radeonsi: turn SDMA IBs into de-facto preambles of GFX IBs

2017-01-02 Thread Marek Olšák
From: Marek Olšák Draw calls no longer flush SDMA IBs. r600_need_dma_space is responsible for synchronizing execution between both IBs. Initial buffer clears and fast clears will stay unflushed in the SDMA IB (up to 64 MB) as long as the GFX IB isn't flushed either. ---

[Mesa-dev] [PATCH 10/12] radeonsi: do all math in bytes in SI DMA code

2017-01-02 Thread Marek Olšák
From: Marek Olšák --- src/amd/common/sid.h | 6 -- src/gallium/drivers/radeonsi/si_dma.c | 34 +- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/amd/common/sid.h b/src/amd/common/sid.h index

[Mesa-dev] [PATCH 09/12] gallium/radeon: prevent SDMA stalls by detecting RAW hazards in need_dma_space

2017-01-02 Thread Marek Olšák
From: Marek Olšák Call r600_dma_emit_wait_idle only when there is a possibility of a read-after-write hazard. Buffers not yet used by the SDMA IB don't have to wait. --- src/gallium/drivers/r600/evergreen_hw_context.c | 1 - src/gallium/drivers/r600/evergreen_state.c

[Mesa-dev] [PATCH 01/12] radeonsi: implement SDMA-based buffer clearing for CIK-VI

2017-01-02 Thread Marek Olšák
From: Marek Olšák --- src/gallium/drivers/radeon/r600_pipe_common.c | 9 ++ src/gallium/drivers/radeon/r600_pipe_common.h | 3 ++ src/gallium/drivers/radeonsi/cik_sdma.c | 42 +++ 3 files changed, 54 insertions(+) diff --git

  1   2   >