Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libdrm for openSUSE:Factory checked in at 2024-06-04 12:49:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libdrm (Old) and /work/SRC/openSUSE:Factory/.libdrm.new.24587 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libdrm" Tue Jun 4 12:49:59 2024 rev:176 rq:1178202 version:2.4.121 Changes: -------- --- /work/SRC/openSUSE:Factory/libdrm/libdrm.changes 2024-01-15 22:11:49.142580599 +0100 +++ /work/SRC/openSUSE:Factory/.libdrm.new.24587/libdrm.changes 2024-06-04 12:50:05.165551268 +0200 @@ -1,0 +2,34 @@ +Mon Jun 3 00:46:48 UTC 2024 - Stefan Dirsch <sndir...@suse.com> + +- update to 2.4.121 + * meson: make build system happy by replacing deprecated feature + * include poll.h instead of sys/poll.h + * amdgpu: Make amdgpu_device_deinitialize thread-safe + * Revert "xf86drm: ignore symlinks in process_device()" + * xf86drm: Don't consider node names longer than the maximum allowed + * tests/amdgpu: fix compile warning with the guard enum value + * tests/amdgpu: fix compile error with gcc7.5 + * tests/amdgpu: fix compile error with gcc14 + * tests/util: add tidss driver + * meson: Replace usages of deprecated ExternalProgram.path() + * meson: Fix broken str.format usage + * amdgpu: add marketing names from Adrenalin 23.11.1 + * amdgpu: add marketing names from PRO Edition for W7700 + * amdgpu: add marketing names from Windows Steam Deck OLED APU driver + * amdgpu: add marketing names from amd-6.0 + * amdgpu: add marketing name for Radeon RX 6550M + * amdgpu: add marketing names from amd-6.0.1 + * amdgpu: Make amdgpu_cs_signal_semaphore() thread-safe + * amdgpu: sync amdgpu_drm.h + * symbols-check: Add _GLOBAL_OFFSET_TABLE_ + * symbols-check: Add _fbss, _fdata, _ftext + * amdgpu: expose amdgpu_va_manager publicly + * amdgpu: add amdgpu_va_range_alloc2 + * amdgpu: add amdgpu_device_initialize2 + * amdgpu: fix deinit logic + * ci: build with meson --fatal-meson-warnings + * ci: use "meson setup" sub-command + * xf86drm: document drmDevicesEqual() + * xf86drm: ignore symlinks in process_device() + +------------------------------------------------------------------- Old: ---- libdrm-2.4.120.tar.xz New: ---- libdrm-2.4.121.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libdrm.spec ++++++ --- /var/tmp/diff_new_pack.pYYQ7p/_old 2024-06-04 12:50:06.917614846 +0200 +++ /var/tmp/diff_new_pack.pYYQ7p/_new 2024-06-04 12:50:06.917614846 +0200 @@ -24,7 +24,7 @@ Name: libdrm # Please remember to adjust the version in the n_libdrm-drop-valgrind* patches -Version: 2.4.120 +Version: 2.4.121 Release: 0 Summary: Userspace Interface for Kernel DRM Services License: MIT ++++++ libdrm-2.4.120.tar.xz -> libdrm-2.4.121.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/.gitlab-ci.yml new/libdrm-2.4.121/.gitlab-ci.yml --- old/libdrm-2.4.120/.gitlab-ci.yml 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/.gitlab-ci.yml 2024-06-01 19:31:41.000000000 +0200 @@ -190,8 +190,8 @@ variables: GIT_DEPTH: 10 script: - - meson build - --auto-features=enabled + - meson setup build + --fatal-meson-warnings --auto-features=enabled -D udev=true - ninja -C build - ninja -C build test @@ -213,7 +213,7 @@ # the workspace to see details about the failed tests. - | set +e - /app/vmctl exec "pkg info; cd $CI_PROJECT_NAME ; meson build --auto-features=enabled -D etnaviv=disabled -D nouveau=disabled -D valgrind=disabled && ninja -C build" + /app/vmctl exec "pkg info; cd $CI_PROJECT_NAME ; meson setup build --fatal-meson-warnings --auto-features=enabled -D etnaviv=disabled -D nouveau=disabled -D valgrind=disabled && ninja -C build" set -ex scp -r vm:$CI_PROJECT_NAME/build/meson-logs . /app/vmctl exec "ninja -C $CI_PROJECT_NAME/build install" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/amdgpu/amdgpu-symbols.txt new/libdrm-2.4.121/amdgpu/amdgpu-symbols.txt --- old/libdrm-2.4.120/amdgpu/amdgpu-symbols.txt 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/amdgpu/amdgpu-symbols.txt 2024-06-01 19:31:41.000000000 +0200 @@ -56,6 +56,7 @@ amdgpu_device_deinitialize amdgpu_device_get_fd amdgpu_device_initialize +amdgpu_device_initialize2 amdgpu_find_bo_by_cpu_mapping amdgpu_get_marketing_name amdgpu_query_buffer_size_alignment @@ -71,7 +72,11 @@ amdgpu_query_sensor_info amdgpu_query_video_caps_info amdgpu_read_mm_registers +amdgpu_va_manager_alloc +amdgpu_va_manager_init +amdgpu_va_manager_deinit amdgpu_va_range_alloc +amdgpu_va_range_alloc2 amdgpu_va_range_free amdgpu_va_get_start_addr amdgpu_va_range_query diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/amdgpu/amdgpu.h new/libdrm-2.4.121/amdgpu/amdgpu.h --- old/libdrm-2.4.120/amdgpu/amdgpu.h 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/amdgpu/amdgpu.h 2024-06-01 19:31:41.000000000 +0200 @@ -139,6 +139,12 @@ typedef struct amdgpu_va *amdgpu_va_handle; /** + * Define handle dealing with VA allocation. An amdgpu_device + * owns one of these, but they can also be used without a device. + */ +typedef struct amdgpu_va_manager *amdgpu_va_manager_handle; + +/** * Define handle for semaphore */ typedef struct amdgpu_semaphore *amdgpu_semaphore_handle; @@ -528,6 +534,20 @@ amdgpu_device_handle *device_handle); /** + * Same as amdgpu_device_initialize() except when deduplicate_device + * is false *and* fd points to a device that was already initialized. + * In this case, amdgpu_device_initialize would return the same + * amdgpu_device_handle while here amdgpu_device_initialize2 would + * return a new handle. + * amdgpu_device_initialize() should be preferred in most situations; + * the only use-case where not-deduplicating devices make sense is + * when one wants to have isolated device handles in the same process. + */ +int amdgpu_device_initialize2(int fd, bool deduplicate_device, + uint32_t *major_version, + uint32_t *minor_version, + amdgpu_device_handle *device_handle); +/** * * When access to such library does not needed any more the special * function must be call giving opportunity to clean up any @@ -1411,6 +1431,37 @@ uint64_t *end); /** + * Allocate a amdgpu_va_manager object. + * The returned object has be initialized with the amdgpu_va_manager_init + * before use. + * On release, amdgpu_va_manager_deinit needs to be called, then the memory + * can be released using free(). + */ +amdgpu_va_manager_handle amdgpu_va_manager_alloc(void); + +void amdgpu_va_manager_init(amdgpu_va_manager_handle va_mgr, + uint64_t low_va_offset, uint64_t low_va_max, + uint64_t high_va_offset, uint64_t high_va_max, + uint32_t virtual_address_alignment); + +void amdgpu_va_manager_deinit(amdgpu_va_manager_handle va_mgr); + +/** + * Similar to #amdgpu_va_range_alloc() but allocates VA + * directly from an amdgpu_va_manager_handle instead of using + * the manager from an amdgpu_device. + */ + +int amdgpu_va_range_alloc2(amdgpu_va_manager_handle va_mgr, + enum amdgpu_gpu_va_range va_range_type, + uint64_t size, + uint64_t va_base_alignment, + uint64_t va_base_required, + uint64_t *va_base_allocated, + amdgpu_va_handle *va_range_handle, + uint64_t flags); + +/** * VA mapping/unmapping for the buffer object * * \param bo - \c [in] BO handle diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/amdgpu/amdgpu_cs.c new/libdrm-2.4.121/amdgpu/amdgpu_cs.c --- old/libdrm-2.4.120/amdgpu/amdgpu_cs.c 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/amdgpu/amdgpu_cs.c 2024-06-01 19:31:41.000000000 +0200 @@ -598,24 +598,31 @@ uint32_t ring, amdgpu_semaphore_handle sem) { + int ret; + if (!ctx || !sem) return -EINVAL; if (ip_type >= AMDGPU_HW_IP_NUM) return -EINVAL; if (ring >= AMDGPU_CS_MAX_RINGS) return -EINVAL; - /* sem has been signaled */ - if (sem->signal_fence.context) - return -EINVAL; + pthread_mutex_lock(&ctx->sequence_mutex); + /* sem has been signaled */ + if (sem->signal_fence.context) { + ret = -EINVAL; + goto unlock; + } sem->signal_fence.context = ctx; sem->signal_fence.ip_type = ip_type; sem->signal_fence.ip_instance = ip_instance; sem->signal_fence.ring = ring; sem->signal_fence.fence = ctx->last_seq[ip_type][ip_instance][ring]; update_references(NULL, &sem->refcount); + ret = 0; +unlock: pthread_mutex_unlock(&ctx->sequence_mutex); - return 0; + return ret; } drm_public int amdgpu_cs_wait_semaphore(amdgpu_context_handle ctx, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/amdgpu/amdgpu_device.c new/libdrm-2.4.121/amdgpu/amdgpu_device.c --- old/libdrm-2.4.120/amdgpu/amdgpu_device.c 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/amdgpu/amdgpu_device.c 2024-06-01 19:31:41.000000000 +0200 @@ -95,22 +95,26 @@ static void amdgpu_device_free_internal(amdgpu_device_handle dev) { - amdgpu_device_handle *node = &dev_list; - - pthread_mutex_lock(&dev_mutex); - while (*node != dev && (*node)->next) - node = &(*node)->next; - *node = (*node)->next; - pthread_mutex_unlock(&dev_mutex); + /* Remove dev from dev_list, if it was added there. */ + if (dev == dev_list) { + dev_list = dev->next; + } else { + for (amdgpu_device_handle node = dev_list; node; node = node->next) { + if (node->next == dev) { + node->next = dev->next; + break; + } + } + } close(dev->fd); if ((dev->flink_fd >= 0) && (dev->fd != dev->flink_fd)) close(dev->flink_fd); - amdgpu_vamgr_deinit(&dev->vamgr_32); - amdgpu_vamgr_deinit(&dev->vamgr); - amdgpu_vamgr_deinit(&dev->vamgr_high_32); - amdgpu_vamgr_deinit(&dev->vamgr_high); + amdgpu_vamgr_deinit(&dev->va_mgr.vamgr_32); + amdgpu_vamgr_deinit(&dev->va_mgr.vamgr_low); + amdgpu_vamgr_deinit(&dev->va_mgr.vamgr_high_32); + amdgpu_vamgr_deinit(&dev->va_mgr.vamgr_high); handle_table_fini(&dev->bo_handles); handle_table_fini(&dev->bo_flink_names); pthread_mutex_destroy(&dev->bo_table_mutex); @@ -140,22 +144,23 @@ *dst = src; } -drm_public int amdgpu_device_initialize(int fd, - uint32_t *major_version, - uint32_t *minor_version, - amdgpu_device_handle *device_handle) +static int _amdgpu_device_initialize(int fd, + uint32_t *major_version, + uint32_t *minor_version, + amdgpu_device_handle *device_handle, + bool deduplicate_device) { - struct amdgpu_device *dev; + struct amdgpu_device *dev = NULL; drmVersionPtr version; int r; int flag_auth = 0; int flag_authexist=0; uint32_t accel_working = 0; - uint64_t start, max; *device_handle = NULL; pthread_mutex_lock(&dev_mutex); + r = amdgpu_get_auth(fd, &flag_auth); if (r) { fprintf(stderr, "%s: amdgpu_get_auth (1) failed (%i)\n", @@ -164,9 +169,10 @@ return r; } - for (dev = dev_list; dev; dev = dev->next) - if (fd_compare(dev->fd, fd) == 0) - break; + if (deduplicate_device) + for (dev = dev_list; dev; dev = dev->next) + if (fd_compare(dev->fd, fd) == 0) + break; if (dev) { r = amdgpu_get_auth(dev->fd, &flag_authexist); @@ -238,35 +244,22 @@ goto cleanup; } - start = dev->dev_info.virtual_address_offset; - max = MIN2(dev->dev_info.virtual_address_max, 0x100000000ULL); - amdgpu_vamgr_init(&dev->vamgr_32, start, max, - dev->dev_info.virtual_address_alignment); - - start = max; - max = MAX2(dev->dev_info.virtual_address_max, 0x100000000ULL); - amdgpu_vamgr_init(&dev->vamgr, start, max, - dev->dev_info.virtual_address_alignment); - - start = dev->dev_info.high_va_offset; - max = MIN2(dev->dev_info.high_va_max, (start & ~0xffffffffULL) + - 0x100000000ULL); - amdgpu_vamgr_init(&dev->vamgr_high_32, start, max, - dev->dev_info.virtual_address_alignment); - - start = max; - max = MAX2(dev->dev_info.high_va_max, (start & ~0xffffffffULL) + - 0x100000000ULL); - amdgpu_vamgr_init(&dev->vamgr_high, start, max, - dev->dev_info.virtual_address_alignment); + amdgpu_va_manager_init(&dev->va_mgr, + dev->dev_info.virtual_address_offset, + dev->dev_info.virtual_address_max, + dev->dev_info.high_va_offset, + dev->dev_info.high_va_max, + dev->dev_info.virtual_address_alignment); amdgpu_parse_asic_ids(dev); *major_version = dev->major_version; *minor_version = dev->minor_version; *device_handle = dev; - dev->next = dev_list; - dev_list = dev; + if (deduplicate_device) { + dev->next = dev_list; + dev_list = dev; + } pthread_mutex_unlock(&dev_mutex); return 0; @@ -279,9 +272,27 @@ return r; } +drm_public int amdgpu_device_initialize(int fd, + uint32_t *major_version, + uint32_t *minor_version, + amdgpu_device_handle *device_handle) +{ + return _amdgpu_device_initialize(fd, major_version, minor_version, device_handle, true); +} + +drm_public int amdgpu_device_initialize2(int fd, bool deduplicate_device, + uint32_t *major_version, + uint32_t *minor_version, + amdgpu_device_handle *device_handle) +{ + return _amdgpu_device_initialize(fd, major_version, minor_version, device_handle, deduplicate_device); +} + drm_public int amdgpu_device_deinitialize(amdgpu_device_handle dev) { + pthread_mutex_lock(&dev_mutex); amdgpu_device_reference(&dev, NULL); + pthread_mutex_unlock(&dev_mutex); return 0; } @@ -306,10 +317,10 @@ switch (info) { case amdgpu_sw_info_address32_hi: - if (dev->vamgr_high_32.va_max) - *val32 = (dev->vamgr_high_32.va_max - 1) >> 32; + if (dev->va_mgr.vamgr_high_32.va_max) + *val32 = (dev->va_mgr.vamgr_high_32.va_max - 1) >> 32; else - *val32 = (dev->vamgr_32.va_max - 1) >> 32; + *val32 = (dev->va_mgr.vamgr_32.va_max - 1) >> 32; return 0; } return -EINVAL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/amdgpu/amdgpu_internal.h new/libdrm-2.4.121/amdgpu/amdgpu_internal.h --- old/libdrm-2.4.120/amdgpu/amdgpu_internal.h 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/amdgpu/amdgpu_internal.h 2024-06-01 19:31:41.000000000 +0200 @@ -63,6 +63,17 @@ struct amdgpu_bo_va_mgr *vamgr; }; +struct amdgpu_va_manager { + /** The VA manager for the lower virtual address space */ + struct amdgpu_bo_va_mgr vamgr_low; + /** The VA manager for the 32bit address space */ + struct amdgpu_bo_va_mgr vamgr_32; + /** The VA manager for the high virtual address space */ + struct amdgpu_bo_va_mgr vamgr_high; + /** The VA manager for the 32bit high address space */ + struct amdgpu_bo_va_mgr vamgr_high_32; +}; + struct amdgpu_device { atomic_t refcount; struct amdgpu_device *next; @@ -80,14 +91,8 @@ pthread_mutex_t bo_table_mutex; struct drm_amdgpu_info_device dev_info; struct amdgpu_gpu_info info; - /** The VA manager for the lower virtual address space */ - struct amdgpu_bo_va_mgr vamgr; - /** The VA manager for the 32bit address space */ - struct amdgpu_bo_va_mgr vamgr_32; - /** The VA manager for the high virtual address space */ - struct amdgpu_bo_va_mgr vamgr_high; - /** The VA manager for the 32bit high address space */ - struct amdgpu_bo_va_mgr vamgr_high_32; + + struct amdgpu_va_manager va_mgr; }; struct amdgpu_bo { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/amdgpu/amdgpu_vamgr.c new/libdrm-2.4.121/amdgpu/amdgpu_vamgr.c --- old/libdrm-2.4.120/amdgpu/amdgpu_vamgr.c 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/amdgpu/amdgpu_vamgr.c 2024-06-01 19:31:41.000000000 +0200 @@ -229,24 +229,39 @@ amdgpu_va_handle *va_range_handle, uint64_t flags) { + return amdgpu_va_range_alloc2(&dev->va_mgr, va_range_type, size, + va_base_alignment, va_base_required, + va_base_allocated, va_range_handle, + flags); +} + +drm_public int amdgpu_va_range_alloc2(amdgpu_va_manager_handle va_mgr, + enum amdgpu_gpu_va_range va_range_type, + uint64_t size, + uint64_t va_base_alignment, + uint64_t va_base_required, + uint64_t *va_base_allocated, + amdgpu_va_handle *va_range_handle, + uint64_t flags) +{ struct amdgpu_bo_va_mgr *vamgr; bool search_from_top = !!(flags & AMDGPU_VA_RANGE_REPLAYABLE); int ret; /* Clear the flag when the high VA manager is not initialized */ - if (flags & AMDGPU_VA_RANGE_HIGH && !dev->vamgr_high_32.va_max) + if (flags & AMDGPU_VA_RANGE_HIGH && !va_mgr->vamgr_high_32.va_max) flags &= ~AMDGPU_VA_RANGE_HIGH; if (flags & AMDGPU_VA_RANGE_HIGH) { if (flags & AMDGPU_VA_RANGE_32_BIT) - vamgr = &dev->vamgr_high_32; + vamgr = &va_mgr->vamgr_high_32; else - vamgr = &dev->vamgr_high; + vamgr = &va_mgr->vamgr_high; } else { if (flags & AMDGPU_VA_RANGE_32_BIT) - vamgr = &dev->vamgr_32; + vamgr = &va_mgr->vamgr_32; else - vamgr = &dev->vamgr; + vamgr = &va_mgr->vamgr_low; } va_base_alignment = MAX2(va_base_alignment, vamgr->va_alignment); @@ -259,9 +274,9 @@ if (!(flags & AMDGPU_VA_RANGE_32_BIT) && ret) { /* fallback to 32bit address */ if (flags & AMDGPU_VA_RANGE_HIGH) - vamgr = &dev->vamgr_high_32; + vamgr = &va_mgr->vamgr_high_32; else - vamgr = &dev->vamgr_32; + vamgr = &va_mgr->vamgr_32; ret = amdgpu_vamgr_find_va(vamgr, size, va_base_alignment, va_base_required, search_from_top, va_base_allocated); @@ -300,3 +315,45 @@ { return va_handle->address; } + +drm_public amdgpu_va_manager_handle amdgpu_va_manager_alloc(void) +{ + amdgpu_va_manager_handle r = calloc(1, sizeof(struct amdgpu_va_manager)); + return r; +} + +drm_public void amdgpu_va_manager_init(struct amdgpu_va_manager *va_mgr, + uint64_t low_va_offset, uint64_t low_va_max, + uint64_t high_va_offset, uint64_t high_va_max, + uint32_t virtual_address_alignment) +{ + uint64_t start, max; + + start = low_va_offset; + max = MIN2(low_va_max, 0x100000000ULL); + amdgpu_vamgr_init(&va_mgr->vamgr_32, start, max, + virtual_address_alignment); + + start = max; + max = MAX2(low_va_max, 0x100000000ULL); + amdgpu_vamgr_init(&va_mgr->vamgr_low, start, max, + virtual_address_alignment); + + start = high_va_offset; + max = MIN2(high_va_max, (start & ~0xffffffffULL) + 0x100000000ULL); + amdgpu_vamgr_init(&va_mgr->vamgr_high_32, start, max, + virtual_address_alignment); + + start = max; + max = MAX2(high_va_max, (start & ~0xffffffffULL) + 0x100000000ULL); + amdgpu_vamgr_init(&va_mgr->vamgr_high, start, max, + virtual_address_alignment); +} + +drm_public void amdgpu_va_manager_deinit(struct amdgpu_va_manager *va_mgr) +{ + amdgpu_vamgr_deinit(&va_mgr->vamgr_32); + amdgpu_vamgr_deinit(&va_mgr->vamgr_low); + amdgpu_vamgr_deinit(&va_mgr->vamgr_high_32); + amdgpu_vamgr_deinit(&va_mgr->vamgr_high); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/data/amdgpu.ids new/libdrm-2.4.121/data/amdgpu.ids --- old/libdrm-2.4.120/data/amdgpu.ids 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/data/amdgpu.ids 2024-06-01 19:31:41.000000000 +0200 @@ -29,6 +29,46 @@ 131B, 00, AMD Radeon R4 Graphics 131C, 00, AMD Radeon R7 Graphics 131D, 00, AMD Radeon R6 Graphics +1435, AE, AMD Custom GPU 0932 +1506, C1, AMD Radeon 610M +1506, C2, AMD Radeon 610M +1506, C3, AMD Radeon 610M +1506, C4, AMD Radeon 610M +15BF, 00, AMD Radeon 780M +15BF, 01, AMD Radeon 760M +15BF, 02, AMD Radeon 780M +15BF, 03, AMD Radeon 760M +15BF, C1, AMD Radeon 780M +15BF, C2, AMD Radeon 780M +15BF, C3, AMD Radeon 760M +15BF, C4, AMD Radeon 780M +15BF, C5, AMD Radeon 740M +15BF, C6, AMD Radeon 780M +15BF, C7, AMD Radeon 780M +15BF, C8, AMD Radeon 760M +15BF, C9, AMD Radeon 780M +15BF, CA, AMD Radeon 740M +15BF, CB, AMD Radeon 760M +15BF, CD, AMD Radeon 760M +15BF, CF, AMD Radeon 780M +15BF, D3, AMD Radeon 780M +15BF, D4, AMD Radeon 780M +15BF, D5, AMD Radeon 760M +15BF, D6, AMD Radeon 760M +15BF, D7, AMD Radeon 780M +15BF, D8, AMD Radeon 740M +15BF, D9, AMD Radeon 780M +15BF, DA, AMD Radeon 780M +15BF, DB, AMD Radeon 760M +15BF, DD, AMD Radeon 780M +15BF, DE, AMD Radeon 740M +15BF, F0, AMD Radeon 760M +15C8, C1, AMD Radeon 740M +15C8, C2, AMD Radeon 740M +15C8, C3, AMD Radeon 740M +15C8, C4, AMD Radeon 740M +15C8, D1, AMD Radeon 740M +15C8, D3, AMD Radeon 740M 15D8, 00, AMD Radeon RX Vega 8 Graphics WS 15D8, 91, AMD Radeon Vega 3 Graphics 15D8, 91, AMD Ryzen Embedded R1606G with Radeon Vega Gfx @@ -101,6 +141,19 @@ 15DD, E1, AMD Radeon Vega 3 Graphics 15DD, E2, AMD Radeon Vega 3 Graphics 163F, AE, AMD Custom GPU 0405 +163F, E1, AMD Custom GPU 0405 +164E, D8, AMD Radeon 610M +164E, D9, AMD Radeon 610M +164E, DA, AMD Radeon 610M +164E, DB, AMD Radeon 610M +164E, DC, AMD Radeon 610M +1681, 06, AMD Radeon 680M +1681, 07, AMD Radeon 660M +1681, 0A, AMD Radeon 680M +1681, 0B, AMD Radeon 660M +1681, C7, AMD Radeon 680M +1681, C8, AMD Radeon 680M +1681, C9, AMD Radeon 660M 6600, 00, AMD Radeon HD 8600 / 8700M 6600, 81, AMD Radeon R7 M370 6601, 00, AMD Radeon HD 8500M / 8700M @@ -368,7 +421,12 @@ 73DF, C3, AMD Radeon RX 6800M 73DF, C5, AMD Radeon RX 6700 XT 73DF, CF, AMD Radeon RX 6700M +73DF, D5, AMD Radeon RX 6750 GRE 12GB 73DF, D7, AMD TDC-235 +73DF, DF, AMD Radeon RX 6700 +73DF, E5, AMD Radeon RX 6750 GRE 12GB +73DF, FF, AMD Radeon RX 6700 +73E0, 00, AMD Radeon RX 6600M 73E1, 00, AMD Radeon Pro W6600M 73E3, 00, AMD Radeon Pro W6600 73EF, C0, AMD Radeon RX 6800S @@ -380,6 +438,8 @@ 73FF, C3, AMD Radeon RX 6600M 73FF, C7, AMD Radeon RX 6600 73FF, CB, AMD Radeon RX 6600S +73FF, CF, AMD Radeon RX 6600 LE +73FF, DF, AMD Radeon RX 6750 GRE 10GB 7408, 00, AMD Instinct MI250X 740C, 01, AMD Instinct MI250X / MI250 740F, 02, AMD Instinct MI210 @@ -394,22 +454,29 @@ 743F, C7, AMD Radeon RX 6400 743F, C8, AMD Radeon RX 6500M 743F, CC, AMD Radeon 6550S +743F, CE, AMD Radeon RX 6450M 743F, CF, AMD Radeon RX 6300M +743F, D3, AMD Radeon RX 6550M 743F, D7, AMD Radeon RX 6400 7448, 00, AMD Radeon Pro W7900 744C, C8, AMD Radeon RX 7900 XTX 744C, CC, AMD Radeon RX 7900 XT 744C, CE, AMD Radeon RX 7900 GRE +744C, CF, AMD Radeon RX 7900M 745E, CC, AMD Radeon Pro W7800 +7470, 00, AMD Radeon Pro W7700 747E, C8, AMD Radeon RX 7800 XT 747E, FF, AMD Radeon RX 7700 XT 7480, 00, AMD Radeon Pro W7600 +7480, C0, AMD Radeon RX 7600 XT 7480, C1, AMD Radeon RX 7700S 7480, C3, AMD Radeon RX 7600S 7480, C7, AMD Radeon RX 7600M XT 7480, CF, AMD Radeon RX 7600 7483, CF, AMD Radeon RX 7600M 7489, 00, AMD Radeon Pro W7500 +74A0, 00, AMD Instinct MI300A +74A1, 00, AMD Instinct MI300X 9830, 00, AMD Radeon HD 8400 / R3 Series 9831, 00, AMD Radeon HD 8400E 9832, 00, AMD Radeon HD 8330 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/etnaviv/meson.build new/libdrm-2.4.121/etnaviv/meson.build --- old/libdrm-2.4.120/etnaviv/meson.build 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/etnaviv/meson.build 2024-06-01 19:31:41.000000000 +0200 @@ -61,6 +61,6 @@ args : [ '--lib', libdrm_etnaviv, '--symbols-file', files('etnaviv-symbols.txt'), - '--nm', prog_nm.path(), + '--nm', prog_nm.full_path(), ], ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/exynos/meson.build new/libdrm-2.4.121/exynos/meson.build --- old/libdrm-2.4.120/exynos/meson.build 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/exynos/meson.build 2024-06-01 19:31:41.000000000 +0200 @@ -56,6 +56,6 @@ args : [ '--lib', libdrm_exynos, '--symbols-file', files('exynos-symbols.txt'), - '--nm', prog_nm.path(), + '--nm', prog_nm.full_path(), ], ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/freedreno/meson.build new/libdrm-2.4.121/freedreno/meson.build --- old/libdrm-2.4.120/freedreno/meson.build 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/freedreno/meson.build 2024-06-01 19:31:41.000000000 +0200 @@ -77,6 +77,6 @@ args : [ '--lib', libdrm_freedreno, '--symbols-file', files('freedreno-symbols.txt'), - '--nm', prog_nm.path(), + '--nm', prog_nm.full_path(), ], ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/include/drm/amdgpu_drm.h new/libdrm-2.4.121/include/drm/amdgpu_drm.h --- old/libdrm-2.4.120/include/drm/amdgpu_drm.h 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/include/drm/amdgpu_drm.h 2024-06-01 19:31:41.000000000 +0200 @@ -392,7 +392,7 @@ #define AMDGPU_TILING_NUM_BANKS_SHIFT 21 #define AMDGPU_TILING_NUM_BANKS_MASK 0x3 -/* GFX9 and later: */ +/* GFX9 - GFX11: */ #define AMDGPU_TILING_SWIZZLE_MODE_SHIFT 0 #define AMDGPU_TILING_SWIZZLE_MODE_MASK 0x1f #define AMDGPU_TILING_DCC_OFFSET_256B_SHIFT 5 @@ -406,6 +406,17 @@ #define AMDGPU_TILING_SCANOUT_SHIFT 63 #define AMDGPU_TILING_SCANOUT_MASK 0x1 +/* GFX12 and later: */ +#define AMDGPU_TILING_GFX12_SWIZZLE_MODE_SHIFT 0 +#define AMDGPU_TILING_GFX12_SWIZZLE_MODE_MASK 0x7 +/* These are DCC recompression setting for memory management: */ +#define AMDGPU_TILING_GFX12_DCC_MAX_COMPRESSED_BLOCK_SHIFT 3 +#define AMDGPU_TILING_GFX12_DCC_MAX_COMPRESSED_BLOCK_MASK 0x3 /* 0:64B, 1:128B, 2:256B */ +#define AMDGPU_TILING_GFX12_DCC_NUMBER_TYPE_SHIFT 5 +#define AMDGPU_TILING_GFX12_DCC_NUMBER_TYPE_MASK 0x7 /* CB_COLOR0_INFO.NUMBER_TYPE */ +#define AMDGPU_TILING_GFX12_DCC_DATA_FORMAT_SHIFT 8 +#define AMDGPU_TILING_GFX12_DCC_DATA_FORMAT_MASK 0x3f /* [0:4]:CB_COLOR0_INFO.FORMAT, [5]:MM */ + /* Set/Get helpers for tiling flags. */ #define AMDGPU_TILING_SET(field, value) \ (((__u64)(value) & AMDGPU_TILING_##field##_MASK) << AMDGPU_TILING_##field##_SHIFT) @@ -743,6 +754,16 @@ #define AMDGPU_IDS_FLAGS_TMZ 0x4 #define AMDGPU_IDS_FLAGS_CONFORMANT_TRUNC_COORD 0x8 +/* + * Query h/w info: Flag identifying VF/PF/PT mode + * + */ +#define AMDGPU_IDS_FLAGS_MODE_MASK 0x300 +#define AMDGPU_IDS_FLAGS_MODE_SHIFT 0x8 +#define AMDGPU_IDS_FLAGS_MODE_PF 0x0 +#define AMDGPU_IDS_FLAGS_MODE_VF 0x1 +#define AMDGPU_IDS_FLAGS_MODE_PT 0x2 + /* indicate if acceleration can be working */ #define AMDGPU_INFO_ACCEL_WORKING 0x00 /* get the crtc_id from the mode object id? */ @@ -865,6 +886,8 @@ #define AMDGPU_INFO_SENSOR_PEAK_PSTATE_GFX_SCLK 0xa /* Subquery id: Query GPU peak pstate memory clock */ #define AMDGPU_INFO_SENSOR_PEAK_PSTATE_GFX_MCLK 0xb + /* Subquery id: Query input GPU power */ + #define AMDGPU_INFO_SENSOR_GPU_INPUT_POWER 0xc /* Number of VRAM page faults on CPU access. */ #define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E #define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F @@ -1266,6 +1289,7 @@ #define AMDGPU_FAMILY_GC_10_3_6 149 /* GC 10.3.6 */ #define AMDGPU_FAMILY_GC_10_3_7 151 /* GC 10.3.7 */ #define AMDGPU_FAMILY_GC_11_5_0 150 /* GC 11.5.0 */ +#define AMDGPU_FAMILY_GC_12_0_0 152 /* GC 12.0.0 */ #if defined(__cplusplus) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/intel/meson.build new/libdrm-2.4.121/intel/meson.build --- old/libdrm-2.4.120/intel/meson.build 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/intel/meson.build 2024-06-01 19:31:41.000000000 +0200 @@ -104,6 +104,6 @@ args : [ '--lib', libdrm_intel, '--symbols-file', files('intel-symbols.txt'), - '--nm', prog_nm.path(), + '--nm', prog_nm.full_path(), ], ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/libsync.h new/libdrm-2.4.121/libsync.h --- old/libdrm-2.4.120/libsync.h 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/libsync.h 2024-06-01 19:31:41.000000000 +0200 @@ -33,7 +33,7 @@ #include <stdint.h> #include <string.h> #include <sys/ioctl.h> -#include <sys/poll.h> +#include <poll.h> #include <unistd.h> #if defined(__cplusplus) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/meson.build new/libdrm-2.4.121/meson.build --- old/libdrm-2.4.120/meson.build 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/meson.build 2024-06-01 19:31:41.000000000 +0200 @@ -21,7 +21,7 @@ project( 'libdrm', ['c'], - version : '2.4.120', + version : '2.4.121', license : 'MIT', meson_version : '>= 0.59', default_options : ['buildtype=debugoptimized', 'c_std=c11'], @@ -235,7 +235,7 @@ configuration : config, output : 'config.h', ) -add_project_arguments('-include', '@0@'.format(config_file), language : 'c') +add_project_arguments('-include', meson.current_build_dir() / 'config.h', language : 'c') inc_root = include_directories('.') inc_drm = include_directories('include/drm') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/omap/meson.build new/libdrm-2.4.121/omap/meson.build --- old/libdrm-2.4.120/omap/meson.build 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/omap/meson.build 2024-06-01 19:31:41.000000000 +0200 @@ -56,6 +56,6 @@ args : [ '--lib', libdrm_omap, '--symbols-file', files('omap-symbols.txt'), - '--nm', prog_nm.path(), + '--nm', prog_nm.full_path(), ], ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/symbols-check.py new/libdrm-2.4.121/symbols-check.py --- old/libdrm-2.4.120/symbols-check.py 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/symbols-check.py 2024-06-01 19:31:41.000000000 +0200 @@ -7,6 +7,7 @@ # This list contains symbols that _might_ be exported for some platforms PLATFORM_SYMBOLS = [ + '_GLOBAL_OFFSET_TABLE_', '__bss_end__', '__bss_start__', '__bss_start', @@ -16,6 +17,9 @@ '_end', '_fini', '_init', + '_fbss', + '_fdata', + '_ftext', ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/tegra/job.c new/libdrm-2.4.121/tegra/job.c --- old/libdrm-2.4.120/tegra/job.c 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/tegra/job.c 2024-06-01 19:31:41.000000000 +0200 @@ -33,7 +33,7 @@ #include <unistd.h> #include <sys/ioctl.h> -#include <sys/poll.h> +#include <poll.h> #include "private.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/tegra/meson.build new/libdrm-2.4.121/tegra/meson.build --- old/libdrm-2.4.120/tegra/meson.build 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/tegra/meson.build 2024-06-01 19:31:41.000000000 +0200 @@ -59,6 +59,6 @@ args : [ '--lib', libdrm_tegra, '--symbols-file', files('tegra-symbols.txt'), - '--nm', prog_nm.path(), + '--nm', prog_nm.full_path(), ], ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/tests/amdgpu/shader_code.h new/libdrm-2.4.121/tests/amdgpu/shader_code.h --- old/libdrm-2.4.120/tests/amdgpu/shader_code.h 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/tests/amdgpu/shader_code.h 2024-06-01 19:31:41.000000000 +0200 @@ -75,13 +75,13 @@ struct shader_test_ps_shader { const uint32_t *shader; unsigned shader_size; - const uint32_t patchinfo_code_size; + uint32_t patchinfo_code_size; const uint32_t *patchinfo_code; const uint32_t *patchinfo_code_offset; const struct reg_info *sh_reg; - const uint32_t num_sh_reg; + uint32_t num_sh_reg; const struct reg_info *context_reg; - const uint32_t num_context_reg; + uint32_t num_context_reg; }; struct shader_test_vs_shader { @@ -111,7 +111,7 @@ #define SHADER_PS_INFO(_ps, _n) \ {ps_##_ps##_shader_gfx##_n, sizeof(ps_##_ps##_shader_gfx##_n), \ ps_##_ps##_shader_patchinfo_code_size_gfx##_n, \ - ps_##_ps##_shader_patchinfo_code_gfx##_n, \ + &(ps_##_ps##_shader_patchinfo_code_gfx##_n)[0][0][0], \ ps_##_ps##_shader_patchinfo_offset_gfx##_n, \ ps_##_ps##_sh_registers_gfx##_n, ps_##_ps##_num_sh_registers_gfx##_n, \ ps_##_ps##_context_registers_gfx##_n, ps_##_ps##_num_context_registers_gfx##_n} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/tests/amdgpu/shader_code_gfx10.h new/libdrm-2.4.121/tests/amdgpu/shader_code_gfx10.h --- old/libdrm-2.4.120/tests/amdgpu/shader_code_gfx10.h 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/tests/amdgpu/shader_code_gfx10.h 2024-06-01 19:31:41.000000000 +0200 @@ -41,7 +41,7 @@ 0xF8001C0F, 0x00000100, 0xBF810000 }; -static const uint32_t ps_const_shader_patchinfo_code_size_gfx10 = 6; +#define ps_const_shader_patchinfo_code_size_gfx10 6 static const uint32_t ps_const_shader_patchinfo_code_gfx10[][10][6] = { {{ 0xBF800000, 0xBF800000, 0xBF800000, 0xBF800000, 0xF8001890, 0x00000000 }, @@ -61,7 +61,7 @@ 0x00000004 }; -static const uint32_t ps_const_num_sh_registers_gfx10 = 2; +#define ps_const_num_sh_registers_gfx10 2 static const struct reg_info ps_const_sh_registers_gfx10[] = { {0x2C0A, 0x000C0000},//{ mmSPI_SHADER_PGM_RSRC1_PS, 0x000C0000 }, @@ -79,7 +79,7 @@ {0xA1C5, 0x00000004}, //{ mmSPI_SHADER_COL_FORMAT, 0x00000004 /* SI_EXPORT_FMT_FP16_ABGR */ } }; -static const uint32_t ps_const_num_context_registers_gfx10 = 7; +#define ps_const_num_context_registers_gfx10 7 static const uint32_t ps_tex_shader_gfx10[] = { 0xBEFC030C, 0xBE8E047E, 0xBEFE0A7E, 0xC8080000, @@ -93,7 +93,7 @@ 0x0000000C }; -static const uint32_t ps_tex_shader_patchinfo_code_size_gfx10 = 6; +#define ps_tex_shader_patchinfo_code_size_gfx10 6 static const uint32_t ps_tex_shader_patchinfo_code_gfx10[][10][6] = { {{ 0xBF800000, 0xBF800000, 0xBF800000, 0xBF800000, 0xF8001890, 0x00000000 }, @@ -115,7 +115,7 @@ {0x2C0B, 0x00000018 }, //{ mmSPI_SHADER_PGM_RSRC2_PS, 0x00000018 } }; -static const uint32_t ps_tex_num_sh_registers_gfx10 = 2; +#define ps_tex_num_sh_registers_gfx10 2 // Holds Context Register Information static const struct reg_info ps_tex_context_registers_gfx10[] = @@ -129,7 +129,7 @@ {0xA1C5, 0x00000004}, //{ mmSPI_SHADER_COL_FORMAT, 0x00000004 /* SI_EXPORT_FMT_FP16_ABGR */ } }; -static const uint32_t ps_tex_num_context_registers_gfx10 = 7; +#define ps_tex_num_context_registers_gfx10 7 static const uint32_t vs_RectPosTexFast_shader_gfx10[] = { 0x7E000B00, 0x060000F3, 0x7E020202, 0x7E040206, @@ -148,7 +148,7 @@ {0x2C4B, 0x00000018 }, //{ mmSPI_SHADER_PGM_RSRC2_VS, 0x00000018 } }; -static const uint32_t vs_RectPosTexFast_num_sh_registers_gfx10 = 2; +#define vs_RectPosTexFast_num_sh_registers_gfx10 2 // Holds Context Register Information static const struct reg_info vs_RectPosTexFast_context_registers_gfx10[] = @@ -157,7 +157,7 @@ {0xA1C3, 0x00000000}, //{ mmSPI_SHADER_POS_FORMAT, 0x00000000 /* Always 0 for now */} }; -static const uint32_t vs_RectPosTexFast_num_context_registers_gfx10 = 2; +#define vs_RectPosTexFast_num_context_registers_gfx10 2 static const uint32_t preamblecache_gfx10[] = { 0xc0026900, 0x81, 0x80000000, 0x40004000, 0xc0026900, 0x8c, 0xaa99aaaa, 0x0, @@ -196,7 +196,7 @@ 0xc0026900, 0x2b0, 0x0, 0x0, 0xc0016900, 0x2f8, 0x0 }; -static const uint32_t sh_reg_base_gfx10 = 0x2C00; -static const uint32_t context_reg_base_gfx10 = 0xA000; +#define sh_reg_base_gfx10 0x2C00 +#define context_reg_base_gfx10 0xA000 #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/tests/amdgpu/shader_code_gfx11.h new/libdrm-2.4.121/tests/amdgpu/shader_code_gfx11.h --- old/libdrm-2.4.120/tests/amdgpu/shader_code_gfx11.h 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/tests/amdgpu/shader_code_gfx11.h 2024-06-01 19:31:41.000000000 +0200 @@ -101,7 +101,7 @@ 0xBF9F0000 }; -static const uint32_t ps_const_shader_patchinfo_code_size_gfx11 = 6; +#define ps_const_shader_patchinfo_code_size_gfx11 6 static const uint32_t ps_const_shader_patchinfo_code_gfx11[][10][6] = { {{ 0xBF800000, 0xBF800000, 0xBF800000, 0xBF800000, 0xF8000890, 0x00000000 }, // SI_EXPORT_FMT_ZERO @@ -121,7 +121,7 @@ 0x00000006 }; -static const uint32_t ps_const_num_sh_registers_gfx11 = 2; +#define ps_const_num_sh_registers_gfx11 2 static const struct reg_info ps_const_sh_registers_gfx11[] = { {0x2C0A, 0x020C0000}, //{ mmSPI_SHADER_PGM_RSRC1_PS, 0x020C0000 }, @@ -138,7 +138,7 @@ {0xA1C5, 0x00000004 }, //{ mmSPI_SHADER_COL_FORMAT, 0x00000004 /* SI_EXPORT_FMT_FP16_ABGR */ } }; -static const uint32_t ps_const_num_context_registers_gfx11 = 7; +#define ps_const_num_context_registers_gfx11 7 static const uint32_t ps_tex_shader_gfx11[] = { @@ -174,7 +174,7 @@ }; // Denotes the Patch Info Code Length -static const uint32_t ps_tex_shader_patchinfo_code_size_gfx11 = 6; +#define ps_tex_shader_patchinfo_code_size_gfx11 6 static const uint32_t ps_tex_shader_patchinfo_code_gfx11[][10][6] = { @@ -197,7 +197,7 @@ {0x2C0B, 0x00000018 } //{ mmSPI_SHADER_PGM_RSRC2_PS, 0x00000018 } }; -static const uint32_t ps_tex_num_sh_registers_gfx11 = 2; +#define ps_tex_num_sh_registers_gfx11 2 // Holds Context Register Information static const struct reg_info ps_tex_context_registers_gfx11[] = @@ -211,8 +211,7 @@ {0xA1C5, 0x00000004 } //{ mmSPI_SHADER_COL_FORMAT, 0x00000004 /* SI_EXPORT_FMT_FP16_ABGR */ } }; -static const uint32_t ps_tex_num_context_registers_gfx11 = 7; - +#define ps_tex_num_context_registers_gfx11 7 static const uint32_t vs_RectPosTexFast_shader_gfx11[] = { @@ -261,7 +260,7 @@ {0x2C8B, 0x0008001C}, //{ mmSPI_SHADER_PGM_RSRC2_GS, 0x0008001C } }; -static const uint32_t vs_RectPosTexFast_num_sh_registers_gfx11 = 2; +#define vs_RectPosTexFast_num_sh_registers_gfx11 2 // Holds Context Register Information static const struct reg_info vs_RectPosTexFast_context_registers_gfx11[] = @@ -274,7 +273,7 @@ {0xA2CE, 0x00000001}, //{ mmVGT_GS_MAX_VERT_OUT, 0x00000001 } }; -static const uint32_t vs_RectPosTexFast_num_context_registers_gfx11 = 6; +#define vs_RectPosTexFast_num_context_registers_gfx11 6 static const uint32_t preamblecache_gfx11[] = { 0xc0026900, 0x81, 0x80000000, 0x40004000, 0xc0026900, 0x8c, 0xaa99aaaa, 0x0, @@ -314,7 +313,8 @@ 0xc0046900, 0x1d5, 0x0, 0x0, 0x0, 0x0, 0xc0016900, 0x104, 0x4a00005, 0xc0016900, 0x1f, 0xf2a0055, 0xc0017900, 0x266, 0x4 }; -static const uint32_t sh_reg_base_gfx11 = 0x2C00; -static const uint32_t context_reg_base_gfx11 = 0xA000; + +#define sh_reg_base_gfx11 0x2C00 +#define context_reg_base_gfx11 0xA000 #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/tests/amdgpu/shader_code_gfx9.h new/libdrm-2.4.121/tests/amdgpu/shader_code_gfx9.h --- old/libdrm-2.4.120/tests/amdgpu/shader_code_gfx9.h 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/tests/amdgpu/shader_code_gfx9.h 2024-06-01 19:31:41.000000000 +0200 @@ -51,7 +51,7 @@ 0xC4001C0F, 0x00000100, 0xBF810000 }; -static const uint32_t ps_const_shader_patchinfo_code_size_gfx9 = 6; +#define ps_const_shader_patchinfo_code_size_gfx9 6 static const uint32_t ps_const_shader_patchinfo_code_gfx9[][10][6] = { {{ 0xBF800000, 0xBF800000, 0xBF800000, 0xBF800000, 0xC4001890, 0x00000000 }, @@ -71,14 +71,14 @@ 0x00000004 }; -static const uint32_t ps_const_num_sh_registers_gfx9 = 2; +#define ps_const_num_sh_registers_gfx9 2 static const struct reg_info ps_const_sh_registers_gfx9[] = { {0x2C0A, 0x000C0040},//{ mmSPI_SHADER_PGM_RSRC1_PS, 0x000C0040 }, {0x2C0B, 0x00000008}, //{ mmSPI_SHADER_PGM_RSRC2_PS, 0x00000008 } }; -static const uint32_t ps_const_num_context_registers_gfx9 = 7; +#define ps_const_num_context_registers_gfx9 7 static const struct reg_info ps_const_context_registers_gfx9[] = { {0xA1B4, 0x00000002}, //{ mmSPI_PS_INPUT_ADDR, 0x00000002 }, @@ -102,7 +102,7 @@ 0x0000000B }; -static const uint32_t ps_tex_shader_patchinfo_code_size_gfx9 = 6; +#define ps_tex_shader_patchinfo_code_size_gfx9 6 static const uint32_t ps_tex_shader_patchinfo_code_gfx9[][10][6] = { {{ 0xBF800000, 0xBF800000, 0xBF800000, 0xBF800000, 0xC4001890, 0x00000000 }, @@ -118,13 +118,14 @@ } }; -static const uint32_t ps_tex_num_sh_registers_gfx9 = 2; +#define ps_tex_num_sh_registers_gfx9 2 + static const struct reg_info ps_tex_sh_registers_gfx9[] = { {0x2C0A, 0x000C0081},//{ mmSPI_SHADER_PGM_RSRC1_PS, 0x000C0081 }, {0x2C0B, 0x00000018}, //{ mmSPI_SHADER_PGM_RSRC2_PS, 0x00000018 } }; -static const uint32_t ps_tex_num_context_registers_gfx9 = 7; +#define ps_tex_num_context_registers_gfx9 7 static const struct reg_info ps_tex_context_registers_gfx9[] = { {0xA1B4, 0x00000002}, //{ mmSPI_PS_INPUT_ADDR, 0x00000002 }, @@ -153,7 +154,7 @@ {0x2C4B, 0x00000018}, //{ mmSPI_SHADER_PGM_RSRC2_VS, 0x00000018 } }; -static const uint32_t vs_RectPosTexFast_num_sh_registers_gfx9 = 2; +#define vs_RectPosTexFast_num_sh_registers_gfx9 2 // Holds Context Register Information static const struct reg_info vs_RectPosTexFast_context_registers_gfx9[] = @@ -162,7 +163,7 @@ {0xA1C3, 0x00000000}, //{ mmSPI_SHADER_POS_FORMAT, 0x00000000 /* Always 0 for now */} }; -static const uint32_t vs_RectPosTexFast_num_context_registers_gfx9 = 2; +#define vs_RectPosTexFast_num_context_registers_gfx9 2 static const uint32_t preamblecache_gfx9[] = { 0xc0026900, 0x81, 0x80000000, 0x40004000, 0xc0026900, 0x8c, 0xaa99aaaa, 0x0, @@ -198,7 +199,7 @@ 0xc0026900, 0x2b0, 0x0, 0x0, 0xc0016900, 0x2f8, 0x0 }; -static const uint32_t sh_reg_base_gfx9 = 0x2C00; -static const uint32_t context_reg_base_gfx9 = 0xA000; +#define sh_reg_base_gfx9 0x2C00 +#define context_reg_base_gfx9 0xA000 #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/tests/amdgpu/shader_test_util.c new/libdrm-2.4.121/tests/amdgpu/shader_test_util.c --- old/libdrm-2.4.120/tests/amdgpu/shader_test_util.c 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/tests/amdgpu/shader_test_util.c 2024-06-01 19:31:41.000000000 +0200 @@ -4,6 +4,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <string.h> +#include <assert.h> #include "CUnit/Basic.h" #include "amdgpu_test.h" @@ -303,6 +304,9 @@ case AMDGPU_TEST_GFX_V11: amdgpu_dispatch_init_gfx11(test_priv); break; + case AMDGPU_TEST_GFX_MAX: + assert(1 && "Not Support gfx, never go here"); + break; } } @@ -338,6 +342,9 @@ ptr[i++] = 0xffffffff; ptr[i++] = 0xffffffff; break; + case AMDGPU_TEST_GFX_MAX: + assert(1 && "Not Support gfx, never go here"); + break; } test_priv->cmd_curr = i; @@ -541,6 +548,9 @@ case AMDGPU_TEST_GFX_V11: amdgpu_dispatch_write2hw_gfx11(test_priv); break; + case AMDGPU_TEST_GFX_MAX: + assert(1 && "Not Support gfx, never go here"); + break; } } @@ -1168,6 +1178,9 @@ case AMDGPU_TEST_GFX_V11: amdgpu_draw_setup_and_write_drawblt_surf_info_gfx11(test_priv); break; + case AMDGPU_TEST_GFX_MAX: + assert(1 && "Not Support gfx, never go here"); + break; } } @@ -1298,6 +1311,9 @@ case AMDGPU_TEST_GFX_V11: amdgpu_draw_setup_and_write_drawblt_state_gfx11(test_priv); break; + case AMDGPU_TEST_GFX_MAX: + assert(1 && "Not Support gfx, never go here"); + break; } } @@ -1546,6 +1562,9 @@ case AMDGPU_TEST_GFX_V11: amdgpu_draw_vs_RectPosTexFast_write2hw_gfx11(test_priv); break; + case AMDGPU_TEST_GFX_MAX: + assert(1 && "Not Support gfx, never go here"); + break; } } @@ -1679,6 +1698,9 @@ case AMDGPU_TEST_GFX_V11: amdgpu_draw_ps_write2hw_gfx11(test_priv); break; + case AMDGPU_TEST_GFX_MAX: + assert(1 && "Not Support gfx, never go here"); + break; } } @@ -1718,6 +1740,9 @@ ptr[i++] = 0x242; ptr[i++] = 0x11; break; + case AMDGPU_TEST_GFX_MAX: + assert(1 && "Not Support gfx, never go here"); + break; } ptr[i++] = PACKET3(PACKET3_DRAW_INDEX_AUTO, 1); @@ -2010,6 +2035,9 @@ ptr_cmd[i++] = 0x400; i++; break; + case AMDGPU_TEST_GFX_MAX: + assert(1 && "Not Support gfx, never go here"); + break; } ptr_cmd[i++] = PACKET3(PACKET3_SET_SH_REG, 4); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/tests/util/kms.c new/libdrm-2.4.121/tests/util/kms.c --- old/libdrm-2.4.120/tests/util/kms.c 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/tests/util/kms.c 2024-06-01 19:31:41.000000000 +0200 @@ -126,6 +126,7 @@ "simpledrm", "imx-lcdif", "vkms", + "tidss", }; int util_open(const char *device, const char *module) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/xf86drm.c new/libdrm-2.4.121/xf86drm.c --- old/libdrm-2.4.120/xf86drm.c 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/xf86drm.c 2024-06-01 19:31:41.000000000 +0200 @@ -4471,14 +4471,24 @@ { struct stat sbuf; char node[PATH_MAX + 1]; - int node_type, subsystem_type; + int node_type, subsystem_type, written; unsigned int maj, min; + const int max_node_length = ALIGN(drmGetMaxNodeName(), sizeof(void *)); node_type = drmGetNodeType(d_name); if (node_type < 0) return -1; - snprintf(node, PATH_MAX, "%s/%s", DRM_DIR_NAME, d_name); + written = snprintf(node, PATH_MAX, "%s/%s", DRM_DIR_NAME, d_name); + if (written < 0) + return -1; + + /* anything longer than this will be truncated in drmDeviceAlloc. + * Account for NULL byte + */ + if (written + 1 > max_node_length) + return -1; + if (stat(node, &sbuf)) return -1; @@ -4585,6 +4595,7 @@ const char *dev_name; int node_type, subsystem_type; int maj, min, n, ret; + const int max_node_length = ALIGN(drmGetMaxNodeName(), sizeof(void *)); if (device == NULL) return -EINVAL; @@ -4603,9 +4614,14 @@ if (!dev_name) return -EINVAL; + /* anything longer than this will be truncated in drmDeviceAlloc. + * Account for NULL byte + */ n = snprintf(node, PATH_MAX, dev_name, DRM_DIR_NAME, min); if (n == -1 || n >= PATH_MAX) return -errno; + if (written + 1 > max_node_length) + return -EINVAL if (stat(node, &sbuf)) return -EINVAL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdrm-2.4.120/xf86drm.h new/libdrm-2.4.121/xf86drm.h --- old/libdrm-2.4.120/xf86drm.h 2024-01-13 10:37:07.000000000 +0100 +++ new/libdrm-2.4.121/xf86drm.h 2024-06-01 19:31:41.000000000 +0200 @@ -926,6 +926,11 @@ */ extern int drmGetNodeTypeFromDevId(dev_t devid); +/** + * Check if two drmDevice pointers represent the same DRM device. + * + * Returns 1 if the devices are equal, 0 otherwise. + */ extern int drmDevicesEqual(drmDevicePtr a, drmDevicePtr b); extern int drmSyncobjCreate(int fd, uint32_t flags, uint32_t *handle);