XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions
drm_bridge.h File Reference
#include <linux/cleanup.h>
#include <linux/ctype.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <drm/drm_atomic.h>
#include <drm/drm_encoder.h>
#include <drm/drm_mode_object.h>
#include <drm/drm_modes.h>
Include dependency graph for drm_bridge.h:

Go to the source code of this file.

Classes

struct  drm_bridge_funcs
 
struct  drm_bridge_timings
 
struct  drm_bridge
 

Macros

#define devm_drm_bridge_alloc(dev, type, member, funcs)
 
#define drm_for_each_bridge_in_chain_scoped(encoder, bridge)
 
#define drm_for_each_bridge_in_chain_from(first_bridge, bridge)
 

Enumerations

enum  drm_bridge_attach_flags { DRM_BRIDGE_ATTACH_NO_CONNECTOR = BIT(0) }
 
enum  drm_bridge_ops {
  DRM_BRIDGE_OP_DETECT = BIT(0) , DRM_BRIDGE_OP_EDID = BIT(1) , DRM_BRIDGE_OP_HPD = BIT(2) , DRM_BRIDGE_OP_MODES = BIT(3) ,
  DRM_BRIDGE_OP_HDMI = BIT(4) , DRM_BRIDGE_OP_HDMI_AUDIO = BIT(5) , DRM_BRIDGE_OP_DP_AUDIO = BIT(6) , DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER = BIT(7) ,
  DRM_BRIDGE_OP_HDMI_CEC_ADAPTER = BIT(8) , DRM_BRIDGE_OP_HDMI_HDR_DRM_INFOFRAME = BIT(9) , DRM_BRIDGE_OP_HDMI_SPD_INFOFRAME = BIT(10)
}
 

Functions

bool drm_bridge_enter (struct drm_bridge *bridge, int *idx)
 
void drm_bridge_exit (int idx)
 
void drm_bridge_unplug (struct drm_bridge *bridge)
 
struct drm_bridge * drm_bridge_get (struct drm_bridge *bridge)
 
void drm_bridge_put (struct drm_bridge *bridge)
 
void drm_bridge_clear_and_put (struct drm_bridge **bridge_pp)
 
 DEFINE_FREE (drm_bridge_put, struct drm_bridge *, if(_T) drm_bridge_put(_T)) void *__devm_drm_bridge_alloc(struct device *dev
 
void drm_bridge_add (struct drm_bridge *bridge)
 
int devm_drm_bridge_add (struct device *dev, struct drm_bridge *bridge)
 
void drm_bridge_remove (struct drm_bridge *bridge)
 
int drm_bridge_attach (struct drm_encoder *encoder, struct drm_bridge *bridge, struct drm_bridge *previous, enum drm_bridge_attach_flags flags)
 
 DEFINE_FREE (__drm_for_each_bridge_in_chain_cleanup, struct drm_bridge *, if(_T) { mutex_unlock(&_T->encoder->bridge_chain_mutex);drm_bridge_put(_T);}) static inline struct drm_bridge *__drm_for_each_bridge_in_chain_scoped_start(struct drm_encoder *encoder)
 
enum drm_mode_status drm_bridge_chain_mode_valid (struct drm_bridge *bridge, const struct drm_display_info *info, const struct drm_display_mode *mode)
 
void drm_bridge_chain_mode_set (struct drm_bridge *bridge, const struct drm_display_mode *mode, const struct drm_display_mode *adjusted_mode)
 
int drm_atomic_bridge_chain_check (struct drm_bridge *bridge, struct drm_crtc_state *crtc_state, struct drm_connector_state *conn_state)
 
void drm_atomic_bridge_chain_disable (struct drm_bridge *bridge, struct drm_atomic_commit *state)
 
void drm_atomic_bridge_chain_post_disable (struct drm_bridge *bridge, struct drm_atomic_commit *state)
 
void drm_atomic_bridge_chain_pre_enable (struct drm_bridge *bridge, struct drm_atomic_commit *state)
 
void drm_atomic_bridge_chain_enable (struct drm_bridge *bridge, struct drm_atomic_commit *state)
 
u32 * drm_atomic_helper_bridge_propagate_bus_fmt (struct drm_bridge *bridge, struct drm_bridge_state *bridge_state, struct drm_crtc_state *crtc_state, struct drm_connector_state *conn_state, u32 output_fmt, unsigned int *num_input_fmts)
 
enum drm_connector_status drm_bridge_detect (struct drm_bridge *bridge, struct drm_connector *connector)
 
int drm_bridge_get_modes (struct drm_bridge *bridge, struct drm_connector *connector)
 
const struct drm_edid * drm_bridge_edid_read (struct drm_bridge *bridge, struct drm_connector *connector)
 
void drm_bridge_hpd_enable (struct drm_bridge *bridge, void(*cb)(void *data, enum drm_connector_status status), void *data)
 
void drm_bridge_hpd_disable (struct drm_bridge *bridge)
 
void drm_bridge_hpd_notify (struct drm_bridge *bridge, enum drm_connector_status status)
 
void devm_drm_put_bridge (struct device *dev, struct drm_bridge *bridge)
 
void drm_bridge_debugfs_params (struct dentry *root)
 
void drm_bridge_debugfs_encoder_params (struct dentry *root, struct drm_encoder *encoder)
 

Variables

: printf style format string for the plane name, or NULL for default name

drm_universal_plane_alloc() - Allocate and initialize an universal plane object @dev: DRM device @type: the type of the struct which contains struct &drm_plane @member: the name of the &drm_plane within @type @possible_crtcs: bitmask of possible CRTCs @funcs: callbacks for the new plane @formats: array of supported formats (DRM_FORMAT_*) @format_count: number of elements in @formats @format_modifiers: array of struct drm_format modifiers terminated by DRM_FORMAT_MOD_INVALID @plane_type: type of plane (overlay, primary, cursor)

Allocates and initializes a plane object of type @type. The caller is responsible for releasing the allocated memory with kfree().

Drivers are encouraged to use drmm_universal_plane_alloc() instead.

Drivers that only support the DRM_FORMAT_MOD_LINEAR modifier support may set @format_modifiers to NULL. The plane will advertise the linear modifier.

Returns: Pointer to new plane, or ERR_PTR on failure.

size_t size
 
size_t size_t offset
 
: human readable name, can be overwritten by the driver

struct drm_encoder - central DRM encoder structure @dev: parent DRM device @head: list management @base: base KMS object

@funcs: control functions, can be NULL for simple managed encoders @helper_private: mid-layer private data

CRTCs drive pixels to encoders, which convert them into signals appropriate for a given connector or set of connectors.

size_t size_t const struct drm_bridge_funcs * funcs
 

Macro Definition Documentation

◆ devm_drm_bridge_alloc

#define devm_drm_bridge_alloc (   dev,
  type,
  member,
  funcs 
)
Value:
((type *)__devm_drm_bridge_alloc(dev, sizeof(type), \
offsetof(type, member), funcs))
size_t size_t const struct drm_bridge_funcs * funcs
Definition drm_bridge.h:1300
const struct device * dev
Definition drm_print.h:519

