summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* i965: Add compiler options to brw_compilerJason Ekstrand2015-06-236-46/+57
| | | | | | | | | | | | | This creates the options at screen cration time and then we just copy them into the context at context creation time. We also move is_scalar to the brw_compiler structure. We also end up manually setting some values that the core would have set by default for us. Fortunately, there are only two non-zero shader compiler option defaults that we aren't overriding anyway so this isn't a big deal. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
* i965/fs: Plumb compiler debug logging through brw_compilerJason Ekstrand2015-06-233-4/+36
| | | | | Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
* i965/fs: Do the no16 perf logging directly in fs_visitor::no16()Jason Ekstrand2015-06-231-11/+2
| | | | | | | While we're at it, we'll drop the note about 10-20% performance loss. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
* i965/fs: Make no16 non-variadicJason Ekstrand2015-06-232-11/+5
| | | | | | | We never used the fact that it was variadic anyway. Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* i965: Move INTEL_DEBUG variable parsing to screen creation timeJason Ekstrand2015-06-234-10/+11
| | | | | | v2: Do bufmgr set_debug and set_aub_dump at screen time as well. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* i965: Remove the dependance on brw_context from the generatorsJason Ekstrand2015-06-239-11/+17
| | | | | Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* i965: Plumb compiler debug logging through a function pointer in brw_compilerJason Ekstrand2015-06-2311-34/+51
| | | | | | | | v2 (Ken): Make shader_debug_log a printf-like function. v3 (Jason): Add a void * to pass the brw_context through Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: Add a va_args variant of _mesa_gl_debug().Kenneth Graunke2015-06-232-8/+30
| | | | | | | | This will be useful for wrapper functions. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
* i965: Replace some instances of brw->gen with devinfo->genJason Ekstrand2015-06-232-6/+6
|
* i965: Initialize backend_shader::mem_ctx in its constructor.Matt Turner2015-06-234-5/+5
| | | | | | | We were initializing it in each subclasses' constructors for some reason. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* i965: Assert that the GL primitive isn't out of range.Matt Turner2015-06-231-1/+3
| | | | | | | | Coverity sees the if (mode >= BRW_PRIM_OFFSET (128)) test and assumes that the else-branch might execute for mode to up 127, which out be out of bounds. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* i965/cfg: Assert that cur_do/while/if pointers are non-NULL.Matt Turner2015-06-231-0/+2
| | | | | | | | Coverity sees that the functions immediately below the new assertions dereference these pointers, but is unaware that an ENDIF always follows an IF, etc. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* mesa: Delete unused ICEIL().Matt Turner2015-06-231-32/+0
| | | | | | Can't find any uses of it in git history. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* i965/fs: Don't mess up stride for uniform integer multiplication.Matt Turner2015-06-231-4/+16
| | | | | | | | | If the stride is 0, the source is a uniform and we should not modify the stride. Cc: "10.6" <mesa-stable@lists.freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91047 Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* egl/x11: Remove duplicate call to dri2_x11_add_configs_for_visualsBoyan Ding2015-06-231-5/+0
| | | | | | | | | | | | | The call to dri2_x11_add_configs_for_visuals (previously dri2_add_configs_for_visuals) was moved downwards in commit f8c5b8a1, but appeared again in its original position after its rename in d019cd81. Remove it. Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org> Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* i965/gen9: Don't use encrypted MOCSBen Widawsky2015-06-231-2/+2
| | | | | | | | | | | | | | | | | | On gen9+ MOCS is an index into a table. It is 7 bits, and AFAICT, bit 0 is for doing encrypted reads. I don't recall how I decided to do this for BXT. I don't know this patch was ever needed, since it seems nothing is broken today on SKL. Furthermore, this patch may no longer be needed because of the ongoing changes with MOCS setup. It is what is being used/tested, so it's included in the series. The chosen values are the old values left shifted. That was also an arbitrary choice. v2: Use shift in MOCS to make it clear what we're doing. (Ken) Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* nv50,nvc0: make sure to pushbuf_refn before putting bo into pushbuf_dataIlia Mirkin2015-06-234-0/+4
| | | | | | | | | | | | Without first running the bo through pushbuf_refn, the nouveau drm library will have uninitialized structures regarding this bo, and will insert incorrect data. This fixes supertuxkart 0.9 crash on start (where it ends up doing a lot of indirect draws). Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
* nvc0: always put all tfb bufs into bufctxIlia Mirkin2015-06-231-3/+4
| | | | | | | | | | Since we clear the TFB bufctx binding point above, we need to put all of the active tfb's back in, even if they haven't changed since last time. Otherwise the tfb may get moved into sysmem and the underlying mapping will generate write errors. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
* glsl: binding point is a texture unit, which is a combined spaceIlia Mirkin2015-06-231-1/+1
| | | | | | | | | | | | This fixes compilation failures in Dota 2 Reborn where a texture unit binding point was used that was numerically higher than the max per stage. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au> Tested-by: Nick Sarnie <commendsarnex@gmail.com> Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
* android: egl: do not link against libglapiEmil Velikov2015-06-231-1/+0
| | | | | | | | | | | The only reason we touch glapi is to dlopen it in order to: - make sure that the unresolved _glapi* symbols in the dri modules are provided. - fetch glFlush() and use it at various stages in the dri2 driver. Cc: Chih-Wei Huang <cwhuang@linux.org.tw> Cc: Eric Anholt <eric@anholt.net> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* gbm: do not (over)link against libglapi.soEmil Velikov2015-06-231-1/+2
| | | | | | | | | | The whole of GBM does not rely on even a single symbol from the GL dispatch library, unsuprisingly. The only need for it comes from the unresolved symbols in the DRI modules, which are now correctly handled with Frank's commit. Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* gbm: dlopen libglapi so gbm_create_device worksFrank Henigman2015-06-231-0/+8
| | | | | | | | | | | | | Dri driver libs are not linked to pull in libglapi so gbm_create_device() fails when it tries to dlopen them (unless the application is linked with something that does pull in libglapi, like libGL). Until dri drivers can be fixed properly, dlopen libglapi before trying to dlopen them. Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org> Signed-off-by: Frank Henigman <fjhenigman@google.com> [Emil Velikov: Drop misleading bugzilla link, mention that libname differs] Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* configure: drop unused variable GBM_BACKEND_DIRSEmil Velikov2015-06-231-1/+0
| | | | | Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* configure: error out when building libEGL without shared-glapiEmil Velikov2015-06-231-0/+3
| | | | | | | | | The latter is a hard requirement and without it we'll error out later on in the build. Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* configure: error out when building backend-less libEGLEmil Velikov2015-06-231-2/+6
| | | | | | Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* drivers/x11: drop unneeded HAVE_X11_DRIVER checkEmil Velikov2015-06-231-2/+0
| | | | | | | Already handled in the Makefile which includes the drivers/x11 subdir. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* configure: allow building shared-glapi powered libgl-xlibEmil Velikov2015-06-231-6/+0
| | | | | | | | Cc: Brian Paul <brianp@vmware.com> Cc: Adam Jackson <ajax@redhat.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jose Fonseca <jfonseca@vmware.com>
* targets/libgl-xlib: fix the build against shared_glapiEmil Velikov2015-06-231-0/+7
| | | | | | | Cc: Brian Paul <brianp@vmware.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jose Fonseca <jfonseca@vmware.com>
* drivers/x11: fix the build against shared_glapiEmil Velikov2015-06-231-0/+7
| | | | | | | Cc: Brian Paul <brianp@vmware.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jose Fonseca <jfonseca@vmware.com>
* configure: warn about shared_glapi & xlib-glx only when both are setEmil Velikov2015-06-231-1/+1
| | | | | | | | | Printing out the message when shared_glapi is disabled only leads to confusion. Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net>
* glapi: remap_helper.py: remove unused argument 'es'Emil Velikov2015-06-231-8/+0
| | | | | | | | | Identical to the previous commit - unused by neither the Autotools, Android or SCons build. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* glapi: gl_table.py: remove unused variable 'es'Emil Velikov2015-06-231-49/+8
| | | | | | | | | None of the three build systems ever set it, as such we can clear things up a bit. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* egl: Use the loader_open_device() helper to do open with CLOEXECDerek Foreman2015-06-234-32/+6
| | | | | | | | | | | We've moved the open with CLOEXEC idiom into a helper function, so call it instead of duplicating the code. This also replaces a couple of opens that didn't properly do CLOEXEC. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* glx: Use loader_open_device() helperDerek Foreman2015-06-231-9/+1
| | | | | | | | | We've moved the open with CLOEXEC idiom into a helper function, so call it instead of duplicating the code here. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* loader: Rename drm_open_device() to loader_open_device() and share itDerek Foreman2015-06-232-3/+6
| | | | | | | | | This is already our common idiom for opening files with CLOEXEC and it's a little ugly, so let's share this one implementation. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* egl/drm: Duplicate fd with F_DUPFD_CLOEXEC to prevent leakDerek Foreman2015-06-231-1/+1
| | | | | | | | | | Replacing dup() with fcntl F_DUPFD_CLOEXEC creates the duplicate file descriptor with CLOEXEC so it won't be leaked to child processes if the process fork()s later. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* draw,tgsi: Assume TGSI_PROPERTY_GS_INVOCATIONS default of 1.Jose Fonseca2015-06-231-0/+1
| | | | | | | | | If the shader doesn't specify number of invocations, assume one. This fixes geometry shaders on state trackers other than Mesa (and probably graw tests too.) Trivial.
* glsl: Specify the shader stage in linker errors due to too many in/outputs.Jose Fonseca2015-06-231-4/+8
| | | | | Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* docs: update GL3 with softpipe/llvmpipe gpu_shader5 pieces.Dave Airlie2015-06-231-2/+2
| | | | | | This just updates the bits I've added in the previous few patches. Signed-off-by: Dave Airlie <airlied@redhat.com>
* draw/gallivm: add invocation ID support for llvmpipe.Dave Airlie2015-06-235-3/+14
| | | | | | | This extends the draw code to add support for invocations. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* draw/tgsi: implement geom shader invocation support.Dave Airlie2015-06-234-18/+34
| | | | | | | | This is just for softpipe, llvmpipe won't work without some changes. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* tgsi: handle indirect sampler arrays. (v2)Dave Airlie2015-06-231-4/+38
| | | | | | | | | This is required for ARB_gpu_shader5 support in softpipe. v2: add support to txd/txf/txq paths. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* nir: Allow vec2/vec3/vec4 instructions in the select peephole pass.Kenneth Graunke2015-06-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are basically just moves, so they should be safe as well. When disabling i965's GLSL IR level scalarizer (channel expressions) pass, I started seeing NIR code like this: if ssa_21 { block block_1: /* preds: block_0 */ vec4 ssa_120 = vec4 ssa_82, ssa_83, ssa_84, ssa_30 /* succs: block_3 */ } else { block block_2: /* preds: block_0 */ /* succs: block_3 */ } block block_3: /* preds: block_1 block_2 */ vec4 ssa_33 = phi block_1: ssa_120, block_2: ssa_2 Previously, the GLSL IR scalarizer pass would break the vec4 into a series of fmovs, which were allowed by the peephole pass. But with the vec4 operation, they were not. We want to keep getting selects. Normal i965 on Broadwell: instructions in affected programs: 200 -> 176 (-12.00%) helped: 4 With brw_fs_channel_expressions() disabled: instructions in affected programs: 1832 -> 1646 (-10.15%) helped: 30 Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
* i965: Add and fix comments in brw_vue_map.c.Kenneth Graunke2015-06-221-1/+13
| | | | | Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
* i965: Split VUE map handling out of brw_vs.c into brw_vue_map.c.Kenneth Graunke2015-06-223-102/+137
| | | | | | | | | | | This was originally only used by the vertex shader, but it's now used by the geometry shader as well, and will also eventually be used for tessellation control and evaluation shaders. I suspect it will be easier to find in a file named after the concept. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
* i965/gen9: Implement Push Constant Buffer workaroundBen Widawsky2015-06-221-7/+41
| | | | | | | | | | | | | | | | | | | | | | | This implements a workaround (exact excerpt as a comment in the code). The docs specify [clearly, after you struggle for a while] that the offset isn't relative to state base. This actually makes sense. This fixes hangs on SKL. Buffer #0 is meant to be used for normal uniforms. Buffer #1 is typically used for gather constants when using RS. Buffer #1-#3 could be used to push a bunch of UBO data which would just be somewhere in memory, and not relative to the dynamic state. NOTE: I've moved away from the ternary operator for the new gen9 conditions. Admittedly it's probably not great to do this, but I really want to fix this all up in the subsequent patch and doing it here makes that diff a lot nicer. I want to split out the gen8/9 code to make the function a bit more readable, but to keep this easily cherry-pickable I am doing this fix first. If we decide not to merge the cleanup patch then I can revisit this. Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org> Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Tested-by: Valtteri Rantala <Valtteri.rantala@intel.com>
* mesa: use _mesa_lookup_enum_by_nr() in print_array()Brian Paul2015-06-221-4/+4
| | | | | | Print GL_FLOAT, etc. instead of hex value. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
* ilo: emit 3DPRIMITIVE from gen6_3dprimitive_infoChia-I Wu2015-06-2211-87/+91
| | | | | | It allows us to remove ilo_ib_state::draw_start_offset and ILO_PRIM_RECTANGLES. gen6_3d_translate_pipe_prim() is also replaced by ilo_translate_draw_mode().
* ilo: align vertex buffer size in buf_create()Chia-I Wu2015-06-222-19/+20
| | | | | With ilo_format.[ch] moved out of core, the aligning of vertex buffers does not belong to core anymore.
* ilo: move ilo_format.[ch] out of coreChia-I Wu2015-06-225-8/+8
| | | | | They provide PIPE_FORMAT_x to GEN6_FORMAT_x translation as well as some convenient helpers. Move them out of core.