RetroArch
Classes | Functions | Variables
drm_gfx.c File Reference
#include <xf86drm.h>
#include <xf86drmMode.h>
#include <libdrm/drm_fourcc.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <errno.h>
#include <compat/strl.h>
#include <rthreads/rthreads.h>
#include <string/stdstring.h>
#include "../font_driver.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
#include "../common/drm_common.h"
#include "drm_pixformats.h"
Include dependency graph for drm_gfx.c:

Classes

struct  modeset_buf
 
struct  drm_rect
 
struct  drm_page
 
struct  drm_surface
 
struct  drm_struct
 
struct  drm_video
 

Functions

static int modeset_create_dumbfb (int fd, struct modeset_buf *buf, int bpp, uint32_t pixformat)
 
static void deinit_drm (void)
 
static void drm_surface_free (void *data, struct drm_surface **sp)
 
static void drm_surface_set_aspect (struct drm_surface *surface, float aspect)
 
static void drm_surface_setup (void *data, int src_width, int src_height, int pitch, int bpp, uint32_t pixformat, int alpha, float aspect, int numpages, int layer, struct drm_surface **sp)
 
static void drm_page_flip (struct drm_surface *surface)
 
static void drm_surface_update (void *data, const void *frame, struct drm_surface *surface)
 
static uint32_t get_plane_prop_id (uint32_t obj_id, const char *name)
 
static void drm_format_name (const unsigned int fourcc, char *format_str)
 
static bool format_support (const drmModePlanePtr ovr, uint32_t fmt)
 
static uint64_t drm_plane_type (drmModePlane *plane)
 
static void drm_plane_setup (struct drm_surface *surface)
 
static bool init_drm (void)
 
static voiddrm_gfx_init (const video_info_t *video, const input_driver_t **input, void **input_data)
 
static bool drm_gfx_frame (void *data, const void *frame, unsigned width, unsigned height, uint64_t frame_count, unsigned pitch, const char *msg, video_frame_info_t *video_info)
 
static void drm_set_texture_enable (void *data, bool state, bool full_screen)
 
static void drm_set_texture_frame (void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha)
 
static void drm_gfx_set_nonblock_state (void *data, bool state)
 
static bool drm_gfx_alive (void *data)
 
static bool drm_gfx_focus (void *data)
 
static void drm_gfx_viewport_info (void *data, struct video_viewport *vp)
 
static bool drm_gfx_suppress_screensaver (void *data, bool enable)
 
static bool drm_gfx_set_shader (void *data, enum rarch_shader_type type, const char *path)
 
static void drm_gfx_set_rotation (void *data, unsigned rotation)
 
static bool drm_gfx_read_viewport (void *data, uint8_t *buffer, bool is_idle)
 
static void drm_set_aspect_ratio (void *data, unsigned aspect_ratio_idx)
 
static void drm_gfx_get_poke_interface (void *data, const video_poke_interface_t **iface)
 
static void drm_gfx_free (void *data)
 

Variables

struct drm_struct drm
 
static const video_poke_interface_t drm_poke_interface
 
video_driver_t video_drm
 

Function Documentation

◆ deinit_drm()

static void deinit_drm ( void  )
static
Here is the caller graph for this function:

◆ drm_format_name()

static void drm_format_name ( const unsigned int  fourcc,
char *  format_str 
)
static
Here is the caller graph for this function:

◆ drm_gfx_alive()

static bool drm_gfx_alive ( void data)
static
Here is the call graph for this function:

◆ drm_gfx_focus()

static bool drm_gfx_focus ( void data)
static
Here is the call graph for this function:

◆ drm_gfx_frame()

static bool drm_gfx_frame ( void data,
const void frame,
unsigned  width,
unsigned  height,
uint64_t  frame_count,
unsigned  pitch,
const char *  msg,
video_frame_info_t video_info 
)
static
Here is the call graph for this function:

◆ drm_gfx_free()

static void drm_gfx_free ( void data)
static
Here is the call graph for this function:

◆ drm_gfx_get_poke_interface()

static void drm_gfx_get_poke_interface ( void data,
const video_poke_interface_t **  iface 
)
static
Here is the call graph for this function:

◆ drm_gfx_init()

static void* drm_gfx_init ( const video_info_t video,
const input_driver_t **  input,
void **  input_data 
)
static
Here is the call graph for this function:

◆ drm_gfx_read_viewport()

static bool drm_gfx_read_viewport ( void data,
uint8_t buffer,
bool  is_idle 
)
static
Here is the call graph for this function:

◆ drm_gfx_set_nonblock_state()

static void drm_gfx_set_nonblock_state ( void data,
bool  state 
)
static
Here is the call graph for this function:

