platform/upstream/mesa.git
12 months agoRemove dependency on llvm 67/292067/1 accepted/tizen/8.0/unified/20231005.095220 accepted/tizen/unified/20230613.170807 accepted/tizen/unified/riscv/20230720.024226
Xuelian Bai [Thu, 27 Apr 2023 03:30:19 +0000 (11:30 +0800)]
Remove dependency on llvm

Disable llvmpipe, fallback to traditional swrast softpipe.

Change-Id: I88346e043e27364d4981770bb88df12485070f65
Signed-off-by: Xuelian Bai <xuelian.bai@samsung.com>
14 months agoUpgrade to mesa22.3.5 12/288812/1 accepted/tizen/unified/20230227.042036 accepted/tizen/unified/20230227.152721
Xuelian Bai [Thu, 23 Feb 2023 09:01:12 +0000 (17:01 +0800)]
Upgrade to mesa22.3.5

1. Add missing linux header files which is not included in glibc
2. Disable unsupported fence syn  related features
3. Fixed crash in pipeline cases

Change-Id: I64c9b3fcddf119ccc34ad393244f03ec96618942
Signed-off-by: Xuelian Bai <xuelian.bai@samsung.com>
14 months agoUpgrade to mesa 22.1.7
Xuelian Bai [Mon, 26 Sep 2022 08:24:35 +0000 (16:24 +0800)]
Upgrade to mesa 22.1.7

1. Upgrade version number
2. Remove deprecated option
3. Fix some issues which caused by upgrade of mesa22.1.7

Change-Id: I86a928c9f5e272e209825e6a1b7a8bab30425ddf
Signed-off-by: Xuelian Bai <xuelian.bai@samsung.com>
14 months agoFix to support EGL_SYNC_NATIVE_FENCE_ANDROID on TIZEN
Joonbum Ko [Mon, 9 May 2022 04:36:25 +0000 (13:36 +0900)]
Fix to support EGL_SYNC_NATIVE_FENCE_ANDROID on TIZEN

 - EGL_SYNC_NATIVE_FENCE_TIZEN is not an official extension.
  So we need to support official extensions about egl sync.
   EGL_SYNC_NATIVE_FENCE_TIZEN will be deprecated.

Change-Id: I53c4ea248d4ffaf0190619b861633eda450b44c4
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agofix the fd leak
SooChan Lim [Tue, 19 Apr 2022 03:06:23 +0000 (12:06 +0900)]
fix the fd leak

Change-Id: I67de75fc242ccba1dd41a08784241ced6b898de8

14 months agocheck the master_fd
SooChan Lim [Thu, 7 Apr 2022 09:45:25 +0000 (18:45 +0900)]
check the master_fd

Display Server(Enlightenment) always use the master_fd, so if the process can get the
master_fd from tbm_drm_helper_get_master_fd(), there is no need to get
the authentication information.
If the process does not have the master_fd, it needs to get the
authentication from the master process which is the Display
Server(Enlightenment).

Change-Id: Ib18113468b133c5335f1f280760383e40977062a

14 months agoFix build issue of x86,i586 platform
Tianhao Ni [Mon, 28 Feb 2022 01:18:37 +0000 (09:18 +0800)]
Fix build issue of x86,i586 platform

Change-Id: I15595c08ad24ed3d074705b426e5061aaa68ca03
Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com>
14 months agoUpdate spec file
Tianhao Ni [Fri, 25 Feb 2022 05:37:21 +0000 (13:37 +0800)]
Update spec file

Change-Id: I636231eeb420d8b191e58d0196b52171ed8a080b
Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com>
14 months ago1.Update spec file
Tianhao Ni [Tue, 23 Nov 2021 01:29:36 +0000 (09:29 +0800)]
1.Update spec file
2.Fix GLES31 eglSwapBuffers issue:
- GLES31 CTS, TC will call eglSwapBuffers without any draw call,
  in this case tbm_surface will be NULL, but this should not be
  an error.

Change-Id: I2eeda60f9581c40158ebec328024cb8f107dc646
Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com>
14 months agoFix memory leak issue
Tianhao Ni [Thu, 11 Nov 2021 03:13:55 +0000 (11:13 +0800)]
Fix memory leak issue
- close gem handle in mesa

Change-Id: Ia6ce921fe54e32ff39335d12593e53f24382220d
Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com>
14 months agoUpgrade to 21.2.3
Xuelian Bai [Mon, 11 Oct 2021 08:26:25 +0000 (16:26 +0800)]
Upgrade to 21.2.3

Add llvm support, since SWR in new version needs llvm

Change-Id: I196cb2a89e1080c952172590421bac3f61680a74
Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
14 months agoModify rpath option to support both armv7l and aarch64
Joonbum Ko [Thu, 19 Aug 2021 10:15:26 +0000 (19:15 +0900)]
Modify rpath option to support both armv7l and aarch64

Change-Id: Ib250916f0d8ca096107eb988626fa20e221bda3a
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agoFix build issue.
Joonbum Ko [Thu, 19 Aug 2021 06:13:23 +0000 (15:13 +0900)]
Fix build issue.

Change-Id: I54df67efa3f14779bc278fd90d8403d096ef3a82
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agoAdd rpath option with /hal/lib/
Joonbum Ko [Thu, 19 Aug 2021 04:48:58 +0000 (13:48 +0900)]
Add rpath option with /hal/lib/

Change-Id: I8b31bd3a6db6bad405c9ddd272697a9cd12ad698
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agoChange the build prefix to /hal/
Joonbum Ko [Thu, 29 Jul 2021 10:34:22 +0000 (19:34 +0900)]
Change the build prefix to /hal/

Change-Id: I9fbcdf30f04cc643ab9b4d674529d485aedff00e
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agoDisable build gbm
Changyeon Lee [Mon, 9 Aug 2021 06:35:48 +0000 (15:35 +0900)]
Disable build gbm

display server of tizen doesn't use gbm of mesa

Change-Id: I039a08a2443ff6975245c9a896fc8cc5e6d3cf0c

14 months agoAdd a symbolic link of libvulkan_broadcom.so to /usr/lib
Joonbum Ko [Mon, 26 Jul 2021 06:58:36 +0000 (15:58 +0900)]
Add a symbolic link of libvulkan_broadcom.so to /usr/lib

Change-Id: I7728385f6f00dad1e0f262e057a022175672968c
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agoChange install path to /hal/lib
Joonbum Ko [Thu, 22 Jul 2021 02:07:51 +0000 (11:07 +0900)]
Change install path to /hal/lib

Change-Id: I7b8a8c35cf8826476c7d7401d9948b37284b3128
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agoSupport vkSetPrivateDataEXT/vkGetPrivateDataEXT
Xuelian Bai [Tue, 13 Jul 2021 02:38:23 +0000 (10:38 +0800)]
Support vkSetPrivateDataEXT/vkGetPrivateDataEXT

