summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* glx/dri2: fix build failure on HURDJulien Cristau2014-03-031-0/+5
| | | | | | | Patch from Debian package. Cc: "10.0 10.1" <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* st/dri: add support for dma-buf importer (DRIimage v8)Dave Airlie2014-03-032-1/+57
| | | | | | | | This is just a simple implementation that stores the extra values into the DRIimage struct and just uses the fd importer. I haven't looked into what is required to import YUV or deal with the extra parameters. Signed-off-by: Dave Airlie <[email protected]>
* st/dri: move fourcc->format conversion to a common placeDave Airlie2014-03-031-46/+35
| | | | | | Before I cut-n-paste this a 3rd time lets consolidate it. Signed-off-by: Dave Airlie <[email protected]>
* mesa: Move MESA_GLSL=dump output to stderr.Kenneth Graunke2014-03-022-20/+23
| | | | | | | | | | | | i965 recently moved debug printfs to use stderr, including ones which trigger on MESA_GLSL=dump. This resulted in scrambled output. For drivers using ir_to_mesa, print_program was already using stderr, yet all the code around it was using stdout. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Fix broken LRP algebraic optimization.Kenneth Graunke2014-03-021-1/+3
| | | | | | | | | | | | | | | | | | | | | opt_algebraic was translating lrp(x, 0, a) into add(x, -mul(x, a)). Unfortunately, this references "x" twice, which is invalid in the IR, leading to assertion failures in the validator. Normally, cloning IR solves this. However, "x" could actually be an arbitrary expression tree, so copying it could result in huge piles of wasted computation. This is why we avoid reusing subexpressions. Instead, transform it into mul(x, add(1.0, -a)), which is equivalent but doesn't need two references to "x". Fixes a regression since d5fa8a95621169, which isn't in any stable branches. Fixes 18 shaders in shader-db (bastion and yofrankie). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* freedreno/a3xx/compiler: overflow in trans_endifRob Clark2014-03-021-13/+5
| | | | | | | | The logic to count number of block outputs was out of sync with the actual array construction. But to simplify / make things less fragile, we can just allocate the arrays for worst case size. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a3xx/compiler: fix for resolving PHI'sRob Clark2014-03-021-18/+33
| | | | | | | A value may be assigned on only one side of an if/else. In this case we can simply substitute a mov.f32f32. Signed-off-by: Rob Clark <[email protected]>
* freedreno/lowering: two-sided-colorRob Clark2014-03-025-57/+269
| | | | | | | | | Add option to generate fragment shader to emulate two sided color. Additional inputs are added to shader for BCOLOR's (on corresponding to each COLOR input). CMP instructions are used to select whether to use COLOR or BCOLOR. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a3xx/compiler: add SSGRob Clark2014-03-022-0/+2
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a3xx: fix gl_PointSizeRob Clark2014-03-025-13/+20
| | | | | | | If vertex writes pointsize, there are a few extra bits we need to turn on in the cmdstream here and there. Signed-off-by: Rob Clark <[email protected]>
* freedreno: resync generated headersRob Clark2014-03-024-5/+7
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a3xx: binning-pass vertex shader variantRob Clark2014-03-023-18/+57
| | | | | | | | | | | Now that we have the infrastructure for shader variants, add support to generate an optimized shader for hw binning pass (with varyings/outputs other than position/pointsize removed). This exposes the possibility that the shader uses fewer constants than what is bound, so we have to take care to not emit consts beyond what the shader uses, lest we provoke the wrath of the HLSQ lockup! Signed-off-by: Rob Clark <[email protected]>
* freedreno/a3xx: add support for frag coord/faceRob Clark2014-03-027-123/+408
| | | | | | | Fixes anything that tries to use gl_FrontFacing/gl_FragCoord. Also, face support is needed to emulate two sided color. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a3xx: fix for unused inputsRob Clark2014-03-022-5/+11
| | | | | | | An unused input might not have a register assigned. We don't want bogus regid to result in impossibly high max_reg.. Signed-off-by: Rob Clark <[email protected]>
* i965: Validate (and resolve) all the bound textures.Chris Forbes2014-03-022-2/+2
| | | | | | | | | | | | | | | | | | | BRW_MAX_TEX_UNIT is the static limit on the number of textures we support per-stage, not in total. Core's `Unit` array is sized by MAX_COMBINED_TEXTURE_IMAGE_UNITS, which is significantly larger, and across the various shader stages, up to ctx->Const.MaxCombinedTextureImageUnits elements of it may be actually used. Fixes invisible bad behavior in piglit's max-samplers test (although this escalated to an assertion failure on HSW with texture_view, since non-immutable textures only have _Format set by validation.) Signed-off-by: Chris Forbes <[email protected]> Cc: "9.2 10.0 10.1" <[email protected]> Cc: Kenneth Graunke <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Widen sampler key bitfields for 32 samplersChris Forbes2014-03-021-3/+3
| | | | | | | | | | | | | Previously the `high` 16 samplers on Haswell+ would not get sampler workarounds applied. Don't bother widening YUV fields, since they're ignored and going away soon anyway. Signed-off-by: Chris Forbes <[email protected]> Cc: "10.1" <[email protected]> Cc: Kenneth Graunke <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* dri/i9*5: correctly calculate the amount of system memoryEmil Velikov2014-03-012-2/+2
| | | | | | | | | The variable name states megabytes, while we calculate the amount in kilobytes. Correct this by dividing with the correct amount. Signed-off-by: Emil Velikov <[email protected]> Cc: "10.0 10.1" <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* gallium/util: add missing u_math includeIlia Mirkin2014-02-281-0/+2
| | | | | | | This is needed for MIN2/MAX2 Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: add unpacking code for MESA_FORMAT_Z32_FLOAT_S8X24_UINTBrian Paul2014-02-281-0/+22
| | | | | | | | | Fixes glGetTexImage() when converting from MESA_FORMAT_Z32_FLOAT_S8X24_UINT to GL_UNSIGNED_INT_24_8. Hit by the piglit ext_packed_depth_stencil-getteximage test. Cc: "10.0" "10.1" <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glx/apple: Fixed glx context memory leak in case of failure.Siavash Eliasi2014-02-281-0/+1
| | | | | Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Jeremy Huddleston Sequoia: <[email protected]>
* gbm/dri: Fixed buffer object memory leak in case of failure.Siavash Eliasi2014-02-281-2/+6
| | | | Reviewed-by: Kristian Høgsberg <[email protected]>
* r300g/tests: Added missing fclose for FILE resource.Siavash Eliasi2014-02-281-0/+3
| | | | | Reviewed-by: Tom Stellard <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]>
* i915: Allocate the sys_buffer using _mesa_align_mallocIan Romanick2014-02-281-7/+8
| | | | | | | | | | | | | Though it won't matter on Linux, use _mesa_align_free to release it. Since i965 doesn't have sys_buffer, I overlooked this in the GL_ARB_map_buffer_alignment work a few months ago. Fixes i915 (and presumably i830) regressions in ARB_map_buffer_range tests and the failure in arb_map_buffer_alignment-sanity_test. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74960 Cc: "10.1" <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i915: Only allow 8 vertex texture unitsIan Romanick2014-02-281-0/+1
| | | | | | | | | | | | | | There's no reason to have more vertex texture units than fragment texture units on this hardware. Since increasing the default maximum number of texture units from 16 to 32, this has triggered some segfault in i915 driver. There's probably some array or bitfield that isn't properly sized now. This really papers over the bug, but I don't think I'll lose any sleep over that. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74071 Cc: "10.1" <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Assert array index on access to vec4_visitor's arrays.Petri Latvala2014-02-282-0/+8
| | | | | | | | | v2: vec4_visitor::pack_uniform_registers(): Use correct comparison in the assert, this->uniforms is already adjusted. Compare the actual value used to index uniform_size and uniform_vector_size instead. Signed-off-by: Petri Latvala <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Allocate vec4_visitor's uniform_size and uniform_vector_size arrays ↵Petri Latvala2014-02-284-2/+28
| | | | | | | | | | | | | | | | | | | | | | dynamically. v2: Don't add function parameters, pass the required size in prog_data->nr_params. v3: - Use the name uniform_array_size instead of uniform_param_count. - Round up when dividing param_count by 4. - Use MAX2() instead of taking the maximum by hand. - Don't crash if prog_data passed to vec4_visitor constructor is NULL v4: Rebase for current master v5 (idr): Trivial whitespace change. Signed-off-by: Petri Latvala <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71254 Cc: "10.1" <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* gbm: export gbm_device_is_format_supportedMarek Chalupa2014-02-281-1/+1
| | | | | | | | Probably depending on compiler settings, the definition can be hidden, so undefined reference error can be encountred during linking. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75528 Reviewed-by: Emil Velikov <[email protected]>
* configure: use enable_dri_glx local variableEmil Velikov2014-02-281-6/+9
| | | | | | | | | GLX can be either dri or xlib based, while enable_dri is used in a variety of contexts. With enable_dri_glx the context is clearly visible. Signed-off-by: Emil Velikov <[email protected]>
* configure: enable the drm pipe-loader for non swrast driversEmil Velikov2014-02-281-1/+3
| | | | | | | | | | | | | | | All hardware drivers including the virtual vmwgfx require the drm pipe-loader in order to be properly loaded by xa, gbm and opencl. Note this does _not_ add support for the above three it only allows the pipe driver to be loaded by the library. Eg. GBM will now properly open the pipe-i915 driver, should one be working on the such hardware. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75453 Signed-off-by: Emil Velikov <[email protected]>
* configure: error out when building xa only with swrastEmil Velikov2014-02-281-0/+8
| | | | | | | | | | | | | Building to provide accelration using swrast does not make sense. Note: update your build script to explicitly mention svga in the gallium drivers list, if you are building the vmwgfx xa library. v2: Update error message to provide more clarify, add an example. Signed-off-by: Emil Velikov <[email protected]>
* configure: avoid setting variables as empty stringsEmil Velikov2014-02-281-3/+3
| | | | | | | | | | Recent patch converted our logic to use test -n and test -z. An emptry string variable (empty_str="") return true for both thus making the check unreliable. Fix this by correctly setting the variable when applicable. Signed-off-by: Emil Velikov <[email protected]>
* configure: avoid constantly building megadrivers 'core'Emil Velikov2014-02-281-4/+7
| | | | | | | | | The issue is caused by a thinko that an empty string will be considered of zero length by 'test'. This is not the case, thus we were building the 'core' of megadrivers even when no classic drivers were built. Signed-off-by: Emil Velikov <[email protected]>
* r600g/compute: PIPE_CAP_COMPUTE should be false for pre-evergreen GPUsTom Stellard2014-02-281-1/+3
| | | | | | | | | This prevents clover from using unsupported devices. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Alex Deucher <[email protected]> CC: "10.0 10.1" <[email protected]>
* glsl: Don't vectorize horizontal expressions.Matt Turner2014-02-281-0/+15
| | | | | Cc: "10.1" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75224
* glsl: Add is_horizontal() method to ir_expression.Matt Turner2014-02-281-0/+12
| | | | Cc: "10.1" <[email protected]>
* glsl: Optimize lrp(x, 0, a) into x - (x * a).Matt Turner2014-02-281-0/+2
| | | | | | | | Helps one program in shader-db: instructions in affected programs: 96 -> 92 (-4.17%) Reviewed-by: Ian Romanick <[email protected]>
* glsl: Optimize lrp(0, y, a) into y * a.Matt Turner2014-02-281-0/+2
| | | | | | | | Helps two programs in shader-db: instructions in affected programs: 254 -> 234 (-7.87%) Reviewed-by: Ian Romanick <[email protected]>
* mesa: do depth/stencil format conversion in glGetTexImageBrian Paul2014-02-281-2/+9
| | | | | | | | | | | | | | | | glGetTexImage(GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8) was just using memcpy() instead of _mesa_unpack_uint_24_8_depth_stencil_row() to convert texels from the hardware format to the GL format. Fixes issue reported by David Meng at Intel. The new piglit ext_packed_depth_stencil-getteximage test checks for this bug. Also, add some format/type assertions. We don't yet handle the GL_FLOAT_32_UNSIGNED_INT_24_8_REV type. That should be fixed in a follow-on patch. Reviewed-by: Eric Anholt <[email protected]> Cc: "10.0" "10.1" <[email protected]>
* mesa: fix depth/stencil comments in formats.hBrian Paul2014-02-281-2/+2
|
* winsys/svga: Avoid calling drm getparam for max surface size on older kernelsThomas Hellstrom2014-02-281-7/+8
| | | | | | | | | | | | | This avoids the kernel driver spewing out errors about the param not being supported. Also correct the max surface size used when the kernel does not support the query. Reported-by: Brian Paul <[email protected]> Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Cc: "10.1" <[email protected]>
* meta: Drop ctx->API checks.Kenneth Graunke2014-02-272-92/+50
| | | | | | | | | | | | | API is always API_OPENGL_COMPAT (since commit 4e4a537ad55f61a25, "meta: Push into desktop GL mode when doing meta operations."), so most of these checks do nothing. We could instead check save->API to only bother setting/restoring relevant GL state, but I'm not sure saving a few _mesa_set_enable calls is worth the complexity. My understanding is the point of the ctx->API guards was to avoid raising GL errors. Signed-off-by: Kenneth Graunke <[email protected]>
* meta: Restore API at the end of _mesa_meta_end(), not the start.Kenneth Graunke2014-02-271-2/+2
| | | | | | | | | | | In _mesa_meta_begin(), we switch to API_OPENGL_COMPAT, then munge a lot of state (including some that doesn't exist in the actual API - like PolygonStipple in API_OPENGL_CORE). It seems reasonable that in _mesa_meta_end(), we should restore it, then switch back to the original API. This at least makes it symmetric. Signed-off-by: Kenneth Graunke <[email protected]>
* util/u_format: don't crash in util_format_translate if we can't do translationRoland Scheidegger2014-02-272-6/+17
| | | | | | | | | | | | Some formats can't be handled - in particular cannot handle ints/uints formats, which lack the pack_rgba_float/unpack_rgba_float functions. Instead of trying to call these (and crash) return an error (I'm not sure yet if we should try to translate such formats too here might not make much sense). v2: suggested by Jose, use separate checks for pack/unpack of rgba_8unorm and rgba_float functions (right now if one exists the other should as well). Reviewed-by: Jose Fonseca <[email protected]>
* i965: Convert VUE map generation checks to if rather than switch.Kenneth Graunke2014-02-271-11/+2
| | | | | | | | | | | | There are currently only two VUE map layouts: one for Gen4-5, and one for everything else. We keep having to add new "case N+1" labels for every new hardware generation, and so far it's always been the same. This patch makes it so we only have to do work in the case where something actually changes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Only emit VS state pipe control workaround on IVB and BYT.Kenneth Graunke2014-02-273-3/+5
| | | | | | | | | | | | | | According to the BSpec's 3D workarounds page, this is unnecessary on shipping Haswell hardware, and was never necessary on Broadwell. It unfortunately doesn't say anything about Baytrail. The workaround database confirms those results for Ivybridge, Haswell, and Broadwell. Baytrail is less clear - one page says it's necessary, while the other says it isn't. For now, be conservative and leave it enabled. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* nouveau: add a nouveau_compiler binary to compile TGSI into shader ISAIlia Mirkin2014-02-263-0/+235
| | | | | | | This makes it easy to compare output between different cards, especially for ones that you don't have (and/or not in the current machine). Signed-off-by: Ilia Mirkin <[email protected]>
* nv30: remove nv30_context use from nvfx_*progIlia Mirkin2014-02-2613-107/+110
| | | | | | | This should pave the way to being able to use the compiler without a context. Also leads to cleaner code. Signed-off-by: Ilia Mirkin <[email protected]>
* nv30: remove unused sprite flipping parameterIlia Mirkin2014-02-263-5/+3
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nv30: remove unused render_mode and hw_pointsprite_controlIlia Mirkin2014-02-262-8/+3
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* nv30: remove use_nv4x, it is identical to is_nv4xIlia Mirkin2014-02-264-16/+14
| | | | Signed-off-by: Ilia Mirkin <[email protected]>