blob: aa17f466151c36d52ca831c6ee2fbb122b91055c [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/bind/bind.gni")
import("//build/config/fuchsia/rules.gni")
import("//src/graphics/lib/magma/gnbuild/magma.gni")
bind_rules("msg_img_rgx_mt8167_bind") {
rules = "mt8167s-gpu.bind"
output = "mt8167s-gpu-bind.h"
tests = "bind-tests.json"
deps = [ "//src/devices/bind/fuchsia.mediatek.platform" ]
}
driver_module("msd_img_rgx_mt8167") {
output_name = "libmsd_img_rgx_mt8167"
if (magma_enable_developer_build) {
testonly = true
}
if (magma_enable_developer_build) {
deps = [ ":test_driver_sources" ]
} else {
deps = [ ":driver_sources" ]
}
deps += [ "//src/graphics/lib/magma/src/magma_util/platform:logger_for_system_drivers" ]
}
template("driver_source_template") {
source_set(target_name) {
sources = [
"mt8167s-gpu.cc",
"mt8167s-gpu.h",
]
public_deps = [
":msg_img_rgx_mt8167_bind",
"../include",
"//sdk/banjo/fuchsia.hardware.clock:fuchsia.hardware.clock_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.platform.device",
"//sdk/fidl/fuchsia.gpu.magma:fuchsia.gpu.magma_llcpp",
"//src/devices/bus/lib/device-protocol-pdev",
"//src/devices/bus/lib/device-protocol-platform-device",
"//src/devices/lib/driver",
"//src/devices/lib/mmio",
"//src/graphics/lib/magma/src/magma_util:macros",
"//src/graphics/lib/magma/src/magma_util/platform:logger",
"//src/graphics/lib/magma/src/magma_util/platform:trace",
"//src/graphics/lib/magma/src/magma_util/platform:trace_provider",
"//src/graphics/lib/magma/src/magma_util/platform:trace_provider_with_fdio",
"//src/graphics/lib/magma/src/sys_driver",
"//src/graphics/lib/magma/tests/helper:platform_device_helper",
"//src/lib/ddk",
"//src/lib/ddktl",
"//third_party/imgtec-pvr-rgx-km:src",
"//zircon/system/ulib/fidl-utils",
]
if (invoker.developer_build) {
testonly = true
defines = [ "MAGMA_TEST_DRIVER=1" ]
deps = [
"//src/graphics/lib/magma/tests/unit_tests:magma_platform_hardware_tests",
"//src/graphics/lib/magma/tests/unit_tests:msd_abi_conformance_tests",
"//third_party/googletest:gtest",
"//third_party/imgtec-pvr-rgx-km:unit_tests",
]
sources += [ "driver_test_gtest.cc" ]
}
if (defined(invoker.configs)) {
configs += invoker.configs
}
}
}
driver_source_template("driver_sources") {
developer_build = false
}
driver_source_template("test_driver_sources") {
developer_build = true
}
group("tests") {
testonly = true
deps = [ ":msg_img_rgx_mt8167_bind_test" ]
}