mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-28 09:38:53 +00:00
4b653fbac1
As the PPGTT is populated by the client, the client has to account for guard pages and so forth. Issue #4148 #4233
53 lines
1.3 KiB
C++
53 lines
1.3 KiB
C++
/*
|
|
* \brief Connection to Gpu service
|
|
* \author Josef Soentgen
|
|
* \date 2017-04-28
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2017 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.
|
|
*/
|
|
|
|
#ifndef _INCLUDE__GPU_SESSION__CONNECTION_H_
|
|
#define _INCLUDE__GPU_SESSION__CONNECTION_H_
|
|
|
|
#include <gpu_session/client.h>
|
|
#include <base/connection.h>
|
|
#include <base/allocator.h>
|
|
|
|
namespace Gpu { struct Connection; }
|
|
|
|
struct Gpu::Connection : Genode::Connection<Session>, Session_client
|
|
{
|
|
/**
|
|
* Issue session request
|
|
*
|
|
* \noapi
|
|
*/
|
|
Genode::Capability<Gpu::Session> _session(Genode::Parent &parent,
|
|
char const *label, Genode::size_t quota)
|
|
{
|
|
return session(parent, "ram_quota=%ld, cap_quota=%ld, label=\"%s\"",
|
|
quota, CAP_QUOTA, label);
|
|
}
|
|
|
|
/**
|
|
* Constructor
|
|
*
|
|
* \param quota initial amount of quota used for allocating Gpu
|
|
* memory
|
|
*/
|
|
Connection(Genode::Env &env,
|
|
Genode::size_t quota = Session::REQUIRED_QUOTA,
|
|
const char *label = "")
|
|
:
|
|
Genode::Connection<Session>(env, _session(env.parent(), label, quota)),
|
|
Session_client(cap())
|
|
{ }
|
|
};
|
|
|
|
#endif /* _INCLUDE__GPU_SESSION__CONNECTION_H_ */
|