◆ drm_gfx_set_rotation()

static void drm_gfx_set_rotation ( void data,
unsigned  rotation 
)
static
Here is the call graph for this function:

◆ drm_gfx_set_shader()

static bool drm_gfx_set_shader ( void data,
enum rarch_shader_type  type,
const char *  path 
)
static
Here is the call graph for this function:

◆ drm_gfx_suppress_screensaver()

static bool drm_gfx_suppress_screensaver ( void data,
bool  enable 
)
static
Here is the call graph for this function:

◆ drm_gfx_viewport_info()

static void drm_gfx_viewport_info ( void data,
struct video_viewport vp 
)
static

◆ drm_page_flip()

static void drm_page_flip ( struct drm_surface surface)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drm_plane_setup()

static void drm_plane_setup ( struct drm_surface surface)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drm_plane_type()

static uint64_t drm_plane_type ( drmModePlane *  plane)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drm_set_aspect_ratio()

static void drm_set_aspect_ratio ( void data,
unsigned  aspect_ratio_idx 
)
static
Here is the call graph for this function:

◆ drm_set_texture_enable()

static void drm_set_texture_enable ( void data,
bool  state,
bool  full_screen 
)
static
Here is the call graph for this function:

◆ drm_set_texture_frame()

static void drm_set_texture_frame ( void data,
const void frame,
bool  rgb32,
unsigned  width,
unsigned  height,
float  alpha 
)
static
Here is the call graph for this function:

◆ drm_surface_free()

static void drm_surface_free ( void data,
struct drm_surface **  sp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drm_surface_set_aspect()

static void drm_surface_set_aspect ( struct drm_surface surface,
float  aspect 
)
static
Here is the caller graph for this function:

◆ drm_surface_setup()

static void drm_surface_setup ( void data,
int  src_width,
int  src_height,
int  pitch,
int  bpp,
uint32_t  pixformat,
int  alpha,
float  aspect,
int  numpages,
int  layer,
struct drm_surface **  sp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drm_surface_update()

static void drm_surface_update ( void data,
const void frame,
struct drm_surface surface 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ format_support()

static bool format_support ( const drmModePlanePtr  ovr,
uint32_t  fmt 
)
static
Here is the caller graph for this function:

◆ get_plane_prop_id()

static uint32_t get_plane_prop_id ( uint32_t  obj_id,
const char *  name 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_drm()

static bool init_drm ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ modeset_create_dumbfb()

static int modeset_create_dumbfb ( int  fd,
struct modeset_buf buf,
int  bpp,
uint32_t  pixformat 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ drm

struct drm_struct drm

◆ drm_poke_interface

const video_poke_interface_t drm_poke_interface
static
Initial value:
= {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}
float drm_get_refresh_rate(void *data)
Definition: drm_common.c:171
static void drm_set_texture_enable(void *data, bool state, bool full_screen)
Definition: drm_gfx.c:805
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static void drm_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
Definition: drm_gfx.c:950
static void drm_set_texture_frame(void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha)
Definition: drm_gfx.c:821

◆ video_drm

video_driver_t video_drm
Initial value:
= {
NULL,
"drm",
NULL,
NULL,
}
static bool drm_gfx_read_viewport(void *data, uint8_t *buffer, bool is_idle)
Definition: drm_gfx.c:942
static void drm_gfx_viewport_info(void *data, struct video_viewport *vp)
Definition: drm_gfx.c:905
static void drm_gfx_free(void *data)
Definition: drm_gfx.c:1001
static bool drm_gfx_alive(void *data)
Definition: drm_gfx.c:893
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static void * drm_gfx_init(const video_info_t *video, const input_driver_t **input, void **input_data)
Definition: drm_gfx.c:710
static void drm_gfx_set_rotation(void *data, unsigned rotation)
Definition: drm_gfx.c:936
static bool drm_gfx_set_shader(void *data, enum rarch_shader_type type, const char *path)
Definition: drm_gfx.c:926
static bool drm_gfx_focus(void *data)
Definition: drm_gfx.c:899
static void drm_gfx_get_poke_interface(void *data, const video_poke_interface_t **iface)
Definition: drm_gfx.c:994
static bool drm_gfx_suppress_screensaver(void *data, bool enable)
Definition: drm_gfx.c:918
static bool drm_gfx_frame(void *data, const void *frame, unsigned width, unsigned height, uint64_t frame_count, unsigned pitch, const char *msg, video_frame_info_t *video_info)
Definition: drm_gfx.c:759
static void drm_gfx_set_nonblock_state(void *data, bool state)
Definition: drm_gfx.c:883