RetroArch
Classes | Macros | Enumerations | Functions | Variables
exynos_gfx.c File Reference
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <poll.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <drm_fourcc.h>
#include <libdrm/exynos_drmif.h>
#include <exynos/exynos_fimg2d.h>
#include <retro_inline.h>
#include <retro_assert.h>
#include <string/stdstring.h>
#include "../common/drm_common.h"
#include "../font_driver.h"
#include "../../configuration.h"
#include "../../retroarch.h"
Include dependency graph for exynos_gfx.c:

Classes

struct  exynos_config_default
 
struct  exynos_page
 
struct  exynos_data
 
struct  exynos_video
 

Macros

#define EXYNOS_GFX_DEBUG_LOG   0
 
#define EXYNOS_GFX_DEBUG_PERF   0
 

Enumerations

enum  exynos_buffer_type { EXYNOS_BUFFER_MAIN = 0, EXYNOS_BUFFER_AUX, EXYNOS_BUFFER_COUNT }
 
enum  exynos_image_type { EXYNOS_IMAGE_FRAME = 0, EXYNOS_IMAGE_FRONT, EXYNOS_IMAGE_MENU, EXYNOS_IMAGE_COUNT }
 

Functions

voidmemcpy_neon (void *dst, const void *src, size_t n)
 
static INLINE unsigned align_common (unsigned i, unsigned j)
 
static int exynos_get_device_index (void)
 
static void exynos_page_flip_handler (int fd, unsigned frame, unsigned sec, unsigned usec, void *data)
 
static struct exynos_pageexynos_get_free_page (struct exynos_page *p, unsigned cnt)
 
static unsigned exynos_pages_used (struct exynos_page *p, unsigned cnt)
 
static void exynos_clean_up_pages (struct exynos_page *p, unsigned cnt)
 
static struct exynos_bo * exynos_create_mapped_buffer (struct exynos_device *dev, unsigned size)
 
static int exynos_realloc_buffer (struct exynos_data *pdata, enum exynos_buffer_type type, unsigned size)
 
static int exynos_clear_buffer (struct g2d_context *g2d, struct g2d_image *img)
 
static void exynos_put_glyph_rgba4444 (struct exynos_data *pdata, const uint8_t *__restrict__ src, uint16_t color, unsigned g_width, unsigned g_height, unsigned g_pitch, unsigned dst_x, unsigned dst_y)
 
static int exynos_g2d_init (struct exynos_data *pdata)
 
static void exynos_g2d_free (struct exynos_data *pdata)
 
static int exynos_open (struct exynos_data *pdata)
 
static void exynos_close (struct exynos_data *pdata)
 
static int exynos_init (struct exynos_data *pdata, unsigned bpp)
 
static void exynos_deinit (struct exynos_data *pdata)
 
static int exynos_alloc (struct exynos_data *pdata)
 
static void exynos_free (struct exynos_data *pdata)
 
static struct exynos_pageexynos_free_page (struct exynos_data *pdata)
 
static void exynos_setup_scale (struct exynos_data *pdata, unsigned width, unsigned height, unsigned src_bpp)
 
static void exynos_set_fake_blit (struct exynos_data *pdata)
 
static int exynos_blit_frame (struct exynos_data *pdata, const void *frame, unsigned src_pitch)
 
static int exynos_blend_menu (struct exynos_data *pdata, unsigned rotation)
 
static int exynos_blend_font (struct exynos_data *pdata)
 
static int exynos_flip (struct exynos_data *pdata, struct exynos_page *page)
 
static int exynos_init_font (struct exynos_video *vid)
 
static int exynos_render_msg (struct exynos_video *vid, const char *msg)
 
static voidexynos_gfx_init (const video_info_t *video, const input_driver_t **input, void **input_data)
 
static void exynos_gfx_free (void *data)
 
static bool exynos_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 exynos_gfx_set_nonblock_state (void *data, bool state)
 
static bool exynos_gfx_alive (void *data)
 
static bool exynos_gfx_focus (void *data)
 
static bool exynos_gfx_suppress_screensaver (void *data, bool enable)
 
static void exynos_gfx_set_rotation (void *data, unsigned rotation)
 
static void exynos_gfx_viewport_info (void *data, struct video_viewport *vp)
 
static void exynos_set_aspect_ratio (void *data, unsigned aspect_ratio_idx)
 
static void exynos_apply_state_changes (void *data)
 
static void exynos_set_texture_frame (void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha)
 
static void exynos_set_texture_enable (void *data, bool state, bool full_screen)
 
static void exynos_set_osd_msg (void *data, const char *msg, const struct font_params *params)
 
static void exynos_show_mouse (void *data, bool state)
 
static void exynos_gfx_get_poke_interface (void *data, const video_poke_interface_t **iface)
 
static bool exynos_gfx_set_shader (void *data, enum rarch_shader_type type, const char *path)
 
static bool exynos_gfx_read_viewport (void *data, uint8_t *buffer, bool is_idle)
 

Variables

static const struct exynos_config_default defaults [EXYNOS_IMAGE_COUNT]
 
static const video_poke_interface_t exynos_poke_interface
 
video_driver_t video_exynos
 

Macro Definition Documentation

◆ EXYNOS_GFX_DEBUG_LOG

#define EXYNOS_GFX_DEBUG_LOG   0

◆ EXYNOS_GFX_DEBUG_PERF

#define EXYNOS_GFX_DEBUG_PERF   0

Enumeration Type Documentation

◆ exynos_buffer_type

Enumerator
EXYNOS_BUFFER_MAIN 
EXYNOS_BUFFER_AUX 
EXYNOS_BUFFER_COUNT 

◆ exynos_image_type

Enumerator
EXYNOS_IMAGE_FRAME 
EXYNOS_IMAGE_FRONT 
EXYNOS_IMAGE_MENU 
EXYNOS_IMAGE_COUNT 

Function Documentation

◆ align_common()

static INLINE unsigned align_common ( unsigned  i,
unsigned  j 
)
static
Here is the caller graph for this function:

◆ exynos_alloc()

static int exynos_alloc ( struct exynos_data pdata)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_apply_state_changes()

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

◆ exynos_blend_font()

static int exynos_blend_font ( struct exynos_data pdata)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_blend_menu()

