summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* intel: Move the DRM uapi headers to a non-Intel location.Eric Anholt2017-07-1213-34/+9
| | | | | | | | | | | | I want to remove vc4's dependency on headers from libdrm as well, but storing multiple copies of drm_fourcc.h in our tree would be silly. v2: Update Android.mk as well, move distcheck drm*.h references to top-level noinst_HEADERS. Reviewed-by: Lionel Landwerlin <[email protected]> (v1) Reviewed-by: Daniel Stone <[email protected]> (v1) Reviewed-by: Rob Herring <[email protected]>
* vc4: Remove a stale comment.Eric Anholt2017-07-121-4/+0
| | | | | The kernel hasn't been synchronous in a couple of years, plus there was synchronization code right there.
* anv: Round u_vector element sizes to a power of twoJason Ekstrand2017-07-121-2/+3
| | | | | | | | | | | This fixes 32-bit builds of the driver. Commit 08413a81b93dc537fb0c3 changed things so that we now put struct anv_states in the u_vector for binding tables. On 64-bit builds, sizeof(struct anv_state) is a power of two but it isn't on 32-bit builds. Fixes: 08413a81b93dc537fb0c34327ad162f07e8c3427 Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
* svga: whitespace, formatting fixes in svga_swtnl_backend.cBrian Paul2017-07-121-34/+45
|
* svga: whitespace, formatting fixes in svga_swtnl_draw.cBrian Paul2017-07-121-9/+9
|
* svga: whitespace, formatting fixes in svga_swtnl_state.cBrian Paul2017-07-121-19/+19
|
* svga: move comment, declaration in svga_init_shader_key_common()Brian Paul2017-07-121-6/+5
| | | | | | | put the comment before the relevant code. Move declaration of swizzle_tab var to where it's used. Reviewed-by: Charmaine Lee <[email protected]>
* draw: whitespace, formatting fixes in draw_vs_exec.cBrian Paul2017-07-121-47/+43
| | | | Trivial.
* draw: s/unsigned/enum tgsi_semantic/Brian Paul2017-07-122-3/+3
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* travis: lower SWR requirement to GCC 4.8, aka std=c++11Emil Velikov2017-07-121-8/+4
| | | | | | | | | With ealier commit we relaxed the requirement from C++14 to C++11. Update the build script so that it Cc: Tim Rowley <[email protected] Fixes: 0b80b025021 ("swr: relax c++ requirement from c++14 to c++11") Signed-off-by: Emil Velikov <[email protected]>
* docs: update HTTP -> HTTPS reference to reflect realityEmil Velikov2017-07-121-1/+1
| | | | | | | The link recently got updated to https. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: set KHR_gl_texture_3D_image only when the requirements are met.Emil Velikov2017-07-121-3/+4
| | | | | | | | DRI_IMAGE's createImageFromTexture is used to implement the extension, so we should check for it prior to advertising. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: enhance KHR_gl_image extensions checksEmil Velikov2017-07-121-15/+21
| | | | | | | | | | Drop the (duplicate) top-level check in dri2_create_image_khr() and add the respective checks in dri2_create_image_khr_{texture,renderbuffer} v2: use unreachable instead of assert in dri2_create_image_khr_texture Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: don't set modifier if no modifiers are availableEmil Velikov2017-07-121-2/+0
| | | | | | | | | If no modifiers are available, the variable will never be used. Thus there's no point in initialising it. Cc: Varad Gautam <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: check for extensions' presence during attr parsingEmil Velikov2017-07-121-4/+18
| | | | | | | | If the respective extension is not supported, one should return EGL_BAD_PARAMETER as mentioned in earlier commits. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: add width/height as EXT_image_dma_buf_import attrsEmil Velikov2017-07-121-0/+6
| | | | | | | | | | | | | | | | | Although not listed amongst the initial EGL_LINUX_DRM_FOURCC_EXT and friends list, the spec reads ... Required attributes and their values are as follows: * EGL_WIDTH & EGL_HEIGHT: The logical dimensions of the buffer in pixels * EGL_LINUX_DRM_FOURCC_EXT: The pixel format of the buffer, as specified by drm_fourcc.h and used as the pixel_format parameter of the drm_mode_fb_cmd2 ioctl. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: polish EXT_image_dma_buf_import attr parsingEmil Velikov2017-07-121-29/+22
| | | | | | | | Simplify the existing if/else + temporary variable into if (foo) return X. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: simplify EXT_image_dma_buf_import_modifiers attr parsingEmil Velikov2017-07-121-26/+4
| | | | | | | Move the common extension check at the top. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: split _eglParseImageAttribList into per extension functionsEmil Velikov2017-07-121-186/+260
| | | | | | | | | | Will allow us to simplify existing code and make further improvements short and simple. No functional change intended. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: call _eglError within _eglParseImageAttribListEmil Velikov2017-07-123-30/+18
| | | | | | | | | | | | | | | | | | | | | | | As per EGL_KHR_image_base: If an attribute specified in <attrib_list> is not one of the attributes listed in Table bbb, the error EGL_BAD_PARAMETER is generated. We should set the error as opposed to simply log it. Currently we have a partial solution, whereby only some of the callers call _eglError(). Since that has proven to be less robust, simply set the error by the function itself and change the return type to EGLBoolean, updating the callers. So now the code is slightly simpler. Plus the follow-up fixes will be easier to manage. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: move eglCreateDRMImageMESA's malloc laterEmil Velikov2017-07-121-29/+23
| | | | | | | | | | | | | | | | Don't bother allocating any memory until we're finished parsing and sanitising all the attributes. As a nice side effect we now consistently set eglError when any of the attrib/values are not correct. Strangely enough the spec does not mention _anything_ about what error should be set where, even if the implementation already sets the odd one. Cc: Kristian Høgsberg <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* svga: fix texture swizzle writemaskingBrian Paul2017-07-111-0/+2
| | | | | | | | | | | | | | | Commit bfe1e7737a76e3b046 changed how texture swizzles are set up. This exposed a latent bug in the VMware driver: we were ignoring the texture instruction's writemask when applying the 0 and 1 swizzle terms. This wasn't caught by the Piglit texture swizzle test because it only exercises fixed function (no write masking). Fixes issues seen with ETQW apitrace. CC: <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* i965: Use VALGRIND_MAKE_MEM_x in place of MALLOCLIKE/FREELIKEChris Wilson2017-07-111-7/+27
| | | | | | | | | | | | | | | | | | | | | Valgrind doesn't actually implement VALGRIND_FREELIKE_BLOCK as the exact inverse of VALGRIND_MALLOCLIKE_BLOCK. It makes the block inaccessible, but still leaves it defined in its allocation tracker i.e. it will report the mmap as lost despite the call to FREELIKE! Instead of treating the mmap as an allocation, treat it as changing the access bits upon the memory, i.e. that it becomes defined (because of the buffer objects always contain valid content from the user's perspective) upon mmap and inaccessible upon munmap. This makes memcheck happy without leaving it thinking there is a very large leak. Finally for consistency, we treat all the mmap/munmap paths the same even though valgrind can intercept the regular mmap used for GTT. We could move this in the drm_mmap/drm_munmap macros, but that quickly looks ugly given the desire for those to support different OSes, but I didn't try that hard! Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Fix asynchronous mappings on !LLC platforms.Kenneth Graunke2017-07-111-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | When using a read-only CPU mapping, we may encounter stale buffer contents. For example, the Piglit primitive-restart test offers the following scenario: 1. Read data via a CPU map. 2. Destroy that buffer. 3. Create a new buffer - obtaining the same one via the BO cache. 4. Call BufferSubData, which does a GTT map with MAP_WRITE | MAP_ASYNC. (We avoid set_domain for async mappings, so no flushing occurs.) 5. Read data via a CPU map. (Without explicit clflushing, this will contain data from step 1!) Otherwise, everything ought to work, keeping in mind that we never use CPU maps for writing - just read-only CPU maps. This restores the performance gains after Matt's revert in commit 71651b3139c501f50e6547c21a1cdb816b0a9dde. v2: Do the invalidate later, and even when asking for a brand new map. v3: Add more comments from Chris. Reviewed-by: Chris Wilson <[email protected]>
* i965: Don't use PREAD for glGetBufferSubData().Kenneth Graunke2017-07-113-28/+10
| | | | | | | | | | | | | | | Just map the buffer and memcpy. This will do a CPU mmap, which should be reasonably efficient, and doing this gives us full control over the domains and caching instead of leaving it to the kernel. This prevents regressions on Braswell in the next commit. Specifically GL45-CTS.shader_atomic_counters.basic-buffer-operations. Because async maps start skipping set-domain, the pread thought everything was nicely still in the CPU domain, and returned stale data. v2: Use _mesa_error_no_memory() if the map fails instead of crashing. Reviewed-by: Chris Wilson <[email protected]>
* swr: build driver proper separate from rasterizerTim Rowley2017-07-115-39/+36
| | | | | | | | | | | | | | | | | | swr used to build and link the rasterizer to the driver, and to support multiple architectures we needed to have multiple versions of the driver/rasterizer combination, which needed to link in much of mesa. Changing to having one instance of the driver and just building architecture specific versions of the rasterizer gives a large reduction in disk space. libGL.so 6464 Kb -> 7000 Kb libswrAVX.so 10068 Kb -> 5432 Kb libswrAVX2.so 9828 Kb -> 5200 Kb Total 26360 Kb -> 17632 Kb Reviewed-by: Emil Velikov <[email protected]>
* swr: switch to using SwrGetInterface api tableTim Rowley2017-07-1110-65/+72
| | | | | | | | | Use the SWR rasterizer API through the table returned from SwrGetInterface rather than referencing the functions directly. This will allow us to move to a model of having the driver dynamically load the appropriate swr architecture library. Reviewed-by: Bruce Cherniak <[email protected]>
* swr/rast: make SWR_VISIBLE attribute work for windowsGeorge Kyriazis2017-07-111-1/+1
| | | | | | Needed to expose SwrGetInterface Reviewed-by: Bruce Cherniak <[email protected]>
* i965: perf: use new subslices numbers from device infoLionel Landwerlin2017-07-111-32/+17
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Ben Widawsky <[email protected]>
* intel: add number of subslices to device infoLionel Landwerlin2017-07-112-8/+54
| | | | | | | | | | | We could have used a single integer to store that value, but Cannonlake has different number of subslices per slice depending on the GT. v2: Add CFL subslice numbers (Lionel) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Ben Widawsky <[email protected]>
* i965: Use already existing eu_totalBen Widawsky2017-07-111-8/+1
| | | | | | | | Reduces IOCTL calls by 1, and provides a centralized place to override such configurations if we have a need to do so. Signed-off-by: Ben Widawsky <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* i965: Resolve framebuffers before signaling the fenceChris Wilson2017-07-111-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From KHR_fence_sync: When the condition of the sync object is satisfied by the fence command, the sync is signaled by the associated client API context, causing any eglClientWaitSyncKHR commands (see below) blocking on <sync> to unblock. The only condition currently supported is EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR, which is satisfied by completion of the fence command corresponding to the sync object, and all preceding commands in the associated client API context's command stream. The sync object will not be signaled until all effects from these commands on the client API's internal and framebuffer state are fully realized. No other state is affected by execution of the fence command. If clients are passing the fence fd (from EGL_ANDROID_native_fence_sync) to a compositor, that fence must only be signaled once the framebuffer is resolved and not before as is currently the case. v2: fixup assert to use GL_SYNC_GPU_COMMANDS_COMPLETE (Chad) Reported-by: Sergi Granell <[email protected]> Fixes: c636284ee8ee ("i965/sync: Implement DRI2_Fence extension") Signed-off-by: Chris Wilson <[email protected]> Cc: Sergi Granell <[email protected]> Cc: Rob Clark <[email protected]> Cc: Chad Versace <[email protected]> Cc: Daniel Stone <[email protected]> Cc: Kenneth Graunke <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* svga: s/unsigned/enum tgsi_texture_type/Brian Paul2017-07-111-3/+4
| | | | | Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* svga: s/unsigned/enum tgsi_swizzleBrian Paul2017-07-111-4/+4
| | | | | Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* svga: s/unsigned/enum tgsi_interpolate_mode/Brian Paul2017-07-111-1/+2
| | | | | | | And s/unsigned/enum tgsi_interpolate_loc/ Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* svga: s/unsigned/enum tgsi_file_type/Brian Paul2017-07-111-7/+7
| | | | | Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* svga: s/unsigned/enum tgsi_semantic/Brian Paul2017-07-114-8/+10
| | | | | | | Makes gdb debugging a little nicer. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* i965: Assert that we don't use CPU write maps to non-coherent buffers.cros-mesa-17.1.1-r3-vanillachadv/cros-mesa-17.1.1-r3-vanillaKenneth Graunke2017-07-101-0/+6
| | | | | | | | | Using CPU maps of non-coherent buffers can get us in a lot of trouble, and WC maps are a reasonable alternative anyway. Guard against shooting ourselves in the foot by adding an assert, and comment. Reviewed-by: Chris Wilson <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Disable access to CPU mmap for async access on non-LLC machinesChris Wilson2017-07-101-4/+12
| | | | | | | | | | | | | | | | | If the user triggers an implicit batch flush while holding access to a CPU mapped buffer, that mmapping will be invalidated by the kernel for non-LLC devices. (The kernel when executing a batch will change the cache domain of the buffers in that batch, which for non-LLC CPU access will cause that buffer to be clflushed and any further CPU access to be discarded.) To prevent this, simply disallow any CPU async mmap access. The cases where async CPU access to a non-LLC buffer should continue to be allowed via their preferred snooping path. v2 (Ken): Reword the comment slightly. Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Track when a bo is shared with an external clientChris Wilson2017-07-102-0/+9
| | | | | | | | | | | | | If the buffer is being shared with an external client, our own state tracking may be stale and in some cases we may wish to double check with the kernel/hw state. At the moment, this is synonymous with not being reusable, but the semantics between reusable and external are quite different and we will have more examples of non-reusable buffers in the near future. Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* intel: Fix clflushing on modern (Baytrail+) Atom CPUs.Kenneth Graunke2017-07-101-0/+12
| | | | | | | | Thanks to Chris Wilson for pointing this out. Reviewed-by: Daniel Vetter <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Lionel Landwerlin <[email protected]>
* intel: Move clflush helpers from anv to common/gen_clflush.h.Kenneth Graunke2017-07-107-34/+63
| | | | | | | | | I want to use these in the OpenGL driver as well. v2: Add to COMMON_FILES in Makefile.sources (caught by Emil) Reviewed-by: Daniel Vetter <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* spirv: Fix reaching unreachable for compare exchange on imagesJames Legg2017-07-101-0/+1
| | | | | | | | | | | | | | | We were hitting the unreachable("Invalid image opcode") near the end of vtn_handle_image when parsing the SpvOpAtomicCompareExchange opcode. v2: Add stable CC. v3: Ignore SpvOpAtomicCompareExchangeWeak. It requires the Kernel capability which is not exposed in Vulkan, and spirv_to_nir is not used for OpenCL which does support it. Reviewed-by: Jason Ekstrand <[email protected]> CC: <[email protected]>
* gallium: use "ull" number suffix to keep the QtCreator parser happyMarek Olšák2017-07-1011-39/+39
| | | | | | | It can't parse "llu". Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* i965: Use brw_bo_wait() for brw_bo_wait_rendering()Chris Wilson2017-07-105-8/+10
| | | | | | | | | | | | | | Currently, we use set_domain() to cause a stall on rendering. But the set-domain ioctl has the side-effect of changing the kernel's cache domain underneath the struct_mutex, which may perturb state if there was no rendering to wait upon and in general is much heavier than the lockless wait-ioctl. Historically libdrm used set-domain as we did not have an explicit wait-ioctl (and the patches to teach it to use wait if available were lost in the mists). Since mesa already depends upon a kernel support the wait-ioctl, we do not need to supply a fallback. Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* svga: fix PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE valueBrian Paul2017-07-101-1/+4
| | | | | | | | | | | | This query is supposed to return the max texture buffer size/width in texels, not size in bytes. Divide by 16 (the largest format size) to return texels. Fixes Piglit arb_texture_buffer_object-max-size test. Cc: [email protected] Reviewed-by :Charmaine Lee <[email protected]>
* svga: fix breakage in create_backed_surface_view()Brian Paul2017-07-101-4/+3
| | | | | | | | This fixes a regression in some piglit tests since commit 5e5d5f1a2eb. I think I mis-resolved the merge conflict when cherry-picking that commit to master. Reviewed-by: Charmaine Lee <[email protected]>
* anv: Stop setting domains to RENDER on EXEC_OBJECT_WRITEJason Ekstrand2017-07-101-5/+2
| | | | | | | | | | | | The reason we were doing this was to ensure that the kernel did the appropriate cross-ring synchronization and flushing. However, the kernel only looks at EXEC_OBJECT_WRITE to determine whether or not to insert a fence. It only cares about the domain for determining whether or not it needs to clflush the BO before using it for scanout but the domain automatically gets set to RENDER internally by the kernel if EXEC_OBJECT_WRITE is set. Reviewed-by: Chris Wilson <[email protected]>
* a5xx: fix condition for updating *_FS_OUTPUT_CNTLIlia Mirkin2017-07-091-1/+1
| | | | | | | | | | | The register values depend on the currently set program, so make sure to revalidate when the program changes. Fixes glsl-1.10-fragdepth as well as dEQP-GLES3.functional.shaders.fragdepth.compare.* Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* radv/ac: drop setting xnackDave Airlie2017-07-091-2/+1
| | | | | | | | | | | Since radv uses compute rings and we can't know when we are setting up the shaders what ring they are to be used on, we should just use the default xnack setting. This may be suboptimal in some places, but if we hit a problem, we likely should try and address this between llvm and mesa. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>