LibVirtGPU: Move VirGLDemo protocol code into VirtGPU namespace

This commit is contained in:
Stephan Unverwerth 2022-12-21 15:16:19 +01:00 committed by Andreas Kling
parent a95eea5ae2
commit 51ac0d73a3
Notes: sideshowbarker 2024-07-17 02:35:07 +09:00
3 changed files with 18 additions and 3 deletions

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2022, Sahan Fernando <sahan.h.fernando@gmail.com>
* Copyright (c) 2022, Stephan Unverwerth <s.unverwerth@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
@ -9,12 +10,15 @@
#include <Kernel/API/VirGL.h>
#include <sys/ioctl_numbers.h>
#include "CommandBufferBuilder.h"
#include "VirGLProtocol.h"
#include <LibVirtGPU/CommandBufferBuilder.h>
#include <LibVirtGPU/VirGLProtocol.h>
namespace VirtGPU {
constexpr int DRAWTARGET_WIDTH = 500;
constexpr int DRAWTARGET_HEIGHT = 500;
static u32 encode_command(u32 length, u32 mid, Protocol::VirGLCommand command)
{
u32 command_value = to_underlying(command);
@ -301,3 +305,5 @@ void CommandBufferBuilder::append_bind_dsa(ObjectHandle handle)
CommandBuilder builder(m_buffer, Protocol::VirGLCommand::BIND_OBJECT, to_underlying(Protocol::ObjectType::DSA));
builder.appendu32(handle.value()); // VIRGL_OBJ_BIND_HANDLE
}
}

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2022, Sahan Fernando <sahan.h.fernando@gmail.com>
* Copyright (c) 2022, Stephan Unverwerth <s.unverwerth@serenityos.org>
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
@ -9,9 +10,10 @@
#include <AK/StringView.h>
#include <AK/Vector.h>
#include <LibVirtGPU/VirGLProtocol.h>
#include <sys/ioctl_numbers.h>
#include "VirGLProtocol.h"
namespace VirtGPU {
class CommandBufferBuilder {
public:
@ -41,3 +43,5 @@ public:
private:
Vector<u32> m_buffer;
};
}

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2022, Sahan Fernando <sahan.h.fernando@gmail.com>
* Copyright (c) 2022, Stephan Unverwerth <s.unverwerth@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -8,6 +9,8 @@
#include <AK/DistinctNumeric.h>
namespace VirtGPU {
AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, ObjectHandle);
AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, ResourceID);
@ -208,3 +211,5 @@ enum class ShaderType : u32 {
};
}
}