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

@ -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.
@ -17,11 +17,19 @@
#include <gpu_session/client.h>
#include <base/connection.h>
#include <base/allocator.h>
#include <base/attached_dataspace.h>
namespace Gpu { struct Connection; }
struct Gpu::Connection : Genode::Connection<Session>, Session_client
{
/**
* Attached GPU information dataspace
*
* \noapi
*/
Genode::Attached_dataspace _info_dataspace;
/**
* Issue session request
*
@ -45,8 +53,20 @@ struct Gpu::Connection : Genode::Connection<Session>, Session_client
const char *label = "")
:
Genode::Connection<Session>(env, _session(env.parent(), label, quota)),
Session_client(cap())
Session_client(cap()),
_info_dataspace(env.rm(), info_dataspace())
{ }
/**
* Get typed pointer to the information dataspace
*
* \return typed pointer
*/
template <typename T>
T const *attached_info() const
{
return _info_dataspace.local_addr<T>();
}
};
#endif /* _INCLUDE__GPU_SESSION__CONNECTION_H_ */