1/*
2 * Copyright © 2021 Collabora, Ltd.
3 * Author: Antonio Caggiano <antonio.caggiano@collabora.com>
4 *
5 * SPDX-License-Identifier: MIT
6 */
7
8#pragma once
9
10struct panfrost_device;
11struct panfrost_perf;
12
13namespace pps
14{
15class PanfrostDevice
16{
17   public:
18   PanfrostDevice(int fd);
19   ~PanfrostDevice();
20
21   PanfrostDevice(const PanfrostDevice &) = delete;
22   PanfrostDevice &operator=(const PanfrostDevice &) = delete;
23
24   PanfrostDevice(PanfrostDevice&&);
25   PanfrostDevice& operator=(PanfrostDevice&&);
26
27   void *ctx = nullptr;
28   struct panfrost_device* dev = nullptr;
29};
30
31class PanfrostPerf
32{
33   public:
34   PanfrostPerf(const PanfrostDevice& dev);
35   ~PanfrostPerf();
36
37   PanfrostPerf(const PanfrostPerf &) = delete;
38   PanfrostPerf &operator=(const PanfrostPerf &) = delete;
39
40   PanfrostPerf(PanfrostPerf&&);
41   PanfrostPerf& operator=(PanfrostPerf&&);
42
43   int enable() const;
44   void disable() const;
45   int dump() const;
46
47   struct panfrost_perf *perf = nullptr;
48};
49
50} // namespace pps
51