buflib: Remove compulsory IRQ disable during buffer move.

It can cause excessively long interrupt outages if moving a larger
buffer and disrupt audio where DMA is not at a higher interrupt priority
such as FIQ.

Some targets, like Gigabeat S, have very low audio interrupt latency
requirements and will even channel swap if they are missed. Pictureflow
will make the issue very obvious. Even then, moves could take
milliseconds or more depending on the buffer size which is far too long
for any target.

Change-Id: I8e7817213e901da67c36b7eb25d7cb1c1e3ba802
Reviewed-on: http://gerrit.rockbox.org/472
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested-by: Michael Sevakis <jethead71@rockbox.org>
This commit is contained in:
Michael Sevakis 2013-05-16 16:15:34 -04:00
parent 33f3af2b8d
commit b7e0e1a0a3

View file

@ -208,18 +208,10 @@ move_block(struct buflib_context* ctx, union buflib_data* block, int shift)
new_block = block + shift; new_block = block + shift;
new_start = tmp->alloc + shift*sizeof(union buflib_data); new_start = tmp->alloc + shift*sizeof(union buflib_data);
/* disable IRQs to make accessing the buffer from interrupt context safe. */ /* If move must be synchronized with use, user should have specified a
/* protect the move callback, as a cached global pointer might be updated callback that handles this */
* in it. and protect "tmp->alloc = new_start" for buflib_get_data() */
/* call the callback before moving */
if (ops && ops->sync_callback) if (ops && ops->sync_callback)
{
ops->sync_callback(handle, true); ops->sync_callback(handle, true);
}
else
{
disable_irq();
}
bool retval = false; bool retval = false;
if (!ops || ops->move_callback(handle, tmp->alloc, new_start) if (!ops || ops->move_callback(handle, tmp->alloc, new_start)
@ -231,13 +223,7 @@ move_block(struct buflib_context* ctx, union buflib_data* block, int shift)
} }
if (ops && ops->sync_callback) if (ops && ops->sync_callback)
{
ops->sync_callback(handle, false); ops->sync_callback(handle, false);
}
else
{
enable_irq();
}
return retval; return retval;
} }