XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions | Variables
drm_plane.h File Reference
#include <linux/list.h>
#include <linux/ctype.h>
#include <linux/kmsg_dump.h>
#include <drm/drm_mode_object.h>
#include <drm/drm_color_mgmt.h>
#include <drm/drm_rect.h>
#include <drm/drm_modeset_lock.h>
#include <drm/drm_util.h>
Include dependency graph for drm_plane.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  drm_plane_state
 
struct  drm_plane_funcs
 
struct  drm_plane
 

Macros

#define obj_to_plane(x)   container_of(x, struct drm_plane, base)
 

Enumerations

enum  drm_scaling_filter { DRM_SCALING_FILTER_DEFAULT , DRM_SCALING_FILTER_NEAREST_NEIGHBOR }
 
enum  drm_plane_type { DRM_PLANE_TYPE_OVERLAY , DRM_PLANE_TYPE_PRIMARY , DRM_PLANE_TYPE_CURSOR }
 

Functions

 __printf (9, 10) int drm_universal_plane_init(struct drm_device *dev
 
struct drm_plane uint32_t const struct drm_plane_funcs const uint32_t unsigned int const uint64_t enum drm_plane_type type const char void drm_plane_cleanup (struct drm_plane *plane)
 

Variables

struct drm_plane * plane
 

: 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.

#define drmm_universal_plane_alloc(dev, type, member, possible_crtcs, funcs, formats, format_count, format_modifiers, plane_type, name, ...)
 
#define drm_universal_plane_alloc(dev, type, member, possible_crtcs, funcs, formats, format_count, format_modifiers, plane_type, name, ...)
 
#define drm_for_each_plane_mask(plane, dev, plane_mask)
 
#define drm_for_each_legacy_plane(plane, dev)
 
#define drm_for_each_plane(plane, dev)    list_for_each_entry(plane, &(dev)->mode_config.plane_list, head)
 
struct drm_plane uint32_t possible_crtcs
 
struct drm_plane uint32_t const struct drm_plane_funcs * funcs
 
struct drm_plane uint32_t const struct drm_plane_funcs const uint32_t * formats
 
struct drm_plane uint32_t const struct drm_plane_funcs const uint32_t unsigned int format_count
 
struct drm_plane uint32_t const struct drm_plane_funcs const uint32_t unsigned int const uint64_t * format_modifiers
 
struct drm_plane uint32_t const struct drm_plane_funcs const uint32_t unsigned int const uint64_t enum drm_plane_type type const char * name
 
size_t size
 
size_t size_t offset
 
 __printf (10, 11) void *__drmm_universal_plane_alloc(struct drm_device *dev
 
struct drm_plane * drm_plane_from_index (struct drm_device *dev, int idx)
 
void drm_plane_force_disable (struct drm_plane *plane)
 
int drm_mode_plane_set_obj_prop (struct drm_plane *plane, struct drm_property *property, uint64_t value)
 
bool drm_plane_has_format (struct drm_plane *plane, u32 format, u64 modifier)
 
bool drm_any_plane_has_format (struct drm_device *dev, u32 format, u64 modifier)
 
void drm_plane_enable_fb_damage_clips (struct drm_plane *plane)
 
unsigned int drm_plane_get_damage_clips_count (const struct drm_plane_state *state)
 
struct drm_mode_rect * drm_plane_get_damage_clips (const struct drm_plane_state *state)
 
int drm_plane_create_scaling_filter_property (struct drm_plane *plane, unsigned int supported_filters)
 
int drm_plane_add_size_hints_property (struct drm_plane *plane, const struct drm_plane_size_hint *hints, int num_hints)
 
int drm_plane_create_color_pipeline_property (struct drm_plane *plane, const struct drm_prop_enum_list *pipelines, int num_pipelines)
 

Macro Definition Documentation

◆ drm_for_each_legacy_plane

#define drm_for_each_legacy_plane (   plane,
  dev 
)
Value:
list_for_each_entry(plane, &(dev)->mode_config.plane_list, head) \
for_each_if (plane->type == DRM_PLANE_TYPE_OVERLAY)
#define list_for_each_entry(pos, head, member)
Definition list.h:66
struct drm_plane * plane
Definition drm_plane.h:828
@ DRM_PLANE_TYPE_OVERLAY
Definition drm_plane.h:608
const struct device * dev
Definition drm_print.h:519
int const struct list_head const struct list_head struct list_head * head
Definition list_sort.h:13
enum drm_plane_type type
Definition drm_plane.h:724

drm_for_each_legacy_plane - iterate over all planes for legacy userspace @plane: the loop cursor @dev: the DRM device

Iterate over all legacy planes of @dev, excluding primary and cursor planes. This is useful for implementing userspace apis when userspace is not universal plane aware. See also &enum drm_plane_type.

◆ drm_for_each_plane

#define drm_for_each_plane (   plane,
  dev 
)     list_for_each_entry(plane, &(dev)->mode_config.plane_list, head)

