Skip to content

Commit 33ca5aa

Browse files
cyndisthierryreding
authored andcommitted
gpu: host1x: Remove mid-job CDMA flushes
The current code can issue CDMA flushes (DMAPUT bumps) in the middle of a job, before all opcodes have been written into the pushbuffer. This can happen when pushbuffer fills up. Presumably this made sense at some point in the past, but it doesn't anymore, as it cannot lead to more space appearing in the pushbuffer as it is only cleaned full jobs at a time. Mid-job flushes can also cause problems, as in an extreme situation (seen in practice), the hardware can run through the entire pushbuffer including the prefix of a partially written job without the driver being able to process any CDMA updates. This can cause the engine MLOCK to be taken and held for extended periods as the tail of the job is not yet available to hardware. Signed-off-by: Mikko Perttunen <[email protected]> Signed-off-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 408ec8e commit 33ca5aa

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

drivers/gpu/host1x/cdma.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,6 @@ static int host1x_cdma_wait_pushbuffer_space(struct host1x *host1x,
247247
trace_host1x_wait_cdma(dev_name(cdma_to_channel(cdma)->dev),
248248
CDMA_EVENT_PUSH_BUFFER_SPACE);
249249

250-
host1x_hw_cdma_flush(host1x, cdma);
251-
252250
/* If somebody has managed to already start waiting, yield */
253251
if (cdma->event != CDMA_EVENT_NONE) {
254252
mutex_unlock(&cdma->lock);
@@ -591,19 +589,16 @@ int host1x_cdma_begin(struct host1x_cdma *cdma, struct host1x_job *job)
591589
*/
592590
void host1x_cdma_push(struct host1x_cdma *cdma, u32 op1, u32 op2)
593591
{
594-
struct host1x *host1x = cdma_to_host1x(cdma);
595592
struct push_buffer *pb = &cdma->push_buffer;
596593
u32 slots_free = cdma->slots_free;
597594

598595
if (host1x_debug_trace_cmdbuf)
599596
trace_host1x_cdma_push(dev_name(cdma_to_channel(cdma)->dev),
600597
op1, op2);
601598

602-
if (slots_free == 0) {
603-
host1x_hw_cdma_flush(host1x, cdma);
599+
if (slots_free == 0)
604600
slots_free = host1x_cdma_wait_locked(cdma,
605601
CDMA_EVENT_PUSH_BUFFER_SPACE);
606-
}
607602

608603
cdma->slots_free = slots_free - 1;
609604
cdma->slots_used++;

0 commit comments

Comments
 (0)