devm_drm_bridge_alloc - Allocate and initialize a bridge @dev: struct device of the bridge device @type: the type of the struct which contains struct &drm_bridge @member: the name of the &drm_bridge within @type @funcs: callbacks for this bridge

The reference count of the returned bridge is initialized to 1. This reference will be automatically dropped via devm (by calling drm_bridge_put()) when @dev is removed.

Returns: Pointer to new bridge, or ERR_PTR on failure.

◆ drm_for_each_bridge_in_chain_from

#define drm_for_each_bridge_in_chain_from (   first_bridge,
  bridge 
)
Value:
for (struct drm_bridge *bridge __free(__drm_for_each_bridge_in_chain_cleanup) = \
__drm_for_each_bridge_in_chain_from_start(first_bridge); \
bridge; \
bridge = __drm_for_each_bridge_in_chain_next(bridge)) \
#define __free(_name)
Definition cleanup.h:123
Definition drm_bridge.h:1100

drm_for_each_bridge_in_chain_from - iterate over all bridges starting from the given bridge @first_bridge: the bridge to start from @bridge: a bridge pointer updated to point to the current bridge at each iteration

Iterate over all bridges in the encoder chain starting from @first_bridge, included.

Automatically gets/puts the bridge reference while iterating and locks the encoder chain mutex to prevent chain modifications while iterating.

◆ drm_for_each_bridge_in_chain_scoped

#define drm_for_each_bridge_in_chain_scoped (   encoder,
  bridge 
)
Value:
for (struct drm_bridge *bridge __free(__drm_for_each_bridge_in_chain_cleanup) = \
__drm_for_each_bridge_in_chain_scoped_start((encoder)); \
bridge; \
bridge = __drm_for_each_bridge_in_chain_next(bridge)) \
struct drm_encoder * encoder
Definition drm_encoder.h:211

drm_for_each_bridge_in_chain_scoped - iterate over all bridges attached to an encoder @encoder: the encoder to iterate bridges on @bridge: a bridge pointer updated to point to the current bridge at each iteration

Iterate over all bridges present in the bridge chain attached to @encoder.

Automatically gets/puts the bridge reference while iterating and locks the encoder chain mutex to prevent chain modifications while iterating.

Enumeration Type Documentation

◆ drm_bridge_attach_flags

enum drm_bridge_attach_flags - Flags for &drm_bridge_funcs.attach

Enumerator
DRM_BRIDGE_ATTACH_NO_CONNECTOR 

