| # 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_v1") { |
| rules = "virtio_gpu.bind" |
| tests = "bind_tests.json" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.pci:fuchsia.hardware.pci_bindlib", |
| "//sdk/fidl/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_bindlib", |
| "//src/devices/bind/fuchsia.acpi", |
| "//src/devices/bind/fuchsia.pci", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":virtio-gpu-test-package-v1", |
| ":virtio_gpu_bind_v1_test", |
| ] |
| } |
| |
| source_set("gpu_control_server") { |
| sources = [ |
| "gpu-control-server.cc", |
| "gpu-control-server.h", |
| ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.gpu.virtio:fuchsia.gpu.virtio_cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//sdk/lib/driver/runtime:driver_runtime_cpp", |
| "//src/devices/bin/driver_runtime", |
| "//src/lib/ddk", |
| ] |
| } |
| |
| source_set("common_srcs") { |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "display-engine.cc", |
| "display-engine.h", |
| "gpu-device-driver.cc", |
| "gpu-device-driver.h", |
| "virtio-gpu-device.cc", |
| "virtio-gpu-device.h", |
| "virtio-pci-device.cc", |
| "virtio-pci-device.h", |
| ] |
| public_deps = [ |
| ":gpu_control_server", |
| "//sdk/banjo/fuchsia.hardware.display.controller:fuchsia.hardware.display.controller_banjo_cpp", |
| "//sdk/fidl/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_cpp", |
| "//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_cpp", |
| "//src/devices/bus/lib/virtio", |
| "//src/devices/lib/driver", |
| "//src/graphics/display/lib/api-types-cpp", |
| "//src/graphics/lib/virtio:virtio-spec", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//src/lib/fxl", |
| "//zircon/system/ulib/image-format", |
| "//zircon/system/ulib/sysmem-version", |
| ] |
| } |
| |
| test("virtio-gpu-test") { |
| output_name = "virtio-gpu-test-test-v1" |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| sources = [ |
| "display-engine-test.cc", |
| "virtio-abi-test.cc", |
| ] |
| deps = [ |
| ":common_srcs", |
| "//sdk/fidl/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_cpp_testing", |
| "//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_cpp_testing", |
| "//sdk/lib/async-loop-testing/cpp", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/no_ddk", |
| "//src/lib/fsl", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/predicates", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| } |
| |
| fuchsia_unittest_package("virtio-gpu-test-package-v1") { |
| package_name = "virtio-gpu-test-v1" |
| deps = [ ":virtio-gpu-test" ] |
| } |