PebbleOS v4.47.0-1075-g013613c8a
Loading...
Searching...
No Matches
Display bridge

Display bridges. More...

Data Structures

struct  pbl_display_bridge_ops
 Bridge operations, callable from an interrupt. More...
 
struct  pbl_display_bridge
 A bridge. More...
 

Macros

#define PBL_DISPLAY_BRIDGE_INIT(sym, _name, _parent, _ops)
 Initializer for the struct pbl_display_bridge of bridge sym, with its device state defined by PBL_DEVICE_STATE_DEFINE().
 

Typedefs

typedef void(* pbl_display_bridge_event_cb_t) (enum pbl_display_bridge_event event, void *arg)
 Called on an event of a bridge, from its interrupt.
 

Enumerations

enum  pbl_display_bridge_event { PBL_DISPLAY_BRIDGE_EVENT_TEAR , PBL_DISPLAY_BRIDGE_EVENT_REFRESH_DONE }
 Events of a bridge. More...
 

Functions

int pbl_display_bridge_refresh (const struct pbl_display_bridge *bridge)
 Send a frame from the display controller to the panel.
 
void pbl_display_bridge_hold (const struct pbl_display_bridge *bridge, bool hold)
 Stop taking from the display controller while it is set up, or go on.
 
int pbl_display_bridge_request_tear (const struct pbl_display_bridge *bridge)
 Report the next tearing effect of the panel, with PBL_DISPLAY_BRIDGE_EVENT_TEAR.
 
int pbl_display_bridge_set_event_cb (const struct pbl_display_bridge *bridge, pbl_display_bridge_event_cb_t cb, void *arg)
 Set the callback of the events of a bridge.
 

Detailed Description

Display bridges.

A bridge is what a display controller sends its pixels through on their way to the panel, as a MIPI DSI host, found at the output port of the controller. To a panel with its own frame memory, the controller has the bridge send it a frame on each refresh, timed by the tearing effect of the panel, which the bridge reports. The controller holds the bridge while it sets itself up for the next refresh.

ret = pbl_display_bridge_set_event_cb(bridge, prv_event, ctx);
// From prv_event() on PBL_DISPLAY_BRIDGE_EVENT_TEAR
int pbl_display_bridge_refresh(const struct pbl_display_bridge *bridge)
Send a frame from the display controller to the panel.
int pbl_display_bridge_set_event_cb(const struct pbl_display_bridge *bridge, pbl_display_bridge_event_cb_t cb, void *arg)
Set the callback of the events of a bridge.
int pbl_display_bridge_request_tear(const struct pbl_display_bridge *bridge)
Report the next tearing effect of the panel, with PBL_DISPLAY_BRIDGE_EVENT_TEAR.

Data Structure Documentation

◆ pbl_display_bridge

struct pbl_display_bridge

A bridge.

Data Fields
struct pbl_device dev Device.
const struct pbl_display_bridge_ops * ops Driver operations.

Macro Definition Documentation

◆ PBL_DISPLAY_BRIDGE_INIT

#define PBL_DISPLAY_BRIDGE_INIT (   sym,
  _name,
  _parent,
  _ops 
)
Value:
{ \
.dev = PBL_DEVICE_INIT_CLASS(sym, _name, nullptr, _parent, &pbl_display_bridge_class), \
.ops = (_ops), \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:153

Initializer for the struct pbl_display_bridge of bridge sym, with its device state defined by PBL_DEVICE_STATE_DEFINE().

Parameters
symSymbol of the bridge instance.
_nameName.
_parentParent device, as the host the bridge is part of, or NULL.
_opsDriver operations.

Typedef Documentation

◆ pbl_display_bridge_event_cb_t

typedef void(* pbl_display_bridge_event_cb_t) (enum pbl_display_bridge_event event, void *arg)

Called on an event of a bridge, from its interrupt.

Parameters
eventEvent.
argArgument given with the callback.

Enumeration Type Documentation

◆ pbl_display_bridge_event

Events of a bridge.

Enumerator
PBL_DISPLAY_BRIDGE_EVENT_TEAR 

The panel reported its tearing effect, once asked for with pbl_display_bridge_request_tear().

PBL_DISPLAY_BRIDGE_EVENT_REFRESH_DONE 

The frame of a refresh is out.

Function Documentation

◆ pbl_display_bridge_hold()

void pbl_display_bridge_hold ( const struct pbl_display_bridge *  bridge,
bool  hold 
)

Stop taking from the display controller while it is set up, or go on.

Callable from an interrupt, as the event callback.

Parameters
bridgeBridge.
holdStop, or go on.

◆ pbl_display_bridge_refresh()

int pbl_display_bridge_refresh ( const struct pbl_display_bridge *  bridge)

Send a frame from the display controller to the panel.

The end of the frame is reported with PBL_DISPLAY_BRIDGE_EVENT_REFRESH_DONE. Callable from an interrupt, as the event callback.

Parameters
bridgeBridge.
Returns
0 or a negative errno.

◆ pbl_display_bridge_request_tear()

int pbl_display_bridge_request_tear ( const struct pbl_display_bridge *  bridge)

Report the next tearing effect of the panel, with PBL_DISPLAY_BRIDGE_EVENT_TEAR.

Parameters
bridgeBridge.
Returns
0 or a negative errno.

◆ pbl_display_bridge_set_event_cb()

int pbl_display_bridge_set_event_cb ( const struct pbl_display_bridge *  bridge,
pbl_display_bridge_event_cb_t  cb,
void *  arg 
)

Set the callback of the events of a bridge.

Parameters
bridgeBridge.
cbCallback, or NULL.
argPassed to cb.
Returns
0, or -ENODEV if the bridge is not ready.