| # 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/components.gni") |
| import("//build/drivers.gni") |
| import("//build/testing/cc_test_executable.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":aml-gpu-test", |
| ":aml_gpu_bind_test", |
| ] |
| } |
| |
| driver_bind_rules("aml_gpu_bind") { |
| rules = "meta/aml_gpu.bind" |
| bind_output = "aml-gpu.bindbc" |
| tests = "meta/bind_tests.json" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.clock:fuchsia.hardware.clock_bindlib", |
| "//sdk/fidl/fuchsia.hardware.registers:fuchsia.hardware.registers_bindlib", |
| "//src/devices/bind/fuchsia.amlogic.platform", |
| "//src/devices/bind/fuchsia.arm.platform", |
| "//src/devices/bind/fuchsia.devicetree", |
| "//src/devices/bind/fuchsia.platform", |
| ] |
| } |
| |
| source_set("common") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ |
| "aml-gpu.cc", |
| "aml-gpu.h", |
| "s905d2-gpu.h", |
| "s912-gpu.h", |
| "t931-gpu.h", |
| ] |
| deps = [ |
| "//sdk/lib/driver/platform-device/cpp", |
| "//zircon/system/ulib/ddk-platform-defs", |
| ] |
| public_deps = [ |
| ":aml_gpu_bind", |
| "//sdk/fidl/fuchsia.hardware.clock:fuchsia.hardware.clock_cpp", |
| "//sdk/fidl/fuchsia.hardware.gpu.amlogic:fuchsia.hardware.gpu.amlogic_cpp", |
| "//sdk/fidl/fuchsia.hardware.gpu.mali:fuchsia.hardware.gpu.mali_cpp", |
| "//sdk/fidl/fuchsia.hardware.registers:fuchsia.hardware.registers_cpp", |
| "//sdk/lib/driver/compat/cpp", |
| "//sdk/lib/driver/component/cpp", |
| "//sdk/lib/driver/mmio/cpp", |
| "//sdk/lib/driver/outgoing/cpp", |
| "//sdk/lib/driver/runtime:driver_runtime", |
| "//src/devices/bind/fuchsia.arm.platform:fuchsia.arm.platform_cpp", |
| "//src/devices/bind/fuchsia.platform:fuchsia.platform_cpp", |
| "//src/devices/lib/amlogic", |
| "//src/devices/lib/driver:driver_runtime", |
| "//src/devices/tee/drivers/optee:tee_smc", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/sync:sync-cpp", |
| "//zircon/system/ulib/trace", |
| ] |
| } |
| |
| fuchsia_cc_driver("aml-gpu-driver") { |
| output_name = "aml-gpu" |
| deps = [ ":common" ] |
| } |
| |
| fuchsia_driver_component("aml-gpu") { |
| component_name = "aml-gpu" |
| deps = [ ":aml-gpu-driver" ] |
| info = "meta/aml-gpu-info.json" |
| manifest = "meta/aml-gpu.cml" |
| } |
| |
| fuchsia_driver_package("aml-gpu-package") { |
| export_to_bazel = true |
| driver_components = [ ":aml-gpu" ] |
| } |
| |
| cc_test_executable("aml-gpu-test-bin") { |
| testonly = true |
| output_name = "aml-gpu-test" |
| sources = [ "aml-gpu-test.cc" ] |
| deps = [ |
| ":common", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/async-loop:async-loop-default", |
| "//sdk/lib/async_patterns/testing/cpp", |
| "//sdk/lib/driver/runtime/testing/cpp", |
| "//sdk/lib/driver/testing/cpp", |
| "//src/devices/registers/testing/mock-registers", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("aml-gpu-test") { |
| deps = [ ":aml-gpu-test-bin" ] |
| } |