mesa assume that all object is created inside mesa, but for
VK_OBJECT_TYPE_SWAPCHAIN_KHR type, when we use vulkan_wsi_layer,
the object structure is different from mesa object, so don't use
mesa original object logic.

Change-Id: Iaea7f18e094b1bd1d2c7a4f4e7ecea0b81d9866a
Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
14 months agoEnable vulkan support for mesa:
Tianhao Ni [Mon, 10 May 2021 02:26:31 +0000 (10:26 +0800)]
Enable vulkan support for mesa:

1. Set "USE_VULKAN" to 1 in spec file to enable vulkan support.

Change-Id: I15e9c8a70f88ffc595d8f4a4ffb37d99e9bf214d
Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com>
14 months agoFix coredump for swrast
xuelian.bai [Tue, 20 Apr 2021 15:45:09 +0000 (23:45 +0800)]
Fix coredump for swrast

When LIBGL_ALWAYS_SOFTWARE is enabled, coredump will happen because
tizen_swap_buffers is called.

Change-Id: Ifd048d4f2904064fddf9975aa9d86f6104ee8997
Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
14 months agoFix fence fd leak issue:
nith1989 [Thu, 18 Mar 2021 06:57:08 +0000 (14:57 +0800)]
Fix fence fd leak issue:
- close fence fd when destroy context

Change-Id: I4ec1fe1c2f7de3221802ea53c3e563471cd1a332
Signed-off-by: Tianhao Ni <tianhao.ni@samsung.com>
14 months agoUse _udevrulesdir macro
INSUN PYO [Mon, 30 Nov 2020 05:21:54 +0000 (14:21 +0900)]
Use _udevrulesdir macro

Location of udev rules file is changed from /etc/udev/rules.d to /usr/lib/udev/rules.d.
So, use macro instead of real path.

Change-Id: I5f7aada411f75206fabf86751ee8b6c2702c8b93

14 months agoAdd malloc_trim after builtin_builder release.
Sungguk Na [Mon, 10 Aug 2020 06:16:05 +0000 (15:16 +0900)]
Add malloc_trim after builtin_builder release.

Memory usage pattern of Built-in builder causes large size chunk pools by glibc pool management scheme.
It is not useful ,but just unnecessary expense.
so malloc_trim will help to reduce memory usage in this case.

Change-Id: Ia63fb2050b468e55cd6b740b6a26585ed8e824a5
Signed-off-by: Sungguk Na <sungguk.na@samsung.com>
14 months agoFixed build error in aarch64.
Joonbum Ko [Mon, 10 Aug 2020 05:49:25 +0000 (14:49 +0900)]
Fixed build error in aarch64.

Change-Id: I9a3e9b05fb07e03b3b3aaf39f4038bee39072189
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agoReduced the calling tpl_surface_validate.
Joonbum Ko [Wed, 22 Jul 2020 10:15:06 +0000 (19:15 +0900)]
Reduced the calling tpl_surface_validate.

Change-Id: I92d33fba7cc073dc43cf6babc56778a600148b1a
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agoAdded ttrace points
Joonbum Ko [Tue, 21 Jul 2020 03:37:49 +0000 (12:37 +0900)]
Added ttrace points

Change-Id: Idc9d301b560373d05bc427f171f5f48777deb78c
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agoEnabled the extension EGL_TIZEN_native_fence_sync.
Joonbum Ko [Mon, 20 Jul 2020 10:58:33 +0000 (19:58 +0900)]
Enabled the extension EGL_TIZEN_native_fence_sync.

Change-Id: Ic5be6f92a9ae5fd9db54c0491d5af9aa1838fd66
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months ago Fixed missing server_wait_sync to be called.
Joonbum Ko [Tue, 30 Jun 2020 12:27:27 +0000 (21:27 +0900)]
 Fixed missing server_wait_sync to be called.

 - 'server_wait_sync' should be called from
  'tizen_internal_wait_sync_for_release_fence' with release_fence fd
  received from dequeue, but the part was missing and fixed.

Change-Id: Ic505b2937ef472528a7dae2db486f66cf0cb3626
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agofixed fd leak problem.
Joonbum Ko [Thu, 4 Jun 2020 07:31:31 +0000 (16:31 +0900)]
fixed fd leak problem.

Change-Id: I59e0b8c42f280582b0c0c25b2963786a3a5404d1
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agoImplemented internal_wait_sync with release_fence_fd from tpl_surface.
Joonbum Ko [Wed, 3 Jun 2020 04:25:41 +0000 (13:25 +0900)]
Implemented internal_wait_sync with release_fence_fd from tpl_surface.

Change-Id: Ieb1ddcee8f196e4e7138fc04bbb1fce2547bb92a
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agov3d: Implemented some functions to support eglWaitsync.
Joonbum Ko [Tue, 2 Jun 2020 04:47:22 +0000 (13:47 +0900)]
v3d: Implemented some functions to support eglWaitsync.

 This is a test phase and can be fixed later.

Change-Id: I9670fc27b331b7ac4ccbcb9f659d82f4ab78f058
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agoImplemented frontbuffer rendering mode.
Joonbum Ko [Fri, 10 Jul 2020 07:03:43 +0000 (16:03 +0900)]
Implemented frontbuffer rendering mode.

Change-Id: I9b562a2b70eae9c1334fea0248906f84ba932e9f
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agoAdd support for ttrace
Xuelian [Tue, 23 Jun 2020 10:26:28 +0000 (18:26 +0800)]
Add support for ttrace

1. Add ttrace link in spec file
2. Add header file for ttrace

Change-Id: Ibfbc44f14f5e4b4e34d954249b2b399335134c4b
Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
14 months agoAdd exception handle for multithread case.
Xuelian [Tue, 12 May 2020 11:00:12 +0000 (19:00 +0800)]
Add exception handle for multithread case.

In some cases, main thread got some problem and exit with calling
_eglAtExit, while another thread may still be running, that will
cause assert in mesa.

Change-Id: I6ee87abcb8c818e8a6808cd6098f4061bf7779b2
Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
14 months agoImplement extension EGL_TIZEN_native_fence_sync
Joonbum Ko [Fri, 20 Mar 2020 05:58:36 +0000 (14:58 +0900)]
Implement extension EGL_TIZEN_native_fence_sync

Merged old commit:
Changed the initial setting of dri2_surface to use out_fence_fd.
Change-Id: Ic51d7e2441927010b5889a2328199428c06d6351
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Fixed to use out_fence_fd to wait render done in twe_thread.
Change-Id: I2bee255bcd5eb2697e49a5e8973c03ea65fe0e30
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
v3d_screen: Fixed to support capability for NATIVE_FENCE_FD.
Change-Id: I3335ee417d88e51a904114869fb5ac287622c526
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
v3d_fence: Added function to get fence_fd from dri2.
Change-Id: Ibd86254f2352a01cd993c61b0ab036c721005be0
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Added new extension EGL_TIZEN_native_fence_sync.

      EGL_TIZEN_native_fence_sync
     - Added EGL_SYNC_NATIVE_FENCE_TIZEN to distinguish EGLSyncKHR.
     - Added EGL_SYNC_NATIVE_FENCE_FD_TIZEN to get tizen's native fence fd
      in the sync attribute.
     - Added EGL_NO_NATIVE_FENCE_FD_TIZEN to indicate no native fence fd.
     - The eglDupNativeFenceFDTIZEN function has been added to get an fd to
      indicate when rendering is complete from the egl core.
Change-Id: I6876572ec04b3d1616f6b7e5018dc6647685b536
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Implemented extension EGL_TIZEN_native_fence_sync.
 - this patch is only for the 'tizen' branch
 - Added new API to get native fence fd from driver.
    eglDupNativeFenceFDTIZEN()
Change-Id: I21d46faedbfc46abd4dde03d36560bf941061d38
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agoFix to use TPL_BACKEND_WAYLAND_THREAD.
Joonbum Ko [Wed, 18 Mar 2020 10:40:59 +0000 (19:40 +0900)]
Fix to use TPL_BACKEND_WAYLAND_THREAD.

 - It is a valid backend only for wayland clients.

Change-Id: Ifea5a5b5bd03074f267c4be02d325ed544840753
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
14 months agoFix "close object **" error in vc4_bo_free on RPI3
Xuelian [Wed, 4 Mar 2020 16:35:24 +0000 (00:35 +0800)]
Fix "close object **" error in vc4_bo_free on RPI3

When running case dEQP-GLES2.functional.prerequisite.read_pixels
for deqp-gles2, there will be an error "close object **".
This error is caused by invalid fd, so we call
tbm_drm_helper_get_auth_info  in dri2_initialize_tizen.

Change-Id: I959b404daa33c629ea72c38bfe7838e643eb603d
Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
14 months agoFix resize issue
Xuelian Bai [Tue, 28 May 2019 16:01:10 +0000 (00:01 +0800)]
Fix resize issue
Handle 1x1 issue for driimage

When evas resize window after dequeue, then draw and swapbuffers,
window is shown with old size until next makecurrent.
Add validate_drawable function to check if resize happen each time
makecurrent is called.

For RPI4, render node is used, so buffer is allocated on another
device, when 1x1 issue happen, we need to make sure if driimage
size is changed, then created new if yes.

Merged Commit:
commit 2dc471b0e167693b81c24c9a3f89b985cb98249f
Author: Zhaowei Yuan <zhaowei.yuan@samsung.com>
    - Check if stdraw is NULL before access
      Variable "stdraw" could be NULL in some case, check it before access.

commit cc2dc99365906ea52b645be3bb10f50708d67e84
Author: Xuelian Bai <xuelian.bai@samsung.com>
    - Fix 1x1 issue of task-mgr
      Makecurrent is called just before resize callback is called, so we
      have to check if size is changed when drawcall.

commit 670d77331c986a92bcf2459567ccd6dfc181bc66
Author: Xuelian Bai <xuelian.bai@samsung.com>
    - Fix resize issue

Change-Id: Ieaebe72661a081d496ab6214c1c1526f7d16f19b
Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
    - Handle 1x1 issue for driimage

Change-Id: Id5a463a8db290ca5b80c130ebcdcb13c7786d70c
Signed-off-by: Xuelian Bai <xuelian.bai@samsung.com>
14 months agoFix display issue on RPI4
Xuelian Bai [Thu, 31 Oct 2019 17:06:11 +0000 (01:06 +0800)]
Fix display issue on RPI4

RPI4 has seperated devices for display and render, so when init
Tizen, we open /dev/dri/renderD128 and init v3d screen as renderonly.

Merged commit:
commit 50839c47736cbab7db6a9fb25ea0d983434c56cc
Author: Zhaowei Yuan <zhaowei.yuan@samsung.com>
    - platform_tizen: free driver_name if initialization goes wrong
      Mallocated driver_name needs to be freed if following steps for
      initialization goes wrong, whether hw_accel if set or not

Change-Id: Iffac62ac9717f7a4da589fd51f008968615a6321
Signed-off-by: Xuelian Bai <xuelian.bai@samsung.com>
14 months agoAdd Pbuffer support on Tizen platform
Xuelian [Mon, 17 Feb 2020 12:39:44 +0000 (20:39 +0800)]
Add Pbuffer support on Tizen platform

Merged old commit:
commit f409ef598976a4fd4f74ab4695478b1fc1651c06
Author: Zhaowei Yuan <zhaowei.yuan@samsung.com>
    1. Add EGL_PBUFFER_BIT to surface_type if maskes match
    2. Alloc local buffer when render buffer type is
    "FRONT_LEFT" which will be used by Pbuffer

commit b0dec10d0d0fbc7f77623016f3d986122f718f8b
Author: Xuelian Bai <xuelian.bai@samsung.com>
    Fix crash when query a pbuffer surface
    Pbuffer is not created via TPL, so when query a pbuffer surface,
    we can only call _eglQuerySurface instead of TPL APIs.

Change-Id: Ib9990973f228374a95f60157a3b79069529a62b2
Signed-off-by: Xuelian Bai <xuelian.bai@samsung.com>
14 months agoEGL: Add support for weston
Zhaowei Yuan [Mon, 3 Dec 2018 03:08:44 +0000 (11:08 +0800)]
EGL: Add support for weston

Add support for wayland & drm platforms which are used by weston.
Select EGL platform for weston by setting environment variable:
    export EGL_PLATFORM=wayland

Modifications to mesa.spec:
    Add platforms wayland and drm which is needed by weston
    Enable gbm and pack it into RPM package
Modifications to egl_dri2.h
    Since tizen, drm and wayland are all supported now, remove
    the duplicate definition of "color_buffers" and "back" for
    tizen to avoid from building error.

Merged commit:
commit 7c8922c1ead5875fda90106793c2fcfab2feb9f3
Author: Xiaowei Guan <xiaowei.guan@samsung.com>
    - fix weston build error and app launch error

commit 6e7ce80fc524b78980d702549cf5bbc3a641e6ae
Author: Xiaowei Guan <xiaowei.guan@samsung.com>
    - add wayland-egl code for platform_wayland

commit 5cd0256faa43e376dcd5b5f2c2edd2515aff9c04
Author: Zhaowei Yuan <zhaowei.yuan@samsung.com>
    - EGL: Add support for weston

Change-Id: I58272083b7d110d55800d8b9ad7e7c4f0a6f6077
Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
14 months agodocs: add Readme for Tizen and Readme RPI3 Setup for Tizen
Mun, Gwan-gyeong [Mon, 10 Apr 2017 10:36:58 +0000 (19:36 +0900)]
docs: add Readme for Tizen and Readme RPI3 Setup for Tizen
docs: Add Tizen Binary Download Instructions for RPI3

Readme_for_Tizen explains howto seting up build environment for tizen and geting
build dependancy packages.
Readme_RPI3_Setup_for_Tizen explains How to building RPI3 kernel for tizen and
downloading to tizen platform binaries to rpi3.

