RetroArch
Classes | Macros | Typedefs | Functions | Variables
drm_ctx.c File Reference
#include <stdint.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include <sched.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/poll.h>
#include <libdrm/drm.h>
#include <gbm.h>
#include <lists/dir_list.h>
#include <string/stdstring.h>
#include "../../configuration.h"
#include "../../verbosity.h"
#include "../../frontend/frontend_driver.h"
#include "../common/drm_common.h"
Include dependency graph for drm_ctx.c:

Classes

struct  gfx_ctx_drm_data
 
struct  drm_fb
 

Macros

#define EGL_PLATFORM_GBM_KHR   0x31D7
 

Typedefs

typedef struct gfx_ctx_drm_data gfx_ctx_drm_data_t
 

Functions

static void drm_fb_destroy_callback (struct gbm_bo *bo, void *data)
 
static struct drm_fbdrm_fb_get_from_bo (struct gbm_bo *bo)
 
static void gfx_ctx_drm_swap_interval (void *data, int interval)
 
static void gfx_ctx_drm_check_window (void *data, bool *quit, bool *resize, unsigned *width, unsigned *height, bool is_shutdown)
 
static void drm_flip_handler (int fd, unsigned frame, unsigned sec, unsigned usec, void *data)
 
static bool gfx_ctx_drm_wait_flip (bool block)
 
static bool gfx_ctx_drm_queue_flip (void)
 
static void gfx_ctx_drm_swap_buffers (void *data, void *data2)
 
static void gfx_ctx_drm_get_video_size (void *data, unsigned *width, unsigned *height)
 
static void free_drm_resources (gfx_ctx_drm_data_t *drm)
 
static void gfx_ctx_drm_destroy_resources (gfx_ctx_drm_data_t *drm)
 
static voidgfx_ctx_drm_init (video_frame_info_t *video_info, void *video_driver)
 
static EGLint * gfx_ctx_drm_egl_fill_attribs (gfx_ctx_drm_data_t *drm, EGLint *attr)
 
static bool gfx_ctx_drm_set_video_mode (void *data, video_frame_info_t *video_info, unsigned width, unsigned height, bool fullscreen)
 
static void gfx_ctx_drm_destroy (void *data)
 
static void gfx_ctx_drm_input_driver (void *data, const char *joypad_name, const input_driver_t **input, void **input_data)
 
static bool gfx_ctx_drm_has_focus (void *data)
 
static bool gfx_ctx_drm_suppress_screensaver (void *data, bool enable)
 
static enum gfx_ctx_api gfx_ctx_drm_get_api (void *data)
 
static bool gfx_ctx_drm_bind_api (void *video_driver, enum gfx_ctx_api api, unsigned major, unsigned minor)
 
static gfx_ctx_proc_t gfx_ctx_drm_get_proc_address (const char *symbol)
 
static void gfx_ctx_drm_bind_hw_render (void *data, bool enable)
 
static uint32_t gfx_ctx_drm_get_flags (void *data)
 
static void gfx_ctx_drm_set_flags (void *data, uint32_t flags)
 

Variables

static enum gfx_ctx_api drm_api = GFX_CTX_NONE
 
static struct gbm_bo * g_bo = NULL
 
static struct gbm_bo * g_next_bo = NULL
 
static struct gbm_surface * g_gbm_surface = NULL
 
static struct gbm_device * g_gbm_dev = NULL
 
static bool waiting_for_flip = false
 
const gfx_ctx_driver_t gfx_ctx_drm
 

Macro Definition Documentation

◆ EGL_PLATFORM_GBM_KHR

#define EGL_PLATFORM_GBM_KHR   0x31D7

Typedef Documentation

◆ gfx_ctx_drm_data_t

Function Documentation

◆ drm_fb_destroy_callback()

