mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
gfxstream: make functions static when needed
Fixes errors like:
ResourceTracker.cpp:62:6: error: no previous prototype for function 'zx_handle_close'
[-Werror,-Wmissing-prototypes]
Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38632>
This commit is contained in:
parent
0a231dfb40
commit
b6df034363
3 changed files with 36 additions and 33 deletions
|
|
@ -39,15 +39,15 @@ static bool GetRingParamsFromCapset(enum VirtGpuCapset capset, const VirtGpuCaps
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
address_space_handle_t virtgpu_address_space_open() {
|
static address_space_handle_t virtgpu_address_space_open() {
|
||||||
return (address_space_handle_t)(-EINVAL);
|
return (address_space_handle_t)(-EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void virtgpu_address_space_close(address_space_handle_t) {
|
static void virtgpu_address_space_close(address_space_handle_t) {
|
||||||
// Handle opened by VirtioGpuDevice wrapper
|
// Handle opened by VirtioGpuDevice wrapper
|
||||||
}
|
}
|
||||||
|
|
||||||
bool virtgpu_address_space_ping(address_space_handle_t, struct address_space_ping* info) {
|
static bool virtgpu_address_space_ping(address_space_handle_t, struct address_space_ping* info) {
|
||||||
int ret;
|
int ret;
|
||||||
struct VirtGpuExecBuffer exec = {};
|
struct VirtGpuExecBuffer exec = {};
|
||||||
VirtGpuDevice* instance = VirtGpuDevice::getInstance();
|
VirtGpuDevice* instance = VirtGpuDevice::getInstance();
|
||||||
|
|
|
||||||
|
|
@ -435,8 +435,8 @@ void applyDescriptorSetAllocation(VkDescriptorPool pool, VkDescriptorSetLayout s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeDescriptorSetAllocation(VkDescriptorPool pool,
|
static void removeDescriptorSetAllocation(
|
||||||
const std::vector<VkDescriptorSetLayoutBinding>& bindings) {
|
VkDescriptorPool pool, const std::vector<VkDescriptorSetLayoutBinding>& bindings) {
|
||||||
auto allocInfo = as_goldfish_VkDescriptorPool(pool)->allocInfo;
|
auto allocInfo = as_goldfish_VkDescriptorPool(pool)->allocInfo;
|
||||||
|
|
||||||
if (0 == allocInfo->usedSets) {
|
if (0 == allocInfo->usedSets) {
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,7 @@ PERFETTO_DEFINE_CATEGORIES(
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef VK_USE_PLATFORM_FUCHSIA
|
#ifndef VK_USE_PLATFORM_FUCHSIA
|
||||||
void zx_handle_close(zx_handle_t) {}
|
static void zx_handle_close(zx_handle_t) {}
|
||||||
void zx_event_create(int, zx_handle_t*) {}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static constexpr uint32_t kDefaultApiVersion = VK_MAKE_VERSION(1, 1, 0);
|
static constexpr uint32_t kDefaultApiVersion = VK_MAKE_VERSION(1, 1, 0);
|
||||||
|
|
@ -243,51 +242,55 @@ struct CommandBufferPendingDescriptorSets {
|
||||||
|
|
||||||
GOLDFISH_VK_LIST_HANDLE_TYPES(HANDLE_REGISTER_IMPL_IMPL)
|
GOLDFISH_VK_LIST_HANDLE_TYPES(HANDLE_REGISTER_IMPL_IMPL)
|
||||||
GOLDFISH_VK_LIST_TRIVIAL_HANDLE_TYPES(HANDLE_UNREGISTER_IMPL_IMPL)
|
GOLDFISH_VK_LIST_TRIVIAL_HANDLE_TYPES(HANDLE_UNREGISTER_IMPL_IMPL)
|
||||||
uint32_t getWaitSemaphoreCount(const VkSubmitInfo& pSubmit) { return pSubmit.waitSemaphoreCount; }
|
static uint32_t getWaitSemaphoreCount(const VkSubmitInfo& pSubmit) {
|
||||||
|
return pSubmit.waitSemaphoreCount;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t getWaitSemaphoreCount(const VkSubmitInfo2& pSubmit) {
|
static uint32_t getWaitSemaphoreCount(const VkSubmitInfo2& pSubmit) {
|
||||||
return pSubmit.waitSemaphoreInfoCount;
|
return pSubmit.waitSemaphoreInfoCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t getCommandBufferCount(const VkSubmitInfo& pSubmit) { return pSubmit.commandBufferCount; }
|
static uint32_t getCommandBufferCount(const VkSubmitInfo& pSubmit) {
|
||||||
|
return pSubmit.commandBufferCount;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t getCommandBufferCount(const VkSubmitInfo2& pSubmit) {
|
static uint32_t getCommandBufferCount(const VkSubmitInfo2& pSubmit) {
|
||||||
return pSubmit.commandBufferInfoCount;
|
return pSubmit.commandBufferInfoCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t getSignalSemaphoreCount(const VkSubmitInfo& pSubmit) {
|
static uint32_t getSignalSemaphoreCount(const VkSubmitInfo& pSubmit) {
|
||||||
return pSubmit.signalSemaphoreCount;
|
return pSubmit.signalSemaphoreCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t getSignalSemaphoreCount(const VkSubmitInfo2& pSubmit) {
|
static uint32_t getSignalSemaphoreCount(const VkSubmitInfo2& pSubmit) {
|
||||||
return pSubmit.signalSemaphoreInfoCount;
|
return pSubmit.signalSemaphoreInfoCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkSemaphore getWaitSemaphore(const VkSubmitInfo& pSubmit, int i) {
|
static VkSemaphore getWaitSemaphore(const VkSubmitInfo& pSubmit, int i) {
|
||||||
return pSubmit.pWaitSemaphores[i];
|
return pSubmit.pWaitSemaphores[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
VkSemaphore getWaitSemaphore(const VkSubmitInfo2& pSubmit, int i) {
|
static VkSemaphore getWaitSemaphore(const VkSubmitInfo2& pSubmit, int i) {
|
||||||
return pSubmit.pWaitSemaphoreInfos[i].semaphore;
|
return pSubmit.pWaitSemaphoreInfos[i].semaphore;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkSemaphore getSignalSemaphore(const VkSubmitInfo& pSubmit, int i) {
|
static VkSemaphore getSignalSemaphore(const VkSubmitInfo& pSubmit, int i) {
|
||||||
return pSubmit.pSignalSemaphores[i];
|
return pSubmit.pSignalSemaphores[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
VkSemaphore getSignalSemaphore(const VkSubmitInfo2& pSubmit, int i) {
|
static VkSemaphore getSignalSemaphore(const VkSubmitInfo2& pSubmit, int i) {
|
||||||
return pSubmit.pSignalSemaphoreInfos[i].semaphore;
|
return pSubmit.pSignalSemaphoreInfos[i].semaphore;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkCommandBuffer getCommandBuffer(const VkSubmitInfo& pSubmit, int i) {
|
static VkCommandBuffer getCommandBuffer(const VkSubmitInfo& pSubmit, int i) {
|
||||||
return pSubmit.pCommandBuffers[i];
|
return pSubmit.pCommandBuffers[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
VkCommandBuffer getCommandBuffer(const VkSubmitInfo2& pSubmit, int i) {
|
static VkCommandBuffer getCommandBuffer(const VkSubmitInfo2& pSubmit, int i) {
|
||||||
return pSubmit.pCommandBufferInfos[i].commandBuffer;
|
return pSubmit.pCommandBufferInfos[i].commandBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool descriptorPoolSupportsIndividualFreeLocked(VkDescriptorPool pool) {
|
static bool descriptorPoolSupportsIndividualFreeLocked(VkDescriptorPool pool) {
|
||||||
return as_goldfish_VkDescriptorPool(pool)->allocInfo->createFlags &
|
return as_goldfish_VkDescriptorPool(pool)->allocInfo->createFlags &
|
||||||
VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;
|
VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;
|
||||||
}
|
}
|
||||||
|
|
@ -311,7 +314,7 @@ VkDescriptorImageInfo createImmutableSamplersFilteredImageInfo(
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool descriptorBindingIsImmutableSampler(VkDescriptorSet dstSet, uint32_t dstBinding) {
|
static bool descriptorBindingIsImmutableSampler(VkDescriptorSet dstSet, uint32_t dstBinding) {
|
||||||
return as_goldfish_VkDescriptorSet(dstSet)->reified->bindingIsImmutableSampler[dstBinding];
|
return as_goldfish_VkDescriptorSet(dstSet)->reified->bindingIsImmutableSampler[dstBinding];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -750,7 +753,7 @@ uint64_t ResourceTracker::getAHardwareBufferId(AHardwareBuffer* ahw) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void transformExternalResourceMemoryDedicatedRequirementsForGuest(
|
static void transformExternalResourceMemoryDedicatedRequirementsForGuest(
|
||||||
VkMemoryDedicatedRequirements* dedicatedReqs) {
|
VkMemoryDedicatedRequirements* dedicatedReqs) {
|
||||||
dedicatedReqs->prefersDedicatedAllocation = VK_TRUE;
|
dedicatedReqs->prefersDedicatedAllocation = VK_TRUE;
|
||||||
dedicatedReqs->requiresDedicatedAllocation = VK_TRUE;
|
dedicatedReqs->requiresDedicatedAllocation = VK_TRUE;
|
||||||
|
|
@ -808,7 +811,7 @@ void ResourceTracker::EmitGuestAndHostTraceMarker(VkEncoder* encoder) {
|
||||||
#endif // HAVE_PERFETTO
|
#endif // HAVE_PERFETTO
|
||||||
}
|
}
|
||||||
|
|
||||||
VkResult acquireSync(uint64_t syncId, int64_t& osHandle) {
|
static VkResult acquireSync(uint64_t syncId, int64_t& osHandle) {
|
||||||
struct VirtGpuExecBuffer exec = {};
|
struct VirtGpuExecBuffer exec = {};
|
||||||
struct gfxstreamAcquireSync acquireSync = {};
|
struct gfxstreamAcquireSync acquireSync = {};
|
||||||
VirtGpuDevice* instance = VirtGpuDevice::getInstance();
|
VirtGpuDevice* instance = VirtGpuDevice::getInstance();
|
||||||
|
|
@ -826,7 +829,7 @@ VkResult acquireSync(uint64_t syncId, int64_t& osHandle) {
|
||||||
return VK_SUCCESS;
|
return VK_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
VkResult createFence(VkDevice device, uint64_t hostFenceHandle, int64_t& osHandle) {
|
static VkResult createFence(VkDevice device, uint64_t hostFenceHandle, int64_t& osHandle) {
|
||||||
struct VirtGpuExecBuffer exec = {};
|
struct VirtGpuExecBuffer exec = {};
|
||||||
struct gfxstreamCreateExportSyncVK exportSync = {};
|
struct gfxstreamCreateExportSyncVK exportSync = {};
|
||||||
VirtGpuDevice* instance = VirtGpuDevice::getInstance();
|
VirtGpuDevice* instance = VirtGpuDevice::getInstance();
|
||||||
|
|
@ -848,7 +851,7 @@ VkResult createFence(VkDevice device, uint64_t hostFenceHandle, int64_t& osHandl
|
||||||
return VK_SUCCESS;
|
return VK_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void collectAllPendingDescriptorSetsBottomUp(const std::vector<VkCommandBuffer>& workingSet,
|
static void collectAllPendingDescriptorSetsBottomUp(const std::vector<VkCommandBuffer>& workingSet,
|
||||||
std::unordered_set<VkDescriptorSet>& allDs) {
|
std::unordered_set<VkDescriptorSet>& allDs) {
|
||||||
if (workingSet.empty()) return;
|
if (workingSet.empty()) return;
|
||||||
|
|
||||||
|
|
@ -880,7 +883,7 @@ void collectAllPendingDescriptorSetsBottomUp(const std::vector<VkCommandBuffer>&
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void commitDescriptorSetUpdates(void* context, VkQueue queue,
|
static void commitDescriptorSetUpdates(void* context, VkQueue queue,
|
||||||
const std::unordered_set<VkDescriptorSet>& sets) {
|
const std::unordered_set<VkDescriptorSet>& sets) {
|
||||||
VkEncoder* enc = (VkEncoder*)context;
|
VkEncoder* enc = (VkEncoder*)context;
|
||||||
|
|
||||||
|
|
@ -1028,7 +1031,7 @@ uint32_t ResourceTracker::syncEncodersForCommandBuffer(VkCommandBuffer commandBu
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void addPendingDescriptorSets(VkCommandBuffer commandBuffer, uint32_t descriptorSetCount,
|
static void addPendingDescriptorSets(VkCommandBuffer commandBuffer, uint32_t descriptorSetCount,
|
||||||
const VkDescriptorSet* pDescriptorSets) {
|
const VkDescriptorSet* pDescriptorSets) {
|
||||||
struct goldfish_VkCommandBuffer* cb = as_goldfish_VkCommandBuffer(commandBuffer);
|
struct goldfish_VkCommandBuffer* cb = as_goldfish_VkCommandBuffer(commandBuffer);
|
||||||
|
|
||||||
|
|
@ -1045,7 +1048,7 @@ void addPendingDescriptorSets(VkCommandBuffer commandBuffer, uint32_t descriptor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void decDescriptorSetLayoutRef(void* context, VkDevice device,
|
static void decDescriptorSetLayoutRef(void* context, VkDevice device,
|
||||||
VkDescriptorSetLayout descriptorSetLayout,
|
VkDescriptorSetLayout descriptorSetLayout,
|
||||||
const VkAllocationCallbacks* pAllocator) {
|
const VkAllocationCallbacks* pAllocator) {
|
||||||
if (!descriptorSetLayout) return;
|
if (!descriptorSetLayout) return;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue