gpu: move exec sequence number to Gpu namespace

Moving the type definition removes the aritifial linkage to the Gpu
information structure.

Issue #4265.
This commit is contained in:
Josef Söntgen 2021-09-23 16:01:18 +02:00 committed by Norman Feske
parent 3b40790e02
commit cfb170c719
4 changed files with 24 additions and 17 deletions

View File

@ -176,8 +176,8 @@ struct Gpu::Buffer
Genode::Dataspace_capability map_cap { };
Offset map_offset { 0 };
Gpu_virtual_address gpu_vaddr { };
Gpu::Info::Execution_buffer_sequence seqno { };
Gpu_virtual_address gpu_vaddr { };
Gpu::Sequence_number seqno { };
bool gpu_vaddr_valid { false };
bool busy { false };
@ -1149,7 +1149,7 @@ class Drm_call
_buffer_space.for_each<Buffer>([&] (Buffer &h) {
if (!h.busy) return;
if (h.seqno.id > gpu_info.last_completed.id) return;
if (h.seqno.value > gpu_info.last_completed.value) return;
h.busy = false;
/*

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
* Copyright (C) 2017-2021 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
@ -40,8 +40,8 @@ class Gpu::Session_client : public Genode::Rpc_client<Session>
Info info() const override {
return call<Rpc_info>(); }
Gpu::Info::Execution_buffer_sequence exec_buffer(Buffer_id id,
Genode::size_t size) override {
Gpu::Sequence_number exec_buffer(Buffer_id id,
Genode::size_t size) override {
return call<Rpc_exec_buffer>(id, size); }
void completion_sigh(Genode::Signal_context_capability sigh) override {

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (C) 2017 Genode Labs GmbH
* Copyright (C) 2017-2021 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
@ -24,10 +24,19 @@ namespace Gpu {
struct Buffer;
using Buffer_id = Genode::Id_space<Buffer>::Id;
struct Sequence_number;
struct Info;
struct Session;
}
/*
* Execution buffer sequence number
*/
struct Gpu::Sequence_number
{
Genode::uint64_t value;
};
/*
* Gpu information
@ -46,9 +55,7 @@ struct Gpu::Info
size_t aperture_size;
Context_id ctx_id;
struct Execution_buffer_sequence {
Genode::uint64_t id;
} last_completed;
Sequence_number last_completed;
struct Revision { Genode::uint8_t value; } revision;
struct Slice_mask { unsigned value; } slice_mask;
@ -57,7 +64,7 @@ struct Gpu::Info
struct Subslices { unsigned value; } subslices;
Info(Chip_id chip_id, Features features, size_t aperture_size,
Context_id ctx_id, Execution_buffer_sequence last,
Context_id ctx_id, Sequence_number last,
Revision rev, Slice_mask s_mask, Subslice_mask ss_mask,
Eu_total eu, Subslices subslice)
:
@ -109,7 +116,7 @@ struct Gpu::Session : public Genode::Session
*
* \throw Invalid_state is thrown if the provided buffer is not valid, e.g not mapped
*/
virtual Gpu::Info::Execution_buffer_sequence exec_buffer(Buffer_id id, Genode::size_t size) = 0;
virtual Gpu::Sequence_number exec_buffer(Buffer_id id, Genode::size_t size) = 0;
/**
* Register completion signal handler
@ -188,7 +195,7 @@ struct Gpu::Session : public Genode::Session
*******************/
GENODE_RPC(Rpc_info, Info, info);
GENODE_RPC_THROW(Rpc_exec_buffer, Gpu::Info::Execution_buffer_sequence, exec_buffer,
GENODE_RPC_THROW(Rpc_exec_buffer, Gpu::Sequence_number, exec_buffer,
GENODE_TYPE_LIST(Invalid_state),
Gpu::Buffer_id, Genode::size_t);
GENODE_RPC(Rpc_completion_sigh, void, completion_sigh,

View File

@ -1565,7 +1565,7 @@ class Gpu::Session_component : public Genode::Session_object<Gpu::Session>
{
Genode::size_t const aperture_size = Igd::Device::Vgpu::APERTURE_SIZE;
return Info(_device.id(), _device.features(), aperture_size,
_vgpu.id(), { .id = _vgpu.completed_seqno() },
_vgpu.id(), { .value = _vgpu.completed_seqno() },
_device._revision,
_device._slice_mask,
_device._subslice_mask,
@ -1573,8 +1573,8 @@ class Gpu::Session_component : public Genode::Session_object<Gpu::Session>
_device._subslices);
}
Gpu::Info::Execution_buffer_sequence exec_buffer(Buffer_id id,
Genode::size_t) override
Gpu::Sequence_number exec_buffer(Buffer_id id,
Genode::size_t) override
{
bool found = false;
@ -1593,7 +1593,7 @@ class Gpu::Session_component : public Genode::Session_object<Gpu::Session>
throw Gpu::Session::Invalid_state();
_device.vgpu_activate(_vgpu);
return { .id = _vgpu.current_seqno() };
return { .value = _vgpu.current_seqno() };
}
void completion_sigh(Genode::Signal_context_capability sigh) override