AgeCommit message (Collapse)AuthorFilesLines
2015-07-22android: don't build the kms-dri winsysEmil Velikov4-40/+2
GBM (the only user of kms-dri) is currently not available under Android. Considering we have no way of testing/using this let's not bother building it for now. Cc: Chih-Wei Huang <> Cc: Eric Anholt <> Signed-off-by: Emil Velikov <>
2015-07-22android: dri: correctly set HAVE_LIBDRMEmil Velikov1-5/+3
Set the macro if we're not building swrast alone. Cc: Eric Anholt <> Signed-off-by: Emil Velikov <> Reviewed-by: Chih-Wei Huang <>
2015-07-22swrast: remove unneeded __NOT_HAVE_DRM_H defineEmil Velikov1-1/+0
No longer applicable since the cleanup of dri_interface.h. Signed-off-by: Emil Velikov <>
2015-07-22dri/common: use HAVE_LIBDRM over __NOT_HAVE_DRM_HEmil Velikov4-18/+5
See previous commit message for details. Signed-off-by: Emil Velikov <>
2015-07-22loader: use HAVE_LIBDRM instead of ! __NOT_HAVE_DRM_HEmil Velikov5-15/+8
Double negatives in English language are normally avoided, plus the former seems cleaner and more consistent. Signed-off-by: Emil Velikov <> Reviewed-by: Ian Romanick <>
2015-07-22st/dri: unwrap/remove __NOT_HAVE_DRM_H magicEmil Velikov4-23/+1
With the dri_interface.h clean of the macro, we can remove the final only st/dri specific use of the very same. Seemingly it was incorrectly used, as the build-time presence of dri2 is not libdrm specific. At run-time, the code is already limited to dri2 use-cases plus returning true, when the extension is not present (or too old) will likely lead to a crash as one tries to use it shortly after the dri_with_format() call. As a side effect this gives us a nice cleanup the builds. Signed-off-by: Emil Velikov <>
2015-07-22dri_interface: drop __NOT_HAVE_DRM_H magicEmil Velikov1-8/+1
v2: use HAVE_LIBDRM macro. Signed-off-by: Emil Velikov <> Reviewed-by: Ian Romanick <>
2015-07-22dri/swrast: automake: add LIBDRM_CFLAGSEmil Velikov1-0/+1
With the follow up commit we'll remove the __NOT_HAVE_DRM_H macro. As requested by Ian HAVE_LIBDRM will be used instead, which will lead to swrast including drm.h when libdrm package is available, even though we don't need/make use of the header. As the define is added after the AM_CFLAGS we cannnot use -UHAVE_LIBDRM, but instead let's just add LIBDRM_CFLAGS. The latter of which will expand to NULL when the libdrm package is not around. Signed-off-by: Emil Velikov <> do not set HAVE_DRI(23) when libdrm is missingEmil Velikov1-9/+9
These conditionals are used to guard both dri modules and loader(s). Currently if we try to build the gallium swrast dri module (without glx) on a system that's missing libdrm the build will fail. v2: Make sure we assign prior to checking the have_libdrm variable. Cc: 10.6 <> Signed-off-by: Emil Velikov <>
2015-07-22mesa: fix typo s/glGetTextImage/glGetTexImage/Brian Paul1-1/+1
2015-07-22radeonsi: Flush when we're asked to return a fence but don't have one yetMichel Dänzer1-1/+2
Reviewed-by: Marek Olšák <>
2015-07-22mesa: fix misleading commentTimothy Arceri1-2/+0
Reviewed-by: Samuel Iglesias Gonsálvez <>
2015-07-22mesa: fix active sampler conflict validationTimothy Arceri1-7/+13
The type stored in gl_uniform_storage is the type of a single array element not the array type so size was always 1. V2: Dont validate sampler units pointing to 0 Reviewed-by: Samuel Iglesias Gonsálvez <>
2015-07-22glsl: check for leading zeros in array index validationTimothy Arceri1-0/+4
Reviewed-by: Ilia Mirkin <> Reviewed-by: Samuel Iglesias Gonsálvez <>
2015-07-21swrast: remove unneeded & operators in _swrast_choose_texture_sample_func()Brian Paul1-28/+28
Reviewed-by: Anuj Phogat <> Reviewed-by: Eric Anholt <>
2015-07-21mesa: move check for no-op glShadeModel call earlierBrian Paul1-3/+3
Reviewed-by: Anuj Phogat <> Reviewed-by: Ian Romanick <>
2015-07-21mesa: move check for no-op glAlphaFunc call earlierBrian Paul1-3/+3
Reviewed-by: Anuj Phogat <> Reviewed-by: Ian Romanick <>
2015-07-21mesa: move check for no-op glFrontFace call earlierBrian Paul1-3/+3
If the new mode matches the current mode, there can be no error. Reviewed-by: Anuj Phogat <> Reviewed-by: Ian Romanick <>
2015-07-21mesa: s/GLint/GLsizei/ for consistencyBrian Paul1-1/+1
Reviewed-by: Ilia Mirkin <>
2015-07-21docs: document that GL_ARB_get_texture_sub_image is completedBrian Paul2-1/+2
Reviewed-by: Ilia Mirkin <>
2015-07-21mesa: enable GL_ARB_get_texture_sub_image for all driversBrian Paul1-0/+1
Reviewed-by: Ilia Mirkin <>
2015-07-21mesa: add API dispatch for GL_ARB_get_texture_sub_imageBrian Paul4-1/+49
This adds the new glGetTextureSubImage() and glGetCompressedTextureSubImage() functions. Also update the dispatch sanity test program. v2: remove stray brace, move xi:include line in gl_API.xml, fix extension number typo, s/program/texture/ in xml file. Reviewed-by: Ilia Mirkin <>
2015-07-21mesa: add new _mesa_Get[Compressed]TextureSubImage() functionsBrian Paul2-1/+76
Simple implementations in terms of get_[compressed_]texture_image(). Reviewed-by: Ilia Mirkin <>
2015-07-21mesa: overhaul the glGetCompressedTexImage codeBrian Paul1-142/+198
Same idea as the previous patch. v2: a few clean-ups spotted by Ilia Reviewed-by: Ilia Mirkin <>
2015-07-21mesa: overhaul the glGetTexImage codeBrian Paul1-195/+428
1. Reorganize the error checking code. 2. Lay groundwork for getting sub images by passing image offset and dimensions to the error checking code. 3. Implement _mesa_GetnTexImageARB(), _mesa_GetTexImage() and _mesa_GetTextureImage() all in terms of get_texture_image(). v2: pass offset/width/height/depth arguments to the error checking function, avoid using magic width/height/depth values. v3: remove unused bufSize param to get_texture_image() Reviewed-by: Ilia Mirkin <>
2015-07-21mesa: 80-column wrapping in texgetimage.cBrian Paul1-5/+8
Reviewed-by: Ilia Mirkin <>
2015-07-21mesa: replace Driver.GetCompressedTexImage() w/ GetCompressedTexSubImage()Brian Paul5-20/+30
For now, pass offsets of zero and width/height/depth equal to the whole image. Reviewed-by: Ilia Mirkin <>
2015-07-21mesa: make _mesa_get_[compressed_]texture_image() staticBrian Paul2-19/+12
These functions are only called from teximage.c Reviewed-by: Ilia Mirkin <>
2015-07-21mesa: plumb offset/size parameters through GetTexSubImage codeBrian Paul1-57/+80
Needed for GL_ARB_get_texture_sub_image. But at this point, the offsets are always zero and the sizes match the whole texture image. v2: Fixes, suggestions from Laura Ekstrand: * Fix calls to ctx->Driver.UnmapTextureImage() to pass the correct slice value. * Added comments and assertions to check zoffset+depth<=tex->Depth before the 'img' loops. * Added a new zoffset==0 assert in get_tex_memcpy(). Reviewed-by: Ilia Mirkin <>
2015-07-21mesa: replace Driver.GetTexImage with GetTexSubImage()Brian Paul10-54/+83
The new driver hook has x/y/zoffset and width/height/depth parameters for the new glGetTextureSubImage() function. The meta code and gallium state tracker are updated to handle the new parameters. Callers to Driver.GetTexSubImage() pass in offsets=0 and sizes equal to the whole texture size. v2: update i965 driver code, s/GLint/GLsizei/ in GetTexSubImage hook Reviewed-by: Ilia Mirkin <>
2015-07-21meta: add offset, width, height parameters to decompress_texture_image()Brian Paul1-5/+5
In preparation for decompressing texture sub images. Reviewed-by: Ilia Mirkin <>
2015-07-21meta: handle subimages in _mesa_meta_setup_texture_coords()Brian Paul3-33/+65
v2: fix depth, total_depth mix-up in meta.h, per Laura Ekstrand. Reviewed-by: Anuj Phogat <>
2015-07-21mesa: assorted whitespace, formatting fixes in teximage.cBrian Paul1-20/+10
2015-07-21mesa: allow GL_TEXTURE_CUBE_MAP_ARRAY case for glCompressedTexSubImage3D()Brian Paul1-1/+1
Since s3tc works for cube maps and 2D arrays, it should also work for cube arrays. NVIDIA's driver supports this too. Seems like the spec should say this. This is a minor follow-on fix for the commit "mesa: fix up some texture error checks". Reviewed-by: Roland Scheidegger <>
2015-07-21mesa: include stdarg.h for va_listJonathan Gray1-0/+1
Include stdarg.h for va_list. Unbreaks the build on OpenBSD: In file included from mesa/program/dummy_errors.c:24: ../src/mesa/main/errors.h:85: error: expected declaration specifiers or '...' before 'va_list' Signed-off-by: Jonathan Gray <> Acked-by: Matt Turner <> Reviewed-by: Ilia Mirkin <>
2015-07-21gallium: replace INLINE with inlineIlia Mirkin395-1522/+1515
Generated by running: git grep -l INLINE src/gallium/ | xargs sed -i 's/\bINLINE\b/inline/g' git grep -l INLINE src/mesa/state_tracker/ | xargs sed -i 's/\bINLINE\b/inline/g' git checkout src/gallium/state_trackers/clover/Doxyfile and manual edits to src/gallium/include/pipe/p_compiler.h src/gallium/README.portability to remove mentions of the inline define. Signed-off-by: Ilia Mirkin <> Acked-by: Marek Olšák <>
2015-07-21nvc0: force cache flush when binding a new uboSamuel Pitoiset1-0/+2
This fixes the following piglit test: ext_transform_feedback-immediate-reuse-uniform-buffer Signed-off-by: Samuel Pitoiset <> Reviewed-by: Ilia Mirkin <>
2015-07-21nv50: force cache flush when binding a new uboSamuel Pitoiset1-0/+2
This fixes the following piglit test: ext_transform_feedback-immediate-reuse-uniform-buffer Signed-off-by: Samuel Pitoiset <> Reviewed-by: Ilia Mirkin <>
2015-07-21st/mesa: Silence GCC unused-variable warning.Vinson Lee1-0/+1
Silence a release build warning. st_glsl_to_tgsi.cpp: In function 'pipe_error st_translate_program(gl_context*, uint, ureg_program*, glsl_to_tgsi_visitor*, const gl_program*, GLuint, const GLuint*, const GLuint*, const ubyte*, const ubyte*, const GLuint*, const GLuint*, GLuint, const GLuint*, const GLuint*, const ubyte*, const ubyte*, boolean, boolean)': st_glsl_to_tgsi.cpp:5461:36: warning: unused variable 'pscreen' [-Wunused-variable] struct pipe_screen *pscreen = st->pipe->screen; ^ Signed-off-by: Vinson Lee <> Reviewed-by: Brian Paul <>
2015-07-21r600/sb: Fix an &/&& mistakeAdam Jackson1-1/+1
gcc says: sb/sb_sched.cpp: In member function 'bool r600_sb::alu_group_tracker::try_reserve(r600_sb::alu_node*)': sb/sb_sched.cpp:492:7: warning: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Wparentheses] if (!trans & fbs) It happens to be harmless; if fbs is ever non-zero, it will be VEC_210, which is 5, so (!trans & 5) == 1 and the branch works as expected. But logical AND is clearly what was meant. Reviewed-by: Alex Deucher <> Signed-off-by: Adam Jackson <>
2015-07-21Revert "i965/gen9: Plugin the code for selecting YF/YS tiling on skl+"Anuj Phogat1-92/+17
Commit c9dbdc0 introduced some dead code which is supposed to be used once we have Yf/Ys tiling working and performing better. Ken reported the issue that static analysis tool now shows warnings due to the dead code. To fix these warnings, this patch reverts the changes made in commit c9dbdc0. It'll be better to add the Yf/Ys tiling selection code later, when we are ready to use it. Signed-off-by: Anuj Phogat <> Acked-by: Kenneth Graunke <>
2015-07-21i965: Fix stride field for the result of emit_uniformize().Francisco Jerez4-19/+26
This is essentially the same problem fixed in an earlier patch for immediates. Setting the stride to zero will be particularly useful for my future SIMD lowering pass, because we will be able to just check whether the stride of a source register is zero and skip emitting the copies required to unzip it in that case. Instead of setting stride to zero in every caller of emit_uniformize() I've changed the function to return the result as its return value (previously it was being written into a caller-provided destination register), because this way we can enforce that the result is used with the correct regioning from the function itself. The changes to the prototype of its VEC4 counterpart are mainly for the sake of symmetry, VEC4 registers don't have stride. Reviewed-by: Samuel Iglesias Gonsálvez <>
2015-07-21i965/fs: Fix stride field for uniforms.Francisco Jerez1-0/+6
This fixes essentially the same problem as for immediates. Registers of the UNIFORM file are typically accessed according to the formula: read_uniform(r, channel_index, array_index) = read_element(r, channel_index * 0 + array_index * 1) Which matches the general direct addressing formula for stride=0: read_direct(r, channel_index, array_index) = read_element(r, channel_index * stride + array_index * max{1, stride * width}) In either case if reladdr is present the access will be according to the composition of two register regions, the first one determining the per-channel array_index used for the second, like: read_indirect(r, channel_index, array_index) = read_direct(r, channel_index, read(r.reladdr, channel_index, array_index)) where: read(r, channel_index, array_index) = if r.reladdr == NULL then read_direct(r, channel_index, array_index) else read_indirect(r, channel_index, array_index) In conclusion we can handle uniforms consistently with the other register files if we set stride to zero. After lowering to a GRF using VARYING_PULL_CONSTANT_LOAD in demote_pull_constant_loads() the stride of the source is set to one again because the result of VARYING_PULL_CONSTANT_LOAD is generally non-uniform. Reviewed-by: Samuel Iglesias Gonsálvez <>
2015-07-21i965/fs: Fix stride for immediate registers.Francisco Jerez2-0/+7
When the width field was removed from fs_reg the BROADCAST handling code in opt_algebraic() started to miss a number of trivial optimization cases resulting in the ugly indirect-addressing sequence to be emitted unnecessarily for some variable-indexed texturing and UBO loads regardless of one of the sources of BROADCAST being immediate. Apparently the reason was that we were setting the stride field to one for immediates even though they are typically uniform. Width used to be set to one too which is why this optimization used to work previously until the "reg.width == 1" check was removed. The stride field of vector immediates is intentionally left equal to one, because they are strictly speaking not uniform. The assertion in fs_generator makes sure that immediates have the expected stride as consistency check. Reviewed-by: Samuel Iglesias Gonsálvez <>
2015-07-21i965/vec4: Fix liveness analysis with BRW_OPCODE_SELIago Toral Quiroga1-1/+2
We only consider a vgrf defined by a given block if the block writes to it unconditionally. So far we have been checking this by testing that the instruction is not predicated, however, in the case of BRW_OPCODE_SEL, the predication is used to select the value to write, not to decide if the write is actually done. The consequence of this was increased life spans for affected vgrfs, which could lead to additional register pressure. Since NIR generates selects for conditional writes this was causing massive register pressure in a handful of piglit and dEQP tests that had a large number of select operations with the NIR-vec4 backend. Fixes the following piglit tests with the NIR-vec4 backend: spec/glsl-1.50/execution/variable-indexing/vs-output-array-vec4-index-wr-before-gs spec/glsl-1.50/execution/variable-indexing/gs-input-array-vec4-index-rd spec/glsl-1.50/execution/variable-indexing/vs-output-array-vec2-index-wr-before-gs spec/glsl-1.50/execution/variable-indexing/vs-output-array-vec3-index-wr-before-gs spec/glsl-1.50/execution/variable-indexing/vs-output-array-float-index-wr-before-gs Fixes 80 dEQP tests with the NIR-vec4 backend in the following category: dEQP-GLES3.functional.ubo.* Reviewed-by: Francisco Jerez <> Reviewed-by: Kenneth Graunke <>
2015-07-20mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().Kenneth Graunke86-423/+423
Generated by sed; no manual changes. Signed-off-by: Kenneth Graunke <> Reviewed-by: Brian Paul <>
2015-07-21nouveau: use bool instead of booleanSamuel Pitoiset70-679/+679
Signed-off-by: Samuel Pitoiset <> Acked-by: Ilia Mirkin <>
2015-07-20gallivm: Initialize LLVM Modules's DataLayout to an empty string.Tom Stellard1-5/+23
This fixes crashes in llvmpipe with LLVM 3.8 and also some piglit tests on radeonsi that use the draw module. This is just a temporary solution. The correct solution will require creating a TargetMachine during gallivm initialization and pulling the DataLayout from there. This will be a somewhat invasive change, and it will need to be validatated on multiple LLVM versions. Reviewed-by: Roland Scheidegger <>
2015-07-20nvc0: add a missing parameter to nvc0_set_shader_images()Samuel Pitoiset1-3/+3
This fixes a compilation warning introduced in commit 05a12c5 (gallium: add interface for writable shader images). While we are at it, fix indentation and rename parameters according to the gallium interface. Signed-off-by: Samuel Pitoiset <> Reviewed-by: Ilia Mirkin <>
2015-07-20nouveau: always align buffers to 0x100Samuel Pitoiset1-7/+1
Only constbufs must be aligned to 0x100, but since all buffers can be rebinded as constant buffers they must be also aligned. This patch prevents this behaviour by aligning everything to 256-byte increments at buffer creation. This fixes dmesg fails for the following piglit test: ext_transform_feedback-immediate-reuse-uniform-buffer -auto -fbo Signed-off-by: Samuel Pitoiset <> Reviewed-by: Ilia Mirkin <>