summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Refactor scissor rectangle setting even moreIan Romanick2014-01-201-15/+27
| | | | | | | | | | Create an internal function that just writes data into the scissor rectangle. In future patches this will see more use because we only want to call dd_function_table::Scissor once after setting all of the scissor rectangles instead of once per scissor rectangle. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Refactor viewport setting even moreIan Romanick2014-01-201-25/+38
| | | | | | | | | | Create an internal function that just writes data into the viewport. In future patches this will see more use because we only want to call dd_function_table::Viewport once after setting all of the viewport instead of once per viewport. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Refactor depth range setting even moreIan Romanick2014-01-202-19/+41
| | | | | | | | | | Create an internal function that just writes data into the depth range. In future patches this will see more use because we only want to call dd_function_table::DepthRange once after setting all of the depth ranges instead of once per depth range. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add an index parameter to _mesa_set_viewportIan Romanick2014-01-204-19/+23
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Convert gl_context::Viewport to gl_context::ViewportArrayCourtney Goeltzenleuchter2014-01-2025-128/+134
| | | | | | | | | | | Only element 0 of the array is used anywhere at this time, so there should be no changes. v4: Split out from a single megapatch. Suggested by Ken. Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Converty gl_viewport_attrib::X, ::Y, ::Width, and ::Height to floatCourtney Goeltzenleuchter2014-01-2012-30/+31
| | | | | | | | | | v4: Split out from a single megapatch. Suggested by Ken. Also make meta's save_state::ViewportX, ::ViewportY, ::ViewportW, and ::ViewportH to match gl_viewport_attrib. Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Convert gl_viewport_attrib::Near and ::Far to doubleCourtney Goeltzenleuchter2014-01-206-8/+13
| | | | | | | v4: Split out from a single megapatch. Suggested by Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Allow glGet of values that are 2 doublesCourtney Goeltzenleuchter2014-01-201-0/+2
| | | | | | | | | | | | This will be used when the viewport near and far plane are stored as doubles instead of as floats. v4 (idr): Split out from a single megapatch. Suggested by Ken. Also drop value_double_4. It's never used anywhere in the patch series. Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Move parameter validation from _mesa_set_viewport to _mesa_ViewportIan Romanick2014-01-201-9/+10
| | | | | | | Internal callers should do the right thing. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Update gl_scissor_attrib to support ARB_viewport_arrayCourtney Goeltzenleuchter2014-01-2024-94/+140
| | | | | | | | | | | | | | | | | | Update Mesa and drivers to access updated gl_scissor_attrib. Now have an enable bitfield and array of gl_scissor_rects. Drivers have been updated to the new scissor enable state attribute (gl_context.scissor.EnableFlags) but still treat it as a single boolean which is okay as mesa will only use bit 0 when communicating with a driver that does not support ARB_viewport_array. v2 (idr): Rebase fixes. v3 (idr): Small code formatting fix suggsted by Ken. Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add new constants related to GL_ARB_viewport_arrayIan Romanick2014-01-203-0/+15
| | | | | | | | | | | | | | | | | | | These limits will be queryable by GL_MAX_VIEWPORTS, GL_VIEWPORT_SUBPIXEL_BITS, and GL_VIEWPORT_BOUNDS_RANGE. Drivers that actually implement the extension must set values for these constants that comply with the minimum-maximums from the spec. Most of these changes were part of other patches. They were separated out because it make reordering of later patches easier. Also, MaxViewports wasn't set by that patch, and I completely overlooked it in review. It's now obvious that it's set. :) v2 (idr): Split these changes out from the original patches. Keep MaxViewportWidth and MaxViewportHeight as GLuint. Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add extension tracking bit for ARB_viewport_arrayCourtney Goeltzenleuchter2014-01-202-0/+2
| | | | | | | | | | v2 (idr): Split these changes out from the original patch. Only advertise GL_ARB_viewport_array in a core profile because it requires geometry shaders. Signed-off-by: Courtney Goeltzenleuchter <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* draw: use some cast wrappers in draw_pt_fetch_shade_pipeline*.cBrian Paul2014-01-202-19/+29
| | | | Trivial.
* draw: whitespace and formatting fixes in draw_pt_fetch_shade_pipeline*.cBrian Paul2014-01-202-81/+105
| | | | Trivial.
* draw: fix incorrect vertex size computation in LLVM drawing codeBrian Paul2014-01-202-11/+30
| | | | | | | | | | | | | | We were calling draw_total_vs_outputs() too early. The call to draw_pt_emit_prepare() could result in the vertex size changing. So call draw_total_vs_outputs() after draw_pt_emit_prepare(). This fix would seem to be needed for the non-LLVM code as well, but it's not obvious. Instead, I added an assertion there to try to catch this problem if it were to occur there. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72926 Cc: 10.0 <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* draw: clean up d3d style point clippingRoland Scheidegger2014-01-205-25/+42
| | | | | | | | | | | | | | | | | | | | Instead of skipping x/y clipping completely if there's point_tri_clip points use guard band clipping. This should be easier (previously we could not disable generating the x/y bits in the clip mask for llvm path, hence requiring custom clip path), and it also allows us to enable this for tris-as-points more easily too (this would require custom tri clip filtering too otherwise). Moreover, some unexpected things could have happen if there's a NaN or just a huge number in some tri-turned-point, as the driver's rasterizer would need to deal with it and that might well lead to undefined behavior in typical rasterizers (which need to convert these numbers to fixed point). Using a guardband should hence be more robust, while "usually" guaranteeing the same results. (Only "usually" because unlike hw guardbands draw guardband is always just twice the vp size, hence small vp but large points could still lead to different results.) Unfortunately because the clipmask generated is completely unaffected by guard band clipping, we still need a custom clip stage for points (but not for tris, as the actual clipping there takes guard band into account). Reviewed-by: Jose Fonseca <[email protected]>
* swrast: check for null/-1 when mapping renderbuffersBrian Paul2014-01-201-3/+7
| | | | | | | Fixes fbo-drawbuffers-none crash (but test still fails). https://bugs.freedesktop.org/show_bug.cgi?id=73757 Reviewed-by: Roland Scheidegger <[email protected]>
* softpipe: fix crash when accessing null colorbufferBrian Paul2014-01-201-1/+4
| | | | | | | Fixes piglit fbo-missing-attachment-blit test. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73755 Reviewed-by: Roland Scheidegger <[email protected]>
* st/vdpau: s/surface/resource/ to fix compiler warningBrian Paul2014-01-201-1/+1
| | | | Reviewed-by: Christian König <[email protected]>
* i915,r200,radeon,vega: Change vendor from "VMware, Inc." to "Mesa Project".José Fonseca2014-01-204-4/+4
| | | | | | | | | | These are components which were originally developed by Tungsten Graphics, which was in turn acquired by VMware, but are de facto now being maintained by third-party contributors of the Mesa open-source community. This matches what's reported by swrast driver and a few other components. Suggested by Ian Romanick.
* logger: Remove unused variable.José Fonseca2014-01-201-1/+0
| | | | | | Silences gcc "unused variable ‘buf’" warning. Trivial.
* logger: s/\<log\>/log_/José Fonseca2014-01-201-13/+13
| | | | | | | | | Currently the MSVC build is broken because of conflicting definitions of 'log' function. I didn't investigate thoroughly, but I suspect the it is conflicting standard math.h's log. log_ is admittedly not a great name, but it is better than a broken build. A better one can be used in a follow-on build.
* i965/blorp: reduce the scope of the explicit compression controlTopi Pohjolainen2014-01-201-11/+20
| | | | | | | | | | | | | | By highlighting these special cases makes it clearer to switch to the fs-generator as the wider scoped compression control settings used in the current implementation can be simply dropped. No regressions on IVB (piglit quick + unit tests). v2 (Ian): typo in a comment Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965/blorp: remove dependency to compression control stateTopi Pohjolainen2014-01-201-4/+3
| | | | | | | | | | | | | | | | | | | | Effectively only the mask control bit gets altered for the single addition in question and hence there is no real need to use a fresh state control level for it -- that is more useful when multiple intructions share the same mask and compression settings. This is a preparation step for removing the explicit compression control modifiers in the blit compiler. After this patch there are no nested state control levels making the constant nature of the compression settings more apparent. No regressions on IVB (piglit quick + unit tests). v2 (Matt, Ian): use temporary variable instead of assigning directly on the same line with a function call. Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Only update renderbuffers on initial intelMakeCurrentKristian Høgsberg2014-01-191-1/+8
| | | | | | | | | | | | | | | | | We call intel_prepare_render() in intelMakeCurrent() to make sure we have renderbuffers before calling _mesa_make_current(). The only reason we do this is so that we can have valid defaults for width and height. If we already have buffers for the drawable we're making current, we don't need this step. In itself, this is a small optimization, but it also avoids a round trip that could block on the display server in a unexpected place. https://bugs.freedesktop.org/show_bug.cgi?id=72540 https://bugs.freedesktop.org/show_bug.cgi?id=72612 Signed-off-by: Kristian Høgsberg <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* st/vdpau: check surface params before creating surfacesIlia Mirkin2014-01-193-0/+21
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Christian König <[email protected]>
* st/vdpau: fix bogus error handling in output/bitmap creationIlia Mirkin2014-01-192-34/+35
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Christian König <[email protected]>
* st/vdpau: don't return a device if the screen doesn't support NPOTIlia Mirkin2014-01-191-0/+5
| | | | | | | | | | NV3x cards don't support NPOT textures. Technically this restriction could be worked around, but since it also doesn't expose any video decoding hw, just turn it off entirely. Signed-off-by: Ilia Mirkin <[email protected]> Cc: 10.0 <[email protected]> Reviewed-by: Christian König <[email protected]>
* pipe-loader: Fix buildArmin K2014-01-191-0/+1
| | | | | | | pipe_loader_drm.c: In function 'pipe_loader_drm_probe_fd': pipe_loader_drm.c:120:4: error: implicit declaration of function 'loader_get_pci_id_for_fd' [-Werror=implicit-function-declaration] Reviewed-by: Emil Velikov <[email protected]>
* loader: ifdef libdrm specific code and includeEmil Velikov2014-01-194-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | Mesa provides the flexibility of building without the need to have libdrm present on the system. The situation has regressed with the recent commit commit 8c2e7fd8460750543367053b1be9368cc38e1d6a Author: Emil Velikov <[email protected]> Date: Fri Jan 10 23:36:16 2014 +0000 loader: introduce the loader util lib By isolating libdrm code by #ifndef __NOT_HAVE_DRM_H we can have libdrm-less builds on across all build systems. This patch converts Android's _EGL_NO_DRM to __NOT_HAVE_DRM_H to provide consistency with the other cases within mesa, allows compilation of libloader on libdrm-less scons and conditionally links against libdrm if present under automake. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73776 BUgzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73777 Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Double the push constant space multipliers on Broadwell too.Kenneth Graunke2014-01-181-2/+4
| | | | | | | Broadwell has 2Kb push constant size increments like Haswell GT3. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Update invariant state for Broadwell.Kenneth Graunke2014-01-181-4/+12
| | | | | | | | The only difference is that STATE_SIP takes a 48-bit address, so we need to output two zeroes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Use the Sandybridge VUE format on Broadwell as well.Kenneth Graunke2014-01-181-0/+1
| | | | | | | It hasn't changed. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: Create a new fragment shader backend for Broadwell.Kenneth Graunke2014-01-184-5/+1100
| | | | | | | | | | | | | | | | | | | | | | | | This replaces the old fs_generator backend. v2: Port to the C-based representation of assembly instructions. Fix texturing after the texture-grf merge. v3: Add high quality derivative support. Fix SET_SIMD4X2_OFFSET. v4: Pass brw_context to gen8_instruction functions as required. v5: Fixes for MRT, as well as zero render targets (alpha test only). v6: Replace n-wide with SIMDn in comments and messages; port over Topi's blorp-generator changes; add missing TXF_MCS opcode, fix missing high quality derivatives for DDX; fix typo (all caught by Eric). Simplify ADDC/SUBB handling; drop "Used only on Gen6+" comment (caught by Matt). Emit SIMD16 versions of three source instructions (caught by both Eric and Matt). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Create a new vec4 backend for Broadwell.Kenneth Graunke2014-01-185-17/+976
| | | | | | | | | | | | | | | | | | | | This replaces the old vec4_generator backend. v2: Port to use the C-based instruction representation. Also, remove Geometry Shader offset hacks - the visitor will handle those instead of this code. v3: Texturing fixes (including adding textureGather support). v4: Pass brw_context to gen8_instruction functions as required. v5: Add SHADER_OPCODE_TXF_MCS support; port DUAL_INSTANCED gs fixes (caught by Eric). Simplify ADDC/SUBB handling; add comments to gen8_set_dp_message calls (suggested by Matt). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Add a new infrastructure for generating Broadwell shader assembly.Kenneth Graunke2014-01-183-0/+842
| | | | | | | | | | | | | | | | | | | | | | | | | This replaces the brw_eu_emit.c layer for Broadwell. It will be used by both the vector and scalar shader backends. v2: Port to use the C-based instruction representation. v3: Fix destination register type for CMP. v4: Pass brw to gen8_instruction functions (required by rebase). v5: Remove bogus assertion on math instructions (caught by Piglit). v6: Remove more restrictions on math instructions (caught by Eric). Make ADDC and SUBB helpers set accumulator writes, like MAC and MACH (caught by Matt). v7: Don't implicitly force ALU3 operations to SIMD8 (we've been able to do SIMD16 versions since Haswell, but didn't when I originally wrote this code). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Implement a disassembler for Broadwell's new instruction encoding.Kenneth Graunke2014-01-182-0/+932
| | | | | | | | | | | | | | | | | | | | | Heavily based on Keith Packard's existing brw_disasm.c code. I've tried to go through most of the pieces (like SFIDs) and update the lists to include features added in recent generations. v2: Port to use the C-based instruction emitters. This allows us to use C99 array initializers, which tidies up some of the code. v3: Improve decoding of render target write messages. v4: Update for BRW_REGISTER_TYPE becoming an abstraction. v5: Rebase on Chris Forbes' SFID message defines. v6: Fix disassembly of UV immediates; remove silly casts. Signed-off-by: Kenneth Graunke <[email protected]> Acked-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Add a new representation for Broadwell shader instructions.Kenneth Graunke2014-01-184-0/+835
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Broadwell significantly changes the EU instruction encoding. Many of the fields got moved to different bit positions; some even got split in two. With so many changes, it was infeasible to continue using struct brw_instruction. We needed a new representation. This new approach is a bit different: rather than a struct, I created a class that has four DWords, and helper functions that read/write various bits. This has several advantages: 1. We can create several different names for the same bits. For example, conditional modifiers, SFID for SEND instructions, and the MATH instruction's function opcode are all stored in bits 27:24. In each situation, we can use the appropriate setter function: set_sfid(), set_math_function(), or set_cond_modifier(). This is much easier to follow. 2. Since the fields are expressed using the original 128-bit numbers, the code to create the getter/setter functions follows the table in the documentation very closely. To aid in debugging, I've enabled -fkeep-inline-functions when building gen8_instruction.c. Otherwise, these functions cannot be called by gdb, making it insanely difficult to print out anything. Kenneth Graunke wrote most of this code. Damien Lespiau ported it to C99. Xiang Haihao added media fields. Zhao Yakui added indirect addressing support. Eric Anholt added an assertion to make sure that values fit in the alloted number of bits. v2: Update for brw_reg_type_to_hw_type(), which necessitates passing brw_context pointers around everywhere. Signed-off-by: Kenneth Graunke <[email protected]> Signed-off-by: Damien Lespiau <[email protected]> Signed-off-by: Xiang, Haihao <[email protected]> Signed-off-by: Zhao Yakui <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Matt Turner <[email protected]>
* i965: Add SFID #defines for media stuff.Kenneth Graunke2014-01-181-0/+2
| | | | | | | | While we probably won't ever use these, having them makes it easy to share disassembler code between intel-gpu-tools and Mesa. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Add #defines for new Broadwell math functions.Kenneth Graunke2014-01-181-0/+2
| | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: add struct and SFID for pixel interpolator messagesChris Forbes2014-01-182-0/+22
| | | | | Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/Gen7: Only emit cube face enables for cubes.Chris Forbes2014-01-191-2/+5
| | | | | | | | | This is not observed to actually fix anything, but the PRM says this field must be zero for other surface types. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i965: Improve dumping of Gen7 SURFACE_STATEChris Forbes2014-01-191-6/+12
| | | | | | | | | Previously this was missing many interesting fields. Having them decoded makes debugging views much easier. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i965: Add masks for more SURFACE_STATE fieldsChris Forbes2014-01-191-0/+2
| | | | | | Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* nv50: drop obsolete check from error pathEmil Velikov2014-01-181-9/+7
| | | | | | | At 'out_err' the nv50_context has been calloc-ated. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nv50: assert before trying to out-of-bounds access framebuffer.cbufsEmil Velikov2014-01-181-0/+1
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nv50: assert before trying to out-of-bounds access samplersEmil Velikov2014-01-182-0/+4
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nv50: assert before trying to out-of-bounds access texturesEmil Velikov2014-01-183-0/+5
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nv50: pass vtxbuf index as unsignedEmil Velikov2014-01-181-1/+1
| | | | | | | | The index passed to the function is already unsigned, and internally we threat it as unsigned. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nv50: assert before trying to out-of-bounds access vtxbufEmil Velikov2014-01-183-1/+14
| | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>