| # Copyright 2020 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/test.gni") |
| |
| driver_bind_rules("virtio_gpu_bind") { |
| rules = "virtio_gpu.bind" |
| header_output = "virtio_gpu_bind.h" |
| tests = "bind_tests.json" |
| deps = [ "//src/devices/bind/fuchsia.pci" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":virtio-gpu-test-package", |
| ":virtio_gpu_bind_test", |
| ] |
| } |
| |
| source_set("gpu_lib") { |
| configs += [ "//build/config:all_source" ] |
| sources = [ "gpu.cc" ] |
| public_deps = [ |
| "//sdk/banjo/fuchsia.hardware.display.controller:fuchsia.hardware.display.controller_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_banjo_cpp", |
| "//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_llcpp", |
| "//src/devices/bus/lib/virtio", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/image-format", |
| ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| |
| # TODO(fxbug.dev/95833): This target uses the deprecated C bindings. |
| # Consider switching to the C++ bindings. See linked bug for details. |
| configs += [ "//build/c:fidl-deprecated-c-bindings" ] |
| } |
| |
| fuchsia_driver("virtio_gpu-driver") { |
| output_name = "virtio_gpu" |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ "gpu_driver.cc" ] |
| deps = [ |
| ":gpu_lib", |
| ":virtio_gpu_bind", |
| "//src/devices/bus/lib/virtio", |
| "//src/devices/lib/driver", |
| "//src/lib/ddktl", |
| ] |
| } |
| |
| fuchsia_driver_component("virtio_gpu") { |
| info = "virtio_gpu-info.json" |
| component_name = "virtio_gpu" |
| deps = [ ":virtio_gpu-driver" ] |
| colocate = true |
| } |
| |
| test("virtio-gpu-test") { |
| output_name = "virtio-gpu-test-test" |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| sources = [ "gpu_test.cc" ] |
| deps = [ |
| ":gpu_lib", |
| "//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_llcpp_testing", |
| "//src/devices/bus/lib/virtio", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/no_ddk", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| fuchsia_unittest_package("virtio-gpu-test-package") { |
| package_name = "virtio-gpu-test" |
| deps = [ ":virtio-gpu-test" ] |
| } |