blob: b770931ed77728c14f4d52231369595e579f4b2e [file] [log] [blame]
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/cipd.gni")
import("//build/config.gni")
import("//build/package.gni")
import("//garnet/lib/magma/gnbuild/magma.gni")
group("magma-vulkan") {
if (magma_enable_developer_build) {
testonly = true
deps = [
"//garnet/lib/magma/tests/unit_tests:testing_firmware_file",
]
}
public_deps = [
":magma-img-rgx-mt8167",
":magma-img-rgx-mt8167-firmware",
]
if (build_libvulkan_img_rgx != []) {
public_deps += [ ":magma-img-rgx-mt8167-config" ]
}
}
group("magma-vulkan-no-hardware") {
testonly = true
# Without internal access (and the firmware) the driver will fail to load.
if (internal_access) {
public_deps = [
":magma-img-rgx-mt8167-firmware",
":magma-img-rgx-no-hardware",
]
}
}
package("magma-img-rgx-mt8167-firmware") {
deprecated_system_image = true
# internal access is needed to get the firmware.
if (internal_access) {
# The firmware is treated as a library, so the copy needs to go into the
# shared library toolchain directory instead of the main toolchain.
deps = [
":firmware($shlib_toolchain)",
]
libraries = [
{
name = "firmware/rgx.fw.22.40.54.30"
},
]
}
}
package("magma-img-rgx-mt8167") {
deprecated_system_image = true
deps = [
"//garnet/drivers/gpu/msd-img-rgx/mtk:msd_img_rgx_mt8167",
]
if (magma_enable_developer_build) {
testonly = true
}
if (build_libvulkan_img_rgx != []) {
deps += build_libvulkan_img_rgx
libraries = [
{
name = "libvulkan_img_rgx_mt8167.so"
},
]
}
drivers = [
{
name = "libmsd_img_rgx_mt8167.so"
},
]
}
package("magma-img-rgx-no-hardware") {
deprecated_system_image = true
deps = [
"//garnet/drivers/gpu/msd-img-rgx/no_hardware:msd_img_rgx_no_hardware",
]
drivers = [
{
name = "libmsd_img_rgx_no_hardware.so"
},
]
}
if (build_libvulkan_img_rgx != []) {
# api_version must be present but is unused
icd_data = [
"{",
"\"file_format_version\": \"1.0.0\",",
"\"ICD\": {",
"\"library_path\": \"libvulkan_img_rgx_mt8167.so\",",
"\"api_version\": \"1.0.0\"",
"}",
"}",
]
write_file("$target_gen_dir/vulkan/icd.d/libvulkan_img_rgx_mt8167.json",
icd_data)
config_data("magma-img-rgx-mt8167-config") {
for_pkg = "vulkan-icd"
sources = [
rebase_path("$target_gen_dir/vulkan/icd.d/libvulkan_img_rgx_mt8167.json"),
]
outputs = [
"icd.d/{{source_file_part}}",
]
}
}
copy("firmware") {
sources = [
"//garnet/drivers/gpu/msd-img-rgx/mtk/firmware/rgx.fw.22.40.54.30",
]
outputs = [
"$root_out_dir/firmware/rgx.fw.22.40.54.30",
]
}