template <typename Buffer>

class GpuMapping

Defined at line 64 of file ../../src/graphics/magma/lib/magma_service/util/gpu_mapping.h

GpuMapping is created by a connection thread, and mutated only by that connection thread.

However, shared references to GpuMapping may be taken by command buffers, keeping them alive

while the mappings are in flight.

Therefore, GpuMappings can be destroyed from the device thread, if the connection has removed

all its references.

Mutation of the page tables in an AddressSpace is therefore thread locked.

Public Methods

void GpuMapping<Buffer> (std::shared_ptr<AddressSpace<GpuMapping<Buffer>>> address_space, std::shared_ptr<Buffer> buffer, uint64_t offset, uint64_t length, uint64_t gpu_addr, std::unique_ptr<magma::PlatformBusMapper::BusMapping> bus_mapping)

Defined at line 66 of file ../../src/graphics/magma/lib/magma_service/util/gpu_mapping.h

void ~GpuMapping<Buffer> ()

Defined at line 74 of file ../../src/graphics/magma/lib/magma_service/util/gpu_mapping.h

Buffer * buffer ()

Defined at line 76 of file ../../src/graphics/magma/lib/magma_service/util/gpu_mapping.h

std::weak_ptr<AddressSpace<GpuMapping<Buffer>>> address_space ()

Defined at line 78 of file ../../src/graphics/magma/lib/magma_service/util/gpu_mapping.h

void Grow (std::unique_ptr<magma::PlatformBusMapper::BusMapping> bus_mapping)

Add the given |bus_mapping|.

Note that length() changes as a result.

Defined at line 82 of file ../../src/graphics/magma/lib/magma_service/util/gpu_mapping.h

bool Release (std::vector<std::unique_ptr<magma::PlatformBusMapper::BusMapping>> * bus_mappings_out)

Releases the gpu mapping, returns all bus mappings in |bus_mappings_out|.

Called by the device thread (via destructor), or connection thread.

Defined at line 112 of file ../../src/graphics/magma/lib/magma_service/util/gpu_mapping.h