mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-18 05:08:06 +02:00
In file included from ../src/tool/pps/pps_device.cc:10:
../src/tool/pps/pps_device.h:23:11: error: ‘uint32_t’ does not name a type
23 | static uint32_t device_count();
| ^~~~~~~~
In file included from ../src/tool/pps/pps_counter.cc:10:
../src/tool/pps/pps_counter.h:22:4: error: ‘uint32_t’ does not name a type
22 | uint32_t id;
| ^~~~~~~~
Fixes: 1cc72b2aef ("pps: Gfx-pps v0.3.0")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8186
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21714>
54 lines
1.3 KiB
C++
54 lines
1.3 KiB
C++
/*
|
|
* Copyright © 2020 Collabora, Ltd.
|
|
* Author: Antonio Caggiano <antonio.caggiano@collabora.com>
|
|
* Author: Rohan Garg <rohan.garg@collabora.com>
|
|
* Author: Robert Beckett <bob.beckett@collabora.com>
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace pps
|
|
{
|
|
/// @brief Helper class for a DRM device
|
|
class DrmDevice
|
|
{
|
|
public:
|
|
/// @return The number of DRM devices available in the system
|
|
static uint32_t device_count();
|
|
|
|
/// @return All DRM devices available in the system
|
|
static std::vector<DrmDevice> create_all();
|
|
|
|
/// @return A DRM device selected by its number in the system, nullopt otherwise
|
|
static std::optional<DrmDevice> create(int32_t gpu_num);
|
|
|
|
/// @brief Prefer calling create instead of default constructor
|
|
DrmDevice() = default;
|
|
|
|
// Allow move
|
|
DrmDevice(DrmDevice &&);
|
|
DrmDevice &operator=(DrmDevice &&);
|
|
|
|
// Forbid copy
|
|
DrmDevice(const DrmDevice &) = delete;
|
|
DrmDevice &operator=(const DrmDevice &) = delete;
|
|
|
|
~DrmDevice();
|
|
|
|
/// @return Whether a device has a valid name
|
|
operator bool() const;
|
|
|
|
/// File descriptor of the device opened in read/write mode
|
|
int fd = -1;
|
|
int32_t gpu_num = -1;
|
|
std::string name = "";
|
|
};
|
|
|
|
} // namespace pps
|