Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for TD mode to DMA #8

Closed
wants to merge 1 commit into from
Closed

Added support for TD mode to DMA #8

wants to merge 1 commit into from

Conversation

gberthou
Copy link

Hi!

I forked your repo to add support for TD/2D mode to the actual DMA system. Here are some details about what and why. I am open to any discussion.
Thank you in advance for reading this pull request and for accepting it maybe!

Have a nice day,
Gautier

Background

I was working on a Raspberry Pi application with two windows in the same framebuffer, horizontally aligned as you can see on the following picture.
Screenshot
I wanted to update only one window, and to be as efficient as possible, I wanted to do it using the DMA. I could have built a chained list of DMA control blocks, but as I wanted the operation to be optimized, I thought that it would be better if the ARM CPU did not waste too much time building the control blocks. Fortunately bcm2835 documentation provides one way to do it with one single control block, by using the TD mode. I tried it and it worked fine on real hardware. However qemu would raise an assert and crash. That's why I decided to look at qemu's source code.

Modifications

All the modifications are located in hw/dma/bcm2835_dma.c. I transformed the assert into a simple if statement so that branching can occur between "normal" mode and TD mode. Since the portion of code that performs one step (i.e., that does one "word" copy) would be the same, I put it in a seperate function called bcm2835_dma_step so that there won't be any copy/paste.

@Torlus
Copy link
Owner

Torlus commented Apr 10, 2016

Oops forgot this one... Sorry.
As my code has finally reached mainstream, if it is still relevant, I suggest to create a PR on this repo instead.
Thanks for your work.

@Torlus Torlus closed this Apr 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants