videocore

package
v3.4.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package videocore interacts with the VideoCore GPU found on bcm283x.

This package shouldn't be used directly, it is used by bcm283x's DMA implementation.

Datasheet

While not an actual datasheet, this is the closest to actual formal documentation: https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mem

type Mem struct {
	*pmem.View
	// contains filtered or unexported fields
}

Mem represents contiguous physically locked memory that was allocated by VideoCore.

The memory is mapped in user space.

func Alloc

func Alloc(size int) (*Mem, error)

Alloc allocates a continuous chunk of physical memory for use with DMA controller.

Size must be rounded to 4Kb.

Example
package main

import (
	"log"

	"periph.io/x/periph/host/videocore"
)

func main() {
	// Allocates physical memory on a Broadcom CPU by leveraging the GPU.
	// This memory can be leveraged to do DMA operations.
	m, err := videocore.Alloc(64536)
	if err != nil {
		log.Fatal(err)
	}
	// Use m
	if err := m.Close(); err != nil {
		log.Fatal(err)
	}
}
Output:

func (*Mem) Close

func (m *Mem) Close() error

Close unmaps the physical memory allocation.

It is important to call this function otherwise the memory is locked until the host reboots.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL