| # 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" |
| 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", |
| ":virtio_gpu_bind_test", |
| ] |
| } |
| |
| source_set("common_srcs") { |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "gpu-device-driver.cc", |
| "gpu-device-driver.h", |
| "gpu-device.cc", |
| "gpu-device.h", |
| ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.hardware.display.engine:fuchsia.hardware.display.engine_cpp", |
| "//sdk/fidl/fuchsia.hardware.pci:fuchsia.hardware.pci_cpp", |
| "//sdk/fidl/fuchsia.hardware.sysmem:fuchsia.hardware.sysmem_cpp", |
| "//sdk/fidl/fuchsia.sysmem2:fuchsia.sysmem2_cpp", |
| "//sdk/lib/driver/compat/cpp", |
| "//sdk/lib/driver/component/cpp", |
| "//sdk/lib/driver/devfs/cpp", |
| "//sdk/lib/driver/legacy-bind-constants", |
| "//src/devices/bind/fuchsia.display:fuchsia.display_cpp", |
| "//src/devices/lib/driver:driver_runtime", |
| "//src/graphics/lib/virtio:virtio-spec", |
| "//src/lib/fxl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/sysmem-version", |
| ] |
| } |
| |
| 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-device-driver-test.cc", |
| "virtio-abi-test.cc", |
| ] |
| deps = [ |
| ":common_srcs", |
| "//sdk/fidl/fuchsia.hardware.pci:fuchsia.hardware.pci_cpp_testing", |
| "//sdk/fidl/fuchsia.sysmem2:fuchsia.sysmem2_cpp_testing", |
| "//sdk/lib/async_patterns/testing/cpp", |
| "//sdk/lib/driver/component/cpp:cpp_test", |
| "//sdk/lib/driver/testing/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//src/devices/testing/fake-bti", |
| "//src/graphics/display/lib/api-types-cpp:api-types-cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/predicates", |
| ] |
| } |
| |
| fuchsia_unittest_package("virtio-gpu-test-package") { |
| package_name = "virtio-gpu-test" |
| deps = [ ":virtio-gpu-test" ] |
| |
| # TODO(https://fxbug.dev/42084608): Remove this block when below error is resolved. |
| # There's expected error logs that happen in the integration test where |
| # GetBtiAndBackend fails in GpuDevice::Create due to testing |
| # without a fake GPU backend in place. |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |