forked from genodelabs/genode
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial commit to add framebuffer support for imx6
- Loading branch information
1 parent
5dcf06d
commit bb7ad09
Showing
20 changed files
with
1,669 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
repos/os/include/spec/imx6/imx_framebuffer_session/client.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* \brief Client-side i.MX6 specific framebuffer interface | ||
* \author Stefan Kalkowski | ||
* \date 2013-02-26 | ||
*/ | ||
|
||
/* | ||
* Copyright (C) 2006-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__IMX_FRAMEBUFFER_SESSION__CLIENT_H_ | ||
#define _INCLUDE__IMX_FRAMEBUFFER_SESSION__CLIENT_H_ | ||
|
||
#include <framebuffer_session/capability.h> | ||
#include <imx_framebuffer_session/imx_framebuffer_session.h> | ||
#include <base/rpc_client.h> | ||
|
||
namespace Framebuffer { struct Imx_client; } | ||
|
||
|
||
struct Framebuffer::Imx_client : Genode::Rpc_client<Imx_session> | ||
{ | ||
explicit Imx_client(Capability<Imx_session> session) | ||
: Genode::Rpc_client<Imx_session>(session) { } | ||
|
||
Genode::Dataspace_capability dataspace() override { | ||
return call<Rpc_dataspace>(); } | ||
|
||
Mode mode() const override { return call<Rpc_mode>(); } | ||
|
||
void mode_sigh(Genode::Signal_context_capability sigh) override { | ||
call<Rpc_mode_sigh>(sigh); } | ||
|
||
void sync_sigh(Genode::Signal_context_capability sigh) override { | ||
call<Rpc_sync_sigh>(sigh); } | ||
|
||
void refresh(int x, int y, int w, int h) override { | ||
call<Rpc_refresh>(x, y, w, h); } | ||
|
||
void overlay(Genode::addr_t phys_addr, int x, int y, int alpha) override { | ||
call<Rpc_overlay>(phys_addr, x, y, alpha); } | ||
}; | ||
|
||
#endif /* _INCLUDE__IMX_FRAMEBUFFER_SESSION__CLIENT_H_ */ |
89 changes: 89 additions & 0 deletions
89
repos/os/include/spec/imx6/imx_framebuffer_session/connection.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/* | ||
* \brief Connection to i.MX6 specific frame-buffer service | ||
* \author Stefan Kalkowski | ||
* \date 2013-02-26 | ||
*/ | ||
|
||
/* | ||
* Copyright (C) 2008-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__IMX_FRAMEBUFFER_SESSION__CONNECTION_H_ | ||
#define _INCLUDE__IMX_FRAMEBUFFER_SESSION__CONNECTION_H_ | ||
|
||
#include <imx_framebuffer_session/client.h> | ||
#include <util/arg_string.h> | ||
#include <base/connection.h> | ||
|
||
namespace Framebuffer { class Imx_connection; } | ||
|
||
|
||
class Framebuffer::Imx_connection : public Genode::Connection<Imx_session>, | ||
public Imx_client | ||
{ | ||
private: | ||
|
||
/** | ||
* Create session and return typed session capability | ||
*/ | ||
Capability<Imx_session> _connect(Genode::Parent &parent, | ||
unsigned width, unsigned height, | ||
Mode::Format format) | ||
{ | ||
using namespace Genode; | ||
|
||
enum { ARGBUF_SIZE = 128 }; | ||
char argbuf[ARGBUF_SIZE]; | ||
|
||
/* donate ram quota for storing server-side meta data */ | ||
strncpy(argbuf, "ram_quota=8K", sizeof(argbuf)); | ||
|
||
/* set optional session-constructor arguments */ | ||
if (width) | ||
Arg_string::set_arg(argbuf, sizeof(argbuf), "fb_width", width); | ||
if (height) | ||
Arg_string::set_arg(argbuf, sizeof(argbuf), "fb_height", height); | ||
if (format != Mode::INVALID) | ||
Arg_string::set_arg(argbuf, sizeof(argbuf), "fb_format", format); | ||
|
||
return session(parent, argbuf); | ||
} | ||
|
||
public: | ||
|
||
/** | ||
* Constructor | ||
* | ||
* \param mode desired size and pixel format | ||
* | ||
* The specified values are not enforced. After creating the | ||
* session, you should validate the actual frame-buffer attributes | ||
* by calling the 'info' method of the frame-buffer interface. | ||
*/ | ||
Imx_connection(Genode::Env &env, Framebuffer::Mode mode) | ||
: | ||
Genode::Connection<Imx_session>(env, _connect(env.parent(), | ||
mode.width(), mode.height(), | ||
mode.format())), | ||
Imx_client(cap()) | ||
{ } | ||
|
||
/** | ||
* Constructor | ||
* | ||
* \noapi | ||
* \deprecated Use the constructor with 'Env &' as first | ||
* argument instead | ||
*/ | ||
Imx_connection(unsigned width = 0, | ||
unsigned height = 0, | ||
Mode::Format format = Mode::INVALID) __attribute__((deprecated)) | ||
: Genode::Connection<Imx_session>(_connect(*Genode::env_deprecated()->parent(), | ||
width, height, format)), | ||
Imx_client(cap()) { } | ||
}; | ||
|
||
#endif /* _INCLUDE__IMX_FRAMEBUFFER_SESSION__CONNECTION_H_ */ |
48 changes: 48 additions & 0 deletions
48
repos/os/include/spec/imx6/imx_framebuffer_session/imx_framebuffer_session.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* \brief i.MX6 specific framebuffer session extension | ||
* \author Stefan Kalkowski | ||
* \date 2013-02-26 | ||
*/ | ||
|
||
/* | ||
* Copyright (C) 2011-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__IMX_FRAMEBUFFER_SESSION__IMX_FRAMEBUFFER_SESSION_H_ | ||
#define _INCLUDE__IMX_FRAMEBUFFER_SESSION__IMX_FRAMEBUFFER_SESSION_H_ | ||
|
||
#include <base/capability.h> | ||
#include <base/rpc.h> | ||
#include <framebuffer_session/framebuffer_session.h> | ||
|
||
namespace Framebuffer { struct Imx_session; } | ||
|
||
|
||
struct Framebuffer::Imx_session : Session | ||
{ | ||
virtual ~Imx_session() { } | ||
|
||
/** | ||
* Set overlay properties | ||
* | ||
* \param phys_base physical base address of overlay framebuffer | ||
* \param x horizontal position in pixel | ||
* \param y vertical position in pixel | ||
* \param alpha alpha transparency value of overlay (0-255) | ||
*/ | ||
virtual void overlay(Genode::addr_t phys_base, int x, int y, int alpha) = 0; | ||
|
||
|
||
/********************* | ||
** RPC declaration ** | ||
*********************/ | ||
|
||
GENODE_RPC(Rpc_overlay, void, overlay, Genode::addr_t, int, int, int); | ||
|
||
GENODE_RPC_INTERFACE_INHERIT(Session, Rpc_overlay); | ||
}; | ||
|
||
#endif /* _INCLUDE__IMX_FRAMEBUFFER_SESSION__IMX_FRAMEBUFFER_SESSION_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* \brief i.MX6 specific platform session client side | ||
* \author Stefan Kalkowski <stefan.kalkowski@genode-labs.com | ||
* \date 2013-04-29 | ||
*/ | ||
|
||
/* | ||
* Copyright (C) 2013-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__PLATFORM_SESSION__CLIENT_H_ | ||
#define _INCLUDE__PLATFORM_SESSION__CLIENT_H_ | ||
|
||
#include <base/capability.h> | ||
#include <base/rpc_client.h> | ||
#include <platform_session/platform_session.h> | ||
|
||
namespace Platform { struct Client; } | ||
|
||
|
||
struct Platform::Client : Genode::Rpc_client<Session> | ||
{ | ||
explicit Client(Genode::Capability<Session> session) | ||
: Genode::Rpc_client<Session>(session) { } | ||
|
||
void enable(Device dev) override { call<Rpc_enable>(dev); } | ||
void disable(Device dev) override { call<Rpc_disable>(dev); } | ||
void clock_rate(Device dev, unsigned long rate) override { | ||
call<Rpc_clock_rate>(dev, rate); } | ||
Board_revision revision() override { return call<Rpc_revision>(); } | ||
}; | ||
|
||
#endif /* _INCLUDE__PLATFORM_SESSION__CLIENT_H_ */ |
68 changes: 68 additions & 0 deletions
68
repos/os/include/spec/imx6/platform_session/platform_session.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* \brief i.MX6 specific platform session | ||
* \author Stefan Kalkowski <stefan.kalkowski@genode-labs.com | ||
* \date 2013-04-29 | ||
*/ | ||
|
||
/* | ||
* Copyright (C) 2013-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__PLATFORM_SESSION__PLATFORM_SESSION_H_ | ||
#define _INCLUDE__PLATFORM_SESSION__PLATFORM_SESSION_H_ | ||
|
||
#include <base/capability.h> | ||
#include <base/rpc.h> | ||
|
||
namespace Platform { struct Session; } | ||
|
||
|
||
struct Platform::Session : Genode::Session | ||
{ | ||
enum Device { | ||
IPU, | ||
I2C_2, | ||
I2C_3, | ||
BUTTONS, | ||
PWM, | ||
}; | ||
|
||
enum Board_revision { | ||
WAND_QUAD = 4, | ||
//SMD = 2, /* Freescale i.MX53 SMD Tablet */ | ||
//QSB = 3, /* Freescale i.MX53 low-cost Quickstart board */ | ||
UNKNOWN, | ||
}; | ||
|
||
/** | ||
* \noapi | ||
*/ | ||
static const char *service_name() { return "Platform"; } | ||
|
||
enum { CAP_QUOTA = 2 }; | ||
|
||
virtual ~Session() { } | ||
|
||
virtual void enable(Device dev) = 0; | ||
virtual void disable(Device dev) = 0; | ||
virtual void clock_rate(Device dev, unsigned long rate) = 0; | ||
virtual Board_revision revision() = 0; | ||
|
||
|
||
/********************* | ||
** RPC declaration ** | ||
*********************/ | ||
|
||
GENODE_RPC(Rpc_enable, void, enable, Device); | ||
GENODE_RPC(Rpc_disable, void, disable, Device); | ||
GENODE_RPC(Rpc_clock_rate, void, clock_rate, Device, unsigned long); | ||
GENODE_RPC(Rpc_revision, Board_revision, revision); | ||
|
||
GENODE_RPC_INTERFACE(Rpc_enable, Rpc_disable, Rpc_clock_rate, | ||
Rpc_revision); | ||
}; | ||
|
||
#endif /* _INCLUDE__PLATFORM_SESSION__PLATFORM_SESSION_H_ */ |
Oops, something went wrong.