drm_for_each_plane - iterate over all planes @plane: the loop cursor @dev: the DRM device

Iterate over all planes of @dev, include primary and cursor planes.

◆ drm_for_each_plane_mask

#define drm_for_each_plane_mask (   plane,
  dev,
  plane_mask 
)
Value:
list_for_each_entry((plane), &(dev)->mode_config.plane_list, head) \
for_each_if ((plane_mask) & drm_plane_mask(plane))

drm_for_each_plane_mask - iterate over planes specified by bitmask @plane: the loop cursor @dev: the DRM device @plane_mask: bitmask of plane indices

Iterate over all planes specified by bitmask.

◆ drm_universal_plane_alloc

#define drm_universal_plane_alloc (   dev,
  type,
  member,
  possible_crtcs,
  funcs,
  formats,
  format_count,
  format_modifiers,
  plane_type,
  name,
  ... 
)
Value:
((type *)__drm_universal_plane_alloc(dev, sizeof(type), \
offsetof(type, member), \
plane_type, name, ##__VA_ARGS__))
struct drm_plane uint32_t possible_crtcs
Definition drm_plane.h:829
struct drm_plane uint32_t const struct drm_plane_funcs const uint32_t unsigned int const uint64_t * format_modifiers
Definition drm_plane.h:833
struct drm_plane uint32_t const struct drm_plane_funcs const uint32_t unsigned int format_count
Definition drm_plane.h:832
struct drm_plane uint32_t const struct drm_plane_funcs const uint32_t unsigned int const uint64_t enum drm_plane_type type const char * name
Definition drm_plane.h:834
struct drm_plane uint32_t const struct drm_plane_funcs * funcs
Definition drm_plane.h:830
struct drm_plane uint32_t const struct drm_plane_funcs const uint32_t * formats
Definition drm_plane.h:831

◆ drmm_universal_plane_alloc

#define drmm_universal_plane_alloc (   dev,
  type,
  member,
  possible_crtcs,
  funcs,
  formats,
  format_count,
  format_modifiers,
  plane_type,
  name,
  ... 
)
Value:
((type *)__drmm_universal_plane_alloc(dev, sizeof(type), \
offsetof(type, member), \
plane_type, name, ##__VA_ARGS__))

◆ obj_to_plane

#define obj_to_plane (   x)    container_of(x, struct drm_plane, base)

Enumeration Type Documentation

◆ drm_plane_type

enum drm_plane_type - uapi plane type enumeration

For historical reasons not all planes are made the same. This enumeration is used to tell the different types of planes apart to implement the different uapi semantics for them. For userspace which is universal plane aware and which is using that atomic IOCTL there's no difference between these planes (beyong what the driver and hardware can support of course).

For compatibility with legacy userspace, only overlay planes are made available to userspace by default. Userspace clients may set the &DRM_CLIENT_CAP_UNIVERSAL_PLANES client capability bit to indicate that they wish to receive a universal plane list containing all plane types. See also drm_for_each_legacy_plane().

In addition to setting each plane's type, drivers need to setup the &drm_crtc.primary and optionally &drm_crtc.cursor pointers for legacy IOCTLs. See drm_crtc_init_with_planes().

WARNING: The values of this enum is UABI since they're exposed in the "type" property.

Enumerator
DRM_PLANE_TYPE_OVERLAY 

@DRM_PLANE_TYPE_OVERLAY:

Overlay planes represent all non-primary, non-cursor planes. Some drivers refer to these types of planes as "sprites" internally.

DRM_PLANE_TYPE_PRIMARY 

@DRM_PLANE_TYPE_PRIMARY:

A primary plane attached to a CRTC is the most likely to be able to light up the CRTC when no scaling/cropping is used and the plane covers the whole CRTC.

DRM_PLANE_TYPE_CURSOR 

@DRM_PLANE_TYPE_CURSOR:

A cursor plane attached to a CRTC is more likely to be able to be enabled when no scaling/cropping is used and the framebuffer has the size indicated by &drm_mode_config.cursor_width and &drm_mode_config.cursor_height. Additionally, if the driver doesn't support modifiers, the framebuffer should have a linear layout.

◆ drm_scaling_filter

Enumerator
DRM_SCALING_FILTER_DEFAULT 
DRM_SCALING_FILTER_NEAREST_NEIGHBOR 

Function Documentation

◆ __printf() [1/2]

__printf ( 10  ,
11   
)

◆ __printf() [2/2]

__printf ( 9  ,
10   
)

◆ drm_any_plane_has_format()

bool drm_any_plane_has_format ( struct drm_device *  dev,
u32  format,
u64  modifier 
)

◆ drm_mode_plane_set_obj_prop()

int drm_mode_plane_set_obj_prop ( struct drm_plane *  plane,
struct drm_property *  property,
uint64_t  value 
)

◆ drm_plane_add_size_hints_property()

int drm_plane_add_size_hints_property ( struct drm_plane *  plane,
const struct drm_plane_size_hint *  hints,
int  num_hints 
)

◆ drm_plane_cleanup()

struct drm_plane uint32_t const struct drm_plane_funcs const uint32_t unsigned int const uint64_t enum drm_plane_type type const char void drm_plane_cleanup ( struct drm_plane *  plane)

◆ drm_plane_create_color_pipeline_property()

int drm_plane_create_color_pipeline_property ( struct drm_plane *  plane,
const struct drm_prop_enum_list *  pipelines,
int  num_pipelines 
)

◆ drm_plane_create_scaling_filter_property()

int drm_plane_create_scaling_filter_property ( struct drm_plane *  plane,
unsigned int  supported_filters 
)

◆ drm_plane_enable_fb_damage_clips()

void drm_plane_enable_fb_damage_clips ( struct drm_plane *  plane)

◆ drm_plane_force_disable()

void drm_plane_force_disable ( struct drm_plane *  plane)

◆ drm_plane_from_index()

struct drm_plane * drm_plane_from_index ( struct drm_device *  dev,
int  idx 
)

◆ drm_plane_get_damage_clips()

struct drm_mode_rect * drm_plane_get_damage_clips ( const struct drm_plane_state *  state)

◆ drm_plane_get_damage_clips_count()

unsigned int drm_plane_get_damage_clips_count ( const struct drm_plane_state *  state)

◆ drm_plane_has_format()

bool drm_plane_has_format ( struct drm_plane *  plane,
u32  format,
u64  modifier 
)

Variable Documentation

◆ format_count

size_t size_t uint32_t const struct drm_plane_funcs const uint32_t unsigned int format_count

◆ format_modifiers

size_t size_t uint32_t const struct drm_plane_funcs const uint32_t unsigned int const uint64_t * format_modifiers

◆ formats

size_t size_t uint32_t const struct drm_plane_funcs const uint32_t * formats

◆ funcs

size_t size_t uint32_t const struct drm_plane_funcs* funcs

◆ name

size_t size_t uint32_t const struct drm_plane_funcs const uint32_t unsigned int const uint64_t enum drm_plane_type plane_type const char* name

◆ offset

size_t size_t offset

◆ plane

struct drm_plane* plane

◆ possible_crtcs

size_t size_t uint32_t possible_crtcs

◆ size

size_t size