aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* mesa: split bind_atomic_buffer() in twoTimothy Arceri2017-05-301-25/+29
| | | | | | | This will help us add KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: split bind_buffer_range_shader_storage_buffer() in twoTimothy Arceri2017-05-301-13/+23
| | | | | | | This will help us implement KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: split bind_buffer_range_uniform_buffer() in twoTimothy Arceri2017-05-301-13/+19
| | | | | | | This will help us implement KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: add KHR_no_error support for glVertexArrayVertexBuffer()Timothy Arceri2017-05-303-1/+18
| | | | | Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: add KHR_no_error support for glBindVertexBuffer()Timothy Arceri2017-05-303-4/+18
| | | | | Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: split vertex_array_vertex_buffer() in twoTimothy Arceri2017-05-301-42/+53
| | | | | | | | This will allow us to skip the error checkes when adding KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* radv: Reserve space for descriptor and push constant user SGPR setting.Bas Nieuwenhuizen2017-05-291-0/+8
| | | | | | | | flush_compute_state doesn't reserve a large chunk, so these need their own reservation. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver"
* amd/common: set vcn dec as hw decode as wellLeo Liu2017-05-291-0/+2
| | | | | | | Recommit after issue resolved by the previous patch. Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Christian König <[email protected]>
* amd/common: add vcn dec ip info query for amdgpu version 3.17Leo Liu2017-05-291-1/+9
| | | | | Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* glthread/gallium: require safe_glthread to start glthreadGregory Hainaut2017-05-291-4/+17
| | | | | | | | | | | | | | | | | | Print an error message for the user if the requirement isn't met, or we're not thread safe. v2: based on Nicolai feedbacks Check the DRI extension version v3: based on Emil feedbacks improve commit and error messages. use backgroundCallable variable to improve readability v5: based on Emil feedbacks Properly check the function pointer Signed-off-by: Gregory Hainaut <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl: implement __DRIbackgroundCallableExtension.isThreadSafeGregory Hainaut2017-05-291-1/+33
| | | | | | | | | | | | | | | | | v2: bump version v3: Add code comment s/IsGlThread/IsThread/ (and variation) Include X11/Xlibint.h protected by ifdef v5: based on Daniel feedback Move non X11 code outside of X11 define Always return true for Wayland Signed-off-by: Gregory Hainaut <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* glx: implement __DRIbackgroundCallableExtension.isThreadSafeGregory Hainaut2017-05-292-2/+25
| | | | | | | | | | | | | | | v2: bump version v3: Add code comment s/IsGlThread/IsThread/ (and variation) v4: DRI3 doesn't hit X through GL call so it is always safe Signed-off-by: Gregory Hainaut <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* dri: Extend __DRIbackgroundCallableExtensionRec to include a callback that ↵Gregory Hainaut2017-05-291-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | checks for thread safety DRI-drivers could call Xlib functions, for example to allocate a new back buffer. When glthread is enabled, the driver runs mostly on a separate thread. Therefore we need to guarantee the thread safety between libX11 calls from the applications (not aware of the extra thread) and the ones from the driver. See discussion thread: https://lists.freedesktop.org/archives/mesa-dev/2017-April/152547.html Fortunately, Xlib allows to lock display to ensure thread safety but XInitThreads must be called first by the application to initialize the lock function pointer. This patch will allow to check XInitThreads was called to allow glthread on GLX or EGL platform. Note: a tentative was done to port libX11 code to XCB but it didn't solve fully thread safety. See discussion thread: https://lists.freedesktop.org/archives/mesa-dev/2017-April/153137.html Note: Nvidia forces the driver to call XInitThreads. Quoting their manpage: "The NVIDIA OpenGL driver will automatically attempt to enable Xlib thread-safe mode if needed. However, it might not be possible in some situations, such as when the NVIDIA OpenGL driver library is dynamically loaded after Xlib has been loaded and initialized. If that is the case, threaded optimizations will stay disabled unless the application is modified to call XInitThreads() before initializing Xlib or to link directly against the NVIDIA OpenGL driver library. Alternatively, using the LD_PRELOAD environment variable to include the NVIDIA OpenGL driver library should also achieve the desired result." v2: based on Nicolai and Matt feedback Use C style comment v3: based on Emil feedback split the patch in 3 s/isGlThreadSafe/isThreadSafe/ v5: based on Marek comment Add a comment that isThreadSafe is supported by extension v2 Signed-off-by: Gregory Hainaut <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* egl/wayland: use the image_driver alongside the image_loaderEmil Velikov2017-05-291-6/+14
| | | | | | | | | | Analogous to earlier commits - image_driver and image_loader are meant to be used hand in hand. v2: Rebase Cc: Derek Foreman <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* egl/wayland: set the resize_callback if the flush extension is availableEmil Velikov2017-05-291-3/+3
| | | | | | | Strictly speaking __DRI_DRI2 implies __DRI2_FLUSH. Although since we're using the latter in the callback, we want to use the correct guard. Signed-off-by: Emil Velikov <[email protected]>
* egl/wayland: select the format based on the interface usedEmil Velikov2017-05-291-1/+2
| | | | | | | | Rather than misleadingly depending on DRI2 for the WL_DRM vs WL_SHM formats, use the wl_drm and wl_shm interface respectively. Fixes: a1727aa75ed ("egl/wayland: Don't use DRM format codes for SHM") Signed-off-by: Emil Velikov <[email protected]>
* egl/surfaceless: use the image_driver for image_loaderEmil Velikov2017-05-291-4/+4
| | | | | | | | Analogous to previous commit. Cc: Chad Versace <[email protected]> Cc: Gurchetan Singh <[email protected]> Signed-off-by: Emil Velikov <[email protected]>
* egl/android: use the image_driver alongside the image_loaderEmil Velikov2017-05-291-11/+20
| | | | | | | | | | | They are meant to be used together. Otherwise we'll need workarounds like egl/wayland. Namely register an image_loader_extension even thought we should be using only DRI2. v2: Add missing the bracket to fix the build (Tapani). Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* egl/x11: flatten codeflowEmil Velikov2017-05-291-9/+7
| | | | Signed-off-by: Emil Velikov <[email protected]>
* egl/x11: check for dri2_dpy->flush before using the flush extensionEmil Velikov2017-05-291-5/+3
| | | | | | | | | | | | | Analogous to earlier commit. Note that the dri2_x11_post_sub_buffer and dri2_x11_swap_buffers_region paths already implicitly require __DRI2_FLUSH. The corresponding extensions (NV_post_sub_buffer and NOK_swap_region) are enabled only with DRI2. v2: Split cosmetic changes into separate patch. Signed-off-by: Emil Velikov <[email protected]>
* egl/drm: flatten codeflowEmil Velikov2017-05-291-19/+20
| | | | | | | Rework the code to return early and drop an indentation level. It should be easier to read. Signed-off-by: Emil Velikov <[email protected]>
* egl/drm: check for dri2_dpy->flush before using the flush extensionEmil Velikov2017-05-291-1/+1
| | | | | | | | | | | | | The current __DRI_DRI2 imples __DRI2_FLUSH. At the same time, one can use __DRI_IMAGE_DRIVER alongside the latter, so the current check is confusing at best. Check for what we use. v2: Split out from whitespace changes Reviewed-by: Chad Versace <[email protected]> (v1) Signed-off-by: Emil Velikov <[email protected]>
* egl: annotate dri2_egl_display_vtbl as const dataEmil Velikov2017-05-295-7/+7
| | | | | | | | With the final place that modifies the vtbl removed as of last commit we can annotate the symbols accordingly. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl/wayland: don't modify the vtbl if an extension is not availableEmil Velikov2017-05-291-5/+2
| | | | | | | | With previous commit we'll error out should one be using the extension when it's not available. Thus we no longer need to modify the vtbl. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* egl: error out on eglCreateWaylandBufferFromImageWLEmil Velikov2017-05-291-1/+2
| | | | | | | | | | | | | Currently f one does the silly thing by probing the entry point w/o checking the extension they will attempt to use the extension even though it cannot work. That is due our of of an assert which gets removed in release builds. Simply error out if the extension is not enabled. Thus we can apply some cleanups with next commits. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* gbm: manage only the required set of DRI extensionsEmil Velikov2017-05-292-2/+0
| | | | | | | | | | | | | | | | Currently GBM attempts to know all the extensions that might be required by EGL/DRM [at some later stage]. That is a bit unclear and we often forget to update GBM as EGL gets attention. To avoid that, simply let EGL manage it's own required extensions based on the base primitive (screen) we provide it. v2: Rework the approach - GBM should not dive into EGL/DRM. Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Herring <[email protected]>
* egl/drm: use dri2_setup_extensions() over the extensions provided by GBMEmil Velikov2017-05-291-4/+5
| | | | | | | | | | | Allows us to keep things in sync easier and lets us simplify the interface between the two even further. v2: Don't set GBM's extensions. Cc: Rob Herring <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Herring <[email protected]>
* egl: refactor dri2_create_screen() into three separate functionsEmil Velikov2017-05-296-19/+58
| | | | | | | | | | | | | | | | | | | | Split the create_screen into: - create screen - setup/bind extensions - setup screen This will allow us to reuse the latter two on egl/drm. Said platform does create its own screen and attempts to reinvent the later two functions itself. Since the GBM ones tend to get out of sync quite often, and there is no distinct reason why it does so we'll drop them with latter commits. v2: disp -> dpy for the Android platform. v3: use correct goto label (Rob) Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Herring <[email protected]>
* egl/x11: make use of the dri2_display_destroy() helperEmil Velikov2017-05-291-55/+23
| | | | | Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Herring <[email protected]>
* egl/wayland: make use of the dri2_display_destroy() helperEmil Velikov2017-05-291-59/+25
| | | | | Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Herring <[email protected]>
* egl/surfaceless: make use of the dri2_display_destroy() helperEmil Velikov2017-05-291-14/+8
| | | | | | | Cc: Chad Versace <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]> Tested-by: Rob Herring <[email protected]>
* egl/drm: make use of the dri2_display_destroy() helperEmil Velikov2017-05-291-5/+2
| | | | | Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Herring <[email protected]>
* egl/android: make use of dri2_display_destroy() helperEmil Velikov2017-05-291-18/+9
| | | | | | | | | v2: disp -> dpy (Tapani) Cc: Tomasz Figa <[email protected]> Cc: Tapani Pälli <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Herring <[email protected]>
* egl: split out a dri2_display_destroy() helperEmil Velikov2017-05-292-1/+11
| | | | | | | | | | | | | Within dri2_display_release() we already tear down all the display specifics. Within the platform specific dri initialize however we badly and partially duplicate that. Let's stop that by fleshing out the required functionality into a helper and using it throughout the codebase. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]> Tested-by: Rob Herring <[email protected]>
* egl: check for driver_configs in dri2_display_releaseTapani Pälli2017-05-291-1/+1
| | | | | | | | | | | | With later commits we'll split and reuse the destroy side of the function for the initialize_foo error path. In such cases, driver_configs may be NULL leading to a crash. Signed-off-by: Tapani Pälli <[email protected]> [Emil Velikov: reword commit message] Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Herring <[email protected]>
* gbm: remove unneeded gbm_drm_device abstractionEmil Velikov2017-05-296-86/+34
| | | | | Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Herring <[email protected]>
* gbm: move gbm_drm_device::driver_name to gbm_dri_deviceEmil Velikov2017-05-294-11/+11
| | | | | | | | | | | The former already keeps track of the DRI module opened, based on the driver_name provided. So let's keep them together. As a nice bonus this Will allows us to remove the gbm_drm_device all together with next patch. Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Herring <[email protected]>
* gbm: remove "struct gbm_drm_bo" abstractionEmil Velikov2017-05-294-33/+29
| | | | | | | | The struct is a simple wraper around gbm_bo and brings no actual benefit. Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Herring <[email protected]>
* gbm: remove unused gbm_dri_device::loaderEmil Velikov2017-05-291-1/+0
| | | | | | | | | | | Introduced back in 2012 with fd6acb97fb9 ("gbm: Create hooks for dri2_loader_extension in dri backend") and hasn't been used since. Seemingly a copy/paste thinko from development stage. Cc: Ander Conselvan de Oliveira <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Tested-by: Rob Herring <[email protected]>
* radv: automake: list shared libraries after the static onesEmil Velikov2017-05-291-19/+16
| | | | | | | | | | Analogous to previous commit - the compiler can discard xcb + wayland libs, since there is no user (the static libraries) before it on the command line. Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]>
* anv: automake: list shared libraries after the static onesEmil Velikov2017-05-291-16/+15
| | | | | | | | | | The compiler can discard the shared ones from the link chain, since there is no user (the static libraries) before it on the command line. Cc: [email protected] Reported-by: Laurent Carlier <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]>
* mesa: add KHR_no_error support for glBindImageTextures()Samuel Pitoiset2017-05-293-32/+52
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glBindImageTexture()Samuel Pitoiset2017-05-293-1/+21
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add bind_image_texture() helperSamuel Pitoiset2017-05-291-7/+16
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add set_image_binding() helperSamuel Pitoiset2017-05-291-36/+34
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove unused layered parameter from validate_bind_image_texture()Samuel Pitoiset2017-05-291-4/+4
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glActiveTexture()Samuel Pitoiset2017-05-293-12/+29
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* radeonsi: use ac_build_buffer_load for shader buffer loadsMarek Olšák2017-05-291-22/+21
| | | | | | and document why we can't use SMEM yet. Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: move building llvm.SI.load.const into ac_build_buffer_loadMarek Olšák2017-05-294-27/+47
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: rename readonly_memory -> can_speculateMarek Olšák2017-05-294-20/+20
| | | | | | | This is more accurate. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>