summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* egl/main: add support for fourth plane tokensPekka Paalanen2017-05-304-3/+23
| | | | | | | | | | | | | | | The EGL_EXT_dma_buf_import_modifiers extension adds support for a fourth plane, just like DRM KMS API does. Bump maximum dma_buf plane count to four. v2: prevent attribute tokens from being parsed if EXT_image_dma_buf_import_modifiers is not suported. (Emil Velikov) Signed-off-by: Pekka Paalanen <[email protected]> Signed-off-by: Varad Gautam <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* egl: introduce DMA_BUF_MAX_PLANESPekka Paalanen2017-05-302-7/+9
| | | | | | | | | | Rather than hardcoding 3, use a #define. Makes it easier to bump this later to 4. Signed-off-by: Pekka Paalanen <[email protected]> Signed-off-by: Varad Gautam <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* nvc0: support for GP10BAlexandre Courbot2017-05-301-0/+1
| | | | | | | | GP10B uses the same 3D class as GP100. Signed-off-by: Alexandre Courbot <[email protected]> Acked-by: Samuel Pitoiset <[email protected]> Acked-by: Ilia Mirkin <[email protected]>
* etnaviv: Don't try to use the index buffer if size is zeroTomeu Vizoso2017-05-301-11/+13
| | | | | | | | | | | | | If info->index_size is zero, info->index will point to uninitialized memory. Fatal signal 11 (SIGSEGV), code 2, fault addr 0xab5d07a3 in tid 20456 (surfaceflinger) lst: Remove useless indexbuf conditional in the index_size != 0 case. Fixes: 330d0607ed60 ("gallium: remove pipe_index_buffer and set_index_buffer") Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Lucas Stach <[email protected]>
* i965: Always scissor on Gen4-5 instead of disabling guardband.Kenneth Graunke2017-05-292-28/+13
| | | | | | | | See commit ece0e535a44c228dd994861592deb155c14740d8. This makes Gen4-5 follow the behavior we use on Gen6+. It seems to have worked out there. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Unify Gen4-5 and Gen6 SF_VIEWPORT/CLIP_VIEWPORT code.Kenneth Graunke2017-05-293-114/+9
| | | | | | | This brings the improved guardbanding we implemented on Gen6+ back to the older Gen4-5 code. It also deletes piles of code. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Make a set_scissor_bits helper function.Kenneth Graunke2017-05-291-33/+40
| | | | | | | | Gen4-5 include a single SCISSOR_RECT in SF_VIEWPORT. Making a helper function will allow us to reuse this code for Gen4-5. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Use GENX(packet_length) rather than hardcoded dword counts.Kenneth Graunke2017-05-291-9/+12
| | | | | | This is clearer and less likely to break in the future. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Move the scissoring code up near the viewport code.Kenneth Graunke2017-05-291-86/+86
| | | | | | | | These are fairly related. Gen4-5 combine the scissor rectangle and SF_VIEWPORT. Co-locating them will allow me to avoid forward declarations of helper functions in a few patches. Reviewed-by: Topi Pohjolainen <[email protected]>
* genxml: Make a SCISSOR_RECT structure on Gen4-5.Kenneth Graunke2017-05-293-12/+24
| | | | | | | | | | | | | Gen6+ support multiple scissor rectangles, and define a SCISSOR_RECT structure containing their dimensions. On Gen4-5, those same fields exist in SF_VIEWPORT. This patch extracts the SF_VIEWPORT fields into a SCISSOR_RECT structure. Although not a named concept on Gen4-5, it works just as well, and gives us a consistent SCISSOR_RECT structure across all generations, making it easier to reuse code. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Replace brw->gen and devinfo->gen with GEN_GEN.Kenneth Graunke2017-05-291-6/+4
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Rework Sandybridge 3DSTATE_VIEWPORT_STATE_POINTERS.Kenneth Graunke2017-05-291-33/+15
| | | | | | | | | | | | | On Gen7+ we emit 3DSTATE_VIEWPORT_STATE_POINTERS_{SF_CL,CC} when emitting a new viewport. This patch makes us take the same approach on Sandybridge - but because we have a combined command, we just set the appropriate "change" bits. This eliminates an atom, some dirty flagging, and some brw->*.vp_offset writes. It does mean we'll emit two 3DSTATE_VIEWPORT_STATE_POINTERS instead of one if both change, but that's probably fine. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Port CC_VIEWPORT to genxml.Kenneth Graunke2017-05-293-52/+55
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Ignore INTEL_SCALAR_* debug variables on Gen10+.Kenneth Graunke2017-05-291-10/+16
| | | | | | | | | | | Scalar mode has been default since Broadwell, and vector mode is getting increasingly unmaintained. There are a few things that don't even fully work in vector mode on Skylake, but we've never cared because nobody uses it. There's no point in porting it forward to new platforms. So, just ignore the debug options to force it on. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: add KHR_no_error support for glBindBufferRange()Timothy Arceri2017-05-303-38/+70
| | | | | Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: create bind_buffer_range() helperTimothy Arceri2017-05-301-3/+10
| | | | | | | This will help us add KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: convert mesa_bind_buffer_range_transform_feedback() to a validate functionTimothy Arceri2017-05-303-31/+35
| | | | | | | | This allows some tidy up and also makes it so we can add KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: create _mesa_bind_buffer_range_xfb() helperTimothy Arceri2017-05-301-0/+20
| | | | | Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* 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]>