quic/qbox
Loading...
Searching...
No Matches
virtio_gpu.h
1/*
2 * This file is part of libqbox
3 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All Rights Reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8#ifndef _LIBQBOX_COMPONENTS_VIRTIO_GPU_H
9#define _LIBQBOX_COMPONENTS_VIRTIO_GPU_H
10
11#include <cci_configuration>
12
13#include <libgssync.h>
14
15#include <qemu_gpex/include/qemu_gpex.h>
16
18{
19public:
20 cci::cci_param<uint8_t> p_outputs;
21
22 void before_end_of_elaboration() override
23 {
24 qemu_gpex::Device::before_end_of_elaboration();
25 get_qemu_dev().set_prop_uint("max_outputs", p_outputs);
26 }
27
28 void gpex_realize(qemu::Bus& bus) override { qemu_gpex::Device::gpex_realize(bus); }
29
30 uint8_t outputs() { return p_outputs.get_value(); }
31
32protected:
33 QemuVirtioGpu(const sc_core::sc_module_name& name, QemuInstance& inst, const char* gpu_type, qemu_gpex* gpex)
34 : QemuVirtioGpu(name, inst, gpu_type, gpex, (const char*)NULL)
35 {
36 }
37
38 QemuVirtioGpu(const sc_core::sc_module_name& name, QemuInstance& inst, const char* gpu_type, qemu_gpex* gpex,
39 const char* device_id)
40 : qemu_gpex::Device(name, inst, gpu_type, device_id), p_outputs("outputs", 1, "Number of outputs for this gpu")
41 {
42 gpex->add_device(*this);
43 }
44};
45#endif
This class encapsulates a libqemu-cxx qemu::LibQemu instance. It handles QEMU parameters and instance...
Definition qemu-instance.h:89
Definition target.h:160
Definition virtio_gpu.h:18
Definition libqemu-cxx.h:732
Definition qemu_gpex.h:35
Definition qemu_gpex.h:32