panfrost: Move PanfrostDevice to a separate file

Put PanfrostDevice into it's own file to keep pan_pps_perf.cpp focused on
the panfrost specific producer implementation.

Signed-off-by: Lukas Zapolskas <lukas.zapolskas@arm.com>
This commit is contained in:
Lukas Zapolskas 2025-03-24 19:57:27 +00:00 committed by Christoph Pillmayer
parent 7e7d9cddc7
commit 226669227e
3 changed files with 37 additions and 20 deletions

View file

@ -5,6 +5,7 @@
pps_panfrost_sources = [
'pan_pps_perf.cpp',
'pan_pps_dev.cpp',
'pan_pps_driver.cpp'
]

View file

@ -0,0 +1,36 @@
/*
* Copyright © 2021 Collabora, Ltd.
* SPDX-License-Identifier: MIT
*/
#include "pan_pps_perf.h"
#include <lib/kmod/pan_kmod.h>
#include <perf/pan_perf.h>
#include <pps/pps.h>
#include <util/ralloc.h>
namespace pps {
PanfrostDevice::PanfrostDevice(int fd): fd(fd)
{
assert(fd >= 0);
}
PanfrostDevice::~PanfrostDevice()
{
}
PanfrostDevice::PanfrostDevice(PanfrostDevice &&o): fd{o.fd}
{
o.fd = -1;
}
PanfrostDevice &
PanfrostDevice::operator=(PanfrostDevice &&o)
{
std::swap(fd, o.fd);
return *this;
}
} // namespace pps

View file

@ -12,26 +12,6 @@
#include <util/ralloc.h>
namespace pps {
PanfrostDevice::PanfrostDevice(int fd): fd(fd)
{
assert(fd >= 0);
}
PanfrostDevice::~PanfrostDevice()
{
}
PanfrostDevice::PanfrostDevice(PanfrostDevice &&o): fd{o.fd}
{
o.fd = -1;
}
PanfrostDevice &
PanfrostDevice::operator=(PanfrostDevice &&o)
{
std::swap(fd, o.fd);
return *this;
}
PanfrostPerf::PanfrostPerf(const PanfrostDevice &dev)
: perf{reinterpret_cast<struct pan_perf *>(