Magma Contributing and Best Practices
Submitting a patch
The core magma code is found under:
Magma service drivers are found under:
Magma client drivers are third party codebases. Open source client drivers typically live in third_party/mesa.
Coding Conventions and Formatting
- Use the Google style guide for source code.
- Run clang-format on your changes to maintain consistent formatting.
Build Configuration for Testing
Product for L0 and L1 testing:
Packages for L0 and L1 testing:
Product for L2 testing:
Package for L2 testing:
For details on the testing strategy for magma, see Test Strategy.
There are multiple levels for magma TPS. Each level includes all previous levels.
When submitting a change, indicate the TPS level tested, prefaced by the hardware on which the testing was performed:
Includes all unit tests and integration tests. There are 2 steps at this tps level:
Build with --args magma_enable_developer_build=true; this will run unit tests that require hardware when the system driver starts, then exposes the device as usual. Inspect the syslog for test results.
--with src/graphics/lib/magma/tests:l0and run the test script src/graphics/lib/magma/scripts/test.sh.
If you have an attached display, execute the spinning vkcube.
This test uses an imagepipe swapchain to pass frames to the system compositor.
Test with present direct to display:
run vkcube-on-fb --c 500
Test with present via Scenic:
run present_view fuchsia-pkg://fuchsia.com/vkcube-on-scenic#meta/vkcube-on-scenic.cmx.
A full UI 'smoke' test. Build the entire product including your change.
Login as Guest on the device and run both of these commands: ./scripts/fx shell sessionctl --story_name=spinning_cube --mod_name=spinning_cube --mod_url=spinning_cube add_mod spinning_cube ./scripts/fx shell sessionctl --story_name=spinning_cube2 --mod_name=spinning_cube2 --mod_url=spinning_cube add_mod spinning_cube
For details, refer to top level project documentation.
Run vkcube-on-scenic overnight (12-24 hours).
A full UI stress test. Launch two instances of the spinning_cube flutter example, and let them run overnight.
For some changes, it's appropriate to run the Vulkan conformance test suite before submitting. See Conformance.
For some changes, it's appropriate to run benchmarks to validate performance metrics. See Benchmarking.
For details on the Vulkan conformance test suite, see
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-03-11.