gl/dma: Fix range calculation when creating DMA blocks
This commit is contained in:
@@ -22,7 +22,7 @@ namespace gl
|
|||||||
void* userptr = vm::get_super_ptr(base_address);
|
void* userptr = vm::get_super_ptr(base_address);
|
||||||
|
|
||||||
m_data = std::make_unique<gl::buffer>();
|
m_data = std::make_unique<gl::buffer>();
|
||||||
m_data->create(buffer::target::array, block_size, userptr, buffer::memory_type::userptr, 0);
|
m_data->create(buffer::target::copy_dst, block_size, userptr, buffer::memory_type::userptr, 0);
|
||||||
m_base_address = base_address;
|
m_base_address = base_address;
|
||||||
|
|
||||||
// Some drivers may reject userptr input for whatever reason. Check that the state is still valid.
|
// Some drivers may reject userptr input for whatever reason. Check that the state is still valid.
|
||||||
@@ -77,7 +77,7 @@ namespace gl
|
|||||||
{
|
{
|
||||||
const auto start_block_address = start & s_dma_block_mask;
|
const auto start_block_address = start & s_dma_block_mask;
|
||||||
const auto end_block_address = (start + length + s_dma_block_size - 1) & s_dma_block_mask;
|
const auto end_block_address = (start + length + s_dma_block_size - 1) & s_dma_block_mask;
|
||||||
return utils::address_range32::start_end(start_block_address, end_block_address);
|
return utils::address_range32::start_length(start_block_address, end_block_address - start_block_address);
|
||||||
}
|
}
|
||||||
|
|
||||||
const dma_block& get_block(u32 start, u32 length)
|
const dma_block& get_block(u32 start, u32 length)
|
||||||
|
|||||||
Reference in New Issue
Block a user