static void drm_fb_destroy_callback ( struct gbm_bo *  bo,
void data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drm_fb_get_from_bo()

static struct drm_fb* drm_fb_get_from_bo ( struct gbm_bo *  bo)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drm_flip_handler()

static void drm_flip_handler ( int  fd,
unsigned  frame,
unsigned  sec,
unsigned  usec,
void data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ free_drm_resources()

static void free_drm_resources ( gfx_ctx_drm_data_t drm)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gfx_ctx_drm_bind_api()

static bool gfx_ctx_drm_bind_api ( void video_driver,
enum gfx_ctx_api  api,
unsigned  major,
unsigned  minor 
)
static
Here is the call graph for this function:

◆ gfx_ctx_drm_bind_hw_render()

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

◆ gfx_ctx_drm_check_window()

static void gfx_ctx_drm_check_window ( void data,
bool quit,
bool resize,
unsigned *  width,
unsigned *  height,
bool  is_shutdown 
)
static
Here is the call graph for this function:

◆ gfx_ctx_drm_destroy()

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

◆ gfx_ctx_drm_destroy_resources()

static void gfx_ctx_drm_destroy_resources ( gfx_ctx_drm_data_t drm)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gfx_ctx_drm_egl_fill_attribs()

static EGLint* gfx_ctx_drm_egl_fill_attribs ( gfx_ctx_drm_data_t drm,
EGLint *  attr 
)
static
Here is the call graph for this function:

◆ gfx_ctx_drm_get_api()

static enum gfx_ctx_api gfx_ctx_drm_get_api ( void data)
static

◆ gfx_ctx_drm_get_flags()

static uint32_t gfx_ctx_drm_get_flags ( void data)
static

◆ gfx_ctx_drm_get_proc_address()

static gfx_ctx_proc_t gfx_ctx_drm_get_proc_address ( const char *  symbol)
static
Here is the call graph for this function:

◆ gfx_ctx_drm_get_video_size()

static void gfx_ctx_drm_get_video_size ( void data,
unsigned *  width,
unsigned *  height 
)
static

◆ gfx_ctx_drm_has_focus()

static bool gfx_ctx_drm_has_focus ( void data)
static

◆ gfx_ctx_drm_init()

static void* gfx_ctx_drm_init ( video_frame_info_t video_info,
void video_driver 
)
static
Here is the call graph for this function:

◆ gfx_ctx_drm_input_driver()

static void gfx_ctx_drm_input_driver ( void data,
const char *  joypad_name,
const input_driver_t **  input,
void **  input_data 
)
static
Here is the call graph for this function:

◆ gfx_ctx_drm_queue_flip()

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

◆ gfx_ctx_drm_set_flags()

static void gfx_ctx_drm_set_flags ( void data,
uint32_t  flags 
)
static

◆ gfx_ctx_drm_set_video_mode()

static bool gfx_ctx_drm_set_video_mode ( void data,
video_frame_info_t video_info,
unsigned  width,
unsigned  height,
bool  fullscreen 
)
static
Here is the call graph for this function:

◆ gfx_ctx_drm_suppress_screensaver()

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

◆ gfx_ctx_drm_swap_buffers()

static void gfx_ctx_drm_swap_buffers ( void data,
void data2 
)
static
Here is the call graph for this function:

◆ gfx_ctx_drm_swap_interval()

static void gfx_ctx_drm_swap_interval ( void data,
int  interval 
)
static
Here is the call graph for this function:

◆ gfx_ctx_drm_wait_flip()

static bool gfx_ctx_drm_wait_flip ( bool  block)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ drm_api

enum gfx_ctx_api drm_api = GFX_CTX_NONE
static

◆ g_bo

struct gbm_bo* g_bo = NULL
static

◆ g_gbm_dev

struct gbm_device* g_gbm_dev = NULL
static

◆ g_gbm_surface

struct gbm_surface* g_gbm_surface = NULL
static

◆ g_next_bo

struct gbm_bo* g_next_bo = NULL
static

◆ gfx_ctx_drm

const gfx_ctx_driver_t gfx_ctx_drm

◆ waiting_for_flip

bool waiting_for_flip = false
static