summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa/glthread: fix misaligned address accessBartosz Tomczyk2017-04-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | Address sanitizer reports lot of misaligned access: SUMMARY: AddressSanitizer: undefined-behavior main/marshal.c:276:31 in main/marshal.c:276:31: runtime error: load of misaligned address 0x631000104866 for type 'const GLuint' (aka 'const unsigned int'), which requires 4 byte alignment 0x631000104866: note: pointer points here 92 88 00 00 00 00 00 00 4a 03 0c 00 93 88 00 00 00 00 00 00 02 01 0c 00 40 8d 00 00 00 00 00 00 ^ SUMMARY: AddressSanitizer: undefined-behavior main/marshal_generated.c:28725:12 in main/marshal_generated.c:28726:12: runtime error: member access within misaligned address 0x6310003fc874 for type 'struct marshal_cmd_VertexAttribPointer', which requires 8 byte alignment 0x6310003fc874: note: pointer points here 01 00 00 00 7a 02 20 00 00 00 00 00 be be be be be be be be be be be be be be be be be be be be ^ SUMMARY: AddressSanitizer: undefined-behavior main/marshal_generated.c:28726:12 in main/marshal_generated.c:28726:12: runtime error: store to misaligned address 0x6310003fc87c for type 'GLint' (aka 'int'), which requires 8 byte alignment 0x6310003fc87c: note: pointer points here 00 00 00 00 be be be be be be be be be be be be be be be be be be be be be be be be be be be be Reviewed-by: Timothy Arceri <[email protected]>
* glsl: Fix blob memory leakBartosz Tomczyk2017-04-041-1/+1
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* aubinator/gen_decoder/i965: decode instructions from dword 0Lionel Landwerlin2017-04-031-4/+4
| | | | | | | | | Some packets like 3DSTATE_VF_STATISTICS, 3DSTATE_DRAWING_RECTANGLE, 3DPRIMITIVE, PIPELINE_SELECT, etc... have configurable fields in dword0, we probably want to print those. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* st/mesa: add st_convert_image()Samuel Pitoiset2017-04-032-47/+63
| | | | | | | | | | | | | Should be used by the state tracker when glGetImageHandleARB() is called in order to create a pipe_image_view template. v3: - move the comment to *.c v2: - make 'st' const - describe the function Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: make 'st' const in st_mesa_format_to_pipe_format()Samuel Pitoiset2017-04-032-2/+2
| | | | | | | | | This avoids a compilation warning since st_convert_image() requires 'st' to be const. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/glthread: Call unmarshal_batch directly in glthread_finishBartosz Tomczyk2017-04-031-12/+32
| | | | | | | | Call it directly when batch queue is empty. This avoids costly thread synchronisation. This commit improves performance of games that have previously regressed with mesa_glthread=true. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: disable glthread when DEBUG_OUTPUT_SYNCHRONOUS is enabledTimothy Arceri2017-04-032-0/+45
| | | | | | | | | | | | | We could re-enable it also but I haven't tested that yet, and I'm not sure we care much anyway. V2: don't disable it from with the call itself. We need a custom marshalling function or we get stuck waiting for thread to finish. V3: tidy up redundant code copied from generated version. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/main: Fix memset in formatquery.cEdward O'Callaghan2017-04-021-1/+2
| | | | | | | | | v2: We explicitly set each member to -1 over using a confusing memset(). Signed-off-by: Edward O'Callaghan <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glsl: ir_explog_to_explog2 is no moreErik Faye-Lund2017-04-012-2/+6
| | | | | | | | | | | | | | Since 63684a9a ("glsl: Combine many instruction lowering passes into one.", Thu Nov 18 2010), we no longer have anything called ir_explog_to_explog2. So it's only confusing to have those references there. Update with the appropriate method, so people can grep for it in the current tree if they encounter it. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: avoid aliasing violation in st_cb_perfmon.cErik Faye-Lund2017-04-011-3/+3
| | | | | Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st: Add cubeMapFace parameter to st_finalize_texture.Michal Srb2017-04-016-7/+9
| | | | | | | | | | | st_finalize_texture always accesses image at face 0, but it may not be set if we are working with cubemap that had other face set. This fixes crash in piglit same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL_ATTACHMENT. Cc: [email protected] Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: Add support for NV_fill_rectangleLyude2017-03-312-0/+3
| | | | | | | | | Signed-off-by: Lyude <[email protected]> Changes since v1: - Fix commit name Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: Add support for GL_NV_fill_rectangleLyude2017-03-314-2/+26
| | | | | | | | | | | | | | | | Since we don't have the bits required to support this in OpenGLES yet, this only enables support for Desktop OpenGL Signed-off-by: Lyude <[email protected]> Changes since v1: - Simply _mesa_PolygonMode() a little bit - Fix formatting in OpenGL spec excerpts - Move polygon mode checking into _mesa_valid_to_render() Changes since v3: - Improve error message for invalid drawings with GL_FILL_RECTANGLE_NV Reviewed-by: Ilia Mirkin <[email protected]>
* tnl: remove unused var to silence warningBrian Paul2017-03-311-2/+0
| | | | Trivial.
* st/glsl_to_tgsi: fix 64-bit integer bit shiftsNicolai Hähnle2017-03-311-5/+15
| | | | | | | | | | | | | | Fix a bug that was caused by a type mismatch in the shift count between GLSL and TGSI. I briefly considered adjusting the TGSI semantics, but since both LLVM and AMD GCN require both arguments to be of the same type, it makes more sense to keep TGSI as-is -- it reflects the underlying implementation better. I'm also sending out piglit tests that expose this error. v2: use the right number of components for the temporary register Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: implement ARB_shader_clockNicolai Hähnle2017-03-312-1/+11
| | | | | Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: remove MESA_GLSL=optTimothy Arceri2017-03-312-10/+7
| | | | | | | | | This is unused. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: remove MESA_GLSL=no_opts env optionTimothy Arceri2017-03-314-15/+9
| | | | | | | | | | | | This is confusing because is only applys to GL_ARB_vertex/fragment_program, and because of that its also not very useful. If someone requires this for debugging they can just make an ad-hoc code change. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: move FLUSH_VERTICES() call to metaTimothy Arceri2017-03-313-15/+13
| | | | | | | | There is no need for this to be in the common code. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/vbo: remove redundant _mesa_is_bufferobj() callsTimothy Arceri2017-03-311-10/+4
| | | | | | | | | This is already called inside the vbo_exec_vtx_{unmap,map}() functions. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Fix trailing whitespace in polygon.cLyude2017-03-301-3/+3
| | | | | Signed-off-by: Lyude <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: Fix gross indenting in _mesa_PolygonMode()Lyude2017-03-301-5/+4
| | | | | Signed-off-by: Lyude <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* i965: Stop using legacy dri_bufmgr_* and intel_* names.Kenneth Graunke2017-03-3010-14/+18
| | | | | | | | Eric renamed these from dri_bufmgr_* and intel_bufmgr_* to drm_intel_* in libdrm commit 4b9826408f65976a1a13387beda748b65e03ec52, circa 2008, but we've been using the legacy names this whole time. Reviewed-by: Jason Ekstrand <[email protected]>
* st/glsl_to_tgsi: use glsl_type::sampler_index()Samuel Pitoiset2017-03-301-66/+2
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: improve error messages and fix security warningNicolai Hähnle2017-03-301-2/+2
| | | | | | | | | | | | | | | | Debian, Ubuntu set default build flag: -Werror=format-security CC state_tracker/st_cb_texturebarrier.lo state_tracker/st_cb_eglimage.c: In function ‘st_egl_image_get_surface’: state_tracker/st_cb_eglimage.c:64:7: error: format not a string literal and no format arguments [-Werror=format-security] _mesa_error(ctx, GL_INVALID_VALUE, error); ^~~~~~~~~~~ state_tracker/st_cb_eglimage.c:71:7: error: format not a string literal and no format arguments [-Werror=format-security] _mesa_error(ctx, GL_INVALID_OPERATION, error); ^~~~~~~~~~~ Reported-by: Krzysztof Kolasa <[email protected]> Fixes: 83e9de25f325 ("st/mesa: EGLImageTarget* error handling")
* i965: Combine intel_batchbuffer_reloc and intel_batchbuffer_reloc64Kenneth Graunke2017-03-303-53/+19
| | | | | | | | | | | These two functions do the exact same thing. One returns a uint64_t, and the other takes the same uint64_t and truncates it to a uint32_t. We only need the uint64_t variant - the caller can truncate if it wants. This patch gives us one function, intel_batchbuffer_reloc, that does the 64-bit thing. Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Use WARN_ONCE instead of open coding it.Kenneth Graunke2017-03-301-9/+4
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* android: pass sse4.1 flag as appropriateHarish Krupo2017-03-301-0/+3
| | | | | | | | | We have functions which depend on sse4.1 support but we didnt pass the right compile flag for it. This patch fixes it. Signed-off-by: Kalyan Kondapally <[email protected]> Signed-off-by: Harish Krupo <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/glthread: print out syncs when MARSHAL_MAX_CMD_SIZE is exceededTimothy Arceri2017-03-301-0/+13
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: EGLImageTarget* error handlingPhilipp Zabel2017-03-291-4/+19
| | | | | | | | | | | | | | | | | | | Stop trying to specify texture or renderbuffer objects for unsupported EGL images. Generate the error codes specified in the OES_EGL_image extension. EGLImageTargetTexture2D and EGLImageTargetRenderbuffer would call the pipe driver's create_surface callback without ever checking that the given EGL image is actually compatible with the chosen target texture or renderbuffer. This patch adds a call to the pipe driver's is_format_supported callback and generates an INVALID_OPERATION error for unsupported EGL images. If the EGL image handle does not describe a valid EGL image, an INVALID_VALUE error is generated. v2: fixed get_surface to actually use the usage and error parameters Signed-off-by: Philipp Zabel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: move st_manager_get_egl_image_surface into st_cb_eglimage.cPhilipp Zabel2017-03-293-37/+34
| | | | | | | | | | The only callers are here, and we will add generation of GL errors in the following patch. Rename the function to st_egl_image_get_surface, pass the gl_context instead of st_context, and move the cast from GLeglImageOES to void* into st_egl_image_get_surface. Signed-off-by: Philipp Zabel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: remove dd_function_table::BindProgramMarek Olšák2017-03-296-66/+7
| | | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* r200: remove BindProgramMarek Olšák2017-03-292-16/+5
| | | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* i915: remove BindProgramMarek Olšák2017-03-291-25/+0
| | | | | | | | | The same thing is done in i915_update_program called by i915InvalidateState. Why do it twice. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: don't use _NEW_TEXTURE mainly in mesa/mainMarek Olšák2017-03-295-14/+17
| | | | | | | | v2: add missing %s Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: split _NEW_TEXTURE into _NEW_TEXTURE_OBJECT & _NEW_TEXTURE_STATEMarek Olšák2017-03-2915-48/+50
| | | | | | | | | | | | No performance testing has been done, because it makes sense to make this change regardless of that. Also, _NEW_TEXTURE is still used in many places, but the obvious occurences are replaced here. It's now possible to split _NEW_TEXTURE_OBJECT further. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: inline _mesa_update_textureMarek Olšák2017-03-293-22/+14
| | | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st_cb_bitmap: check NULL return from u_upload_allocJulien Isorce2017-03-281-0/+6
| | | | | | Signed-off-by: Julien Isorce <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* i965: Delete tile resource mode codeAnuj Phogat2017-03-275-267/+35
| | | | | | | | | | | Yf/Ys tiling never got used in i965 due to not delivering the expected performance benefits. So, this patch is deleting this dead code in favor of adding it later in ISL when we actually find it useful. ISL can then share this code between vulkan and GL. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Delete fast copy blit codeAnuj Phogat2017-03-272-185/+48
| | | | | | | | | | | | | | | Fast copy blit was primarily added to support Yf/Ys detiling. But, Yf/Ys tiling never got used in i965 due to not delivering the expected performance benefits. Also, replacing legacy blits with fast copy blit didn't help the benchmarking numbers. This is probably due to a h/w restriction that says "start pixel for Fast Copy blit should be on an OWord boundary". This restriction causes many blit operations to skip fast copy blit and use legacy blits. So, this patch is deleting this dead code in favor of adding it later when we actually find it useful. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Require Kernel 3.6 for Gen4-5 platforms.Kenneth Graunke2017-03-272-3/+3
| | | | | | | | | | | | | | We've already required Kernel 3.6 on Gen6+ since Mesa 9.2 (May 2013, commit 92d2f5acfadea672417b6785710c9e8b7f605e41). It seems reasonable to require it for Gen4-5 as well, bumping the requirement from 2.6.39. This is necessary for glClientWaitSync with a timeout to work, which is a feature we expose on Gen4-5. Without it, we would fall back to an infinite wait, which is pretty bad. See kernel commit 172cf15d18889313bf2c3bfb81fcea08369274ef in 3.6+. Reviewed-by: Matt Turner <[email protected]>
* mesa/tests: Link main-test with CLOCK_LIB.Vinson Lee2017-03-271-1/+2
| | | | | | | | | | Fix 'make check' linking error with glibc < 2.17. CXXLD main-test ../../../../src/mesa/.libs/libmesa.a(libmesautil_la-u_queue.o): In function `u_thread_get_time_nano': src/util/../../src/util/u_thread.h:84: undefined reference to `clock_gettime' Signed-off-by: Vinson Lee <[email protected]>
* mesa: simplify code around 'variable_data' in marshal.cBrian Paul2017-03-271-12/+7
| | | | | | | Remove needless pointer increments, unneeded vars, etc. Untested. Plus, fix a couple comments. Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: move duplicated st_ws_framebuffer() function into header fileBrian Paul2017-03-273-28/+18
| | | | Reviewed-by: Marek Olšák <[email protected]>
* glsl, st/shader_cache: check the whole sha1 for zeroGrazvydas Ignotas2017-03-271-1/+2
| | | | | | | | | | | | The checks were only looking at the first byte, while the intention seems to be to check if the whole sha1 is zero. This prevented all shaders with first byte zero in their sha1 from being saved. This shaves around a second from Deus Ex load time on a hot cache. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* scons: Fix dependencies of marshal_generated.[ch].Jose Fonseca2017-03-261-2/+2
| | | | | | | | | | | These generated source files depend not only upon gl_and_es_API.xml, but all other XML files that are included by it. This change updates the generation rules to depend on all gen/*.xml files, like done for other SCons generation rules, and should fix incremental broken SCons builds due to missing dependencies. Trivial.
* mesa/glthread: add custom marshalling for ClearBufferfv()Timothy Arceri2017-03-252-0/+83
| | | | | | This is one of the main causes of syncs in Civ6. Reviewed-by: Nicolai Hähnle <[email protected]>
* i965: Fix symbolic size of next_offset[] array.Kenneth Graunke2017-03-241-1/+1
| | | | | | | It's indexed by buffer, not stream. BRW_MAX_SOL_BUFFERS and MAX_VERTEX_STREAMS happen to both be 4, so there's no actual bug. Reviewed-by: Matt Turner <[email protected]>
* i965: Remove pointless NULL check from Gen6 primitive counting code.Kenneth Graunke2017-03-241-2/+3
| | | | | | | | | We create the BO when creating a transform feedback object, and only destroy it when deleting that object. So it won't be NULL. CID: 1401410 Reviewed-by: Matt Turner <[email protected]>
* glsl_to_tgsi: don't rely on glsl types when visiting tex instructionsSamuel Pitoiset2017-03-241-7/+6
| | | | | | | Instead add is_cube_shadow like is_cube_array. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>