gpu: introduce information dataspace

The current info implementation (as RPC) is limited in a few ways:

  * The amount of data that may be transferred is constrained by the
    underlying base platform
  * Most information never changes during run time but is copied
    nonetheless
  * The information differs depending on the used GPU device and
    in its current implementation only contains Intel GPU specific
    details

With this commit the 'info' RPC call is replaced with the
'info_dataspace' call that transfers the capability for the dataspace
containing the information only. This is complemented by a client
local 'attached_info' call that allows for getting typed access to
the information. The layout of the information is moved to its own
and GPU-specific header file, e.g., 'gpu/info_intel.h'

Issue #4265.
This commit is contained in:
Josef Söntgen
2021-09-23 16:36:48 +02:00
committed by Norman Feske
parent cfb170c719
commit e37792ce94
7 changed files with 139 additions and 79 deletions

View File

@ -25,7 +25,6 @@ namespace Gpu {
using Buffer_id = Genode::Id_space<Buffer>::Id;
struct Sequence_number;
struct Info;
struct Session;
}
@ -38,48 +37,6 @@ struct Gpu::Sequence_number
};
/*
* Gpu information
*
* Used to query information in the DRM backend
*/
struct Gpu::Info
{
using Chip_id = Genode::uint16_t;
using Features = Genode::uint32_t;
using size_t = Genode::size_t;
using Context_id = Genode::uint32_t;
Chip_id chip_id;
Features features;
size_t aperture_size;
Context_id ctx_id;
Sequence_number last_completed;
struct Revision { Genode::uint8_t value; } revision;
struct Slice_mask { unsigned value; } slice_mask;
struct Subslice_mask { unsigned value; } subslice_mask;
struct Eu_total { unsigned value; } eus;
struct Subslices { unsigned value; } subslices;
Info(Chip_id chip_id, Features features, size_t aperture_size,
Context_id ctx_id, Sequence_number last,
Revision rev, Slice_mask s_mask, Subslice_mask ss_mask,
Eu_total eu, Subslices subslice)
:
chip_id(chip_id), features(features),
aperture_size(aperture_size), ctx_id(ctx_id),
last_completed(last),
revision(rev),
slice_mask(s_mask),
subslice_mask(ss_mask),
eus(eu),
subslices(subslice)
{ }
};
/*
* Gpu session interface
*/
@ -102,9 +59,9 @@ struct Gpu::Session : public Genode::Session
***********************/
/**
* Query GPU information
* Get GPU information dataspace
*/
virtual Info info() const = 0;
virtual Genode::Dataspace_capability info_dataspace() const = 0;
/**
* Execute commands from given buffer
@ -194,7 +151,7 @@ struct Gpu::Session : public Genode::Session
** RPC interface **
*******************/
GENODE_RPC(Rpc_info, Info, info);
GENODE_RPC(Rpc_info_dataspace, Genode::Dataspace_capability, info_dataspace);
GENODE_RPC_THROW(Rpc_exec_buffer, Gpu::Sequence_number, exec_buffer,
GENODE_TYPE_LIST(Invalid_state),
Gpu::Buffer_id, Genode::size_t);
@ -217,7 +174,7 @@ struct Gpu::Session : public Genode::Session
GENODE_RPC(Rpc_set_tiling, bool, set_tiling,
Gpu::Buffer_id, unsigned);
GENODE_RPC_INTERFACE(Rpc_info, Rpc_exec_buffer,
GENODE_RPC_INTERFACE(Rpc_info_dataspace, Rpc_exec_buffer,
Rpc_completion_sigh, Rpc_alloc_buffer,
Rpc_free_buffer, Rpc_map_buffer, Rpc_unmap_buffer,
Rpc_map_buffer_ppgtt, Rpc_unmap_buffer_ppgtt,