-
Notifications
You must be signed in to change notification settings - Fork 54
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
Initial Pi VideoCore and DMA support #14
Conversation
kenbell
commented
Sep 26, 2020
- DMA is just memory to memory transfers for now
- VideoCore mailbox is functional
* DMA is just memory to memory transfers for now * VideoCore mailbox is functional
Very cool! Here's the output of the functions for boards I have lying around. It seems this "interrogation" can indeed be used to detect the available RAM like suggested in #13 (comment). However, other values, such a BoardModel/Serial/CPUAvailableDMAChannels look fishy. Raspberry Pi 1 A
Raspberry Pi 1 B
Raspberry Pi 1 B+
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Please rename dmaController to DMAController (it is exported through the
DMA
variable anyway so it's beneficial to export the type as well. -
Rather than having
lock
as sync.Mutex, requiring c.lock.Lock(), please just declaresync.Mutex
as a struct member so that you can do c.Lock() (see here). Same thing applies tomailbox
type. -
To be consistent with the rest of the code
regBase
should bebase
? -
If
CopyRAMToRAM
is not RAM specific (e.g. would it work on other kind of memories?) it's probably better to rename it to something simpler? Usually in the DMA world MemToMem is used, but I'd also favor the simplicty ofCopy
? -
The
136
in functionEDID
should be a constant. -
Please maintain the copyright notices format which I added in the last merge. Also the header of
framebuffer.go
,messages.go
is inconsistent with the others. -
Function
PhysicalSize
has a typo in its comment as well as a spurious newline, it would also be best to name the return arguments to indicate what they are consistently with its set counterpart. -
In
messages.go
why not attaching the const comments to each individual group? Or have the URL as group comment and the individual values as a comment before each constant? -
In
videocore.go
all functions follow the same pattern for msg creation, mailox call, etc. I feel maybe this should be abstracted with a function that takes ID, buffer size and tag as arguments? There is clearly a repeating pattern and the whole file could be much shorter with just one helper function don't you think?
Thanks for the contribution! Looking forward to merge it.
Heya, any thoughts on my change request? |
Hey - the comments look good. Got distracted with another project. I'll work on making the changes. |
I've pushed a change that I think addresses the review comments. |