summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
Commit message (Collapse)AuthorAgeFilesLines
* i915: Make intelEmitCopyBlit staticIan Romanick2018-01-263-167/+149
| | | | | | | | | | And rename to emit_copy_blit. v2: sed --in-place -e 's/color_logic_ops/gl_logicop_mode/g' $(grep -lr color_logic_ops src/) suggested by Brian. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> [v1]
* i965: Make intelEmitCopyBlit staticIan Romanick2018-01-262-215/+199
| | | | | | | | | | And rename to emit_copy_blit. v2: sed --in-place -e 's/color_logic_ops/gl_logicop_mode/g' $(grep -lr color_logic_ops src/) suggested by Brian. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> [v1]
* i915: Use enum color_logic_ops for blitsIan Romanick2018-01-2610-40/+22
| | | | | | | | v2: sed --in-place -e 's/color_logic_ops/gl_logicop_mode/g' $(grep -lr color_logic_ops src/) suggested by Brian. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> [v1]
* i965: Use enum color_logic_ops for blitsIan Romanick2018-01-268-37/+20
| | | | | | | | v2: sed --in-place -e 's/color_logic_ops/gl_logicop_mode/g' $(grep -lr color_logic_ops src/) suggested by Brian. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> [v1]
* mesa: Pass the translated color logic op dd_function_table::LogicOpcodeIan Romanick2018-01-269-81/+16
| | | | | | | | | | | And delete the resulting dead code. This has only been compile-tested. v2: sed --in-place -e 's/color_logic_ops/gl_logicop_mode/g' $(grep -lr color_logic_ops src/) suggested by Brian. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* i965: Use the translated color logic op from the contextIan Romanick2018-01-263-44/+1
| | | | | | | And delete the resulting dead code. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* swrast: remove non-applicable GLX_SWAP_COPY_OML commentEmil Velikov2018-01-251-3/+0
| | | | | | | | Noticed while skimming for GLX_ instances in the dri codebase. Comment is completely off and was in such a state since day 1. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* automake: small cleanup after the meson.build inclusionEmil Velikov2018-01-251-2/+2
| | | | | | | | | Namely extend the EXTRA_DIST list, instead of re-assigning it and bring back a file dropped by mistake. Fixes: 436ed65d38d ("autotools: include meson build files in tarball") Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* i965: Stop disabling aux during texture preparationJason Ekstrand2018-01-243-12/+8
| | | | | | | | | | | | | | | | | Previously, we were handling self-dependencies by marking the render buffer and then passing disable_aux=true to prepare_texture so that it would do a resolve. This works but ends us up doing to much resolving in some cases. Specifically, if we're doing something such as mipmap generation, this would cause us to resolve all levels of the texture if even one of them is overlapping. Instead, this commit makes us wait until we process the framebuffer to do these resolves and we only resolve the slices needed for rendering. Doing this resolve puts them into the pass-through state so, even if we do texture using CCS_E, the CCS data will effectively be ignored and the real surface contents read. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/draw: Set NEW_AUX_STATE when draw aux changesJason Ekstrand2018-01-241-1/+4
| | | | | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104411 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104383 Fixes: ea0d2e98ecb369ab84e78c84709c0930ea8c293a Cc: [email protected] Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Replace draw_aux_buffer_disabled with draw_aux_usageJason Ekstrand2018-01-244-35/+27
| | | | | | | | | | | Instead of keeping an array of booleans, we now hang onto an array of isl_aux_usage enums. This means that the thing we are passing from brw_draw.c to surface state setup is the thing that surface state setup actually needs instead of an input to compute what it needs. Cc: [email protected] Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/surface_state: Drop brw_aux_surface_disabledJason Ekstrand2018-01-241-20/+0
| | | | | | | | | | | | | The only purpose of this function is to disable aux on texture surfaces when the corresponding renderbuffer has aux disabled. However, the act of disabling aux on the renderbuffer will cause it to be resolved and intel_miptree_texture_aux_usage will already check the resolved status of a texture and return ISL_AUX_USAGE_NONE for it. Even if we used CCS for it, that wouldn't really be a problem because the CCS will be in the pass-through state and so it would effectively be ignored. Cc: [email protected] Reviewed-by: Kenneth Graunke <[email protected]>
* i965/miptree: Add an aux_disabled parameter to render_aux_usageJason Ekstrand2018-01-245-8/+17
| | | | | | | | | | | | | | | | | | | | Only one of the callers of intel_miptree_render_aux_usage actually took brw->draw_aux_buffer_disabled into account. This was causing us to ignore draw_aux_buffer_disabled for the intel_miptree_prepare_render. This isn't a problem because the draw_aux_buffer_disabled entry was set during texture preparation and we already did the resolve at that time. However, this also meant that the aux_usage we were passing to brw_cache_flush_for_render and brw_render_cache_add_bo was wrong so our automatic cache flushing around aux_usage changes wasn't happening. This was causing GPU hangs in Oxenfree. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104711 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104411 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104383 Fixes: ea0d2e98ecb369ab84e78c84709c0930ea8c293a Cc: [email protected] Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/miptree: Take an aux_usage in prepare/finish_renderJason Ekstrand2018-01-244-16/+8
| | | | | | | | | | Both callers of intel_miptree_prepare/finish_render have to call intel_miptree_render_aux_usage anyway for other reasons. They may as well pass the result in instead of us calling it again. Cc: [email protected] Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* vbo/i965: move vbo_all_varyings_in_vbos() to brw_draw.cBrian Paul2018-01-241-1/+17
| | | | | | | | It's only used in brw_draw_prims(). s/GLboolean/bool/, etc. Reviewed-by: Roland Scheidegger <[email protected]>
* vbo: remove vbo_context.h and change includes to use vbo.h insteadBrian Paul2018-01-243-3/+3
| | | | | | Now vbo.h is the public interface to the VBO module. Reviewed-by: Roland Scheidegger <[email protected]>
* nouveau: remove vbo_context() callBrian Paul2018-01-241-2/+1
| | | | | | | _vbo_DestroyContext() can be safely called even if there's no VBO module. Removes a dependency on the vbo_context() function. Reviewed-by: Roland Scheidegger <[email protected]>
* i965: use vbo_set_[indirect]_draw_func()Brian Paul2018-01-241-3/+2
| | | | | | Instead of poking into the vbo_context object. Reviewed-by: Roland Scheidegger <[email protected]>
* i965: Don't try to disable render aux buffers for computeTopi Pohjolainen2018-01-241-2/+4
| | | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104546 Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* radeon: remove left over dead codeEric Engestrom2018-01-231-6/+0
| | | | | | | Fixes: 4e0d99a63588c67a955f "r100: Use shared debug code" Cc: Pauli Nieminen <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Drop render_target_start from binding table struct.Kenneth Graunke2018-01-221-6/+4
| | | | | | | | | We have to start render targets at binding table index 0 in order to use headerless FB write messages, and in fact already assume this in a bunch of places in the code. Let's finish that off, and not bother storing 0 in a struct to pretend to add it in a few places. Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: make brw_context::num_samples unsigned intEmil Velikov2018-01-221-1/+1
| | | | | | | | It is never a negative number. Variable is compared against unsigned values and passed into functions that expect unsigned int. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Accept CONTEXT_ATTRIB_PRIORITY for brwCreateContextChris Wilson2018-01-221-1/+3
| | | | | | | | | | | | | | | | | The forward port of commit 6d87500fe12e ("dri: Change __DriverApiRec::CreateContext to take a struct for attribs") failed to adapt the set of allowed attributes for the earlier introduction of context priorities (commit 1617fca6d12e "i965: Pass the EGL/DRI context priority through to the kernel"). Fixes: 6d87500fe12e ("dri: Change __DriverApiRec::CreateContext to take a struct for attribs") Signed-off-by: Chris Wilson <[email protected]> Cc: Adam Jackson <[email protected]> Cc: Nicolai Hähnle <[email protected]> Cc: Emil Velikov <[email protected]> Cc: Kenneth Graunke <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Cc: [email protected]
* i965: Set tiling on BOs imported with modifiersJason Ekstrand2018-01-211-1/+10
| | | | | | | | | | We need this to ensure that GTT maps work on buffers we get from Vulkan on the off chance that someone does a readpixels or something. Soon, we will be removing GTT maps from i965 entirely and this can be reverted. None the less, it's needed for stable. Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
* i965/bufmgr: Add a create_from_prime_tiled functionJason Ekstrand2018-01-212-8/+35
| | | | | | | This new function is an import and a set tiling in one go. Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
* i965/miptree: Use the tiling from the modifier instead of the BOJason Ekstrand2018-01-211-4/+5
| | | | | | | | | | | This fixes a bug where we were taking the tiling from the BO regardless of what the modifier said. When we got images in from Vulkan where it doesn't set the tiling on the BO, we would treat them as linear even though the modifier expressly said to treat it as Y-tiled. Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
* i965/miptree: Add an explicit tiling parameter to create_for_boJason Ekstrand2018-01-216-10/+24
| | | | | | | | Otherwise, create_for_bo will just grab the tiling from the BO which is not what we want when using modifiers. Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
* i965: Delete completely bogus commentKenneth Graunke2018-01-201-5/+0
| | | | | | | | | | | This hasn't been true in 6+ years, if it was even true then. Before we rewrote the compiler and introduced GLSL IR in 2010-2011, i965 used to have two compiler backends for WM programs, based on Mesa IR. One handled flow control and was SIMD8-only, while the other was SIMD16 only and didn't handle flow control. Or something like that. Even then, this certainly didn't handle vertex shaders, so "all ... code generation" is a bit strong.
* autotools: include meson build files in tarballDylan Baker2018-01-1910-7/+17
| | | | | | | | | | | | This adds the meson.build, meson_options.txt, and a few scripts that are used exclusively by the meson build. v2: - Remove accidentally included changes needed to test make dist with LLVM > 3.9 Signed-off-by: Dylan Baker <[email protected]> Acked-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* i965: Avoid problems from referencing orphaned BOs after growing.Kenneth Graunke2018-01-192-24/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Growing the batch/state buffer is a lot more dangerous than I thought. A number of places emit multiple state buffer sections, and then write data to the returned pointer, or save a pointer to brw->batch.state.bo and then use it in relocations. If each call can grow, this can result in stale map references or stale BO pointers. Furthermore, fences refer to the old batch BO, and that reference needs to continue working. To avoid these woes, we avoid ever swapping the brw->batch.*.bo pointer, instead exchanging the brw_bo structures in place. That way, stale BO references are fine - the GEM handle changes, but the brw_bo pointer doesn't. We also defer the memcpy until a quiescent point, so callers can write to the returned pointer - which may be in either BO - and we'll sort it out and combine the two properly in the end. v2/v3: - Handle stale pointers in the shadow copy case, where realloc may or may not move our shadow copy to a new address. - Track the partial map explicitly, to avoid problems with buffer reuse where multiple map modes exist (caught by Chris Wilson). v4: - Don't use realloc in the CPU shadow case, it isn't safe. Fixes: 2dfc119f22f257082ab0 "i965: Grow the batch/state buffers if we need space and can't flush." Reviewed-by: Iago Toral Quiroga <[email protected]> [v3] Reviewed-by: Chris Wilson <[email protected]>
* i965: Rename 'aux' to 'prog_data' in program cache.Kenneth Graunke2018-01-191-15/+16
| | | | | | | 'aux' is a very generic name, suggesting it can be a bunch of things. However, it's always the brw_*_prog_data structure. So, call it that. Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Bind null render targets for shadow sampling + color.Kenneth Graunke2018-01-181-1/+32
| | | | | | | | | | | | | | | | | | | Portal 2 appears to bind RGBA8888_UNORM textures to a sampler2DShadow, and calls shadow2D() on it. This causes undefined behavior in OpenGL. Unfortunately, our sampler appears to hang in this scenario, which is not acceptable. Just give them a null surface instead, which returns all zeroes. Fixes GPU hangs in Portal 2 on Kabylake. Huge thanks to Jason Ekstrand for noticing this crazy behavior while sifting through crash dumps. Cc: [email protected] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104487 Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/screen: Allow drirc to set 'allow_rgb10_configs' again.Mario Kleiner2018-01-181-1/+6
| | | | | | | | | | | | | | Since setup of ALLOW_RGB10_CONFIGS was moved to i965's own brw_config_options.xml, this was hard-coded to false and could not be overriden by drirc. Add some parsing into i965's private screen->optionCache to enable drirc again. Fixes: b391fb26df9f1b ("dri_util: remove ALLOW_RGB10_CONFIGS option (v2)") Signed-off-by: Mario Kleiner <[email protected]> Cc: Marek Olšák <[email protected]> Cc: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* i965: Pass brw_growing_bo to grow_buffer().Kenneth Graunke2018-01-171-11/+9
| | | | | | Cleaner. Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Make a helper for recreating growing buffers.Kenneth Graunke2018-01-171-13/+17
| | | | | | | | | | | Now that we have two of these, we're duplicating a bunch of this logic. The next commit will add more logic, which would make the duplication seem worse. This ends up setting EXEC_OBJECT_CAPTURE on the batch, which isn't necessary (it's already captured), but it should be harmless. Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Replace cpu_map pointers with a "use_shadow_copy" boolean.Kenneth Graunke2018-01-172-21/+20
| | | | | | | | Having a boolean for "we're using malloc'd shadow copies for all buffers" is cleaner than having a cpu_map pointer for each. It was okay when we had one buffer, but this is more obvious. Reviewed-by: Iago Toral Quiroga <[email protected]>
* mesa: remove unneeded #includes of main/compiler.hBrian Paul2018-01-171-1/+0
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* i915: No longer rely on compatability define in intel_bufmgr.hRhys Kidd2018-01-171-1/+1
| | | | | | | | | | | Symbol rename from dri_* to drm_intel_* introduced a number of compatability defines within intel_bufmgr.h. Replace the old function with the new function, consistent with the balance of this file. Signed-off-by: Rhys Kidd <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Enable CCS_E sampling of sRGB textures as UNORMJason Ekstrand2018-01-161-3/+2
| | | | | Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/draw: Do resolves properly for textures used by TXFJason Ekstrand2018-01-161-0/+41
| | | | | Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/miptree: Refactor CCS_E and CCS_D cases in render_aux_usageJason Ekstrand2018-01-161-13/+15
| | | | | | | | | | | | | | | | | | | | | This commit unifies the CCS_E and CCS_D cases. This should fix a couple of subtle issues. One is that when you use INTEL_DEBUG=norbc to disable CCS_E, we don't get the sRGB blending workaround. By unifying the code, we give CCS_D that workaround as well. The second issue fixed by this refactor is that the blending workaround was appears to be enabled on all gens but really only applies on gen9. Due to a happy accident in the way code was laid out, it was only getting enabled on gen9: gen8 and earlier don't support non-zero-one clear colors, and gen10 supports sRGB for CCS_E so it got caught in the format_ccs_e_compat_with_miptree case. This refactor moves it above the format_ccs_e_compat_with_miptree case so it's an explicit early exit and makes it explicitly only on gen9. Reviewed-by: Nanley Chery <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "17.3" <[email protected]>
* Re-enable regular fast-clears (CCS_D) on gen9+Jason Ekstrand2018-01-162-42/+25
| | | | | | | | | | | | | This reverts commit ee57b15ec764736e2d5360beaef9fb2045ed0f68, "i965: Disable regular fast-clears (CCS_D) on gen9+". How taht we've fixed the issue with too many different aux usages in the render cache, it should be safe to re-enable CCS_D for sRGB. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104163 Tested-by: Eero Tamminen <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "17.3" <[email protected]>
* i965: Track format and aux usage in the render cacheJason Ekstrand2018-01-165-27/+92
| | | | | | | | | | | | | | | | This lets us perform render cache flushes whenever a surface goes from being used with one aux+format to a different aux+format. This is the "proper" fix for https://bugs.freedesktop.org/102435. ee57b15ec764736e2d5360beaef9fb2045ed0f68 which was really just a partial revert of 3e57e9494c2279580ad6a83ab8c065d01e7e634e was just a hack to get rid of a hang in a bunch of Valve games. This solves the actual problem responsible for the hang and lets us enable CCS_E once again. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102435 Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "17.3" <[email protected]>
* i965: Call brw_cache_flush_for_render in predraw_resolve_framebufferJason Ekstrand2018-01-161-0/+2
| | | | | | | | | | | | | This makes sure we flush things out of other caches prior to using a surface through the render cache. Currently, this is a no-op because GL won't let you bind anything other than a color surface as color so it should never end up in the depth cache. However, this does complete the flush/add_bo pair for regular drawing which will be required for the next commit. Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "17.3" <[email protected]>
* i965/gen6-7/sol: Bump primitive counter BO size.Francisco Jerez2018-01-161-2/+3
| | | | | | | | | | Improves performance of SynMark2 OglGSCloth by a further 9.65%±0.59% due to the reduction in overwraps of the primitive count buffer that lead to a CPU stall on previous rendering. Cummulative performance improvement from the series 81.50% ±0.96% (data gathered on VLV). Tested-By: Eero Tamminen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gen6-7/sol: Keep independent counters for the current and previous ↵Francisco Jerez2018-01-163-27/+36
| | | | | | | | | | | | | | | | | | begin/end block. This allows us to aggregate the primitive counts of a completed transform feedback begin/end block lazily, which in the most typical case (where glDrawTransformFeedback is not used) will allow us to avoid aggregating the primitive counters on the CPU altogether, preventing a stall on previous rendering during glBeginTransformFeedback(), which dramatically improves performance of applications that rely heavily on transform feedback. Improves performance of SynMark2 OglGSCloth by 65.52% ±0.25% (data gathered on VLV). Tested-By: Eero Tamminen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gen6-7/sol: Restructure primitive counter into a separate type.Francisco Jerez2018-01-163-39/+58
| | | | | | | | | | | A primitive counter encapsulates a scalar aggregating counter for each vertex stream along with a section within the primitive tally buffer which hasn't been read out yet. Defining this as a separate type will allow us to keep multiple counter objects around for the same transform feedback object without any code duplication. Tested-By: Eero Tamminen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* radeon: remove unneeded semicolonsGrazvydas Ignotas2018-01-173-3/+3
| | | | | | Trivial. Found by Coccinelle. Reviewed-by: Eric Engestrom <[email protected]>
* osmesa: don't check SmoothFlag twiceGrazvydas Ignotas2018-01-171-1/+0
| | | | | | Trivial. Found by Coccinelle. Reviewed-by: Eric Engestrom <[email protected]>
* Revert "i965: Enable flush control"Adam Jackson2018-01-152-21/+1
| | | | | | | This reverts commit 6ce9006d76c050663af0be61cc88c3215d6f8cea. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104490 Signed-off-by: Adam Jackson <[email protected]>