summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa: hook up queries for NUM_TILING_TYPES and TILING_TYPESAndres Rodriguez2017-08-063-0/+47
| | | | | | | | These are just basic implementations. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: hook up UUID queries for driver and deviceAndres Rodriguez2017-08-065-0/+73
| | | | | | | | | v2: respective changes for new gallium interface v3: fix UUID size asserts Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: implement glGetUnsignedByte{v|i_v}Andres Rodriguez2017-08-061-0/+174
| | | | | | | | | | | | | | These are used by EXT_external_objects to present UUIDs for the device and the driver. v2 (Timothy Arceri): - remove extra break - use _mesa_problem() rather the _mesa_error() for unimplemented support for value types Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa/st: expose EXT_memory_object and EXT_memory_object_fdAndres Rodriguez2017-08-063-0/+6
| | | | | | | | | | | v2: use PIPE_CAP_MEMOBJ to guard the extension v3 (Timothy Arceri): - expose extensions via the cap_mappings array Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: hook up (Named)BufferStorageMem apiTimothy Arceri2017-08-061-20/+65
| | | | | | | | | | | | | | | | | | Include no_error variants as well. v2 (Timothy Arceri): - reduced code churn by squashing some changes into previous commits v3 (Timothy Arceri): - drop unused function declaration v4 (Timothy Arceri): - fix Driver function assert() - add missing GL errors Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa/st: implement memory objects as a backend for buffer objectsAndres Rodriguez2017-08-062-17/+61
| | | | | | | | Use a memory object instead of user memory. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa/st: implement memory objects as a backend for texture storageDave Airlie2017-08-062-12/+106
| | | | | | | | | | | | Instead of allocating memory to back a texture, use the provided memory object. v2: split off extension exposure logic v3: de-duplicate code with st_AllocTextureStorage Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa/st: factor out st_AllocTextureStorage into a helperAndres Rodriguez2017-08-061-7/+19
| | | | | | | | Plumbing for using memory objects as texture storage. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: hook up memory object multisamples tex(ture)storage apiAndres Rodriguez2017-08-063-28/+103
| | | | | | | | V2 (Timothy): - error check memory == 0 before lookup Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: hook up memoryobject tex(ture)storage apiAndres Rodriguez2017-08-064-32/+191
| | | | | | | | | | | V2 (Timothy Arceri): - formating fixes V3 (Timothy): - error check memory == 0 before lookup Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa/st: start adding memory object supportDave Airlie2017-08-064-0/+93
| | | | | | | | | | | | v2: pass dedicated flag v3 (Timothy Arceri): - remove unrequired _mesa_init_memory_object_functions() call in the state tracker. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (v2) Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: add support for memory object parametersAndres Rodriguez2017-08-062-1/+53
| | | | | | | | | | | | V2 (Timothy Arceri): - fix copy and paste error with error message V3 (Timothy Arceri): - drop the Protected field for now as its unused Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: add support for memory object creation/import/deleteAndres Rodriguez2017-08-066-2/+233
| | | | | | | | | | | | | | | | | | | | | | Used by EXT_external_objects and EXT_external_objects_fd V2 (Timothy Arceri): - Throw GL_OUT_OF_MEMORY error if CreateMemoryObjectsEXT() fails. - C99 tidy ups - remove void cast (Constantine Kharlamov) V3 (Timothy Arceri): - rename mo -> memObj - check that the object is not NULL before initializing - add missing "EXT" in function error message V4 (Timothy Arceri): - remove checks for (memory objecy id == 0) and catch in _mesa_lookup_memory_object() instead. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mapi: add EXT_external_objects and EXT_external_objects_fdAndres Rodriguez2017-08-068-1/+552
| | | | | | | | Includes implementation stubs. Signed-off-by: Andres Rodriguez <[email protected]> Acked-by: Timothy Arceri <[email protected]> Acked-by: Samuel Pitoiset <[email protected]>
* i965: Reduce passing 2x32b of reloc_domains to 2 bitsChris Wilson2017-08-0423-291/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The kernel only cares about whether the object is to be written to or not, only reduces (reloc.read_domains, reloc.write_domain) down to just !!reloc.write_domain. When we use NO_RELOC, the kernel doesn't even read those relocs and instead userspace has to pass that information in the execobject.flags. We can simplify our reloc api by also removing the unused read/write domains and only pass the resultant flags. The caveat to the above are when we need to make the kernel aware that certain objects need to take into account different work arounds. Previously, this was done using the magic (INSTRUCTION, INSTRUCTION) reloc domains. NO_RELOC requires this to be passed in the execobject flags as well, and now we push that up the callstack. The API is more compact, more expressive of what happens underneath, but unfortunately requires more knowledge of the system at the point of use. Conversely it also means that knowledge is specific and not generally applied and so not overused. text data bss dec hex filename 8502991 356912 424944 9284847 8dacef lib/i965_dri.so (before) 8500455 356912 424944 9282311 8da307 lib/i965_dri.so (after) v2: (by Ken) Rebase. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Convert reloc.target_handle into an index for I915_EXEC_HANDLE_LUTKenneth Graunke2017-08-041-2/+2
| | | | | | | | | | | | | | | | | | | Based on a patch by Chris Wilson (who also wrote this commit message). Passing the index of the target buffer via the reloc.target_handle is marginally more efficient for the kernel (it can avoid some allocations, and can use a direct lookup rather than a hash or search). It is also useful for ourselves as we can use the index into our exec_bos for other tasks. v2: Only enable HANDLE_LUT if we can use BATCH_FIRST and thereby avoid a post-processing loop to fixup the relocations. v3: Move kernel probing from context creation to screen init. Use batch->use_exec_lut as it more descriptive of what's going on (Daniel) v4: Kernel features already exists, use it for BATCH_FIRST Rename locals to preserve current flavouring v5: Squash in "always insert batch bo first" v6: (by Ken) Split out BATCH_FIRST from HANDLE_LUT.
* i965: Use a C99 initializer for new validation list entries.Kenneth Graunke2017-08-041-10/+7
| | | | | | More succinct - we can skip a bunch of = 0 lines. Extracted from a patch by Chris Wilson.
* i965: Simplify some bo != batch->bo special cases.Kenneth Graunke2017-08-041-27/+19
| | | | | | | | Extracted from a patch by Chris Wilson. Now that the batch is always at the front of the validation list, we don't need to special case it - the usual "go find an existing BO" code will work just fine.
* i965: Use I915_EXEC_BATCH_FIRST when available.Kenneth Graunke2017-08-044-10/+33
| | | | | | This will make it easier to use I915_EXEC_HANDLE_LUT. Based on a patch by Chris Wilson.
* i965: Move add_exec_bo()Chris Wilson2017-08-041-53/+53
| | | | | | | | | | To avoid a forward declaration in the next patch, move the definition of add_exec_bo() earlier. v2: (by Ken) redo move. Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Ignore reloc read/write domainsChris Wilson2017-08-041-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | Since before the kernel supported I915_EXEC_NO_RELOC, long before our minimum kernel requirement, the kernel unconditionally invalidated all GPU TLBs before a batch and flushed all GPU caches after a batch. At that moment, the only use for read/write domain was for activity tracking, ensuring that future reads waited for the last writer and future writes waited for all reads. This only requires a single bit in the execbuf interface which can be supplied via the NO_RELOC interface, making the use of relocation domains entirely redundant. Trimming the excess writes into the array allows the compiler to be much more frugal: text data bss dec hex filename 8493790 357184 424944 9275918 8d8a0e i965_dri.baseline 8493758 357184 424944 9275886 8d89ee i965_dri.so (This text improvement really does come from dropping domains, not from the new use of C99 initializers.) Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Use I915_EXEC_NO_RELOCChris Wilson2017-08-041-7/+33
| | | | | | | | | | | | If we correctly fill the batch with the right relocation value, and that matches the expected location of the object, we can then tell the kernel it can forgo checking each individual relocation by only checking whether the object moved. v2: Rebase to apply ahead of I915_EXEC_HANDLE_LUT Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Initialize flags to 0 and |= in new flags.Kenneth Graunke2017-08-041-3/+3
| | | | This makes it a bit easier to add new unconditional flags.
* i965: Make add_exec_bo return the validation list index.Kenneth Graunke2017-08-041-4/+5
| | | | This will be useful for I915_EXEC_HANDLE_LUT and I915_EXEC_NO_RELOC.
* i965: Track last location of bo used for the batchChris Wilson2017-08-043-2/+27
| | | | | | | | | | | | | | Borrow a trick from anv, and use the last known index for the bo to skip a search of the batch->exec_bo when adding a new relocation. In defence against the bo being used in multiple batches simultaneously, we check that this slot exists and points back to us. v2: Also update brw_batch_references() v3: Reset bo->index on creation (Daniel) v4: Improved explanation of bo->index (Kenneth) Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Always use the pre-computed offset for the relocation entryChris Wilson2017-08-042-42/+36
| | | | | | | | | | | | | | | | We must be careful to only compute the address once based on the per-context information (rather than accessing the unlocked global bo->offset64) so that the value in the batch does match the reloc.presumed_offset we declare to the kernel. Otherwise, highly unlikely, but we may see GPU hangs in multithreaded users. The only real complication here is isl_surf_fill_state() which needs to adjust the reloc.delta to both general a tile offset and to encode state into the lower 12 bits. (Rebased on ISL changes by Ken.) Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Make brw_emit_reloc assert that the target BO is non-NULL.Kenneth Graunke2017-08-041-0/+2
| | | | | | You need an actual BO to emit a relocation to it. Suggested by me, authored by Chris, split out of a larger patch.
* i965: Prefer using streaming reads from WC mmapsChris Wilson2017-08-041-3/+15
| | | | | | | | | | For buffer objects, where we primarily expect to be writing to them and so already have a WC mmap (for !llc access) reusing the existing mmap and keeping the buffer out of the CPU cache seems preferable. Cc: Kenneth Graunke <[email protected]> Cc: Matt Turner <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* st/mesa: fix handling of NumSamples=1 (v2)Brian Paul2017-08-033-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Mesa we use the convention that if gl_renderbuffer::NumSamples or gl_texture_image::NumSamples is zero, it's a non-MSAA surface. Otherwise, it's an MSAA surface. But in gallium nr_samples=1 is a non-MSAA surface. Before, if the user called glRenderbufferStorageMultisample() or glTexImage2DMultisample() with samples=1 we skipped the search for the next higher number of supported samples and asked the gallium driver to create a surface with nr_samples=1. So we got a non-MSAA surface. This failed to meet the expection of the user making those calls. This patch changes the sample count checks in st_AllocTextureStorage() and st_renderbuffer_alloc_storage() to test for samples > 0 instead of > 1. And we now start querying for MSAA support at samples=2 since gallium has no concept of a 1x MSAA surface. A specific example of this problem is the Piglit arb_framebuffer_srgb-blit test. It calls glRenderbufferStorageMultisample() with samples=1 to request an MSAA renderbuffer with the minimum supported number of MSAA samples. Instead of creating a 4x or 8x, etc. MSAA surface, we wound up creating a non-MSAA surface. Finally, add a comment on the gl_renderbuffer::NumSamples field. There is one piglit regression with the VMware driver: ext_framebuffer_multisample-blit-mismatched-formats fails because now we're actually creating 4x MSAA surfaces (the requested sample count is 1) and we're hitting some sort of bug in the blitter code. That will have to be fixed separately. Other drivers may find regressions too now that MSAA surfaces are really being created. v2: start quering for MSAA support with samples=2 instead of 1. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: minor clean-ups in st_atom_msaa.cBrian Paul2017-08-031-16/+18
| | | | | Whitespace, formatting, combine nr_bits assignment with declaration. Trivial.
* mesa: init more msaa fieldsBrian Paul2017-08-031-0/+2
| | | | | | | | | | | The default values for GL_SAMPLE_SHADING and GL_MIN_SAMPLE_SHADING_VALUE are missing from the state tables in the GL spec, but they're supposed to be GL_FALSE and 0.0, per the GL_ARB_sample_shading spec. Add code for that, just to be explicit. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: only check errors when the state change in glLogicOp()Samuel Pitoiset2017-08-031-27/+29
| | | | | | | When this GL call is a no-op, it should be a little faster. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: only check errors when the state change in glBlendEquationSeparateiARB()Samuel Pitoiset2017-08-031-20/+22
| | | | | | | When this GL call is a no-op, it should be a little faster. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* i965: Drop unnecessary I915_PARAM_HAS_EXEC_CAPTURE definesKenneth Graunke2017-08-031-3/+0
| | | | | | | | These were only here to keep building without needing to update libdrm. Now that we include i915_drm.h in Mesa, we don't need this - our copy is new enough and has the #define. Trivial.
* gallium/st: Add a method to flush outstanding swapbuffersThomas Hellstrom2017-08-033-0/+27
| | | | | | | | | | | | | Add a state tracker interface method to flush outstanding swapbuffers, and add a call to it from the mesa state tracker during glFinish(). This doesn't strictly mean the outstanding swapbuffers have actually finished executing but is sufficient for glFinish() to be able to be used as a replacement for glXWaitGL(). Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
* i965/blit: Remember to include miptree buffer offset in relocsChris Wilson2017-08-022-3/+3
| | | | | | | | Remember to add the offset to the start of the buffer in the relocation or else we write 0xff into random bytes elsewhere. Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
* i965: Set "Subslice Hashing Mode" to 16x16 on Apollolake.Kenneth Graunke2017-08-022-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of 4.11, the kernel isn't bothering to set the subslice hashing mode on Apollolake, leaving it at the default of 8x8. (It initializes it to 16x4 on most platforms.) Performance data for GPUTest Triangle on Apollolake at 1024x640: X-tiled RT: ----------- 8x8 -> 16x4: 2.4325% +/- 0.383683% (n=107) 8x8 -> 8x4: -3.75105% +/- 0.592491% (n=40) 8x8 -> 16x16: 6.17238% +/- 0.67157% (n=30) Y-tiled RT: ----------- 8x8 -> 16x4: 1.30307% +/- 0.297292% (n=205) 8x8 -> 8x4: -0.769282% +/- 0.729557% (n=35) 8x8 -> 16x16: 3.00254% +/- 0.715503% (n=40) 8x MSAA RT (INTEL_FORCE_MSAA=8): -------------------------------- 8x8 -> 16x4: 1.38889% +/- 0.93729% (n=7) 8x8 -> 8x4: -2.10643% +/- 1.15153% (n=3) 8x8 -> 16x16: 3.87183% +/- 1.08851% (n=5) Based on this, we choose 16x16 for Apollolake. Skylake GT2 with X-tiled buffers appears to be a toss-up between 16x4 and 16x16, and with Y-tiled buffers it doesn't seem to really matter. So we'll leave Skylake alone for now. The hashing mode doesn't seem to make a measurable impact on more complex benchmarks. Acked-by: Matt Turner <[email protected]>
* mesa/dri: drop unneeded mm.h includeDave Airlie2017-08-034-4/+0
| | | | | | | | This isn't used in any of these drivers. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* i965: simplify intel_image_format_lookup()Emil Velikov2017-08-021-7/+3
| | | | | | | Drop the local variable and return directly. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: annotate struct intel_image_format as constEmil Velikov2017-08-023-10/+10
| | | | | | | Already used as such througout the code. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Delete pitch alignment assertion in get_blit_intratile_offset_el.Kenneth Graunke2017-08-021-1/+0
| | | | | | | | | | | | | The cacheline alignment restriction is on the base address; the pitch can be anything. Fixes assertion failures when using primus (say, on glxgears, which creates a 300x300 linear BGRX surface with a pitch of 1200): intel_blit.c:190: get_blit_intratile_offset_el: Assertion `mt->surf.row_pitch % 64 == 0' failed. Cc: [email protected] Reviewed-by: Chris Wilson <[email protected]>
* st/mesa: replace st_shader_stage_to_ptargetNicolai Hähnle2017-08-025-31/+8
| | | | | | | Use pipe_shader_type_from_mesa instead. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: add GLSL 4.60 to shading_language_version()Samuel Pitoiset2017-08-021-0/+2
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add always-false enable for GL 4.6Samuel Pitoiset2017-08-021-2/+18
| | | | | | | I believe this should be enough for now. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support to glPolygonMode()Samuel Pitoiset2017-08-022-0/+11
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add polygon_mode() helperSamuel Pitoiset2017-08-021-19/+28
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glClearBufferiv()Samuel Pitoiset2017-08-022-0/+11
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add clear_bufferiv() helperSamuel Pitoiset2017-08-021-14/+23
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support to glClearBufferuiv()Samuel Pitoiset2017-08-022-0/+13
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add clear_bufferuiv() helperSamuel Pitoiset2017-08-021-13/+22
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>