@DRM_BRIDGE_ATTACH_NO_CONNECTOR: When this flag is set the bridge shall not create a drm_connector.

◆ drm_bridge_ops

enum drm_bridge_ops - Bitmask of operations supported by the bridge

Enumerator
DRM_BRIDGE_OP_DETECT 

@DRM_BRIDGE_OP_DETECT: The bridge can detect displays connected to its output. Bridges that set this flag shall implement the &drm_bridge_funcs->detect callback.

DRM_BRIDGE_OP_EDID 

@DRM_BRIDGE_OP_EDID: The bridge can retrieve the EDID of the display connected to its output. Bridges that set this flag shall implement the &drm_bridge_funcs->edid_read callback.

DRM_BRIDGE_OP_HPD 

@DRM_BRIDGE_OP_HPD: The bridge can detect hot-plug and hot-unplug without requiring polling. Bridges that set this flag shall implement the &drm_bridge_funcs->hpd_enable and &drm_bridge_funcs->hpd_disable callbacks if they support enabling and disabling hot-plug detection dynamically.

DRM_BRIDGE_OP_MODES 

@DRM_BRIDGE_OP_MODES: The bridge can retrieve the modes supported by the display at its output. This does not include reading EDID which is separately covered by @DRM_BRIDGE_OP_EDID. Bridges that set this flag shall implement the &drm_bridge_funcs->get_modes callback.

DRM_BRIDGE_OP_HDMI 

@DRM_BRIDGE_OP_HDMI: The bridge provides HDMI connector operations, including infoframes support. Bridges that set this flag must provide HDMI-related information and implement the &drm_bridge_funcs->clear_avi_infoframe, &drm_bridge_funcs->write_avi_infoframe, &drm_bridge_funcs->clear_hdmi_infoframe and &drm_bridge_funcs->write_hdmi_infoframe callbacks.

Note: currently there can be at most one bridge in a chain that sets this bit. This is to simplify corresponding glue code in connector drivers.

DRM_BRIDGE_OP_HDMI_AUDIO 

@DRM_BRIDGE_OP_HDMI_AUDIO: The bridge provides HDMI audio operations. Bridges that set this flag must implement the &drm_bridge_funcs->hdmi_audio_prepare and &drm_bridge_funcs->hdmi_audio_shutdown callbacks. If the bridge implements @DRM_BRIDGE_OP_HDMI, it also must implement &drm_bridge_funcs->hdmi_write_audio_infoframe and &drm_bridge_funcs->hdmi_cleaer_audio_infoframe callbacks.

Note: currently there can be at most one bridge in a chain that sets this bit. This is to simplify corresponding glue code in connector drivers. Also it is not possible to have a bridge in the chain that sets @DRM_BRIDGE_OP_DP_AUDIO if there is a bridge that sets this flag.

DRM_BRIDGE_OP_DP_AUDIO 

@DRM_BRIDGE_OP_DP_AUDIO: The bridge provides DisplayPort audio operations. Bridges that set this flag must implement the &drm_bridge_funcs->dp_audio_prepare and &drm_bridge_funcs->dp_audio_shutdown callbacks.

Note: currently there can be at most one bridge in a chain that sets this bit. This is to simplify corresponding glue code in connector drivers. Also it is not possible to have a bridge in the chain that sets @DRM_BRIDGE_OP_HDMI_AUDIO if there is a bridge that sets this flag.

DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER 

@DRM_BRIDGE_OP_HDMI_CEC_NOTIFIER: The bridge requires CEC notifier to be present.

DRM_BRIDGE_OP_HDMI_CEC_ADAPTER 

@DRM_BRIDGE_OP_HDMI_CEC_ADAPTER: The bridge requires CEC adapter to be present.

DRM_BRIDGE_OP_HDMI_HDR_DRM_INFOFRAME 

@DRM_BRIDGE_OP_HDMI_HDR_DRM_INFOFRAME: The bridge supports &drm_bridge_funcs->hdmi_write_hdr_drm_infoframe and &drm_bridge_funcs->hdmi_clear_hdr_drm_infoframe callbacks.

DRM_BRIDGE_OP_HDMI_SPD_INFOFRAME 

@DRM_BRIDGE_OP_HDMI_SPD_INFOFRAME: The bridge supports &drm_bridge_funcs->hdmi_write_spd_infoframe and &drm_bridge_funcs->hdmi_clear_spd_infoframe callbacks.

Function Documentation

◆ DEFINE_FREE() [1/2]

DEFINE_FREE ( __drm_for_each_bridge_in_chain_cleanup  ,
struct drm_bridge *  ,
if(_T) { mutex_unlock(&_T->encoder->bridge_chain_mutex);drm_bridge_put(_T);}   
)

◆ DEFINE_FREE() [2/2]

