From 226669227ebf4fdd6276d880de36f306a1ea3a24 Mon Sep 17 00:00:00 2001 From: Lukas Zapolskas Date: Mon, 24 Mar 2025 19:57:27 +0000 Subject: [PATCH] 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 --- src/panfrost/ds/meson.build | 1 + src/panfrost/ds/pan_pps_dev.cpp | 36 ++++++++++++++++++++++++++++++++ src/panfrost/ds/pan_pps_perf.cpp | 20 ------------------ 3 files changed, 37 insertions(+), 20 deletions(-) create mode 100644 src/panfrost/ds/pan_pps_dev.cpp diff --git a/src/panfrost/ds/meson.build b/src/panfrost/ds/meson.build index b61b02ee248..8f8f5ccae5d 100644 --- a/src/panfrost/ds/meson.build +++ b/src/panfrost/ds/meson.build @@ -5,6 +5,7 @@ pps_panfrost_sources = [ 'pan_pps_perf.cpp', + 'pan_pps_dev.cpp', 'pan_pps_driver.cpp' ] diff --git a/src/panfrost/ds/pan_pps_dev.cpp b/src/panfrost/ds/pan_pps_dev.cpp new file mode 100644 index 00000000000..065a9c46b7d --- /dev/null +++ b/src/panfrost/ds/pan_pps_dev.cpp @@ -0,0 +1,36 @@ +/* + * Copyright © 2021 Collabora, Ltd. + * SPDX-License-Identifier: MIT + */ + +#include "pan_pps_perf.h" + +#include +#include + +#include +#include + +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 diff --git a/src/panfrost/ds/pan_pps_perf.cpp b/src/panfrost/ds/pan_pps_perf.cpp index fce1792f55f..f801779c18e 100644 --- a/src/panfrost/ds/pan_pps_perf.cpp +++ b/src/panfrost/ds/pan_pps_perf.cpp @@ -12,26 +12,6 @@ #include 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(