[Mesa-dev] [PATCH 2/2] i965: add missing rollback of a xfb zero_offsets flag

2018-11-19 Thread asimiklit . work
From: Andrii Simiklit This patch is needed to avoid incorrect value of StreamOffset flag in 3DSTATE_SO_BUFFER command after rollback operation. To be able to test easily this issue the following workaround is necessary: -if (!brw_batch_has_aperture_space(brw, 0)) { by: +if (true) { in

[Mesa-dev] [PATCH 1/2] i965: add missing rollback of URB requirements

2018-11-19 Thread asimiklit . work
From: Andrii Simiklit This patch is needed to avoid missing 3DSTATE_URB_* commands in a batch after rollback operation. To be able to test easily this issue the following workaround is necessary: -if (!brw_batch_has_aperture_space(brw, 0)) { by: +if (true) { in brw_draw_single_prim function.

[Mesa-dev] [PATCH v4 5/5] intel/tools: make sure the binary file is properly read

2018-11-14 Thread asimiklit . work
From: Andrii Simiklit 1. tools/i965_disasm.c:58:4: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result fread(assembly, *end, 1, fp); v2: Fixed incorrect return value check. ( Eric Engestrom ) v3: Zero size file check placed before fread

[Mesa-dev] [PATCH v3 5/5] intel/tools: avoid 'ignoring return value'

2018-11-14 Thread asimiklit . work
From: Andrii Simiklit 1. tools/i965_disasm.c:58:4: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result fread(assembly, *end, 1, fp); v2: Fixed incorrect return value check. ( Eric Engestrom ) v3: Zero size file check moved before fread

[Mesa-dev] [PATCH v2 2/5] compiler: avoid 'unused variable'

2018-11-13 Thread asimiklit . work
From: Andrii Simiklit 1. nir/nir_lower_vars_to_ssa.c:691:21: warning: unused variable ‘var’ nir_variable *var = path->path[0]->var; v2: Changes for some part of 'may be used uninitialized' warnings were removed, seems like it is a compiler issue. ( Eric Engestrom )

[Mesa-dev] [PATCH v2 3/5] i965: avoid 'unused variable'

2018-11-13 Thread asimiklit . work
From: Andrii Simiklit 1. brw_pipe_control.c:311:34: warning: unused variable ‘devinfo’ 2. brw_program_binary.c:209:19: warning: unused variable ‘gen_size’ 3. brw_program_binary.c:216:19: warning: unused variable ‘nir_size’ v2: Changes for unreproducible issues were removed

[Mesa-dev] [PATCH v2 5/5] intel/tools: avoid 'ignoring return value'

2018-11-13 Thread asimiklit . work
From: Andrii Simiklit 1. tools/i965_disasm.c:58:4: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result fread(assembly, *end, 1, fp); v2: - Fixed incorrect return value check. ( Eric Engestrom ) Signed-off-by: Andrii Simiklit ---

[Mesa-dev] [PATCH v2 4/5] main: avoid 'may be used uninitialized' warnings

2018-11-13 Thread asimiklit . work
From: Andrii Simiklit 1. main/texcompress_etc.c:1314:12: warning: ‘*((void *)+2)’ may be used uninitialized in this function 2. main/texcompress_etc.c:1354:12: warning: ‘*((void *)+2)’ may be used uninitialized in this function 3. main/texcompress_etc.c:1293:12: warning: ‘dst’ may be

[Mesa-dev] [PATCH v2 0/5] mesa: fix against several compilation warnings

2018-11-13 Thread asimiklit . work
From: Andrii Simiklit Fixes several compilation warnings for a release configuration v2: the patch '1/4' was separated to '1/5' and '5/5' ( Eric Engestrom ) Andrii Simiklit (5): intel/tools: avoid 'unused variable' warnings compiler: avoid 'unused variable' i965: avoid 'unused

[Mesa-dev] [PATCH v2 1/5] intel/tools: avoid 'unused variable' warnings

2018-11-13 Thread asimiklit . work
From: Andrii Simiklit 1. tools/aub_read.c:271:31: warning: unused variable ‘end’ const uint32_t *p = data, *end = data + data_len, *next; 2. tools/aub_mem.c:292:13: warning: unused variable ‘res’ void *res = mmap((uint8_t *)bo.map + map_offset, 4096, PROT_READ,

[Mesa-dev] [PATCH v4 1/2] i965/batch: avoid reverting batch buffer if saved state is an empty

2018-11-04 Thread asimiklit . work
From: Andrii Simiklit There's no point reverting to the last saved point if that save point is the empty batch, we will just repeat ourselves. v2: Merge with new commits, changes was minimized, added the 'fixes' tag v3: Added in to patch series v4: Fixed the regression which was introduced by

[Mesa-dev] [PATCH v2] intel/tools: fix resource leak

2018-10-26 Thread asimiklit . work
From: Andrii Simiklit Some memory and file descriptors are not freed/closed. v2: fixed case where we skipped the 'aub' variable initialization Signed-off-by: Andrii Simiklit --- src/intel/tools/error2aub.c | 10 ++ 1 file changed, 10 insertions(+) diff --git

[Mesa-dev] [PATCH] intel/tools: fix resource leak

2018-10-26 Thread asimiklit . work
From: Andrii Simiklit Some memory and file descriptors are not freed/closed. Signed-off-by: Andrii Simiklit --- src/intel/tools/error2aub.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/intel/tools/error2aub.c b/src/intel/tools/error2aub.c index 8a23d5ef1e..451fd8c74a 100644

[Mesa-dev] [PATCH] egl: return correct error code for a case req ver < 3 with forward-compatible

2018-10-11 Thread asimiklit . work
From: Andrii Simiklit The EGL_KHR_create_context spec says: "If an OpenGL context is requested and the values for attributes EGL_CONTEXT_MAJOR_VERSION_KHR and EGL_CONTEXT_MINOR_VERSION_KHR, when considered together with the value for attribute

[Mesa-dev] [PATCH] glsl: prevent qualifiers modification of predeclared variables

2018-10-04 Thread asimiklit . work
From: Andrii Simiklit GLSL 3.7 (Identifiers): "However, as noted in the specification, there are some cases where previously declared variables can be redeclared to change or add some property, and predeclared "gl_" names are allowed to be redeclared in a shader only for these specific purposes.

[Mesa-dev] [PATCH] i965: consider a 'base level' when calculating width0, height0, depth0

2018-10-02 Thread asimiklit . work
From: Andrii Simiklit I guess that when we calculating the width0, height0, depth0 to use for function 'intel_miptree_create' we need to consider the 'base level' like it is done in the 'intel_miptree_create_for_teximage' function. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107987

[Mesa-dev] [PATCH v2] i965/glsl: don't add unused aoa element to the program resource list

2018-09-20 Thread asimiklit . work
From: Andrii Simiklit It fixes a bit incorrectly implemented ARB_program_interface_query. If input aoa element is unused in shader program the 'glGetProgramResourceIndex' function shouldn't return a valid resource index for it according to: ARB_program_interface_query spec: " For an active

[Mesa-dev] [PATCH v3 1/2] i965/batch: avoid reverting batch buffer if saved state is an empty

2018-09-12 Thread asimiklit . work
From: Andrii Simiklit There's no point reverting to the last saved point if that save point is the empty batch, we will just repeat ourselves. CC: Chris Wilson Fixes: 3faf56ffbdeb "intel: Add an interface for saving/restoring the batchbuffer state." Bugzilla:

[Mesa-dev] [PATCH v3 0/2] fix batchbuffer restoring/saving api

2018-09-12 Thread asimiklit . work
From: Andrii Simiklit If due to some reasons the last saved batch is empty and we restoring batch using this empty batch we have to call 'brw_new_batch' to properly reset all fields of it or we can just avoid this restoring to prevent incorrect state of the batch. Andrii Simiklit (2):

[Mesa-dev] [PATCH v3 2/2] i965/batch: don't ignore the 'brw_new_batch' call for a 'new batch'

2018-09-12 Thread asimiklit . work
From: Andrii Simiklit If we restore the 'new batch' using 'intel_batchbuffer_reset_to_saved' function we must restore the default state of the batch using 'brw_new_batch' function because the 'intel_batchbuffer_flush' function will not do it for the 'new batch' again. At least the following

[Mesa-dev] [PATCH 4/4] main: avoid 'may be used uninitialized' warnings

2018-09-11 Thread asimiklit . work
From: Andrii Simiklit 1. main/texcompress_etc.c:1314:12: warning: ‘*((void *)+2)’ may be used uninitialized in this function 2. main/texcompress_etc.c:1354:12: warning: ‘*((void *)+2)’ may be used uninitialized in this function 3. main/texcompress_etc.c:1293:12: warning: ‘dst’ may be

[Mesa-dev] [PATCH 3/4] i965: avoid 'unused variable' and 'may be used uninitialized' warnings

2018-09-11 Thread asimiklit . work
From: Andrii Simiklit 1. brw_blorp.c:1502:4: warning: ‘num_layers’ may be used uninitialized in this function 2. brw_blorp.c:1502:4: warning: ‘start_layer’ may be used uninitialized in this function 3. brw_blorp.c:1502:4: warning: ‘level’ may be used uninitialized in this function 4.

[Mesa-dev] [PATCH 1/4] intel/tools: avoid 'ignoring return value' and 'unused variable' warnings

2018-09-11 Thread asimiklit . work
From: Andrii Simiklit 1. tools/i965_disasm.c:58:4: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result fread(assembly, *end, 1, fp); 2. tools/aub_read.c:271:31: warning: unused variable ‘end’ const uint32_t *p = data, *end = data + data_len,

[Mesa-dev] [PATCH 2/4] compiler: avoid 'unused variable' and 'may be used uninitialized' warnings

2018-09-11 Thread asimiklit . work
From: Andrii Simiklit 1. nir/nir_lower_vars_to_ssa.c:691:21: warning: unused variable ‘var’ nir_variable *var = path->path[0]->var; 2. nir_types.cpp:558:31: warning: ‘elem_align’ may be used uninitialized in this function unsigned elem_size, elem_align;

[Mesa-dev] [PATCH 0/4] mesa: fix against several compilation warnings

2018-09-11 Thread asimiklit . work
From: Andrii Simiklit Fixes several compilation warnings for a not debug configuration Andrii Simiklit (4): intel/tools: avoid 'ignoring return value' and 'unused variable' warnings compiler: avoid 'unused variable' and 'may be used uninitialized' warnings i965: avoid 'unused

[Mesa-dev] [PATCH v2] i965/batch: don't ignore the 'brw_new_batch' call for a 'new batch'

2018-09-10 Thread asimiklit . work
From: Andrii Simiklit If we restore the 'new batch' using 'intel_batchbuffer_reset_to_saved' function we must restore the default state of the batch using 'brw_new_batch' function because the 'intel_batchbuffer_flush' function will not do it for the 'new batch' again. At least the following

[Mesa-dev] [PATCH v5 6/8] util: use cross platform implementation 'util_vsnprintf'

2018-09-07 Thread asimiklit . work
From: Andrii Simiklit The win '_vsnprintf' function incompatibility with C99 vsnprintf. At least for case when the input buffer size less than the required size: '_vsnprintf' returns -1 for this case. 'vsnprintf' returns the required size. So use cross platform implementation 'util_vsnprintf'.

[Mesa-dev] [PATCH v5 5/8] mesa/main: don't use win _vsnprintf. there is 'util_vsnprintf' function

2018-09-07 Thread asimiklit . work
From: Andrii Simiklit The win '_vsnprintf' function incompatibility with C99 vsnprintf. At least for case when the input buffer size less than the required size: '_vsnprintf' returns -1 for this case. 'vsnprintf' returns the required size. v5: remove _mesa_*snprintf functions and replace it by

[Mesa-dev] [PATCH v4 7/8] radv: use cross platform implementation 'util_vsnprintf'

2018-09-06 Thread asimiklit . work
From: Andrii Simiklit I guess it makes this implementation more portable. Signed-off-by: Andrii Simiklit --- src/amd/vulkan/radv_util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_util.c b/src/amd/vulkan/radv_util.c index 72bedc6..90d3824

[Mesa-dev] [PATCH v4 7/7] egl/main: use cross platform implementation 'util_vsnprintf'

2018-09-06 Thread asimiklit . work
From: Andrii Simiklit I guess it makes this implementation more portable. Signed-off-by: Andrii Simiklit --- src/amd/vulkan/radv_util.c | 5 +++-- src/egl/main/egllog.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_util.c

[Mesa-dev] [PATCH v4 8/8] egl/main: use cross platform implementation 'util_vsnprintf'

2018-09-06 Thread asimiklit . work
From: Andrii Simiklit I guess it makes this implementation more portable. Signed-off-by: Andrii Simiklit --- src/egl/main/egllog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/egl/main/egllog.c b/src/egl/main/egllog.c index c223f49..d21b070 100644 ---

[Mesa-dev] [PATCH v4 5/8] mesa/main: don't use win _vsnprintf. there is 'util_vsnprintf' function

2018-09-06 Thread asimiklit . work
From: Andrii Simiklit The win '_vsnprintf' function incompatibility with C99 vsnprintf. At least for case when the input buffer size less than the required size: '_vsnprintf' returns -1 for this case. 'vsnprintf' returns the required size. So use cross platform implementation 'util_vsnprintf'.

[Mesa-dev] [PATCH v4 6/8] mesa/util: use cross platform implementation 'util_vsnprintf'

2018-09-06 Thread asimiklit . work
From: Andrii Simiklit The win '_vsnprintf' function incompatibility with C99 vsnprintf. At least for case when the input buffer size less than the required size: '_vsnprintf' returns -1 for this case. 'vsnprintf' returns the required size. So use cross platform implementation 'util_vsnprintf'.

[Mesa-dev] [PATCH v4 1/8] apple/glx/log: added missing va_end() after va_copy()

2018-09-06 Thread asimiklit . work
From: Andrii Simiklit Each invocation of va_copy() must be matched by a corresponding invocation of va_end() Fixes: 51691f0767f6 "darwin: Use ASL for logging" Signed-off-by: Andrii Simiklit --- src/glx/apple/apple_glx_log.c | 1 + 1 file changed, 1 insertion(+) diff --git

[Mesa-dev] [PATCH v4 4/8] mesa/util: add missing va_end() after va_copy()

2018-09-06 Thread asimiklit . work
From: Andrii Simiklit MSDN: "va_end must be called on each argument list that's initialized with va_start or va_copy before the function returns." Reviewed-by: Eric Engestrom Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107810 Fixes: c6267ebd6c8a "gallium/util: Stop bundling our

[Mesa-dev] [PATCH v4 2/8] mesa/util: don't use the same 'va_list' instance twice

2018-09-06 Thread asimiklit . work
From: Andrii Simiklit The first usage of the 'va_list' instance could change it. Reviewed-by: Eric Engestrom Fixes: 864148d69e1e "util: add util_vasprintf() for Windows (v2)" Signed-off-by: Andrii Simiklit --- src/util/u_string.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[Mesa-dev] [PATCH v4 3/8] mesa/util: don't ignore NULL returned from 'malloc'

2018-09-06 Thread asimiklit . work
From: Andrii Simiklit We should exit from the function 'util_vasprintf' with error code -1 for case where 'malloc' returns NULL Reviewed-by: Eric Engestrom Fixes: 864148d69e1e "util: add util_vasprintf() for Windows (v2)" Signed-off-by: Andrii Simiklit --- src/util/u_string.h | 2 +- 1 file

[Mesa-dev] [PATCH v4 0/8] mesa: fix usage of [v][s][n]printf functions

2018-09-06 Thread asimiklit . work
From: Andrii Simiklit This patch improve usage of [v][s][n]printf functions. Fixes cross platform implementation of vsnprintf v2: Linux man about vXXXprintf functions: "These functions do not call the va_end macro. Because they invoke the va_arg macro, the value of ap is undefined

[Mesa-dev] [PATCH v3] mesa/util: add missing va_end() after va_copy()

2018-09-04 Thread asimiklit . work
From: Andrii Simiklit MSDN: "va_end must be called on each argument list that's initialized with va_start or va_copy before the function returns." v2: Linux man about vXXXprintf functions: "These functions do not call the va_end macro. Because they invoke the va_arg macro, the value

[Mesa-dev] [PATCH v2] mesa/util: add missing va_end() after va_copy()

2018-09-04 Thread asimiklit . work
From: Andrii Simiklit MSDN: "va_end must be called on each argument list that's initialized with va_start or va_copy before the function returns." v2: Linux man about vXXXprintf functions: "These functions do not call the va_end macro. Because they invoke the va_arg macro, the value

[Mesa-dev] [PATCH] mesa/util: add missing va_end() after va_copy()

2018-09-03 Thread asimiklit . work
From: Andrii Simiklit MSDN: "va_end must be called on each argument list that's initialized with va_start or va_copy before the function returns." Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107810 Signed-off-by: Andrii Simiklit --- src/util/u_string.h | 1 + 1 file changed, 1

[Mesa-dev] [PATCH] i965/glsl: don't add unused aoa elements to the program resource list

2018-08-31 Thread asimiklit . work
From: Andrii Simiklit It fixes a bit incorrectly implemented ARB_program_interface_query. If input aoa element is unused in shader program the 'glGetProgramResourceIndex' function shouldn't return a valid resource index for it according to: ARB_program_interface_query spec: " For an active

[Mesa-dev] [PATCH v3] intel/decoder: fix the possible out of bounds group_iter

2018-08-20 Thread asimiklit . work
From: Andrii Simiklit The "gen_group_get_length" function can return a negative value and it can lead to the out of bounds group_iter. v2: printing of "unknown command type" was added v3: just the asserts are added Signed-off-by: Andrii Simiklit --- src/intel/common/gen_decoder.c | 5 -

[Mesa-dev] [PATCH] i965/batch: don't ignore the 'brw_new_batch' call for a 'new batch'

2018-08-20 Thread asimiklit . work
From: Andrii Simiklit If we restore the 'new batch' using 'intel_batchbuffer_reset_to_saved' function we must restore the default state of the batch using 'brw_new_batch' function because the 'intel_batchbuffer_flush' function will not do it for the 'new batch' again. At least the following

[Mesa-dev] [PATCH] i965/batch: don't ignore the 'brw_new_batch' call for a 'new batch'

2018-08-20 Thread asimiklit . work
From: Andrii Simiklit If we restore the 'new batch' using 'intel_batchbuffer_reset_to_saved' function we must restore the default state of the batch using 'brw_new_batch' function because the 'intel_batchbuffer_flush' function will not do it for the 'new batch' again. At least the following

[Mesa-dev] [PATCH] i965/gen6/xfb: handle case where transform feedback is not active

2018-08-15 Thread asimiklit . work
From: Andrii Simiklit When the SVBI Payload Enable is false I guess the register R1.4 which contains the Maximum Streamed Vertex Buffer Index is filled by zero and GS stops to write transform feedback when the transform feedback is not active. Bugzilla:

[Mesa-dev] [PATCH v2] intel/decoder: fix the possible out of bounds group_iter

2018-08-14 Thread asimiklit . work
From: Andrii Simiklit The "gen_group_get_length" function can return a negative value and it can lead to the out of bounds group_iter. v2: printing of "unknown command type" was added Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107544 Signed-off-by: Andrii Simiklit ---