blob: 195abaa65f4c9ed95d386c56893eb25f8e57905c [file] [log] [blame]
# 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/config/fuchsia/rules.gni")
import("//build/test.gni")
import("//build/test/test_package.gni")
group("tests") {
testonly = true
deps = [
":sysmem-unittest",
":sysmem_bind_test",
]
}
bind_rules("sysmem_bind") {
rules = "sysmem.bind"
output = "sysmem-bind.h"
tests = "bind_tests.json"
deps = [ "//src/devices/bind/fuchsia.platform" ]
}
source_set("sysmem_common_srcs") {
sources = [
"allocator.cc",
"buffer_collection.cc",
"buffer_collection_token.cc",
"contiguous_pooled_memory_allocator.cc",
"device.cc",
"driver.cc",
"koid_util.cc",
"logging.cc",
"logical_buffer_collection.cc",
"memory_allocator.cc",
"usage_pixel_format_cost.cc",
"utils.cc",
]
public_deps = [
"//sdk/banjo/ddk.protocol.platform.bus",
"//sdk/banjo/ddk.protocol.platform.device",
"//sdk/banjo/ddk.protocol.sysmem",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_c",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_llcpp",
"//sdk/fidl/fuchsia.sysmem2:fuchsia.sysmem2_llcpp",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/public/lib/async-cpp",
"//zircon/public/lib/fbl",
"//zircon/public/lib/fidl",
"//zircon/public/lib/fit",
"//zircon/public/lib/sync",
"//zircon/public/lib/zx",
"//zircon/public/lib/zx",
"//zircon/system/ulib/async-default",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/closure-queue",
"//zircon/system/ulib/fidl-async-2",
"//zircon/system/ulib/fidl-utils",
"//zircon/system/ulib/image-format",
"//zircon/system/ulib/inspect",
"//zircon/system/ulib/region-alloc",
"//zircon/system/ulib/trace:trace-driver",
]
deps = [
"//zircon/system/ulib/fidl-async-2",
"//zircon/system/ulib/fidl-utils",
"//zircon/system/ulib/image-format",
"//zircon/system/ulib/region-alloc",
"//zircon/system/ulib/sysmem-make-tracking",
"//zircon/system/ulib/sysmem-version",
]
}
driver_module("sysmem") {
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
if (is_fuchsia) {
fdio_config = [ "//build/config/fuchsia:fdio_config" ]
if (configs + fdio_config - fdio_config != configs) {
configs -= fdio_config
}
}
sources = [ "binding.cc" ]
deps = [
":sysmem_bind",
":sysmem_common_srcs",
"//src/devices/lib/driver",
]
}
test("sysmem-unittest-executable") {
if (is_fuchsia) {
fdio_config = [ "//build/config/fuchsia:fdio_config" ]
if (configs + fdio_config - fdio_config != configs) {
configs -= fdio_config
}
}
output_name = "sysmem-unittest"
sources = [
"test/contiguous_pooled_memory_allocator_test.cc",
"test/device_test.cc",
"test/pixel_format_cost_test.cc",
]
include_dirs = [ "." ]
deps = [
":sysmem_common_srcs",
"//sdk/banjo/ddk.protocol.platform.bus",
"//sdk/banjo/ddk.protocol.platform.device",
"//sdk/banjo/ddk.protocol.sysmem",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_c",
"//src/devices/testing/fake-bti",
"//src/devices/testing/fake_ddk",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/public/lib/async-cpp",
"//zircon/public/lib/fbl",
"//zircon/public/lib/fidl",
"//zircon/public/lib/fit",
"//zircon/public/lib/sync",
"//zircon/public/lib/zx",
"//zircon/public/lib/zxtest",
"//zircon/system/ulib/async-default",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/closure-queue",
"//zircon/system/ulib/fidl-async-2",
"//zircon/system/ulib/fidl-utils",
"//zircon/system/ulib/image-format",
"//zircon/system/ulib/region-alloc",
"//zircon/system/ulib/sysmem-make-tracking",
"//zircon/system/ulib/sysmem-version",
]
}
unittest_package("sysmem-unittest") {
deps = [ ":sysmem-unittest-executable" ]
tests = [
{
name = "sysmem-unittest"
},
]
}