@@ -517,19 +517,17 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryForImageImpl(const A
517517 drm_i915_gem_create create = {0 , 0 , 0 };
518518 create.size = allocationData.imgInfo ->size ;
519519
520- auto ret = this ->getDrm (allocationData.rootDeviceIndex ).ioctl (DRM_IOCTL_I915_GEM_CREATE, &create);
520+ [[maybe_unused]] auto ret = this ->getDrm (allocationData.rootDeviceIndex ).ioctl (DRM_IOCTL_I915_GEM_CREATE, &create);
521521 DEBUG_BREAK_IF (ret != 0 );
522- UNUSED_VARIABLE (ret);
523522
524523 std::unique_ptr<BufferObject, BufferObject::Deleter> bo (new (std::nothrow) BufferObject (&getDrm (allocationData.rootDeviceIndex ), create.handle , allocationData.imgInfo ->size , maxOsContextCount));
525524 if (!bo) {
526525 return nullptr ;
527526 }
528527 bo->setAddress (gpuRange);
529528
530- auto ret2 = bo->setTiling (I915_TILING_Y, static_cast <uint32_t >(allocationData.imgInfo ->rowPitch ));
529+ [[maybe_unused]] auto ret2 = bo->setTiling (I915_TILING_Y, static_cast <uint32_t >(allocationData.imgInfo ->rowPitch ));
531530 DEBUG_BREAK_IF (ret2 != true );
532- UNUSED_VARIABLE (ret2);
533531
534532 auto allocation = new DrmAllocation (allocationData.rootDeviceIndex , allocationData.type , bo.get (), nullptr , gpuRange, allocationData.imgInfo ->size , MemoryPool::SystemCpuInaccessible);
535533 allocation->setDefaultGmm (gmm.release ());
@@ -635,10 +633,10 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromSharedHandle(o
635633 auto ret = this ->getDrm (properties.rootDeviceIndex ).ioctl (DRM_IOCTL_PRIME_FD_TO_HANDLE, &openFd);
636634
637635 if (ret != 0 ) {
638- int err = errno;
636+ [[maybe_unused]] int err = errno;
639637 PRINT_DEBUG_STRING (DebugManager.flags .PrintDebugMessages .get (), stderr, " ioctl(PRIME_FD_TO_HANDLE) failed with %d. errno=%d(%s)\n " , ret, err, strerror (err));
640638 DEBUG_BREAK_IF (ret != 0 );
641- UNUSED_VARIABLE (ret);
639+
642640 return nullptr ;
643641 }
644642
@@ -819,9 +817,9 @@ uint64_t DrmMemoryManager::getSystemSharedMemory(uint32_t rootDeviceIndex) {
819817
820818 drm_i915_gem_context_param getContextParam = {};
821819 getContextParam.param = I915_CONTEXT_PARAM_GTT_SIZE;
822- auto ret = getDrm (rootDeviceIndex).ioctl (DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM, &getContextParam);
820+ [[maybe_unused]] auto ret = getDrm (rootDeviceIndex).ioctl (DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM, &getContextParam);
823821 DEBUG_BREAK_IF (ret != 0 );
824- UNUSED_VARIABLE (ret);
822+
825823 uint64_t gpuMemorySize = getContextParam.value ;
826824
827825 return std::min (hostMemorySize, gpuMemorySize);
@@ -887,9 +885,8 @@ void DrmMemoryManager::cleanOsHandles(OsHandleStorage &handleStorage, uint32_t r
887885 if (osHandle->bo ) {
888886 BufferObject *search = osHandle->bo ;
889887 search->wait (-1 );
890- auto refCount = unreference (search, true );
888+ [[maybe_unused]] auto refCount = unreference (search, true );
891889 DEBUG_BREAK_IF (refCount != 1u );
892- UNUSED_VARIABLE (refCount);
893890 }
894891 delete handleStorage.fragmentStorageData [i].osHandleStorage ;
895892 handleStorage.fragmentStorageData [i].osHandleStorage = nullptr ;
0 commit comments