diff options
author | Xuelian Bai <xuelian.bai@samsung.com> | 2023-02-23 17:01:12 +0800 |
---|---|---|
committer | Xuelian Bai <xuelian.bai@samsung.com> | 2023-08-15 14:02:15 +0800 |
commit | a69294ca3dd95a5dbf74dcf72a14c6b0c9268de6 (patch) | |
tree | c315af7529cbd3b839e9a1a61035595c566e3995 | |
parent | 214093b11c1497342656c8b885110a0620ae95be (diff) | |
download | mesa-a69294ca3dd95a5dbf74dcf72a14c6b0c9268de6.tar.gz mesa-a69294ca3dd95a5dbf74dcf72a14c6b0c9268de6.tar.bz2 mesa-a69294ca3dd95a5dbf74dcf72a14c6b0c9268de6.zip |
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>
-rw-r--r-- | include/EGL/eglext.h | 1 | ||||
-rw-r--r-- | include/linux/dma-buf.h | 50 | ||||
-rw-r--r-- | include/linux/sync_file.h | 98 | ||||
-rw-r--r-- | packaging/mesa.spec | 2 | ||||
-rw-r--r-- | src/broadcom/vulkan/v3dv_device.c | 7 | ||||
-rw-r--r-- | src/broadcom/vulkan/v3dv_pipeline_cache.c | 25 | ||||
-rw-r--r-- | src/egl/main/eglapi.c | 2 |
7 files changed, 160 insertions, 25 deletions
diff --git a/include/EGL/eglext.h b/include/EGL/eglext.h index 9d5915ae9d1..43e9fa7aacb 100644 --- a/include/EGL/eglext.h +++ b/include/EGL/eglext.h @@ -1498,7 +1498,6 @@ EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDTIZEN (EGLDisplay dpy, EGLSyncKHR s #endif /* EGL_TIZEN_native_fence_sync */ #include <EGL/eglmesaext.h> -#include <EGL/eglextchromium.h> #ifdef __cplusplus } diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h new file mode 100644 index 00000000000..7f30393b92c --- /dev/null +++ b/include/linux/dma-buf.h @@ -0,0 +1,50 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +/* + * Framework for buffer objects that can be shared across devices/subsystems. + * + * Copyright(C) 2015 Intel Ltd + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef _DMA_BUF_UAPI_H_ +#define _DMA_BUF_UAPI_H_ + +#include <linux/types.h> + +/* begin/end dma-buf functions used for userspace mmap. */ +struct dma_buf_sync { + __u64 flags; +}; + +#define DMA_BUF_SYNC_READ (1 << 0) +#define DMA_BUF_SYNC_WRITE (2 << 0) +#define DMA_BUF_SYNC_RW (DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE) +#define DMA_BUF_SYNC_START (0 << 2) +#define DMA_BUF_SYNC_END (1 << 2) +#define DMA_BUF_SYNC_VALID_FLAGS_MASK \ + (DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END) + +#define DMA_BUF_NAME_LEN 32 + +#define DMA_BUF_BASE 'b' +#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync) + +/* 32/64bitness of this uapi was botched in android, there's no difference + * between them in actual uapi, they're just different numbers. + */ +#define DMA_BUF_SET_NAME _IOW(DMA_BUF_BASE, 1, const char *) +#define DMA_BUF_SET_NAME_A _IOW(DMA_BUF_BASE, 1, u32) +#define DMA_BUF_SET_NAME_B _IOW(DMA_BUF_BASE, 1, u64) + +#endif diff --git a/include/linux/sync_file.h b/include/linux/sync_file.h new file mode 100644 index 00000000000..ee2dcfb3d66 --- /dev/null +++ b/include/linux/sync_file.h @@ -0,0 +1,98 @@ +/* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */ +/* + * Copyright (C) 2012 Google, Inc. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#ifndef _UAPI_LINUX_SYNC_H +#define _UAPI_LINUX_SYNC_H + +#include <linux/ioctl.h> +#include <linux/types.h> + +/** + * struct sync_merge_data - data passed to merge ioctl + * @name: name of new fence + * @fd2: file descriptor of second fence + * @fence: returns the fd of the new fence to userspace + * @flags: merge_data flags + * @pad: padding for 64-bit alignment, should always be zero + */ +struct sync_merge_data { + char name[32]; + __s32 fd2; + __s32 fence; + __u32 flags; + __u32 pad; +}; + +/** + * struct sync_fence_info - detailed fence information + * @obj_name: name of parent sync_timeline +* @driver_name: name of driver implementing the parent +* @status: status of the fence 0:active 1:signaled <0:error + * @flags: fence_info flags + * @timestamp_ns: timestamp of status change in nanoseconds + */ +struct sync_fence_info { + char obj_name[32]; + char driver_name[32]; + __s32 status; + __u32 flags; + __u64 timestamp_ns; +}; + +/** + * struct sync_file_info - data returned from fence info ioctl + * @name: name of fence + * @status: status of fence. 1: signaled 0:active <0:error + * @flags: sync_file_info flags + * @num_fences number of fences in the sync_file + * @pad: padding for 64-bit alignment, should always be zero + * @sync_fence_info: pointer to array of structs sync_fence_info with all + * fences in the sync_file + */ +struct sync_file_info { + char name[32]; + __s32 status; + __u32 flags; + __u32 num_fences; + __u32 pad; + + __u64 sync_fence_info; +}; + +#define SYNC_IOC_MAGIC '>' + +/** + * Opcodes 0, 1 and 2 were burned during a API change to avoid users of the + * old API to get weird errors when trying to handling sync_files. The API + * change happened during the de-stage of the Sync Framework when there was + * no upstream users available. + */ + +/** + * DOC: SYNC_IOC_MERGE - merge two fences + * + * Takes a struct sync_merge_data. Creates a new fence containing copies of + * the sync_pts in both the calling fd and sync_merge_data.fd2. Returns the + * new fence's fd in sync_merge_data.fence + */ +#define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 3, struct sync_merge_data) + +/** + * DOC: SYNC_IOC_FILE_INFO - get detailed information on a sync_file + * + * Takes a struct sync_file_info. If num_fences is 0, the field is updated + * with the actual number of fences. If num_fences is > 0, the system will + * use the pointer provided on sync_fence_info to return up to num_fences of + * struct sync_fence_info, with detailed fence information. + */ +#define SYNC_IOC_FILE_INFO _IOWR(SYNC_IOC_MAGIC, 4, struct sync_file_info) + +#endif /* _UAPI_LINUX_SYNC_H */ diff --git a/packaging/mesa.spec b/packaging/mesa.spec index dc99dc70e94..819787777ed 100644 --- a/packaging/mesa.spec +++ b/packaging/mesa.spec @@ -1,5 +1,5 @@ Name: mesa -Version: 22.1.7 +Version: 22.3.5 Release: 0 License: MIT and Apache-2.0 and SGI Free Software License B v2.0 and BSD-3-Clause Summary: System for rendering interactive 3-D graphics diff --git a/src/broadcom/vulkan/v3dv_device.c b/src/broadcom/vulkan/v3dv_device.c index d4d2eb7f914..99745a8b567 100644 --- a/src/broadcom/vulkan/v3dv_device.c +++ b/src/broadcom/vulkan/v3dv_device.c @@ -928,7 +928,10 @@ create_physical_device(struct v3dv_instance *instance, */ device->drm_syncobj_type.features &= ~VK_SYNC_FEATURE_TIMELINE; -#if using_v3d_simulator + /* There is still deadlock issue in dEQP-VK.api.external.fence.sync_fd.export* + * cases, so disable external sync for now + * xuelian.bai */ +//#if using_v3d_simulator /* There are CTS tests which do the following: * * 1. Create a command buffer with a vkCmdWaitEvents() @@ -956,7 +959,7 @@ create_physical_device(struct v3dv_instance *instance, */ device->drm_syncobj_type.import_sync_file = NULL; device->drm_syncobj_type.export_sync_file = NULL; -#endif +//#endif /* Multiwait is required for emulated timeline semaphores and is supported * by the v3d kernel interface. diff --git a/src/broadcom/vulkan/v3dv_pipeline_cache.c b/src/broadcom/vulkan/v3dv_pipeline_cache.c index bafa8d759fa..6f504cd1947 100644 --- a/src/broadcom/vulkan/v3dv_pipeline_cache.c +++ b/src/broadcom/vulkan/v3dv_pipeline_cache.c @@ -588,14 +588,14 @@ v3dv_pipeline_shared_data_create_from_blob(struct v3dv_pipeline_cache *cache, blob_read_bytes(blob, sizeof(struct v3dv_descriptor_maps)); if (blob->overrun) - goto fail; + return NULL; maps[stage] = vk_zalloc2(&cache->device->vk.alloc, NULL, sizeof(struct v3dv_descriptor_maps), 8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); if (maps[stage] == NULL) - goto fail; + return NULL; memcpy(maps[stage], current_maps, sizeof(struct v3dv_descriptor_maps)); if (broadcom_shader_stage_is_render_with_binning(stage)) { @@ -619,25 +619,10 @@ v3dv_pipeline_shared_data_create_from_blob(struct v3dv_pipeline_cache *cache, blob_read_bytes(blob, total_assembly_size); if (blob->overrun) - goto fail; - - struct v3dv_pipeline_shared_data *data = - v3dv_pipeline_shared_data_new(cache, sha1_key, maps, variants, - total_assembly, total_assembly_size); - - if (!data) - goto fail; - - return data; + return NULL; -fail: - for (int i = 0; i < BROADCOM_SHADER_STAGES; i++) { - if (maps[i]) - vk_free2(&cache->device->vk.alloc, NULL, maps[i]); - if (variants[i]) - v3dv_shader_variant_destroy(cache->device, variants[i]); - } - return NULL; + return v3dv_pipeline_shared_data_new(cache, sha1_key, maps, variants, + total_assembly, total_assembly_size); } static void diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c index a2476ac39c1..dc359822641 100644 --- a/src/egl/main/eglapi.c +++ b/src/egl/main/eglapi.c @@ -2310,7 +2310,7 @@ eglDupNativeFenceFDTIZEN(EGLDisplay dpy, EGLSync sync) _EGLSync *s = _eglLookupSync(sync, disp); EGLBoolean ret; - _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s, EGL_FALSE); + _EGL_FUNC_START(disp, EGL_OBJECT_SYNC_KHR, s); if (!(s && (s->Type == EGL_SYNC_NATIVE_FENCE_TIZEN))) RETURN_EGL_ERROR(disp, EGL_BAD_PARAMETER, EGL_NO_NATIVE_FENCE_FD_TIZEN); |