Add Tizen Binary Download Instructions for RPI3. it includes which packages
should be installed with Mesa for tizen.

Merged old commit a8f81f8f9382445f072c616e77ce0da72c028480

Change-Id: I44f8cdca5be8c8860d7f6a162889d534068168c1
Signed-off-by: Mun, Gwan-gyeong <kk.moon@samsung.com>
14 months agoegl_dri2: Add support for Tizen
Xuelian [Wed, 20 Nov 2019 09:38:53 +0000 (17:38 +0800)]
egl_dri2: Add support for Tizen

Re-implement _eglLog based on dlog
Add build support for Tizen platform.
Added missed dri2_fini_surface() at tizen_destroy_surface().

Add platform_tizen.c that supports _EGL_PLATFORM_TIZEN. It works with libtpl-egl
(Tizen Porting Layer for egl), libtbm(Tizen Buffer Manager) where back buffers
of windows are backed by GEM objects.

In Tizen a native window has a queue (tbm_surface_queue) of back buffers
allocated by the WL_TBM(wayland client case, WL_TBM is abbreviation of
wayland-tbm protocol) or gbm ( tizen has implements gbm with tbm) or tbm
through tbm_backend.

For each frame, EGL needs to

    dequeue the next back buffer
    render to the buffer
    enqueue the buffer

After enqueuing, the buffer is no longer valid to EGL.

It supports DRI image loader extension, DRI dri2 loader extension and DRI swrast
loader extension.

It supports EGL_NATIVE_SURFACE_TIZEN  target type for eglCreateImageKHR.
(https://www.khronos.org/registry/EGL/extensions/TIZEN/EGL_TIZEN_image_native_surface.txt)

BindWaylandDisplayWL / UnbindWaylandDisplayWL / QueryWaylandBufferWL are
overloaded because tizen platform has its own instead of WL_DRM.

Referenced documents:
https://www.x.org/wiki/Events/XDC2016/Program/XDC2016_Tizen_Window_System_EGL_Vulkan.pdf
https://wiki.tizen.org/wiki/3.0_Porting_Guide/Graphics_and_UI/libtpl-egl
https://wiki.tizen.org/wiki/TBM

egllog: add unlock call preventing the deadlock
Implement dlog for mesa main

_eglLog is a basic log function for mesa, re-implement
it based on dlog here for debug purpose.
Log level can be changed by setting environment variable
EGL_LOG_LEVEL.

Log API for mesa main module are all implemented in file
src/mesa/main/error.c, re-implement them based on dlog
for debug convenience

add configuration of building and packaging for rpi3 ( vc4 gpu driver )
add udev rule files for rpi3 (vc4 drm device)

Mered old commit:
commit f5205524bf20b63c2efe20e99429c9d55543b711
Author: Zhaowei Yuan <zhaowei.yuan@samsung.com>
Date:   Mon May 6 13:52:32 2019 +0800

commit 704bb72470589ede7246af8c6b0a9210df42f1c7
Author: Xuelian <xuelian.bai@samsung.com>
Date:   Wed Nov 20 19:08:41 2019 +0800

commit 247adc92138ad456f5db39acfe5be69748973df3
Author: Joonbum Ko <joonbum.ko@samsung.com>
Date:   Wed Apr 29 20:01:56 2020 +0900

Change-Id: I83348c1cff5f0f59f79bc3c016623adf6fbba32b
Signed-off-by: Xuelian <xuelian.bai@samsung.com>
15 months agoVERSION: bump for 22.3.5 upstream/22.3.5
Eric Engestrom [Wed, 8 Feb 2023 21:05:36 +0000 (21:05 +0000)]
VERSION: bump for 22.3.5

15 months agodocs: add release notes for 22.3.5
Eric Engestrom [Wed, 8 Feb 2023 21:05:31 +0000 (21:05 +0000)]
docs: add release notes for 22.3.5

15 months agoanv: uncompressed views of compressed 3d images are now valid
Iván Briano [Thu, 19 Jan 2023 23:23:56 +0000 (15:23 -0800)]
anv: uncompressed views of compressed 3d images are now valid

There was a VUID-VkImageViewCreateInfo-image-04739 in the Vulkan 1.3
spec that said:

    If image was created with the
    VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag and format is a
    non-compressed format, viewType must not be VK_IMAGE_VIEW_TYPE_3D

That VUID has since been removed, and when a view of a 3D image is
created, with put the depth into the array_len, so it won't be always 1.

Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20803>
(cherry picked from commit 58ababdee6cd6b1e08604033602e4a5f9d5ab7a3)

15 months agoaco: fix imod/omod for gfx11 VOP3 opcodes
Georg Lehmann [Tue, 7 Feb 2023 19:53:12 +0000 (20:53 +0100)]
aco: fix imod/omod for gfx11 VOP3 opcodes

Fixes: d8d99c3c4f2 ("aco: add GFX11 opcode numbers")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21170>
(cherry picked from commit c8adf16278fc02207602e4fafa12b95e6ea8dda0)

15 months agoutil/vbuf: fix multidraw unrolling
Mike Blumenkrantz [Mon, 6 Feb 2023 15:14:24 +0000 (10:14 -0500)]
util/vbuf: fix multidraw unrolling

* drawid needs to be incremented at end of loop
* rescope draw structs to initialize at top of loop

fix #8191

Fixes: 6b07893b31f ("util/vbuf: handle multidraws")

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21139>
(cherry picked from commit 8f5a63ebfe84f0bdaa7959fae79e9d42a17113ac)

15 months agozink: use screen indexing for bindless descriptor set in template bind
Mike Blumenkrantz [Tue, 7 Feb 2023 19:50:16 +0000 (14:50 -0500)]
zink: use screen indexing for bindless descriptor set in template bind

Fixes: 8636717270f ("zink: add a "compact" descriptor mode")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
(cherry picked from commit faaf6f95cc478da6ea4f8416bdae7080d9fca77a)

15 months agozink: make last_vertex_stage the first bit in zink_vs_key_base
Mike Blumenkrantz [Mon, 6 Feb 2023 20:26:43 +0000 (15:26 -0500)]
zink: make last_vertex_stage the first bit in zink_vs_key_base

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
(cherry picked from commit 77d8cd9c07adb5da818ed14c7a60341e6289a308)

15 months agozink: fix gpl lib hashing
Mike Blumenkrantz [Tue, 7 Feb 2023 18:53:28 +0000 (13:53 -0500)]
zink: fix gpl lib hashing

this was including the generated tcs bits, which was likely to be wrong
and thus break optimal key hashing, requiring more pipelines

it also wasn't setting the optimal key value correctly during precompile,
which meant the wrong hash value was used and the precompiled libs were never
actually accessible

cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
(cherry picked from commit 4cf54e2ed22023c986f70711bddd0e934aa5683c)

15 months agozink: set zs feedback loop bit from driver workaround on ctx create
Mike Blumenkrantz [Tue, 7 Feb 2023 17:50:10 +0000 (12:50 -0500)]
zink: set zs feedback loop bit from driver workaround on ctx create

this may otherwise not be set until the cache has been broken

Fixes: 56fb2580642 ("zink: replace mixed_zs with zs feedback loops")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
(cherry picked from commit bbae237258a40c370caffb58602745f1d36f66ba)

15 months agozink: set gfx feedback loop bit in pipeline state for driver workaround
Mike Blumenkrantz [Tue, 7 Feb 2023 17:48:33 +0000 (12:48 -0500)]
zink: set gfx feedback loop bit in pipeline state for driver workaround

this needs to be set on context create or it may never get set

Fixes: 645f2da3faf ("zink: always set VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT sometimes")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
(cherry picked from commit 0cb326cc74464f4e7f57de5c4d740e080f5e5b70)

15 months agozink: add a define for testing that an optimal key is the default
Mike Blumenkrantz [Mon, 6 Feb 2023 22:35:51 +0000 (17:35 -0500)]
zink: add a define for testing that an optimal key is the default

tcs values here are ignored since they only matter for generated tcs

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
(cherry picked from commit 7c021cc5f05d24211f327ea16d686f4bd9986465)

15 months agozink: add a define for the "default" optimal key
Mike Blumenkrantz [Mon, 6 Feb 2023 20:57:45 +0000 (15:57 -0500)]
zink: add a define for the "default" optimal key

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
(cherry-picked from 1f08a6dcdbf382a7586b703379969bdd3113c02e)

15 months agozink: fix pointcoord y inversion
SoroushIMG [Wed, 1 Feb 2023 20:37:26 +0000 (20:37 +0000)]
zink: fix pointcoord y inversion

Point sprite coordinates in general need to be inverted,
not just the texcoords converted to point sprite.

Move point coord y inversion out to its own pass.
Fixes GTF-GL46.gtf21.GL2FixedTests.point_sprites.point_sprites
with FBO dEQP surface.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21050>
(cherry picked from commit 782f1e9e010452850853b9791e673f2e1a7a671e)

15 months agolavapipe: Fix bad array index scale factor in lvp_inline_uniforms pass
Ian Romanick [Mon, 6 Feb 2023 17:41:36 +0000 (09:41 -0800)]
lavapipe: Fix bad array index scale factor in lvp_inline_uniforms pass

A few lines earlier uni_offsets is accessed with ubo scaled by
PIPE_MAX_CONSTANT_BUFFERS:

   if (uni_offsets[ubo * PIPE_MAX_CONSTANT_BUFFERS + i] == offset)

Found by inspection.

Looking at the before and after NIR code for
dEQP-VK.graphicsfuzz.cov-int-initialize-from-multiple-large-arrays,
using the correct indexing appears to enable the pass to inline an
additional uniform. My guess is that when a uniform is used more than
once, the first loop wouldn't find the offset recored in the table
because it was recorded at the wrong location.

Fixes: d23a9380dd6 ("lavapipe: implement extreme uniform inlining")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21144>
(cherry picked from commit a7696a4d98bcf4cdfae1c56a21c4deb3a9ce004f)

15 months agoaco: fix out-of-bounds access when moving s_mem(real)time across SMEM
Rhys Perry [Fri, 3 Feb 2023 17:27:52 +0000 (17:27 +0000)]
aco: fix out-of-bounds access when moving s_mem(real)time across SMEM

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8224
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21138>
(cherry picked from commit fad1f716dd831fba4c380bce1cf76bffc11be6d6)

15 months agolavapipe: disable VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT for int formats
Mike Blumenkrantz [Fri, 3 Feb 2023 15:24:42 +0000 (10:24 -0500)]
lavapipe: disable VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT for int formats

this is unsupported and undefined by the spec

cc: mesa-stable

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21099>
(cherry picked from commit 7d8e2db9f95747895b6cd137cb1db445b3a1a66f)

15 months agov3dv: ensure we apply binning syncs to secondary command buffers
Iago Toral Quiroga [Tue, 7 Feb 2023 12:06:48 +0000 (13:06 +0100)]
v3dv: ensure we apply binning syncs to secondary command buffers

Currently, we postpone binning syncs until we record draw calls
and can validate if any of them require accessing protected
resources in the binning stage, however, if the draw calls are
recorded in a secondary command buffer and the barriers have
been recorded in the primary command buffer, we won't apply the
binning sync in the secondary when we record the draw calls
and so we must apply it when we execute the secondary in the
primary.

Fixes flakyness in:
dEQP-VK.api.command_buffers.record_many_draws_secondary_2

cc: mesa-stable

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21162>
(cherry picked from commit fec15a225f603f7a980241ce6b7fad35dfc6aff4)

15 months agov3dv: ensure at least V3D_CL_MAX_INSTR_SIZE bytes in last CL instruction
Iago Toral Quiroga [Mon, 6 Feb 2023 12:16:12 +0000 (13:16 +0100)]
v3dv: ensure at least V3D_CL_MAX_INSTR_SIZE bytes in last CL instruction

The CLE parser in the sim will read this many bytes for each instruction
in a CL, so we should ensure we have at least that many bytes available
in the BO when reading the last instruction, otherwise we can trigger
a GMP violation. It is not clear whether this behavior applies to real
hardware too.

cc: mesa-stable

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21162>
(cherry picked from commit c2601f06908434aaddd6b1db5e995bbda22d2a72)

15 months agomeson: Ignore unused variables when assertions are disabled
pal1000 [Mon, 6 Feb 2023 23:35:45 +0000 (01:35 +0200)]
meson: Ignore unused variables when assertions are disabled

Fixes: 46b099e3
("meson: Ignore unused variables in release builds")

46b099e3 has some issues:
- it doesn't enable unused variables warning on release builds
with assertions enabled;
- it doesn't disable unused variables warning on debug builds
with assertions disabled;
- it doesn't disable unused variables warning when building
with MSVC and assertions are disabled regardless of buildtype,
see #8147. 3/4 regressions reported there have this limitation
alone as root cause.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21154>
(cherry picked from commit 4347072443867f6337c33ffc330263bb851d9839)

15 months agoloader: unregister special event in loader_dri3_drawable_fini
Yuxuan Shui [Mon, 6 Feb 2023 01:22:47 +0000 (01:22 +0000)]
loader: unregister special event in loader_dri3_drawable_fini

This was inadvertently removed in 98a6cfd3953 and causes continuous
memory leaks as events are being received after the context has been
unbound.

Fixes: 3170b63314f ("loader: Add infrastructure for tracking active CRTC resources")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8238
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21128>
(cherry picked from commit 27a89a0903f2c541541846e8d909bb67af242d5e)

15 months agozink: fix max acquired image count
Mike Blumenkrantz [Fri, 3 Feb 2023 13:40:25 +0000 (08:40 -0500)]
zink: fix max acquired image count

according to spec, the maximum number of acquired images can be calculated with

swapchain_size - VkSurfaceCapabilitiesKHR::minImageCount + 1

the previous calculation was both wrong and occurring in the wrong place,
so this corrects both issues

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21095>
(cherry picked from commit 89cf0a3bdc9949c54d8d7965a2d51bed91b6d10a)

15 months agozink: clear null image surfaces to 0
SoroushIMG [Sun, 5 Feb 2023 14:18:16 +0000 (14:18 +0000)]
zink: clear null image surfaces to 0

GL Spec says that imageLoad from incomplete images must return 0.
This is not really spec compliant as for proper behavior nullDescriptor
and robustImageAccess2 is needed.
A workaround for lack of either of these requires a shader variant.
Clearing the null surface and hoping the app doesn't write to the image
is closer to spec, while avoiding a shader recompile.

KHR-GL46.shader_image_load_store.incomplete_textures tests this.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21135>
(cherry picked from commit 22e91af1a77361249b9c71ee609b67ec187e612c)

15 months agozink: fix leak when rebinding same image surface
SoroushIMG [Sun, 5 Feb 2023 17:31:47 +0000 (17:31 +0000)]
zink: fix leak when rebinding same image surface

simple way to reproduce this is to run these 4 together:
KHR-GL46.gpu_shader5.images_array_indexing
KHR-GL46.shader_image_load_store.advanced-allMips
KHR-GL46.shader_image_load_store.advanced-sso-simple
KHR-GL46.shader_image_load_store.incomplete_textures

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21134>
(cherry picked from commit 104040b5c7135403194005951e57197ef76438a6)

15 months agozink: only save frag const buffers when used by blit
SoroushIMG [Sun, 5 Feb 2023 15:43:45 +0000 (15:43 +0000)]
zink: only save frag const buffers when used by blit

fixes upload manager constant buffer leak.
zink only needs to save the const buffer for stencil fallback blits.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21134>
(cherry picked from commit 4c647c9e259a6a0fc1499c377a07bfd0ba902079)

15 months agoradv: set state.vbo_misaligned_mask_invalid in radv_bind_vs_input_state
Rhys Perry [Wed, 25 Jan 2023 18:00:54 +0000 (18:00 +0000)]
radv: set state.vbo_misaligned_mask_invalid in radv_bind_vs_input_state

Found by inspection. Something probably hangs because of this, but I don't
know what.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: c199a5160a0 ("radv: bind the VS input state for prologs created with GPL")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20913>
(cherry picked from commit 10a5035c836a852fcdc7a4532d9ec1af5fd3464d)

15 months agoac/llvm: Fix validation error with global io
Konstantin Seurer [Wed, 4 Jan 2023 15:49:08 +0000 (16:49 +0100)]
ac/llvm: Fix validation error with global io

Fixes: afd645f0576 ("ac/llvm: remove LLVMBuildGEP usages")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20521>
(cherry picked from commit 10ac51a52bad2c2378b2d847eae23e1366ddc46f)

15 months agoac/nir/ngg: Include culled primitives in query.
Timur Kristóf [Wed, 1 Feb 2023 12:07:42 +0000 (13:07 +0100)]
ac/nir/ngg: Include culled primitives in query.

Vulkan spec 18.8. Primitives Generated Queries:

When a generated primitive query for a vertex stream is active,
the primitives-generated count is incremented every time a
primitive emitted to that stream reaches the transform feedback
stage, whether or not transform feedback is active.

We can see the order of stages in chapter 27 Fixed-Function
Vertex Post-Processing, which shows that the transform feedback
stage is before rasterization (and therefore culling).

Conclusion is that culled primitives should be included
in the primitives generated query.

This commit makes sure to emit the primitives generated query
code before culling and uses the input primitive count passed
to the current wave instead of the exec mask after culling.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21037>
(cherry picked from commit 3a819bd22ec5a7eea2e0e337977cbc0af9e38032)

15 months agozink: fix cap check for arb sparse texture2
SoroushIMG [Sat, 4 Feb 2023 17:44:40 +0000 (17:44 +0000)]
zink: fix cap check for arb sparse texture2

arb_sparse_texture2 also enables multisampled sparse textures.
bring back the check for msaa support.

fixes #8229

Fixes: 4f8ba2b9aae ("zink: fix sparse residency query and minLOD feature checks")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21121>
(cherry picked from commit 8f928a95e167423320af711b21270a8212f34628)

15 months agozink: fix sparse residency query and minLOD feature checks
SoroushIMG [Mon, 30 Jan 2023 18:53:19 +0000 (18:53 +0000)]
zink: fix sparse residency query and minLOD feature checks

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21013>
(cherry picked from commit 4f8ba2b9aae265dfc56a62e85cd5eab3c4c718f3)

15 months agomeson: combine checks for linker --gc-sections support
Dylan Baker [Thu, 2 Feb 2023 21:05:33 +0000 (13:05 -0800)]
meson: combine checks for linker --gc-sections support

We first do an incomplete check for whether the linker supports
--gc-sections, then potentially add C and C++ arguments assuming that it
works, then later do a complete check to see if it actually works and
use --gc-sections. This means we can end up putting functions and data
in separate sections when we can't gc them.

Combine the checks, do less work, and be more accurate.

fixes: f51ce21e4e0bf7efabe58afb4a2cd6b9f98d9505
       ("meson: Drop adding -Wl,--gc-sections to project c/cpp arguments.")

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21083>
(cherry picked from commit fd9b50aa1c07512c46ec981f19ea68fa4b8d7b4f)

15 months agoac/nir/ngg: fix clip dist culling mask uninitialized
Qiang Yu [Sat, 14 Jan 2023 14:06:32 +0000 (22:06 +0800)]
ac/nir/ngg: fix clip dist culling mask uninitialized

Fixes: f75452918b2 ("ac/nir/ngg: support clipdist culling")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
(cherry picked from commit d798214c7b25b0bf2ce6b094475913a1f72585b8)

15 months agoradv: Disable NGG culling when conservative overestimation is used.
Timur Kristóf [Mon, 30 Jan 2023 14:23:12 +0000 (15:23 +0100)]
radv: Disable NGG culling when conservative overestimation is used.

Even when small primitive culling is disabled, the face culling algorithm
in ac_nir_cull can delete tiny triangles when their area is almost zero.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20987>
(cherry picked from commit 3508597aa1b88d1b5a6f78ad53d8abcc32cde2c9)

15 months agoanv: handle ATTACHMENT_OPTIMAL layout
Constantine Shablya [Thu, 2 Feb 2023 08:45:16 +0000 (10:45 +0200)]
anv: handle ATTACHMENT_OPTIMAL layout

Closes: #8216
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21066>
(cherry picked from commit 9b3b7e509106976b131df85f0462df299a44c80f)

15 months agoamd: fix typo in shadowed uconfig registers on gfx11
Marek Olšák [Fri, 27 Jan 2023 23:02:37 +0000 (18:02 -0500)]
amd: fix typo in shadowed uconfig registers on gfx11

It used an invalid offset, which hung.

Fixes: f24f8665dbe2a - ac: implement register shadowing for gfx11

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
(cherry picked from commit 76472c850b7f93a5389c473a9cf87685ad97cb72)

15 months agoamd: fix tile_swizzle on gfx11 - should be shifted by 10 bits, not 8
Marek Olšák [Tue, 24 Jan 2023 07:44:48 +0000 (02:44 -0500)]
amd: fix tile_swizzle on gfx11 - should be shifted by 10 bits, not 8

This reverts the radv_adjust_tile_swizzle change to unify the code.

Fixes: 529eb739fc4 - radeonsi/gfx11: add CB deltas

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
(cherry picked from commit 47f598a183e849dfee4a587b51074664ee778312)

15 months agoamd: split GFX1103 into GFX1103_R1 and GFX1103_R2
Marek Olšák [Tue, 24 Jan 2023 08:00:38 +0000 (03:00 -0500)]
amd: split GFX1103 into GFX1103_R1 and GFX1103_R2

Fixes: caa09f66ae4 - amd: add chip identification for gfx1100-1103

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
(cherry picked from commit 84d59cdb5971424a4297e288b852c8cc15c46163)

15 months agoradeonsi/gfx11: unset SAMPLE_MASK_TRACKER_WATERMARK to fix hangs
Marek Olšák [Tue, 24 Jan 2023 04:08:36 +0000 (23:08 -0500)]
radeonsi/gfx11: unset SAMPLE_MASK_TRACKER_WATERMARK to fix hangs

Same as PAL.

Fixes: 529eb739fc4 - radeonsi/gfx11: add CB deltas

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
(cherry picked from commit 66d11391f76c0892388d933282fbc74028d9edc4)

15 months agoradeonsi: fix RB+ blending with sRGB formats
Marek Olšák [Tue, 24 Jan 2023 10:52:17 +0000 (05:52 -0500)]
radeonsi: fix RB+ blending with sRGB formats

The epsilon for 8bpc is for the linear colorspace. There is no epsilon
for sRGB.

Fixes: 17021efc742 - radeonsi: adjust RB+ blend optimization settings

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
(cherry picked from commit 8556b3db71683fc0393b7f75b0317890c8c0ae4e)

15 months agoetnaviv: fix double scanout import of multiplanar resources
Lucas Stach [Mon, 30 Jan 2023 17:58:30 +0000 (18:58 +0100)]
etnaviv: fix double scanout import of multiplanar resources

etna_resource_from_handle() is called for each plane of a multiplanar
resource, so there is no point in looping over all planes to do the
renderonly scanout import. In fact that will cause us to lose track
of the scanout imports from later planes when the earlier planes are
redoing the import, overwriting the pointer to the allocated
renderonly_scanout struct.

Drop the loop and just do the import for the current plane.

Fixes: 826f95778a4e ("etnaviv: always try to create KMS side handles for imported resources")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20993>
(cherry picked from commit 175732bb51c81513ae05f9313d6df7c0631ef159)

15 months agoRevert "radeonsi: enable glthread by default"
Marek Olšák [Thu, 2 Feb 2023 23:21:39 +0000 (18:21 -0500)]
Revert "radeonsi: enable glthread by default"

This reverts commit d6fabe49cd72fb7f7087b12efd8a9e3371e36c01.

It has issues that are not worth fixing in this release branch in my opinion.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21087>

15 months ago.pick_status.json: Mark d23b3a13943576bbb8dd0fea12ac717c40b376e1 as denominated
Eric Engestrom [Thu, 2 Feb 2023 16:43:21 +0000 (16:43 +0000)]
.pick_status.json: Mark d23b3a13943576bbb8dd0fea12ac717c40b376e1 as denominated

15 months agointel/fs: Always stall between the fences on Gen11+
Sagar Ghuge [Mon, 30 Jan 2023 18:41:37 +0000 (10:41 -0800)]
intel/fs: Always stall between the fences on Gen11+

Be conservative in Gfx11+ and always stall in a fence.  Since there are
two different fences, and shader might want to synchronize between them.

This change also brings back the original code block for the stall
between the fence and comment from the commit
b390ff35170fdc2b7f1fb1709a79d81edcd56981.

v2: (Caio)
 - Re-arrange code block.
 - Adjust comment.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6958

Fixes: f7262462 ("intel/fs: Rework fence handling in brw_fs_nir.cpp")
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Tested-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20996>
(cherry picked from commit 0c083d29a55bf20a993eab82786d583403582c8c)

15 months ago.pick_status.json: Mark a568a5492f1dd7eb8c08247b74df2aae498b0863 as denominated
Eric Engestrom [Thu, 2 Feb 2023 12:24:49 +0000 (12:24 +0000)]
.pick_status.json: Mark a568a5492f1dd7eb8c08247b74df2aae498b0863 as denominated

15 months agoaco: limit VALUPartialForwardingHazard search
Rhys Perry [Thu, 26 Jan 2023 16:14:26 +0000 (16:14 +0000)]
aco: limit VALUPartialForwardingHazard search

Complicated CFG and lots of SALU can cause this to take an extremely long
time to finish.

Fixes
dEQP-VK.graphicsfuzz.cov-value-tracking-selection-dag-negation-clamp-loop
and Monster Hunter Rise demo compile times.

fossil-db (gfx1100):
Totals from 57 (0.04% of 134574) affected shaders:
Instrs: 170919 -> 171165 (+0.14%)
CodeSize: 860144 -> 861128 (+0.11%)
Latency: 961466 -> 961505 (+0.00%)
InvThroughput: 127598 -> 127608 (+0.01%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8153
Fixes: 5806f0246fd ("aco/gfx11: workaround VALUPartialForwardingHazard")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20941>
(cherry picked from commit bfd4ac4581bae0d36b2c58524131f91c7c0d27ce)

15 months agointel/ds: Fix crash when allocating more intel_ds_queues than u_vector was initialized
José Roberto de Souza [Mon, 23 Jan 2023 20:09:56 +0000 (12:09 -0800)]
intel/ds: Fix crash when allocating more intel_ds_queues than u_vector was initialized

u_vector_add() don't keep the returned pointers valid.
After the initial size allocated in u_vector_init() is reached it will
allocate a bigger buffer and copy data from older buffer to the new
one and free the old buffer, making all the previous pointers returned
by u_vector_add() invalid and crashing the application when trying to
access it.

This is reproduced when running
dEQP-VK.synchronization.signal_order.timeline_semaphore.* in DG2 SKUs
that has 4 CCS engines, INTEL_COMPUTE_CLASS=1 is set and of course
perfetto build is enabled.

To fix this issue here I'm moving the storage/allocation of
struct intel_ds_queue to struct anv_queue/iris_batch and using
struct list_head to maintain a chain of intel_ds_queue of the
intel_ds_device.
This allows us to append or remove queues dynamically in future if
necessary.

Fixes: e760c5b37be9 ("anv: add perfetto source")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20977>
(cherry picked from commit 8092bc2158ebb8a5f85e0ec569387c5dcd0d1627)

15 months agointel/ds: Nuke intel_ds_queue::queue_id
José Roberto de Souza [Mon, 23 Jan 2023 21:02:34 +0000 (13:02 -0800)]
intel/ds: Nuke intel_ds_queue::queue_id

queue_id is not used anywhere.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20888>
(cherry picked from commit 5ccc2049fae591d1baf6f581bbd0e3953c0ee5fa)

15 months agoaco/spill: always end spill vgpr after control flow
Rhys Perry [Tue, 10 Jan 2023 17:33:52 +0000 (17:33 +0000)]
aco/spill: always end spill vgpr after control flow

To fix a hypothetical issue:

v0 = start_linear_vgpr
if (...) {

} else {
   use_linear_vgpr(v0)
}
v0 = phi

We need a p_end_linear_vgpr to ensure that the phi does not use the same
VGPR as the linear VGPR.

This is also much simpler.

fossil-db (gfx1100):
Totals from 1195 (0.89% of 134574) affected shaders:
Instrs: 4123856 -> 4123826 (-0.00%); split: -0.00%, +0.00%
CodeSize: 21461256 -> 21461100 (-0.00%); split: -0.00%, +0.00%
Latency: 62816001 -> 62812999 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 9339049 -> 9338564 (-0.01%); split: -0.01%, +0.00%
Copies: 304028 -> 304005 (-0.01%); split: -0.02%, +0.01%
PreVGPRs: 115761 -> 115762 (+0.00%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20621>
(cherry picked from commit bbc5247bf71cebfdb2ee79646bd2231a909a74eb)

15 months agoaco: end reduce tmp after control flow, when used within control flow
Rhys Perry [Tue, 10 Jan 2023 15:29:15 +0000 (15:29 +0000)]
aco: end reduce tmp after control flow, when used within control flow

In the case of:

v0 = start_linear_vgpr
if (...) {

} else {
   use_linear_vgpr(v0)
}
v0 = phi

We need a p_end_linear_vgpr to ensure that the phi does not use the same
VGPR as the linear VGPR.

fossil-db (gfx1100):
Totals from 3763 (2.80% of 134574) affected shaders:
MaxWaves: 90296 -> 90164 (-0.15%)
Instrs: 6857726 -> 6856608 (-0.02%); split: -0.03%, +0.01%
CodeSize: 35382188 -> 35377688 (-0.01%); split: -0.02%, +0.01%
VGPRs: 234864 -> 235692 (+0.35%); split: -0.01%, +0.36%
Latency: 47471923 -> 47474965 (+0.01%); split: -0.03%, +0.04%
InvThroughput: 5640320 -> 5639736 (-0.01%); split: -0.04%, +0.03%
VClause: 93098 -> 93107 (+0.01%); split: -0.01%, +0.02%
SClause: 214137 -> 214130 (-0.00%); split: -0.00%, +0.00%
Copies: 369895 -> 369305 (-0.16%); split: -0.31%, +0.15%
Branches: 164996 -> 164504 (-0.30%); split: -0.30%, +0.00%
PreVGPRs: 210655 -> 211438 (+0.37%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20621>
(cherry picked from commit 44fdd2ebcb271011665dd100ba9ef6852cddb22e)

15 months ago.pick_status.json: Mark 13de23ea07dd7e1340fd9b72367996fa3c2433ee as denominated
Eric Engestrom [Thu, 2 Feb 2023 12:09:51 +0000 (12:09 +0000)]
.pick_status.json: Mark 13de23ea07dd7e1340fd9b72367996fa3c2433ee as denominated

15 months agozink: always unref old images when adding new binds
Mike Blumenkrantz [Mon, 23 Jan 2023 21:34:31 +0000 (16:34 -0500)]
zink: always unref old images when adding new binds

at some point this was correct, but refactoring has since occurred,
and this ends up leaking storage image objects

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20867>
(cherry picked from commit d745e3b0ab4614136f1c8d93feb54b612fd58d3f)

15 months agozink: stop leaking push descriptor templates
Mike Blumenkrantz [Mon, 23 Jan 2023 21:08:48 +0000 (16:08 -0500)]
zink: stop leaking push descriptor templates

templates[ZINK_DESCRIPTOR_TYPE_UNIFORMS] needs to be deleted, which
requires a larger iterator

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20867>
(cherry picked from commit dd733034aa117294be0f06b5b973b18d1c341666)

15 months agozink: don't add dmabuf export type if dmabuf isn't supported
Mike Blumenkrantz [Thu, 19 Jan 2023 18:22:30 +0000 (13:22 -0500)]
zink: don't add dmabuf export type if dmabuf isn't supported

avoid trying to create dmabuf-exportable resources too

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20791>
(cherry picked from commit 01d2e7afce562013a8cb9b6b9fd1190e317e896a)

15 months agoradv: fix RB+ for SRGB formats
Samuel Pitoiset [Mon, 30 Jan 2023 08:16:50 +0000 (09:16 +0100)]
radv: fix RB+ for SRGB formats

This should be set for linear colorspace only.

Ported from RadeonSI.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20982>
(cherry picked from commit c8a575eb3098282f495948b728abd45768dc5d01)

15 months ago.pick_status.json: Mark 47852b9ff45e73f8f6773a1598cf872c6ee6207f as denominated
Eric Engestrom [Thu, 2 Feb 2023 12:03:34 +0000 (12:03 +0000)]
.pick_status.json: Mark 47852b9ff45e73f8f6773a1598cf872c6ee6207f as denominated

15 months agoradv: Shift left the tile swizzle more on GFX11.
Bas Nieuwenhuizen [Mon, 30 Jan 2023 01:54:19 +0000 (02:54 +0100)]
radv: Shift left the tile swizzle more on GFX11.

ac/surface puts the raw pip_bank_xor there, which needs the extra
shift for the actual tile_swizzle.

(I think long term we should refactor this in ac/surface but for
 now lets fix like radeonsi to avoid race conditions.)

CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20979>
(cherry picked from commit b0a9772cc6154e29ba6e3d21a91096dd891ef302)

15 months agoradv: Set FDCC_CONTROL SAMPLE_MASK_TRACKER_WATERMARK
Bas Nieuwenhuizen [Mon, 30 Jan 2023 01:31:41 +0000 (02:31 +0100)]
radv: Set FDCC_CONTROL SAMPLE_MASK_TRACKER_WATERMARK

Might cause hangs according to comments. Syncs with radeonsi/PAL.

Fixes: e210ffb4d0d ("radv: update framebuffer registers on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20979>
(cherry picked from commit d321bc1323b02de92a095397830c9296996e16b3)