[Mesa-dev] [PATCH 7/9] intel: remove null check before free

2017-04-11 Thread Thomas Hindoe Paaboel Andersen
--- src/intel/tools/aubinator_error_decode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/intel/tools/aubinator_error_decode.c b/src/intel/tools/aubinator_error_decode.c index 2e62369..5df8aaf 100644 --- a/src/intel/tools/aubinator_error_decode.c +++

[Mesa-dev] [PATCH 5/9] i965: remove unused context

2017-04-11 Thread Thomas Hindoe Paaboel Andersen
--- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 2 -- src/mesa/drivers/dri/i965/intel_pixel_draw.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 81e2d6e..5d5c77f 100644 ---

[Mesa-dev] [PATCH 8/9] st/mesa: remove null check before free

2017-04-11 Thread Thomas Hindoe Paaboel Andersen
--- src/mesa/state_tracker/st_cb_texture.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 99c59f7..73f784d 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++

[Mesa-dev] [PATCH 4/9] mesa: fix misleading indentation

2017-04-11 Thread Thomas Hindoe Paaboel Andersen
--- src/mesa/main/shaderapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 187475f..9efb2e0 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -1110,7 +1110,7 @@ _mesa_link_program(struct

[Mesa-dev] [PATCH 9/9] util/disk_cache: remove null check before free

2017-04-11 Thread Thomas Hindoe Paaboel Andersen
--- src/util/disk_cache.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c index d9de8ef..93fb1f5 100644 --- a/src/util/disk_cache.c +++ b/src/util/disk_cache.c @@ -891,10 +891,8 @@ cache_put(void *job, int

[Mesa-dev] [PATCH 3/9] anv/image: indentation fix

2017-04-11 Thread Thomas Hindoe Paaboel Andersen
--- src/intel/vulkan/anv_image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index cf34dbe..9bf446a 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -183,7 +183,7 @@

[Mesa-dev] [PATCH 6/9] radv: remove null check before free

2017-04-11 Thread Thomas Hindoe Paaboel Andersen
--- src/amd/vulkan/radv_pipeline.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index cf11362..e3eacf3 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -585,8 +585,7

[Mesa-dev] [PATCH 1/9] radv: remove redundant returns

2017-04-11 Thread Thomas Hindoe Paaboel Andersen
From 1811ccf1 --- src/amd/vulkan/radv_device.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 5f14394..9138a00 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -749,7 +749,6 @@ void

[Mesa-dev] [PATCH 2/9] radv: simplify if statement

2017-04-11 Thread Thomas Hindoe Paaboel Andersen
--- src/amd/vulkan/radv_wsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c index b8999f4..37cb322 100644 --- a/src/amd/vulkan/radv_wsi.c +++ b/src/amd/vulkan/radv_wsi.c @@ -210,7 +210,7 @@ radv_wsi_image_create(VkDevice

[Mesa-dev] Trivial code cleanups

2017-04-11 Thread Thomas Hindoe Paaboel Andersen
A mix of fixes for static analysis warnings, recent indentation mistakes, and unnecessary null checks before free. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] amd/addrlib: use correct variable name in header

2017-04-08 Thread Thomas Hindoe Paaboel Andersen
Since the inclusion in 7f160efcde41b52ad78e562316384373dab419e3 the header used x_biased, while the implementation used y_biased. This changes the header to macth the implementation since the uses of the function seems to expect y_biased. --- src/amd/addrlib/gfx9/rbmap.h | 2 +- 1 file changed, 1

[Mesa-dev] [PATCH] gallium/hud: avoid buffer overrun

2017-01-14 Thread Thomas Hindoe Paaboel Andersen
Renaming data sources was added in e8bb97ce30051b999a4a69c9b27884daeb8d71e6 It was possible to use a new name longer than the name array in hud_graph of 128. This patch truncates the name to fit the array. CC: Marek Olšák --- src/gallium/auxiliary/hud/hud_context.c | 6

[Mesa-dev] [PATCH] nir: remove duplicated foreach loop

2017-01-09 Thread Thomas Hindoe Paaboel Andersen
The foreach loop was called both in the else case and right after. The indentation seems to indicate that the extra call was from a previous version with an else section with out curly brackets. --- Spotted due to the wrong indentation. The patch is untested as I do not have the neccesary

[Mesa-dev] [PATCH] i965: add missing return in if statement

2016-05-28 Thread Thomas Hindoe Paaboel Andersen
Re-add the "return false" that was removed in 0c02d7002d6c005b4c1fe997b5ef5916978dd183 It seems that something went wrong when merging the patch. The patch sent to the mailing list does not directly match what was committed. https://lists.freedesktop.org/archives/mesa-dev/2016-May/118198.html

[Mesa-dev] [PATCH 2/3] freedreno: remove null check before free

2016-05-03 Thread Thomas Hindoe Paaboel Andersen
--- src/gallium/drivers/freedreno/freedreno_resource.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index 99affc4..4455818 100644 ---

[Mesa-dev] [PATCH 1/3] coccinelle: remove null check before free

2016-05-03 Thread Thomas Hindoe Paaboel Andersen
Adds a coccinelle dir for semantic patches. The first patch here just removes null checks before calling free. To create a patch call e.g.: spatch --sp-file null-check-before-free.cocci --dir ../src > patch --- coccinelle/null-check-before-free.cocci | 6 ++ 1 file changed, 6 insertions(+)

[Mesa-dev] [PATCH 3/3] mesa: remove null check before free

2016-05-03 Thread Thomas Hindoe Paaboel Andersen
--- src/mesa/main/readpix.c | 3 +-- src/mesa/main/texgetimage.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index 882d863..1cb06c7 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -608,8 +608,7

[Mesa-dev] [PATCH v2] nir: fix assert for wildcard pairs

2016-05-03 Thread Thomas Hindoe Paaboel Andersen
The assert was null checking dest_arr_parent twice. The intention seems to be to check both dest_ and src_. Added in d3636da9 --- v2: Fix the assert rather than checking both in the if(). Hat tip to Ilia. src/compiler/nir/nir_lower_var_copies.c | 2 +- 1 file changed, 1 insertion(+), 1

[Mesa-dev] [PATCH] nir: fix check for wildcard pairs

2016-05-03 Thread Thomas Hindoe Paaboel Andersen
It seems that the intention was to check both for null as they are dereferenced immediately after. Added in d3636da9 --- src/compiler/nir/nir_lower_var_copies.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_lower_var_copies.c

[Mesa-dev] [PATCH 3/3] nir/lower_double_ops: fix indentation

2016-04-29 Thread Thomas Hindoe Paaboel Andersen
--- src/compiler/nir/nir_lower_double_ops.c | 60 - 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/compiler/nir/nir_lower_double_ops.c b/src/compiler/nir/nir_lower_double_ops.c index e5cf094..3f831dc 100644 ---

[Mesa-dev] [PATCH 2/3] nir/opt_dead_cf: fix indentation

2016-04-29 Thread Thomas Hindoe Paaboel Andersen
--- src/compiler/nir/nir_opt_dead_cf.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/nir/nir_opt_dead_cf.c b/src/compiler/nir/nir_opt_dead_cf.c index 7450b1c..74af19b 100644 --- a/src/compiler/nir/nir_opt_dead_cf.c +++

[Mesa-dev] [PATCH 1/3] nir/opt_dead_cf: correction of side effect check

2016-04-29 Thread Thomas Hindoe Paaboel Andersen
Parenthesis are needed here as ! takes precedence over the &. The check had the opposite effect than intended. --- Not tested as I do not own the neccesary hardware. src/compiler/nir/nir_opt_dead_cf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[Mesa-dev] [PATCH] winsys/amdgpu: fix preamble IB size

2016-04-20 Thread Thomas Hindoe Paaboel Andersen
The missing break caused the IB size to be overwritten with the size of IB_CONST. This was introduced in: 7201230582e060aa2eb79c825d3188b437ef7bb8 --- src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c

[Mesa-dev] [PATCH 1/2] tgsi: fix buffer overflow

2016-04-12 Thread Thomas Hindoe Paaboel Andersen
Increase r to four channels as rgba is written to it --- src/gallium/auxiliary/tgsi/tgsi_exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index fb51051..41dd0f0 100644 ---

[Mesa-dev] [PATCH 2/2] softpipe: avoid buffer overflow

2016-04-12 Thread Thomas Hindoe Paaboel Andersen
--- src/gallium/drivers/softpipe/sp_buffer.c | 8 src/gallium/drivers/softpipe/sp_image.c | 8 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/softpipe/sp_buffer.c b/src/gallium/drivers/softpipe/sp_buffer.c index 69717ba..69a6bd1 100644 ---

[Mesa-dev] [PATCH] st/vdpau: correct null check

2016-03-30 Thread Thomas Hindoe Paaboel Andersen
The null check of result was the wrong way around. Also, move memset and dereference of result after the null check. --- src/gallium/state_trackers/vdpau/surface.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/state_trackers/vdpau/surface.c

[Mesa-dev] [PATCH] svga: avoid freeing non-malloced memory

2016-03-24 Thread Thomas Hindoe Paaboel Andersen
svga_shader_expand will fall back to using non-malloced memory for emit.buf if malloc fails. We should check if the memory is malloced before freeing it in the error path of svga_tgsi_vgpu9_translate. --- All we need to do is check if emit->buf points to the err_buf. I was surprised to see a

[Mesa-dev] [PATCH] st/va: avoid dereference after free

2016-03-05 Thread Thomas Hindoe Paaboel Andersen
--- src/gallium/state_trackers/va/image.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/va/image.c b/src/gallium/state_trackers/va/image.c index 2c42a98..92d014c 100644 --- a/src/gallium/state_trackers/va/image.c +++

[Mesa-dev] [PATCH 2/2] gallium/cso: fix indentation

2016-03-01 Thread Thomas Hindoe Paaboel Andersen
Only one of these were recently introduced. However, since we keep copy/pasting the same wrong indentation we should probably just fix it. --- src/gallium/auxiliary/cso_cache/cso_context.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[Mesa-dev] [PATCH 1/2] st/mesa: move dereference after null check

2016-03-01 Thread Thomas Hindoe Paaboel Andersen
We should not dereference shader before we have done the null check. --- src/mesa/state_tracker/st_atom_image.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_atom_image.c b/src/mesa/state_tracker/st_atom_image.c index 4b48bc3..d0f0c42 100644 ---

[Mesa-dev] [PATCH] anv: remove stray ; after if

2016-02-25 Thread Thomas Hindoe Paaboel Andersen
Both logic and indentation suggests that the ; were not intended here. --- src/intel/vulkan/anv_cmd_buffer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c index b060828..827c3ed 100644 ---

[Mesa-dev] [PATCH] mesa: use sizeof on the correct type

2016-02-22 Thread Thomas Hindoe Paaboel Andersen
Before the luminance stride was based on the size of GL_FLOAT which is just the type constant (0x1406). Change it to use the size of GLfloat. --- src/mesa/main/readpix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index