* Fixed the mix of bufferCount vs. max_segment_count with regards to
B_BLOCK_DEVICE_MAX_SG_BLOCKS as pointed out by Ingo. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26972 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
ad12e71861
commit
61b1a536e8
@ -817,7 +817,7 @@ cd_set_capacity(cd_driver_info *info, uint64 capacity, uint32 blockSize)
|
||||
}
|
||||
|
||||
// TODO: we need to replace the DMAResource in our IOScheduler
|
||||
status_t status = info->dma_resource->Init(info->node, blockSize);
|
||||
status_t status = info->dma_resource->Init(info->node, blockSize, 32);
|
||||
if (status != B_OK)
|
||||
panic("initializing DMAResource failed: %s", strerror(status));
|
||||
|
||||
|
@ -363,7 +363,7 @@ das_set_capacity(das_driver_info* info, uint64 capacity, uint32 blockSize)
|
||||
}
|
||||
|
||||
// TODO: we need to replace the DMAResource in our IOScheduler
|
||||
status_t status = info->dma_resource->Init(info->node, blockSize);
|
||||
status_t status = info->dma_resource->Init(info->node, blockSize, 32);
|
||||
if (status != B_OK)
|
||||
panic("initializing DMAResource failed: %s", strerror(status));
|
||||
|
||||
|
@ -115,7 +115,7 @@ DMAResource::~DMAResource()
|
||||
|
||||
|
||||
status_t
|
||||
DMAResource::Init(device_node* node, size_t blockSize)
|
||||
DMAResource::Init(device_node* node, size_t blockSize, uint32 bufferCount)
|
||||
{
|
||||
dma_restrictions restrictions;
|
||||
memset(&restrictions, 0, sizeof(dma_restrictions));
|
||||
@ -139,10 +139,9 @@ DMAResource::Init(device_node* node, size_t blockSize)
|
||||
B_BLOCK_DEVICE_MAX_BLOCKS_ITEM, &value, true) == B_OK)
|
||||
restrictions.max_transfer_size = value * blockSize;
|
||||
|
||||
uint32 bufferCount;
|
||||
if (gDeviceManagerModule.get_attr_uint32(node,
|
||||
B_BLOCK_DEVICE_MAX_SG_BLOCKS, &bufferCount, true) != B_OK)
|
||||
bufferCount = 16;
|
||||
B_BLOCK_DEVICE_MAX_SG_BLOCKS, &value, true) == B_OK)
|
||||
restrictions.max_segment_count = value;
|
||||
|
||||
return Init(restrictions, blockSize, bufferCount);
|
||||
}
|
||||
|
@ -72,7 +72,8 @@ public:
|
||||
|
||||
status_t Init(const dma_restrictions& restrictions,
|
||||
size_t blockSize, uint32 bufferCount);
|
||||
status_t Init(device_node* node, size_t blockSize);
|
||||
status_t Init(device_node* node, size_t blockSize,
|
||||
uint32 bufferCount);
|
||||
|
||||
status_t CreateBuffer(DMABuffer** _buffer)
|
||||
{ return CreateBuffer(0, _buffer); }
|
||||
|
Loading…
Reference in New Issue
Block a user