![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include "config.h"#include "config_unix.h"#include "config_win32.h"#include <assert.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <xf86drm.h>#include <xf86drmMode.h>#include <drm_fourcc.h>#include <memory>#include <vector>#include <algorithm>#include "debug.h"#include "host.h"#include "lib_common.h"#include "pixfmt_conv.h"#include "utils/color_out.h"#include "utils/macros.h"#include "utils/misc.h"#include "utils/text.h"#include "utils/string_view_utils.hpp"#include "video.h"#include "video_codec.h"#include "video_display.h"#include "hwaccel_drm.h"
Go to the source code of this file.
Classes | |
| struct | drm_display_state |
| struct | Drm_prime_fb |
| struct | Drm_state |
| class | Framebuffer |
Macros | |
| #define | MOD_NAME "[drm] " |
Functions | |
| static Framebuffer | create_dumb_fb (int dri, int width, int height, uint32_t pix_fmt) |
| static void | display_drm_done (void *state) |
| static bool | display_drm_get_property (void *state, int property, void *val, size_t *len) |
| static struct video_frame * | display_drm_getf (void *state) |
| static void * | display_drm_init (struct module *parent, const char *cfg, unsigned int flags) |
| static void | display_drm_probe (struct device_info **available_cards, int *count, void(**deleter)(void *)) |
| static bool | display_drm_putf (void *state, struct video_frame *f, long long flags) |
| static bool | display_drm_reconfigure (void *state, struct video_desc desc) |
| static void | draw_frame (Framebuffer *dst, video_frame *src, bool center=true) |
| static void | draw_splash (drm_display_state *s) |
| static Drm_prime_fb | drm_fb_from_frame (drm_display_state *s, frame_uniq frame) |
| static bool | drm_format_supported (drm_display_state *s, uint32_t fmt) |
| static bool | get_codecs (drm_display_state *s, void *val, size_t *len) |
| static const char * | get_connector_status_str (drmModeConnection c) |
| static std::string | get_connector_str (int type, uint32_t id) |
| static std::vector< Drm_connector_uniq > | get_connectors (drm_display_state *s) |
| static int64_t | get_property (int dri, drmModeObjectPropertiesPtr props, std::string_view name) |
| static Framebuffer | get_splash_fb (drm_display_state *s, int width, int height) |
| static bool | init_drm_state (drm_display_state *s) |
| static Fd_uniq | open_dri (drm_display_state *s) |
| static void | print_connectors (drm_display_state *s) |
| static void | print_drm_driver_info (drm_display_state *s) |
| static bool | probe_drm_formats (drm_display_state *s) |
| static void | recycle_frame (drm_display_state *s, frame_uniq &frame) |
| static void | recycle_prime_frame (drm_display_state *s, Drm_prime_fb &fb) |
| REGISTER_MODULE (drm, &display_drm_info, LIBRARY_CLASS_VIDEO_DISPLAY, VIDEO_DISPLAY_ABI_VERSION) | |
| static bool | set_framebuffer (drm_display_state *s, uint32_t fb_id) |
| static bool | setup_crtc (drm_display_state *s) |
| static bool | swap_buffers (drm_display_state *s) |
Variables | |
| static const struct video_display_info | display_drm_info |
Definition in file drm.cpp.
| #define MOD_NAME "[drm] " |
Definition at line 75 of file drm.cpp.
Referenced by create_dumb_fb(), display_drm_done(), display_drm_reconfigure(), draw_splash(), drm_fb_from_frame(), init_drm_state(), open_dri(), print_drm_driver_info(), probe_drm_formats(), set_framebuffer(), and setup_crtc().
|
static |
Definition at line 703 of file drm.cpp.
References Framebuffer::handle, Framebuffer::height, Framebuffer::id, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, log_msg(), Framebuffer::map, MOD_NAME, Framebuffer::pitch, Framebuffer::size, and Framebuffer::width.
Referenced by display_drm_reconfigure(), and get_splash_fb().

|
static |
Definition at line 905 of file drm.cpp.
References LOG_LEVEL_ERROR, log_msg(), MOD_NAME, and state.

|
static |
Definition at line 1037 of file drm.cpp.
References DISPLAY_PROPERTY_CODECS, DISPLAY_PROPERTY_RGB_SHIFT, drm_format_supported(), get_codecs(), len, property, state, and val.

|
static |
Definition at line 917 of file drm.cpp.
References frame, state, vf_alloc_desc_data(), video_desc_eq(), and video_desc_from_frame().

|
static |
Definition at line 842 of file drm.cpp.
References color_printf(), draw_splash(), flags, get_splash_fb(), init_drm_state(), INIT_NOERR, key, parent, parse_num(), print_connectors(), setup_crtc(), TBOLD, tokenize(), TRED, UNUSED, and val.

|
static |
|
static |
Definition at line 981 of file drm.cpp.
References video_frame::color_spec, draw_frame(), drm_fb_from_frame(), DRM_PRIME, flags, frame, Drm_prime_fb::id, PUTF_DISCARD, recycle_frame(), recycle_prime_frame(), set_framebuffer(), state, and swap_buffers().

|
static |
Definition at line 1062 of file drm.cpp.
References video_desc::color_spec, create_dumb_fb(), desc, drm_display_state::desc, drm_format_supported(), DRM_PRIME, video_desc::height, LOG_LEVEL_ERROR, LOG_LEVEL_WARNING, log_msg(), MOD_NAME, mode, RGBA, state, UYVY, vf_alloc_desc_data(), and video_desc::width.

|
static |
Definition at line 788 of file drm.cpp.
References video_frame::color_spec, tile::data, Framebuffer::height, tile::height, Framebuffer::map, Framebuffer::pitch, video_frame::tiles, vc_get_linesize(), vc_get_size(), Framebuffer::width, and tile::width.
Referenced by display_drm_putf(), and get_splash_fb().

|
static |
Definition at line 779 of file drm.cpp.
References Drm_state::connector, Drm_state::crtc, Drm_state::dri_fd, drm_display_state::drm, Framebuffer::id, LOG_LEVEL_ERROR, log_msg(), MOD_NAME, Drm_state::mode_info, and drm_display_state::splashscreen.
Referenced by display_drm_init().

|
static |
Definition at line 938 of file drm.cpp.
References video_frame::color_spec, Drm_state::dri_fd, drm_display_state::drm, DRM_PRIME, Drm_prime_fb::frame, frame, Drm_state::gem_manager, Drm_prime_fb::gem_objects, Drm_prime_fb::id, LOG_LEVEL_ERROR, log_msg(), and MOD_NAME.
Referenced by display_drm_putf().

|
static |
Definition at line 821 of file drm.cpp.
References drm_display_state::drm, fmt, and Drm_state::supported_drm_formats.
Referenced by display_drm_get_property(), display_drm_reconfigure(), and get_splash_fb().
|
static |
Definition at line 1014 of file drm.cpp.
References drm_display_state::drm, DRM_PRIME, len, Drm_state::prime_support, RGBA, Drm_state::supported_drm_formats, UYVY, and val.
Referenced by display_drm_get_property().
|
static |
Definition at line 563 of file drm.cpp.
Referenced by print_connectors().
|
static |
Definition at line 375 of file drm.cpp.
References type.
Referenced by print_connectors(), and setup_crtc().
|
static |
Definition at line 514 of file drm.cpp.
References Drm_state::dri_fd, drm_display_state::drm, and Drm_state::res.
Referenced by print_connectors(), and setup_crtc().
|
static |
Definition at line 465 of file drm.cpp.
References name.
Referenced by probe_drm_formats(), and sdi_register_display_callbacks().
|
static |
Definition at line 825 of file drm.cpp.
References create_dumb_fb(), draw_frame(), Drm_state::dri_fd, drm_display_state::drm, drm_format_supported(), and get_splashscreen().
Referenced by display_drm_init().

|
static |
Definition at line 528 of file drm.cpp.
References Drm_state::dri_fd, drm_display_state::drm, Drm_state::gem_manager, LOG_LEVEL_ERROR, LOG_LEVEL_WARNING, log_msg(), MOD_NAME, open_dri(), Drm_state::prime_support, print_drm_driver_info(), and Drm_state::res.
Referenced by display_drm_init().

|
static |
Definition at line 415 of file drm.cpp.
References drm_display_state::device_path, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_WARNING, log_msg(), and MOD_NAME.
Referenced by init_drm_state().

|
static |
Definition at line 575 of file drm.cpp.
References color_printf(), get_connector_status_str(), get_connector_str(), and get_connectors().
Referenced by display_drm_init().

|
static |
Definition at line 399 of file drm.cpp.
References Drm_state::dri_fd, drm_display_state::drm, LOG_LEVEL_INFO, LOG_LEVEL_WARNING, log_msg(), and MOD_NAME.
Referenced by init_drm_state().

|
static |
Definition at line 477 of file drm.cpp.
References Drm_state::crtc_index, Drm_state::dri_fd, drm_display_state::drm, get_property(), LOG_LEVEL_ERROR, log_msg(), MOD_NAME, and Drm_state::supported_drm_formats.
Referenced by setup_crtc().

|
static |
Definition at line 967 of file drm.cpp.
References frame, drm_display_state::free_frames, and vf_recycle().
Referenced by display_drm_putf().

|
static |
Definition at line 972 of file drm.cpp.
References Drm_prime_fb::frame, frame, drm_display_state::free_frames, and vf_recycle().
Referenced by display_drm_putf().

| REGISTER_MODULE | ( | drm | , |
| & | display_drm_info, | ||
| LIBRARY_CLASS_VIDEO_DISPLAY | , | ||
| VIDEO_DISPLAY_ABI_VERSION | ) |
|
static |
Definition at line 768 of file drm.cpp.
References Drm_state::connector, Drm_state::crtc, Drm_state::dri_fd, drm_display_state::drm, LOG_LEVEL_ERROR, log_msg(), MOD_NAME, and Drm_state::mode_info.
Referenced by display_drm_putf(), and swap_buffers().

|
static |
Definition at line 591 of file drm.cpp.
References Drm_state::connector, Drm_state::crtc, Drm_state::crtc_index, Drm_state::dri_fd, drm_display_state::drm, Drm_state::encoder, get_connector_str(), get_connectors(), LOG_LEVEL_ERROR, log_msg(), MOD_NAME, mode, Drm_state::mode_info, probe_drm_formats(), drm_display_state::req_connector, drm_display_state::req_height, drm_display_state::req_rate, drm_display_state::req_width, and Drm_state::res.
Referenced by display_drm_init().

|
static |
Definition at line 933 of file drm.cpp.
References drm_display_state::back_buffer, drm_display_state::front_buffer, Framebuffer::id, and set_framebuffer().
Referenced by display_drm_putf().

|
static |
Definition at line 1125 of file drm.cpp.