2017-04-26 09:10:52 +00:00
|
|
|
/*
|
|
|
|
* \brief Client-side Gpu session interface
|
|
|
|
* \author Josef Soentgen
|
|
|
|
* \date 2017-04-28
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2021-09-23 14:01:18 +00:00
|
|
|
* Copyright (C) 2017-2021 Genode Labs GmbH
|
2017-04-26 09:10:52 +00:00
|
|
|
*
|
|
|
|
* 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__CLIENT_H_
|
|
|
|
#define _INCLUDE__GPU_SESSION__CLIENT_H_
|
|
|
|
|
|
|
|
/* Genode includes */
|
|
|
|
#include <base/rpc_client.h>
|
|
|
|
#include <gpu_session/capability.h>
|
|
|
|
|
|
|
|
namespace Gpu { class Session_client; }
|
|
|
|
|
|
|
|
|
|
|
|
class Gpu::Session_client : public Genode::Rpc_client<Session>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
|
|
|
* \param session session capability
|
|
|
|
*/
|
|
|
|
Session_client(Session_capability session)
|
|
|
|
: Genode::Rpc_client<Session>(session) { }
|
|
|
|
|
|
|
|
/***********************
|
|
|
|
** Session interface **
|
|
|
|
***********************/
|
|
|
|
|
2021-09-23 14:36:48 +00:00
|
|
|
Genode::Dataspace_capability info_dataspace() const override {
|
|
|
|
return call<Rpc_info_dataspace>(); }
|
2017-04-26 09:10:52 +00:00
|
|
|
|
2021-09-23 14:01:18 +00:00
|
|
|
Gpu::Sequence_number exec_buffer(Buffer_id id,
|
|
|
|
Genode::size_t size) override {
|
2021-09-23 15:37:51 +00:00
|
|
|
return call<Rpc_exec_buffer>(id, size); }
|
2017-04-26 09:10:52 +00:00
|
|
|
|
2021-09-24 15:22:58 +00:00
|
|
|
bool complete(Sequence_number seqno) override {
|
|
|
|
return call<Rpc_complete>(seqno); }
|
|
|
|
|
2017-04-26 09:10:52 +00:00
|
|
|
void completion_sigh(Genode::Signal_context_capability sigh) override {
|
|
|
|
call<Rpc_completion_sigh>(sigh); }
|
|
|
|
|
2021-09-23 15:37:51 +00:00
|
|
|
Genode::Dataspace_capability alloc_buffer(Buffer_id id, Genode::size_t size) override {
|
|
|
|
return call<Rpc_alloc_buffer>(id, size); }
|
2017-04-26 09:10:52 +00:00
|
|
|
|
2021-09-23 15:37:51 +00:00
|
|
|
void free_buffer(Gpu::Buffer_id id) override {
|
|
|
|
call<Rpc_free_buffer>(id); }
|
2017-04-26 09:10:52 +00:00
|
|
|
|
2021-09-23 15:37:51 +00:00
|
|
|
Genode::Dataspace_capability map_buffer(Buffer_id id,
|
2021-09-23 16:07:56 +00:00
|
|
|
bool aperture,
|
|
|
|
Mapping_attributes attrs) override {
|
|
|
|
return call<Rpc_map_buffer>(id, aperture, attrs); }
|
2017-04-26 09:10:52 +00:00
|
|
|
|
2021-09-23 15:37:51 +00:00
|
|
|
void unmap_buffer(Buffer_id id) override {
|
|
|
|
call<Rpc_unmap_buffer>(id); }
|
2017-04-26 09:10:52 +00:00
|
|
|
|
2021-09-23 15:37:51 +00:00
|
|
|
bool map_buffer_ppgtt(Buffer_id id, Gpu::addr_t va) override {
|
|
|
|
return call<Rpc_map_buffer_ppgtt>(id, va); }
|
2017-04-26 09:10:52 +00:00
|
|
|
|
2021-09-23 15:37:51 +00:00
|
|
|
void unmap_buffer_ppgtt(Buffer_id id, Gpu::addr_t va) override {
|
|
|
|
call<Rpc_unmap_buffer_ppgtt>(id, va); }
|
2017-04-26 09:10:52 +00:00
|
|
|
|
2021-09-23 15:37:51 +00:00
|
|
|
bool set_tiling(Buffer_id id, unsigned mode) override {
|
|
|
|
return call<Rpc_set_tiling>(id, mode); }
|
2017-04-26 09:10:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _INCLUDE__GPU_SESSION__CLIENT_H_ */
|