summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
Commit message (Collapse)AuthorAgeFilesLines
* winsys/virgl: avoid unintended behaviorErik Faye-Lund2018-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If we end up never taking the loop that writes ret, we can end up with an uninitialized value, and if we're *really* unlucky, that value can be -1, causing us to go down an error-path instead of a success path. This was obviously not intended, so let's just initialize this to zero. Noticed by Valgrind: Conditional jump or move depends on uninitialised value(s) at 0xBA640A0: virgl_drm_winsys_resource_cache_create (virgl_drm_winsys.c:348) by 0xBA62FCF: virgl_buffer_create (virgl_buffer.c:170) by 0xBA605AC: virgl_resource_create (virgl_resource.c:60) by 0xBCF816F: bufferobj_data (st_cb_bufferobjects.c:344) by 0xBCF816F: st_bufferobj_data (st_cb_bufferobjects.c:390) by 0xBB7E836: vbo_use_buffer_objects (vbo_exec_api.c:1136) by 0xBCFCC6E: st_create_context_priv (st_context.c:414) by 0xBCFD3CD: st_create_context (st_context.c:590) by 0xBBB30CA: st_api_create_context (st_manager.c:896) by 0xB981E76: dri_create_context (dri_context.c:155) by 0xB97BDCE: driCreateContextAttribs (dri_util.c:473) by 0x5288331: dri3_create_context_attribs (dri3_glx.c:309) by 0x5264D64: glXCreateContextAttribsARB (create_context.c:78) Fixes: a8987b88ff1 ("virgl: add driver for virtio-gpu 3D (v2)") Signed-off-by: Erik Faye-Lund <[email protected]>
* radeonsi: adjust and simplify max_alloc_size determinationMarek Olšák2018-09-101-3/+5
| | | | Tested-by: Dieter Nützel <[email protected]>
* ac: add radeon_info::num_good_cu_per_shMarek Olšák2018-09-101-0/+4
| | | | Tested-by: Dieter Nützel <[email protected]>
* winsys/radeon: fix CMASK fast clear for NPOT textures with mipmapping on SI/CIMarek Olšák2018-09-101-2/+2
| | | | | Cc: 18.2 <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* winsys/drm: check for CAPS2/SM41 support if VGPU10 is enabledCharmaine Lee2018-09-101-1/+1
| | | | | | | | No need to check for HW_CAPS2 or SM4_1 support if VGPU10 is not enabled or is explicitly disabled via the environment variable SVGA_VGPU10. Reviewed-by: Deepak Rawat <[email protected]>
* winsys/drm: Add support for quality level in surface ioctlDeepak Rawat2018-09-104-8/+16
| | | | | | | | | | | A new argument "quality level" is added in surface define v3 which represets precision settings for surface. This commit add support for quality level in DRM_VMW_GB_SURFACE_CREATE_EXT and DRM_VMW_GB_SURFACE_REF_EXT. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* winsys/drm: enable intra_surface_copy if HW_CAP2 is supportedCharmaine Lee2018-09-101-6/+9
| | | | | | | | | With drm version 2_15, we can inquire for support of HW_CAP2. If it is supported, we can enable intra_surface_copy support. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Reviewed-by: Deepak Rawat <[email protected]>
* winsys/svga: Add support for new surface ioctl, multisample patternDeepak Rawat2018-09-105-95/+321
| | | | | | | | | | | | | | | | | | | | | Kernel driver version 2.15 added new surface ioctl named: DRM_VMW_GB_SURFACE_CREATE_EXT DRM_VMW_GB_SURFACE_REF_EXT The new ioctl has support for 64-bit svga3d_flags if DRM_VMW_PARAM_SM4_1 is available. Multisampling surface mob size calculation is added. Also synced the relevant header update. svga device modified the surface define command V3 with new parameter multisampling pattern. Adding support for that in winsys. Signed-off-by: Deepak Rawat <[email protected]> Reviewed-by: Thomas Hellstrom <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* svga: add sample count to the surface_can_create interfaceCharmaine Lee2018-09-101-1/+5
| | | | | | | With this patch, sample count is also taken into account when determining if a resource can be created. Reviewed-by: Brian Paul <[email protected]>
* radeonsi: pin the winsys thread to the requested L3 cache (v2)Marek Olšák2018-09-072-0/+23
| | | | | | v2: rebase Reviewed-by: Brian Paul <[email protected]>
* svga: sync with upstream changes to surface flagsCharmaine Lee2018-09-054-8/+13
| | | | | | | | | SVGA device now supports 64 bits surface flags. This patch updates the winsys interface to allow 64 bits surface flags. The linux winsys layer will for now only honor the lower 32 bits of the surface flags. Reviewed-by: Brian Paul <[email protected]>
* winsys/svga: Avoid cap2 code path for nowNeha Bhende2018-09-051-13/+5
| | | | | | | CAP2 functionality is not yet part of vmwgfx. This is causing unnecessary dmesg error messages. Reviewed-by: Charmaine Lee <[email protected]>
* svga/winsys: Add cap2 support in winsysNeha Bhende2018-09-052-0/+15
| | | | | Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* winsys/drm: Fix assert when try to accumulate an invalid fdCharmaine Lee2018-09-051-2/+7
| | | | | | | | | | This patch makes sure there is a valid fd before merging it to the context's fd in vmw_svga_winsys_fence_server_sync(). This fixes the assert running webot. No regression running kmscube. Reviewed-by: Sinclair Yeh <[email protected]>
* winsys/virgl/vtest: Correct off-by-one error in resource allocationGert Wollny2018-09-051-4/+9
| | | | | | | The resource bo array must already extended when the target index is equal to the current size of the array. Signed-off-by: Gert Wollny <[email protected]>
* winsys/virgl: Initialize value to silence valgrindGert Wollny2018-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | Silences: Conditional jump or move depends on uninitialised value(s) at 0xB72F2C0: virgl_drm_winsys_create (virgl_drm_winsys.c:854) by 0xB72F2C0: virgl_drm_screen_create (virgl_drm_winsys.c:926) by 0xB21C885: pipe_virgl_create_screen (drm_helper.h:275) by 0xB7201F0: pipe_loader_create_screen (pipe_loader.c:137) by 0xB639C91: dri2_init_screen (dri2.c:2112) by 0xB634F68: driCreateNewScreen2 (dri_util.c:153) by 0x63023E6: dri3_create_screen (dri3_glx.c:893) by 0x62D35BD: AllocAndFetchScreenConfigs (glxext.c:820) by 0x62D35BD: __glXInitialize (glxext.c:946) by 0x62CECB3: GetGLXPrivScreenConfig (glxcmds.c:174) by 0x62CF69C: glXQueryExtensionsString (glxcmds.c:1304) by 0x60AA7D9: ??? (in /usr/lib/x86_64-linux-gnu/libwaffle-1.so.0.5.2) by 0x4F81450: wfl_checked_display_connect (piglit-util-waffle.h:74) by 0x4F829E0: piglit_wfl_framework_init (piglit_wfl_framework.c:627) Signed-off-by: Gert Wollny <[email protected]>
* winsys/virgl: correct resource and handle allocation (v2)Gert Wollny2018-09-051-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes crash with piglit/bin/map_buffer_range-invalidate CopyBufferSubData \ increment-offset -auto -fbo * Resize the resource storage already when the count is equal to the allocated size, fixes: Invalid write of size 8 at 0xB72E4CF: virgl_drm_add_res (virgl_drm_winsys.c:629) by 0xB72E4CF: virgl_drm_emit_res (virgl_drm_winsys.c:663) by 0xB72A44A: virgl_encode_resource_copy_region (virgl_encode.c:776) by 0xB40CD12: st_copy_buffer_subdata (st_cb_bufferobjects.c:585) by 0xB244A3B: _mesa_CopyBufferSubData (bufferobj.c:2940) by 0x109A1E: upload (invalidate.c:169) by 0x109C2F: piglit_display (invalidate.c:215) by 0x4F80FBE: run_test (piglit_fbo_framework.c:52) by 0x4F66E5F: piglit_gl_test_run (piglit-framework-gl.c:229) by 0x10949D: main (invalidate.c:47) Address 0xbe07d30 is 0 bytes after a block of size 4,096 alloc'd at 0x4C31B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0xB72DAAF: virgl_drm_cmd_buf_create (virgl_drm_winsys.c:567) * Also resize the space allocated for the handles, fixes: Invalid write of size 4 at 0xB72E4F0: virgl_drm_add_res (virgl_drm_winsys.c:631) by 0xB72E4F0: virgl_drm_emit_res (virgl_drm_winsys.c:663) by 0xB72A44A: virgl_encode_resource_copy_region (virgl_encode.c:776) by 0xB40CD12: st_copy_buffer_subdata (st_cb_bufferobjects.c:585) by 0xB244A3B: _mesa_CopyBufferSubData (bufferobj.c:2940) by 0x109A1E: upload (invalidate.c:169) by 0x109C2F: piglit_display (invalidate.c:215) by 0x4F80FBE: run_test (piglit_fbo_framework.c:52) by 0x4F66E5F: piglit_gl_test_run (piglit-framework-gl.c:229) by 0x10949D: main (invalidate.c:47) Address 0xbe08570 is 0 bytes after a block of size 2,048 alloc'd at 0x4C2FB0F: malloc ( in /usr/lib/valgrind/vgpreload_memcheck-amd64- linux.so) by 0xB72DAC8: virgl_drm_cmd_buf_create (virgl_drm_winsys.c:572) Fixes: 4b15b5e803e ("virgl: resize resource bo allocation if we need to.") v2: - Use REALLOC macro and avoid memory leak when re-allocation fails - add Fixes tag (both Emil Velikov) - reorder commit message Signed-off-by: Gert Wollny <[email protected]>
* imx: make use of loader_open_render_node(..) helperChristian Gmeiner2018-08-311-1/+2
| | | | | | | Gets rid of hard-coded gpu device path. Signed-off-by: Christian Gmeiner <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* radeonsi: add radeonsi_zerovram driconfig optionTimothy Arceri2018-08-301-3/+7
| | | | | | | More and more games seem to require this so lets make it a config option. Reviewed-by: Marek Olšák <[email protected]>
* gallium/winsys/kms: don't unmap what wasn't mappedRay Strode2018-08-171-5/+13
| | | | | | | | | | | | | | | | | | | | | | At the moment, depending on pipe transfer flags, the dumb buffer map address can end up at either kms_sw_dt->ro_mapped or kms_sw_dt->mapped. When it's time to unmap the dumb buffer, both locations get unmapped, even though one is probably initialized to 0. That leads to the code segment getting unmapped at runtime and crashes when trying to call into unrelated code. This commit addresses the problem by using MAP_FAILED instead of NULL for ro_mapped and mapped when the dumb buffer is unmapped, and only unmapping mapped addresses at unmap time. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107098 Signed-off-by: Ray Strode <[email protected]> Fixes: d891f28df9a ("gallium/winsys/kms: Fix possible leak in map/unmap.") Cc: Lepton Wu <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* ac: add radeon_info::nameMarek Olšák2018-08-141-1/+6
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* drisw: Fix build on Android Nougat, which lacks shm (v2)Chad Versace2018-08-061-0/+11
| | | | | | | | | | | | | In commit cf54bd5e8, dri_sw_winsys.c began using <sys/shm.h> to support the new functions putImageShm, getImageShm in DRI_SWRastLoader. But Android began supporting System V shared memory only in Oreo. Nougat has no shm headers. Fix the build by ifdef'ing out the shm code on Nougat. Fixes: cf54bd5e8 "drisw: use shared memory when possible" Reviewed-by: Dave Airlie <[email protected]> Cc: Marc-André Lureau <[email protected]>
* winsys/amdgpu: pass the BO list via the CS ioctl on DRM >= 3.27.0Marek Olšák2018-08-033-4/+58
|
* radeonsi: use storage_samples instead of color_samples in most placesMarek Olšák2018-07-312-6/+3
| | | | | | | and use pipe_resource::nr_storage_samples instead of r600_texture::num_color_samples. Tested-by: Dieter Nützel <[email protected]>
* gallium: add storage_sample_count parameter into is_format_supportedMarek Olšák2018-07-311-1/+1
| | | | Tested-by: Dieter Nützel <[email protected]>
* Revert "virgl: remove unused stride-arguments"Dave Airlie2018-07-241-0/+6
| | | | | | This reverts commit dc938b8398c0dafb60507e41685f7518b681c24d. This adds warnings in vtest, and possibly breaks it.
* virgl: remove unused stride-argumentsErik Faye-Lund2018-07-231-6/+0
| | | | | | | | The IOCTLs doesn't pass this along, so computing them in the first place is kinda pointless. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]>
* winsys/amdgpu: remove RADEON_SURF_FMASK leftoverMarek Olšák2018-07-191-7/+4
| | | | RADEON_SURF_FMASK is never set.
* winsys/amdgpu: fix VDPAU interop by having one amdgpu_winsys_bo per BO (v2)Marek Olšák2018-07-183-5/+41
| | | | | | | | | | | | Dependencies between rings are inserted correctly if a buffer is represented by only one unique amdgpu_winsys_bo instance. Use a hash table keyed by amdgpu_bo_handle to have exactly one amdgpu_winsys_bo per amdgpu_bo_handle. v2: return offset and stride properly Tested-by: Leo Liu <[email protected]> Acked-by: Leo Liu <[email protected]>
* winsys/amdgpu: use a better hash_pointer functionMarek Olšák2018-07-181-8/+5
| | | | | Tested-by: Leo Liu <[email protected]> Acked-by: Leo Liu <[email protected]>
* winsys/amdgpu: clean up error handling in amdgpu_bo_from_handleMarek Olšák2018-07-181-20/+16
| | | | | Tested-by: Leo Liu <[email protected]> Acked-by: Leo Liu <[email protected]>
* winsys/amdgpu: shorten bo->ws in amdgpu_bo_destroyMarek Olšák2018-07-181-9/+10
| | | | | Tested-by: Leo Liu <[email protected]> Acked-by: Leo Liu <[email protected]>
* winsys/amdgpu: clean up error handling in amdgpu_cs_submit_ibMarek Olšák2018-07-161-9/+8
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* radeonsi: rework RADEON_PRIO flags to be <= 31Marek Olšák2018-07-164-7/+7
| | | | | | This decreases sizeof(struct amdgpu_cs_buffer) from 24 to 16 bytes. Reviewed-by: Samuel Pitoiset <[email protected]>
* winsys/amdgpu: use alloca when using global_bo_listMarek Olšák2018-07-161-9/+1
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* winsys/amdgpu: remove label bo_list_errorMarek Olšák2018-07-161-12/+16
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* winsys/amdgpu: always update gfx_bo_list_counterMarek Olšák2018-07-161-3/+3
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* winsys/amdgpu: make amdgpu_cs_context::flags & handles localMarek Olšák2018-07-162-22/+5
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* virgl/vtest: add support to vtest for new cap getting.Dave Airlie2018-07-102-4/+28
| | | | | | | | | | | | The vtest protocol is pretty simple but also pretty dumb, and the v1 caps query was fixed size, with no nice way to expand it, however the server also ignores any command it doesn't understand. So we can query v2 caps by sending a v2 followed by a v1, if the v2 is ignored we know it's an old vtest server, and the we get a v2 answer then we can just read the v1 answer and discard it. Acked-by: Jakob Bornecrantz <[email protected]> (sounds good)
* Shorten u_queue namesMarek Olšák2018-07-042-2/+2
| | | | | | | | There is a 15-character limit for thread names shared by the queue name and process name. Shorten the thread name to make space for the process name. Reviewed-by: Timothy Arceri <[email protected]>
* radeon: duplicate cmask surface for now.Dave Airlie2018-06-261-1/+61
| | | | | | | | The radeon winsys isn't linked against the ac code, I have vague memories of this causing some problems before, for now fix the build but just duplicating the code. Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: move CMASK size computation into ac_surfaceMarek Olšák2018-06-251-0/+13
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* radeonsi: add a debug flag to zero vram allocationsGrazvydas Ignotas2018-06-213-0/+5
| | | | | | | | | | This allows to avoid having to see garbage in Dying Light loading screen at least, which probably expects Windows/NV behavior of all allocations being zeroed by default. Analogous to radv flag with the same name. Reviewed-by: Marek Olšák <[email protected]>
* amd,radeonsi: rename radeon_winsys_cs -> radeon_cmdbufMarek Olšák2018-06-198-38/+38
| | | | Acked-by: Bas Nieuwenhuizen <[email protected]>
* ac/gpu_info: add radeon_info::num_tcc_blocksMarek Olšák2018-06-191-0/+26
| | | | | | The values for the radeon winsys were copied from the kernel driver. Tested-by: Dieter Nützel <[email protected]>
* virgl: Remove debugging left-oversTomeu Vizoso2018-06-191-2/+0
| | | | | | | | | | | Some fprintfs were probably left unintentionally a few years ago and are a bit of a nuisance. Fixes: 2d3301e4d513 ("virgl: fix reference counting of prime handles") Cc: Rob Herring <[email protected]> Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* drisw: Fix invalid pointer arithmeticJan Vesely2018-06-071-1/+1
| | | | | | | | Use of void * in pointer arithmetic is illegal, use char * instead. Fixes: cf54bd5e8381dba18d52fe438acda20cc1685bf3 ("drisw: use shared memory when possible") Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Jan Vesely <[email protected]>
* drisw: learn to query shmid handle typeMarc-André Lureau2018-05-301-1/+9
| | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* drisw: use shared memory when possibleMarc-André Lureau2018-05-301-12/+60
| | | | | | | | If drisw_loader_funcs implements put_image_shm, allocates display target data with shared memory and display with put_image_shm(). Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Adam Jackson <[email protected]>
* gallium/winsys: rename DRM_API_HANDLE_* to WINSYS_HANDLE_*Dave Airlie2018-05-307-40/+40
| | | | | | | | | | | | This just renames this as we want to add an shm handle which isn't really drm related. Originally by: Marc-André Lureau <[email protected]> (airlied: I used this sed script instead) This was generated with: git grep -l 'DRM_API_' | xargs sed -i 's/DRM_API_/WINSYS_/g' Reviewed-by: Marek Olšák <[email protected]>