DEFINE_FREE ( drm_bridge_put  ,
struct drm_bridge *  ,
if(_T) drm_bridge_put(_T)   
)

◆ devm_drm_bridge_add()

int devm_drm_bridge_add ( struct device *  dev,
struct drm_bridge *  bridge 
)

◆ devm_drm_put_bridge()

void devm_drm_put_bridge ( struct device *  dev,
struct drm_bridge *  bridge 
)

◆ drm_atomic_bridge_chain_check()

int drm_atomic_bridge_chain_check ( struct drm_bridge *  bridge,
struct drm_crtc_state *  crtc_state,
struct drm_connector_state *  conn_state 
)

◆ drm_atomic_bridge_chain_disable()

void drm_atomic_bridge_chain_disable ( struct drm_bridge *  bridge,
struct drm_atomic_commit *  state 
)

◆ drm_atomic_bridge_chain_enable()

void drm_atomic_bridge_chain_enable ( struct drm_bridge *  bridge,
struct drm_atomic_commit *  state 
)

◆ drm_atomic_bridge_chain_post_disable()

void drm_atomic_bridge_chain_post_disable ( struct drm_bridge *  bridge,
struct drm_atomic_commit *  state 
)

◆ drm_atomic_bridge_chain_pre_enable()

void drm_atomic_bridge_chain_pre_enable ( struct drm_bridge *  bridge,
struct drm_atomic_commit *  state 
)

◆ drm_atomic_helper_bridge_propagate_bus_fmt()

u32 * drm_atomic_helper_bridge_propagate_bus_fmt ( struct drm_bridge *  bridge,
struct drm_bridge_state *  bridge_state,
struct drm_crtc_state *  crtc_state,
struct drm_connector_state *  conn_state,
u32  output_fmt,
unsigned int *  num_input_fmts 
)

◆ drm_bridge_add()

void drm_bridge_add ( struct drm_bridge *  bridge)

◆ drm_bridge_attach()

int drm_bridge_attach ( struct drm_encoder *  encoder,
struct drm_bridge *  bridge,
struct drm_bridge *  previous,
enum drm_bridge_attach_flags  flags 
)

◆ drm_bridge_chain_mode_set()

void drm_bridge_chain_mode_set ( struct drm_bridge *  bridge,
const struct drm_display_mode *  mode,
const struct drm_display_mode *  adjusted_mode 
)

◆ drm_bridge_chain_mode_valid()

enum drm_mode_status drm_bridge_chain_mode_valid ( struct drm_bridge *  bridge,
const struct drm_display_info *  info,
const struct drm_display_mode *  mode 
)

◆ drm_bridge_clear_and_put()

void drm_bridge_clear_and_put ( struct drm_bridge **  bridge_pp)

◆ drm_bridge_debugfs_encoder_params()

void drm_bridge_debugfs_encoder_params ( struct dentry *  root,
struct drm_encoder *  encoder 
)

◆ drm_bridge_debugfs_params()

void drm_bridge_debugfs_params ( struct dentry *  root)

◆ drm_bridge_detect()

enum drm_connector_status drm_bridge_detect ( struct drm_bridge *  bridge,
struct drm_connector *  connector 
)

◆ drm_bridge_edid_read()

const struct drm_edid * drm_bridge_edid_read ( struct drm_bridge *  bridge,
struct drm_connector *  connector 
)

◆ drm_bridge_enter()

bool drm_bridge_enter ( struct drm_bridge *  bridge,
int *  idx 
)

◆ drm_bridge_exit()

void drm_bridge_exit ( int  idx)

◆ drm_bridge_get()

struct drm_bridge * drm_bridge_get ( struct drm_bridge *  bridge)

◆ drm_bridge_get_modes()

int drm_bridge_get_modes ( struct drm_bridge *  bridge,
struct drm_connector *  connector 
)

◆ drm_bridge_hpd_disable()

void drm_bridge_hpd_disable ( struct drm_bridge *  bridge)

◆ drm_bridge_hpd_enable()

void drm_bridge_hpd_enable ( struct drm_bridge *  bridge,
void(*)(void *data, enum drm_connector_status status)  cb,
void *  data 
)

◆ drm_bridge_hpd_notify()

void drm_bridge_hpd_notify ( struct drm_bridge *  bridge,
enum drm_connector_status  status 
)

◆ drm_bridge_put()

void drm_bridge_put ( struct drm_bridge *  bridge)

◆ drm_bridge_remove()

void drm_bridge_remove ( struct drm_bridge *  bridge)

◆ drm_bridge_unplug()

void drm_bridge_unplug ( struct drm_bridge *  bridge)

Variable Documentation

◆ funcs

size_t size_t uint32_t const struct drm_plane_funcs * funcs

◆ offset

size_t size_t offset

◆ size

size_t size