summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* egl: avoid eglCreatePlatform*Surface{EXT,} crash with invalid dpyEmil Velikov2017-08-101-2/+2
| | | | | | | | | | | | | | | | | | If we have an invalid display fed into the functions, the display lookup will return NULL. Thus as we attempt to get the platform type, we'll deref. it leading to a crash. Keep in mind that this will not happen if Mesa is built without X11 or when the legacy eglCreate*Surface codepaths are used. A similar check was added with earlier commit 5e97b8f5ce9 ("egl: Fix crashes in eglCreate*Surface), although it was only applicable when the surfaceless platform is built. Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl/drm: rename dri2_drm_create_surface()Emil Velikov2017-08-101-13/+4
| | | | | | | | | | | | The function can handle only window surfaces, so let's rename it accordingly, killing the wrapper around it. v2: Use native_window in the function args. list. Suggested-by: Eric Engestrom <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/drm: remove unreachable code in dri2_drm_create_surface()Emil Velikov2017-08-101-13/+7
| | | | | | | | | | | The function can be called only when the type is EGL_WINDOW_BIT. Remove the unneeded switch statement. v2: Rename the local variable window to surface (Eric) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> (v1)
* egl/x11: pass NULL instead of XCB_WINDOW_NONE as native_surfaceEmil Velikov2017-08-102-2/+2
| | | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: Clean up native_type vs drawable messMatt Turner2017-08-102-8/+5
| | | | | | | | | | | | | The next patch is going to stop passing XCB_WINDOW_NONE (of type xcb_window_enum_t) as an argument where these functions expect a void *, which clang does not appreciate. This patch cleans things up to better convince me and reviewers that it's safe to do that. v2: Emil Velikov: rebase/integrate with series Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: handle BAD_NATIVE_PIXMAP further up the stackEmil Velikov2017-08-102-5/+3
| | | | | | | | | | | | The basic (null) check is identical across all backends. Just move it to the top. v2: - Split the WINDOW vs PIXMAP into separate patches - Move check after the dpy and config - dEQP expects so Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: drop unreachable BAD_NATIVE_WINDOW conditionsEmil Velikov2017-08-104-15/+3
| | | | | | | | | | | | | The code in _eglCreateWindowSurfaceCommon() already has a NULL check which handles the condition. There's no point in checking again further down the stack. v2: Split the WINDOW vs PIXMAP into separate patches v3: Resolve typos, s/EGL_PIXMAP_BIT_BIT/EGL_PIXMAP_BIT/ Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl: add dri2_setup_swap_interval helperEmil Velikov2017-08-104-63/+49
| | | | | | | | | | | | | | | | The current two implementations - X11 and Wayland were identical, barrind the upper limit. Instead of having same code twice - introduce a helper and pass the limit as an argument. Thus as Android/DRM/others get support - they only need to call the function ;-) v2: Rebase on top of keeping ::swap_available Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> (v1)
* ac: fail shader compilation if libelf is replaced by an incompatible versionMarek Olšák2017-08-103-4/+15
| | | | | | | | | | | | UE4Editor has this issue. This commit prevents hangs (release build) or assertion failures (debug build). It doesn't fix the editor, but catastrophic scenarios are prevented. Cc: 17.1 17.2 <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* dri: Introduce SWAP_METHOD tokensThomas Hellstrom2017-08-108-11/+23
| | | | | | | | | | | | We shouldn't be using GLX tokens in the dri subsystem, so define dri SWAP_METHOD tokens and translate when necessary. Unfortunately the X server uses the dri swap method value untranslated as the GLX fbconfig swapMethod, so we can't enumerate these tokens arbitrarily, but rather need to make them have the same values as the corresponding GLX tokens. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* glx: Fix swap method config matchingThomas Hellstrom2017-08-101-3/+1
| | | | | | | | | | Due to bugs in dri swap method reporting, neither the fbconfigs received from the server nor the value reported from driconfigs were correct. Now that's been fixed and we can enable config swapmethod matching again. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* glx: Work around X servers reporting bogus values of GLX_SWAP_METHOD_OMLThomas Hellstrom2017-08-101-1/+11
| | | | | | | | | | | | | | | Due to the recently fixed bug where dri drivers didn't report a correct __DRI_ATTRIB_SWAP_METHOD value, and the fact that X servers just forward this incorrect value (from the AIGLX dri driver) untranslated as GLX_SWAP_METHOD_OML, the latter value might be undefined when old dri AIGLX drivers are used, which breaks client fbconfig matching with server fbconfigs. So work around this by assuming GLX_SWAP_METHOD_UNDEFINED when a bogus value is read. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* dri: Fix __DRIconfig reporting of __DRI_ATTRIB_SWAP_METHODThomas Hellstrom2017-08-102-6/+2
| | | | | | | | | | | | | | The attribMap had two entries for this attribute, and driGetConfigAttribIndex didn't return a proper value for this attribute. Fix this, and also make sure we return SWAP_UNDEFINED for single-buffer configs as required by the GLX_OML_swap_method spec. Finally bump the dri core extension version to 2, indicating that we correctly report __DRI_ATTRIB_SWAP_METHOD. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* radv: force cs/ps/l2 flush at end of command stream. (v2)Dave Airlie2017-08-091-1/+4
| | | | | | | | | | | | | | | | | | | | This seems like a workaround, but we don't see the bug on CIK/VI. On SI with the dEQP-VK.memory.pipeline_barrier.host_read_transfer_dst.* tests, when one tests complete, the first flush at the start of the next test causes a VM fault as we've destroyed the VM, but we end up flushing the compute shader then, and it must still be in the process of doing something. Could also be a kernel difference between SI and CIK. v2: hit this with a bigger hammer. This fixes a bunch of hangs in the vk cts with the robustness tests. Fixes: f4e499ec791 ("radv: add initial non-conformant radv vulkan driver") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101334 Acked-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* nv50/ir: fix ConstantFolding with saturationKarol Herbst2017-08-092-0/+9
| | | | | | | | | | | | | | | | | For mul(a, +-1) codegen can generate OP_MOV with a saturation flag set which is ignored at emission. The same can happen with add(a, 0), and others. Adding an assert for detecting more of such issues. Fixes wrongly rendered water in Hitman Absolution running under wine. Also a few shaders in Mad Max and Alien Isolation produce such MOVs. CC: <[email protected]> Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Tobias Klausmann <[email protected]> [imirkin: generalize the fix for other cases] Reviewed-by: Ilia Mirkin <[email protected]>
* st/dri2: fix kms_swrast driconf option handlingRob Herring2017-08-091-3/+3
| | | | | | | | | | | | | Commit e794f8bf8bdb ("gallium: move loading of drirc to pipe-loader") moved the option cache to the pipe_loader_device. However, the screen->dev pointer is not set when dri_init_options() is called. Move the call to after the pipe_loader_sw_probe_kms() call so screen->dev is set. This mirrors the code flow for dri2_init_screen(). Fixes: e794f8bf8bdb ("gallium: move loading of drirc to pipe-loader") Reviewed-by: Nicolai Hähnle <[email protected]> Cc: Marek Olšák <[email protected]> Signed-off-by: Rob Herring <[email protected]>
* radeonsi: drop two unused variables in create_function()Samuel Pitoiset2017-08-091-2/+0
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl: whitespace cleanup in eglapi.cEric Engestrom2017-08-091-25/+25
| | | | Signed-off-by: Eric Engestrom <[email protected]>
* TextureStorage1D should return INVALID_OPERATION if target is not a 1D textureIago Toral Quiroga2017-08-091-1/+1
| | | | | | | | | | Previous behavior was inconsistent with other texture targets so this has been fixed in OpenGL 4.6. Fixes: KHR-GL45.direct_state_access.textures_storage_errors Reviewed-by: Jordan Justen <[email protected]>
* Update TextureParameter* error for incompatible texture targetsIago Toral Quiroga2017-08-091-1/+1
| | | | | | | | | | | The OpenGL 4.6 specs have been updated so that GetTextureParameter* with a texture object with an incompatible TEXTURE_TARGET should now report INVALID_OPERATION instead of INVALID_ENUM. Fixes: KHR-GL45.direct_state_access.textures_parameter_errors Reviewed-by: Jordan Justen <[email protected]>
* egl/dri2: refactor dri2_query_surface, swrastGetDrawableInfoTapani Pälli2017-08-091-7/+18
| | | | | | | | | | | | | | Currently swrastGetDrawableInfo always initializes w and h, patch refactors function as x11_get_drawable_info that returns success and sets the values only if no error happened. Add swrastGetDrawableInfo wrapper function as expected by DRI extension. v2: init w,y,w,h in swrastGetDrawableInfo (Eric) Signed-off-by: Tapani Pälli <[email protected]> Reported-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* i965/bufmgr: Set bo->idle after waiting.Kenneth Graunke2017-08-081-0/+2
| | | | | | | | | | After a successful wait, we know the buffer ought to be idle. Chris points out that: "The only caveat here is that bo is global, and we have a very unlikely (and probably unnoticeable) race condition with multiple contexts." Reviewed-by: Chris Wilson <[email protected]>
* i965: Don't use ggtt_bo for Gen8+ streamout offset buffer.Kenneth Graunke2017-08-081-1/+1
| | | | | | | RELOC_NEEDS_GGTT is only meaningful on Sandybridge - it's skipped on other generations - so this has no purpose. Just use rw_bo(). Reviewed-by: Chris Wilson <[email protected]>
* i965: Simplify *_bo() helpers.Kenneth Graunke2017-08-081-47/+25
| | | | | | | | With the reloc domains gone, most of these are basically the same, and the names don't make much sense anymore. Simplify them to ro_bo(), rw_bo(), and ggtt_bo(). Reviewed-by: Chris Wilson <[email protected]>
* i965: Get rid of KSP_roKenneth Graunke2017-08-081-15/+4
| | | | | | | | | The GPU reads the shader kernel from the program cache BO. It never writes it, so using a read-write BO reference makes no sense. Just make KSP read-only, and drop KSP_ro. Reviewed-by: Chris Wilson <[email protected]>
* ac/nir: fix saturate emissionConnor Abbott2017-08-081-2/+2
| | | | | | | The .f32 was already getting added by emit_intrin_2f_param(). Noticed when enabling LLVM module verification. Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* i965: Only call create_for_planar_image for multiple planesJason Ekstrand2017-08-081-1/+4
| | | | | | | | | Before, we ended up always calling miptree_create_for_planar_image in almost all cases because most images have image->planar_format != NULL. This commit makes us only take that path if we have a multi-planar format. Reviewed-by: Daniel Stone <[email protected]>
* mesa: don't error check the default buffer objectTimothy Arceri2017-08-081-11/+11
| | | | | | | An allocation check is already done when the buffer is created at context creation. Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: check default buffer object creation was successfulTimothy Arceri2017-08-081-0/+9
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: add NULL checking to free_shared_state()Timothy Arceri2017-08-082-31/+65
| | | | | | | | This will allow us to call this function from _mesa_alloc_shared_state() in the case that we run out of memory part way through allocating the state. Reviewed-by: Samuel Pitoiset <[email protected]>
* glapi: per the extension spec, the EXT-suffixed function should be usedIlia Mirkin2017-08-071-10/+0
| | | | | | | | We already expose glMultiDrawElementsBaseVertexEXT as part of the EXT_draw_elements_base_vertex chunk, so this one can just be removed. Signed-off-by: Ilia Mirkin <[email protected]> Acked-by: Samuel Pitoiset <[email protected]>
* radv: remove semicolon in if(...);Bas Nieuwenhuizen2017-08-081-1/+1
| | | | | | Trivial. Fixes: a6a6146aa91 "radv: Don't allow fmask swizzling for shareable images."
* radv: Fix decompression on multisampled depth buffersAlex Smith2017-08-072-35/+69
| | | | | | | | | | Need to take the sample count into account in the depth decompress and resummarize pipelines and render pass. Fixes: f4e499ec791 ("radv: add initial non-conformant radv vulkan driver") Signed-off-by: Alex Smith <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: "17.2" <[email protected]>
* radv: Don't allow fmask swizzling for shareable images.Bas Nieuwenhuizen2017-08-071-1/+4
| | | | | | | | Also adds an assert because you never know how the winsys changes, and multiprocess format differences are annoying. Fixes: 1e696b962b7 "radv: add separate fmask tile swizzle counter." Reviewed-by: Dave Airlie <[email protected]>
* radeonsi: fix a compile failure due to disabled assertsMarek Olšák2017-08-071-1/+1
|
* radeonsi: use optimal packet order when doing a pipeline syncMarek Olšák2017-08-071-34/+83
| | | | | | | | | | | | Process most new SET packets in parallel with previous draw calls, then flush caches and wait, start the draw, and do L2 prefetches last. This decreases the [CP busy / SPI busy] ratio (verified with GRBM perf counters). In other words, the time window when shaders are idle (between (the wait and the draw) is much shorter now. Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: expose the number of decompress calls to the HUDMarek Olšák2017-08-074-7/+20
| | | | | Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/radeon: rename GPU-dma-busy -> GPU-cp-dma-busyMarek Olšák2017-08-074-8/+8
| | | | | Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: rename shader_userdata -> shader_pointers where appropriateMarek Olšák2017-08-075-20/+20
| | | | | Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: prefetch VBO descriptors after the first VGT shaderMarek Olšák2017-08-071-17/+63
| | | | | Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: add a separate dirty mask for prefetchesMarek Olšák2017-08-076-16/+64
| | | | | | | | | | so that we don't rely on si_pm4_state_enabled_and_changed, allowing us to move prefetches after draw calls. v2: ckear the dirty mask after unbinding shaders Tested-by: Dieter Nützel <[email protected]> (v1) Reviewed-by: Nicolai Hähnle <[email protected]> (v1)
* radeonsi: add and use si_pm4_state_enabled_and_changedMarek Olšák2017-08-073-17/+18
| | | | | Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: de-atomize L2 prefetchMarek Olšák2017-08-077-9/+11
| | | | | | | I'd like to be able to move the prefetch call site around. Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: align all CE dumps to L2 cache line sizeMarek Olšák2017-08-071-8/+17
| | | | | Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: remove a tautology sctx->framebuffer.nr_samples >= 1Marek Olšák2017-08-071-2/+1
| | | | | Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/radeon: print all members of radeon_info with R600_DEBUG=infoMarek Olšák2017-08-072-3/+15
| | | | | | | also set max_alignment on amdgpu. Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl: update the extensions/functions that are enabled for 460Samuel Pitoiset2017-08-072-17/+99
| | | | | | | | Other ones are either unsupported or don't have any helper function checks. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* egl/dri2: add image extension such it's usable by swrast driverGurchetan Singh2017-08-073-2/+5
| | | | | | | | | | | | | | | | | | Otherwise, this extension is not visible to the EGL users who use the swrast driver. This will allow the swrast driver to use eglCreateImageKHR, provided the target is EGL_GL_TEXTURE_2D_KHR or EGL_GL_RENDERBUFFER_KHR. Note we still have to implement the create from render buffer path. v2: add it to optional_core_extensions instead of swrast_core_extensions, so it's not a requirement (Emil) v3: Merge egl/dri2 changes together, also add support for platform_wayland (Emil) Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]> (v2)
* st/dri: add drisw image extensionGurchetan Singh2017-08-071-0/+11
| | | | | | | | | Since the revelant functions have been moved to dri_helpers, drisw.c can make use of the extension. Note we have version 6 of the extension, since we want to support createImageFromTexture. Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/dri: move some image functions to dri_helpers.cGurchetan Singh2017-08-073-106/+124
| | | | | | | | | These functions will be used both by drisw.c and dri2.c. This patch also moves some headers that can be shared. Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>