static int exynos_blend_menu ( struct exynos_data pdata,
unsigned  rotation 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_blit_frame()

static int exynos_blit_frame ( struct exynos_data pdata,
const void frame,
unsigned  src_pitch 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_clean_up_pages()

static void exynos_clean_up_pages ( struct exynos_page p,
unsigned  cnt 
)
static
Here is the caller graph for this function:

◆ exynos_clear_buffer()

static int exynos_clear_buffer ( struct g2d_context *  g2d,
struct g2d_image *  img 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_close()

static void exynos_close ( struct exynos_data pdata)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_create_mapped_buffer()

static struct exynos_bo* exynos_create_mapped_buffer ( struct exynos_device *  dev,
unsigned  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_deinit()

static void exynos_deinit ( struct exynos_data pdata)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_flip()

static int exynos_flip ( struct exynos_data pdata,
struct exynos_page page 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_free()

static void exynos_free ( struct exynos_data pdata)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_free_page()

static struct exynos_page* exynos_free_page ( struct exynos_data pdata)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_g2d_free()

static void exynos_g2d_free ( struct exynos_data pdata)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_g2d_init()

static int exynos_g2d_init ( struct exynos_data pdata)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_get_device_index()

static int exynos_get_device_index ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_get_free_page()

static struct exynos_page* exynos_get_free_page ( struct exynos_page p,
unsigned  cnt 
)
static
Here is the caller graph for this function:

◆ exynos_gfx_alive()

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

◆ exynos_gfx_focus()

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

◆ exynos_gfx_frame()

static bool exynos_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:

◆ exynos_gfx_free()

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

◆ exynos_gfx_get_poke_interface()

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

◆ exynos_gfx_init()

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

◆ exynos_gfx_read_viewport()

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

◆ exynos_gfx_set_nonblock_state()

static void exynos_gfx_set_nonblock_state ( void data,
bool  state 
)
static

◆ exynos_gfx_set_rotation()

static void exynos_gfx_set_rotation ( void data,
unsigned  rotation 
)
static

◆ exynos_gfx_set_shader()

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

◆ exynos_gfx_suppress_screensaver()

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

◆ exynos_gfx_viewport_info()

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

◆ exynos_init()

static int exynos_init ( struct exynos_data pdata,
unsigned  bpp 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_init_font()

static int exynos_init_font ( struct exynos_video vid)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_open()

static int exynos_open ( struct exynos_data pdata)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_page_flip_handler()

static void exynos_page_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:

◆ exynos_pages_used()

static unsigned exynos_pages_used ( struct exynos_page p,
unsigned  cnt 
)
static
Here is the caller graph for this function:

◆ exynos_put_glyph_rgba4444()

static void exynos_put_glyph_rgba4444 ( struct exynos_data pdata,
const uint8_t *__restrict__  src,
uint16_t  color,
unsigned  g_width,
unsigned  g_height,
unsigned  g_pitch,
unsigned  dst_x,
unsigned  dst_y 
)
static
Here is the caller graph for this function:

◆ exynos_realloc_buffer()

static int exynos_realloc_buffer ( struct exynos_data pdata,
enum exynos_buffer_type  type,
unsigned  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_render_msg()

static int exynos_render_msg ( struct exynos_video vid,
const char *  msg 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exynos_set_aspect_ratio()

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

◆ exynos_set_fake_blit()

static void exynos_set_fake_blit ( struct exynos_data pdata)
static
Here is the caller graph for this function:

◆ exynos_set_osd_msg()

static void exynos_set_osd_msg ( void data,
const char *  msg,
const struct font_params params 
)
static
Here is the call graph for this function:

◆ exynos_set_texture_enable()

static void exynos_set_texture_enable ( void data,
bool  state,
bool  full_screen 
)
static

◆ exynos_set_texture_frame()

static void exynos_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:

◆ exynos_setup_scale()

static void exynos_setup_scale ( struct exynos_data pdata,
unsigned  width,
unsigned  height,
unsigned  src_bpp 
)
static
Here is the caller graph for this function:

◆ exynos_show_mouse()

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

◆ memcpy_neon()

void* memcpy_neon ( void dst,
const void src,
size_t  n 
)
Here is the caller graph for this function:

Variable Documentation

◆ defaults

Initial value:
= {
{1024, 640, EXYNOS_BUFFER_MAIN, G2D_COLOR_FMT_RGB565 | G2D_ORDER_AXRGB, 2},
{720, 368, EXYNOS_BUFFER_AUX, G2D_COLOR_FMT_ARGB4444 | G2D_ORDER_AXRGB, 2},
{400, 240, EXYNOS_BUFFER_AUX, G2D_COLOR_FMT_ARGB4444 | G2D_ORDER_RGBAX, 2}
}
Definition: exynos_gfx.c:62
Definition: exynos_gfx.c:61

◆ exynos_poke_interface

const video_poke_interface_t exynos_poke_interface
static
Initial value:
= {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}
static void exynos_set_osd_msg(void *data, const char *msg, const struct font_params *params)
Definition: exynos_gfx.c:1478
static void exynos_set_texture_frame(void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha)
Definition: exynos_gfx.c:1440
static void exynos_apply_state_changes(void *data)
Definition: exynos_gfx.c:1435
float drm_get_refresh_rate(void *data)
Definition: drm_common.c:171
static void exynos_set_texture_enable(void *data, bool state, bool full_screen)
Definition: exynos_gfx.c:1471
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static void exynos_show_mouse(void *data, bool state)
Definition: exynos_gfx.c:1486
static void exynos_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
Definition: exynos_gfx.c:1409

◆ video_exynos

video_driver_t video_exynos
Initial value:
= {
NULL,
"exynos",
NULL,
NULL,
}
static bool exynos_gfx_read_viewport(void *data, uint8_t *buffer, bool is_idle)
Definition: exynos_gfx.c:1535
static bool exynos_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: exynos_gfx.c:1279
static bool exynos_gfx_set_shader(void *data, enum rarch_shader_type type, const char *path)
Definition: exynos_gfx.c:1525
static void exynos_gfx_get_poke_interface(void *data, const video_poke_interface_t **iface)
Definition: exynos_gfx.c:1518
static void exynos_gfx_set_rotation(void *data, unsigned rotation)
Definition: exynos_gfx.c:1389
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static void exynos_gfx_viewport_info(void *data, struct video_viewport *vp)
Definition: exynos_gfx.c:1396
static bool exynos_gfx_suppress_screensaver(void *data, bool enable)
Definition: exynos_gfx.c:1381
static void * exynos_gfx_init(const video_info_t *video, const input_driver_t **input, void **input_data)
Definition: exynos_gfx.c:1168
static bool exynos_gfx_alive(void *data)
Definition: exynos_gfx.c:1369
static bool exynos_gfx_focus(void *data)
Definition: exynos_gfx.c:1375
static void exynos_gfx_set_nonblock_state(void *data, bool state)
Definition: exynos_gfx.c:1362
static void exynos_gfx_free(void *data)
Definition: exynos_gfx.c:1247