mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:47:35 +00:00
LibVirtGPU: Move VirGLDemo protocol code into VirtGPU namespace
This commit is contained in:
parent
a95eea5ae2
commit
51ac0d73a3
3 changed files with 18 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022, Sahan Fernando <sahan.h.fernando@gmail.com>
|
* 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.
|
* Copyright (c) 2022, the SerenityOS developers.
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
@ -9,12 +10,15 @@
|
||||||
#include <Kernel/API/VirGL.h>
|
#include <Kernel/API/VirGL.h>
|
||||||
#include <sys/ioctl_numbers.h>
|
#include <sys/ioctl_numbers.h>
|
||||||
|
|
||||||
#include "CommandBufferBuilder.h"
|
#include <LibVirtGPU/CommandBufferBuilder.h>
|
||||||
#include "VirGLProtocol.h"
|
#include <LibVirtGPU/VirGLProtocol.h>
|
||||||
|
|
||||||
|
namespace VirtGPU {
|
||||||
|
|
||||||
constexpr int DRAWTARGET_WIDTH = 500;
|
constexpr int DRAWTARGET_WIDTH = 500;
|
||||||
constexpr int DRAWTARGET_HEIGHT = 500;
|
constexpr int DRAWTARGET_HEIGHT = 500;
|
||||||
|
|
||||||
|
|
||||||
static u32 encode_command(u32 length, u32 mid, Protocol::VirGLCommand command)
|
static u32 encode_command(u32 length, u32 mid, Protocol::VirGLCommand command)
|
||||||
{
|
{
|
||||||
u32 command_value = to_underlying(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));
|
CommandBuilder builder(m_buffer, Protocol::VirGLCommand::BIND_OBJECT, to_underlying(Protocol::ObjectType::DSA));
|
||||||
builder.appendu32(handle.value()); // VIRGL_OBJ_BIND_HANDLE
|
builder.appendu32(handle.value()); // VIRGL_OBJ_BIND_HANDLE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022, Sahan Fernando <sahan.h.fernando@gmail.com>
|
* 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.
|
* Copyright (c) 2022, the SerenityOS developers.
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
@ -9,9 +10,10 @@
|
||||||
|
|
||||||
#include <AK/StringView.h>
|
#include <AK/StringView.h>
|
||||||
#include <AK/Vector.h>
|
#include <AK/Vector.h>
|
||||||
|
#include <LibVirtGPU/VirGLProtocol.h>
|
||||||
#include <sys/ioctl_numbers.h>
|
#include <sys/ioctl_numbers.h>
|
||||||
|
|
||||||
#include "VirGLProtocol.h"
|
namespace VirtGPU {
|
||||||
|
|
||||||
class CommandBufferBuilder {
|
class CommandBufferBuilder {
|
||||||
public:
|
public:
|
||||||
|
@ -41,3 +43,5 @@ public:
|
||||||
private:
|
private:
|
||||||
Vector<u32> m_buffer;
|
Vector<u32> m_buffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2022, Sahan Fernando <sahan.h.fernando@gmail.com>
|
* 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
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -8,6 +9,8 @@
|
||||||
|
|
||||||
#include <AK/DistinctNumeric.h>
|
#include <AK/DistinctNumeric.h>
|
||||||
|
|
||||||
|
namespace VirtGPU {
|
||||||
|
|
||||||
AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, ObjectHandle);
|
AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, ObjectHandle);
|
||||||
AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, ResourceID);
|
AK_TYPEDEF_DISTINCT_ORDERED_ID(u32, ResourceID);
|
||||||
|
|
||||||
|
@ -208,3 +211,5 @@ enum class ShaderType : u32 {
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue