| # Copyright 2016 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/drivers.gni") |
| import("//src/graphics/lib/magma/gnbuild/magma.gni") |
| |
| # The gpu device |
| fuchsia_driver("msd_intel-driver") { |
| output_name = "libmsd_intel" |
| |
| deps = [ |
| ":msd_intel_entry", |
| "$magma_build_root/src/magma_util/platform:logger_for_system_drivers", |
| "src", |
| ] |
| } |
| |
| fuchsia_driver_component("msd_intel") { |
| component_name = "libmsd_intel" |
| deps = [ ":msd_intel-driver" ] |
| info = "msd_intel-info.json" |
| colocate = true |
| root_resource = true |
| uses_profiles = true |
| } |
| |
| # The gpu device; runs gtests at startup |
| fuchsia_driver("msd_intel_test-driver") { |
| testonly = true |
| |
| output_name = "libmsd_intel_test" |
| |
| deps = [ |
| ":msd_intel_test_entry", |
| "$magma_build_root/src/magma_util/platform:logger_for_system_drivers", |
| "src", |
| ] |
| } |
| |
| fuchsia_driver_component("msd_intel_test") { |
| testonly = true |
| component_name = "libmsd_intel_test" |
| deps = [ ":msd_intel_test-driver" ] |
| info = "msd_intel_test-info.json" |
| colocate = true |
| } |
| |
| driver_bind_rules("msd_intel_bind") { |
| rules = "msd_intel.bind" |
| header_output = "bind.h" |
| tests = "tests/bind_tests.json" |
| deps = [ "//src/devices/bind/fuchsia.intel.gpucore" ] |
| } |
| |
| driver_bind_rules("msd_intel_test_bind") { |
| rules = "msd_intel.bind" |
| header_output = "test_bind.h" |
| disable_autobind = true |
| deps = [ "//src/devices/bind/fuchsia.intel.gpucore" ] |
| } |
| |
| source_set("msd_intel_entry") { |
| public_configs = [ "$msd_intel_gen_build_root:msd_src_include_config" ] |
| sources = [ "src/driver_entry.cc" ] |
| |
| # Add the target gen directory as an include path so that `#include "bind.h"` will find the |
| # correct generated bind header. This allows us to use the same binding.cc file with multiple |
| # different bind rules. |
| include_dirs = [ "${target_gen_dir}" ] |
| |
| deps = [ |
| ":msd_intel_bind", |
| "src", |
| "//sdk/fidl/fuchsia.gpu.magma:fuchsia.gpu.magma_llcpp", |
| "//src/devices/lib/driver", |
| "//src/graphics/lib/magma/src/magma_util:macros", |
| "//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/magma_util/platform/zircon:performance_counter_device", |
| "//src/graphics/lib/magma/src/magma_util/platform/zircon:status", |
| "//src/graphics/lib/magma/src/sys_driver", |
| "//src/lib/ddk", |
| "//src/zircon/lib/zircon", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| # TODO(fxbug.dev/94768): This target uses mutable tables which are deprecated, |
| # rather than builders. |
| configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ] |
| } |
| |
| source_set("msd_intel_test_entry") { |
| testonly = true |
| |
| public_configs = [ "$msd_intel_gen_build_root:msd_src_include_config" ] |
| sources = [ "src/driver_entry.cc" ] |
| defines = [ "MAGMA_TEST_DRIVER=1" ] |
| |
| # Add the target gen directory as an include path so that `#include "bind.h"` will find the |
| # correct generated bind header. |
| include_dirs = [ "${target_gen_dir}" ] |
| |
| deps = [ |
| ":msd_intel_test_bind", |
| "src", |
| "//sdk/fidl/fuchsia.gpu.magma:fuchsia.gpu.magma_llcpp", |
| "//src/devices/lib/driver", |
| "//src/graphics/lib/magma/src/magma_util:macros", |
| "//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/magma_util/platform/zircon:status", |
| "//src/graphics/lib/magma/src/sys_driver", |
| "//src/lib/ddk", |
| "//src/zircon/lib/zircon", |
| "//zircon/system/ulib/zx", |
| ] |
| deps += [ |
| "tests/unit_tests:hardware_tests", |
| "//src/graphics/lib/magma/src/magma_util/platform/zircon:pci_driver_gtest", |
| "//src/graphics/lib/magma/src/magma_util/platform/zircon:performance_counter_device", |
| "//src/graphics/lib/magma/tests/unit_tests:magma_platform_hardware_tests", |
| "//src/graphics/lib/magma/tests/unit_tests:msd_conformance_tests", |
| ] |
| |
| # TODO(fxbug.dev/94768): This target uses mutable tables which are deprecated, |
| # rather than builders. |
| configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ] |
| } |
| |
| # This config allows inclusion of headers via relative paths |
| config("msd_tests_include_config") { |
| include_dirs = [ "tests" ] |
| } |
| |
| # This config allows inclusion of headers via relative paths |
| config("msd_src_include_config") { |
| include_dirs = [ "src" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":msd_intel_bind_test", |
| "tests", |
| ] |
| } |
| |
| fuchsia_driver_package("msd-intel-gen") { |
| driver_components = [ ":msd_intel" ] |
| } |
| |
| fuchsia_driver_package("msd-intel-gen-test") { |
| testonly = true |
| driver_components = [ ":msd_intel_test" ] |
| deps = [ "//src/graphics/lib/magma/tests/unit_tests:test_firmware" ] |
| } |
| |
| group("test-driver") { |
| testonly = true |
| deps = [ ":msd-intel-gen-test" ] |
| } |