RetroArch
Classes | Macros | Typedefs | Enumerations | Functions | Variables
sunxi_gfx.c File Reference
#include <signal.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <linux/fb.h>
#include <rthreads/rthreads.h>
#include <string/stdstring.h>
#include "../font_driver.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
Include dependency graph for sunxi_gfx.c:

Classes

struct  __disp_rect_t
 
struct  __disp_rectsz_t
 
struct  __disp_pos_t
 
struct  sunxi_disp_t
 
struct  __disp_fb_t
 
struct  __disp_layer_info_t
 
struct  sunxi_page
 
struct  sunxi_video
 

Macros

#define NUMPAGES   2
 
#define FBIOGET_LAYER_HDL_0   0x4700
 
#define FBIOGET_LAYER_HDL_1   0x4701
 
#define DISP_FORMAT_RGB565   0x5
 
#define DISP_FORMAT_ARGB8888   0xa
 
#define DISP_MOD_INTERLEAVED   0x1
 
#define DISP_SEQ_ARGB   0x0
 
#define DISP_SEQ_P10   0xd
 
#define DISP_BT601   = 0,
 
#define DISP_LAYER_WORK_MODE_NORMAL   0
 
#define DISP_LAYER_WORK_MODE_SCALER   4
 
#define DISP_CMD_VERSION   0x00
 
#define SUNXI_DISP_VERSION_MAJOR   1
 
#define SUNXI_DISP_VERSION_MINOR   0
 
#define SUNXI_DISP_VERSION   ((SUNXI_DISP_VERSION_MAJOR << 16) | SUNXI_DISP_VERSION_MINOR)
 
#define SUNXI_DISP_VERSION_MAJOR_GET(x)   (((x) >> 16) & 0x7FFF)
 
#define SUNXI_DISP_VERSION_MINOR_GET(x)   ((x) & 0xFFFF)
 

Typedefs

typedef enum tag_DISP_CMD __disp_cmd_t
 

Enumerations

enum  tag_DISP_CMD {
  DISP_CMD_LAYER_REQUEST = 0x40, DISP_CMD_LAYER_RELEASE = 0x41, DISP_CMD_LAYER_OPEN = 0x42, DISP_CMD_LAYER_CLOSE = 0x43,
  DISP_CMD_LAYER_SET_FB = 0x44, DISP_CMD_LAYER_GET_FB = 0x45, DISP_CMD_LAYER_SET_SRC_WINDOW = 0x46, DISP_CMD_LAYER_GET_SRC_WINDOW = 0x47,
  DISP_CMD_LAYER_SET_SCN_WINDOW = 0x48, DISP_CMD_LAYER_GET_SCN_WINDOW = 0x49, DISP_CMD_LAYER_SET_PARA = 0x4a, DISP_CMD_LAYER_GET_PARA = 0x4b
}
 

Functions

static int sunxi_layer_change_work_mode (sunxi_disp_t *ctx, int new_mode)
 
static int sunxi_layer_reserve (sunxi_disp_t *ctx)
 
static int sunxi_layer_set_output_window (sunxi_disp_t *ctx, int x, int y, int w, int h)
 
static int sunxi_layer_show (sunxi_disp_t *ctx)
 
static int sunxi_layer_release (sunxi_disp_t *ctx)
 
static int sunxi_layer_set_rgb_input_buffer (sunxi_disp_t *ctx, int bpp, uint32_t offset_in_framebuffer, int width, int height, int stride)
 
static sunxi_disp_tsunxi_disp_init (const char *device)
 
static int sunxi_disp_close (sunxi_disp_t *ctx)
 
void pixman_composite_src_0565_8888_asm_neon (int width, int height, uint32_t *dst, int dst_stride_pixels, uint16_t *src, int src_stride_pixels)
 
void pixman_composite_src_8888_8888_asm_neon (int width, int height, uint32_t *dst, int dst_stride_pixels, uint16_t *src, int src_stride_pixels)
 
static void sunxi_blank_console (struct sunxi_video *_dispvars)
 
static void sunxi_restore_console (struct sunxi_video *_dispvars)
 
static void sunxi_vsync_thread_func (void *data)
 
static voidsunxi_gfx_init (const video_info_t *video, const input_driver_t **input, void **input_data)
 
static void sunxi_gfx_free (void *data)
 
static void sunxi_update_main (const void *frame, struct sunxi_video *_dispvars)
 
static void sunxi_setup_scale (void *data, unsigned width, unsigned height, unsigned pitch)
 
static bool sunxi_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 sunxi_gfx_set_nonblock_state (void *data, bool state)
 
static bool sunxi_gfx_alive (void *data)
 
static bool sunxi_gfx_focus (void *data)
 
static void sunxi_gfx_set_rotation (void *data, unsigned rotation)
 
static bool sunxi_gfx_suppress_screensaver (void *data, bool enable)
 
static void sunxi_gfx_viewport_info (void *data, struct video_viewport *vp)
 
static bool sunxi_gfx_set_shader (void *data, enum rarch_shader_type type, const char *path)
 
static void sunxi_set_texture_enable (void *data, bool state, bool full_screen)
 
static void sunxi_set_texture_frame (void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha)
 
static void sunxi_set_aspect_ratio (void *data, unsigned aspect_ratio_idx)
 
static float sunxi_get_refresh_rate (void *data)
 
static void sunxi_gfx_get_poke_interface (void *data, const video_poke_interface_t **iface)
 

Variables

void(* pixman_blit )(int width, int height, uint32_t *dst, int dst_stride_pixels, uint16_t *src, int src_stride_pixels)
 
static const video_poke_interface_t sunxi_poke_interface
 
video_driver_t video_sunxi
 

Macro Definition Documentation

◆ DISP_BT601

#define DISP_BT601   = 0,

◆ DISP_CMD_VERSION

#define DISP_CMD_VERSION   0x00

◆ DISP_FORMAT_ARGB8888

#define DISP_FORMAT_ARGB8888   0xa

◆ DISP_FORMAT_RGB565

#define DISP_FORMAT_RGB565   0x5

◆ DISP_LAYER_WORK_MODE_NORMAL

#define DISP_LAYER_WORK_MODE_NORMAL   0

◆ DISP_LAYER_WORK_MODE_SCALER

#define DISP_LAYER_WORK_MODE_SCALER   4

◆ DISP_MOD_INTERLEAVED

#define DISP_MOD_INTERLEAVED   0x1

◆ DISP_SEQ_ARGB

#define DISP_SEQ_ARGB   0x0

◆ DISP_SEQ_P10

#define DISP_SEQ_P10   0xd

◆ FBIOGET_LAYER_HDL_0

#define FBIOGET_LAYER_HDL_0   0x4700

◆ FBIOGET_LAYER_HDL_1

#define FBIOGET_LAYER_HDL_1   0x4701

◆ NUMPAGES

#define NUMPAGES   2

◆ SUNXI_DISP_VERSION

#define SUNXI_DISP_VERSION   ((SUNXI_DISP_VERSION_MAJOR << 16) | SUNXI_DISP_VERSION_MINOR)

◆ SUNXI_DISP_VERSION_MAJOR

#define SUNXI_DISP_VERSION_MAJOR   1

◆ SUNXI_DISP_VERSION_MAJOR_GET

#define SUNXI_DISP_VERSION_MAJOR_GET (   x)    (((x) >> 16) & 0x7FFF)

◆ SUNXI_DISP_VERSION_MINOR

#define SUNXI_DISP_VERSION_MINOR   0

◆ SUNXI_DISP_VERSION_MINOR_GET

#define SUNXI_DISP_VERSION_MINOR_GET (   x)    ((x) & 0xFFFF)

Typedef Documentation

◆ __disp_cmd_t

typedef enum tag_DISP_CMD __disp_cmd_t

Enumeration Type Documentation

◆ tag_DISP_CMD

Enumerator
DISP_CMD_LAYER_REQUEST 
DISP_CMD_LAYER_RELEASE 
DISP_CMD_LAYER_OPEN 
DISP_CMD_LAYER_CLOSE 
DISP_CMD_LAYER_SET_FB 
DISP_CMD_LAYER_GET_FB 
DISP_CMD_LAYER_SET_SRC_WINDOW 
DISP_CMD_LAYER_GET_SRC_WINDOW 
DISP_CMD_LAYER_SET_SCN_WINDOW 
DISP_CMD_LAYER_GET_SCN_WINDOW 
DISP_CMD_LAYER_SET_PARA 
DISP_CMD_LAYER_GET_PARA 

Function Documentation

◆ pixman_composite_src_0565_8888_asm_neon()

void pixman_composite_src_0565_8888_asm_neon ( int  width,
int  height,
uint32_t dst,
int  dst_stride_pixels,
uint16_t src,
int  src_stride_pixels 
)
Here is the caller graph for this function:

◆ pixman_composite_src_8888_8888_asm_neon()

void pixman_composite_src_8888_8888_asm_neon ( int  width,
int  height,
uint32_t dst,
int  dst_stride_pixels,
uint16_t src,
int  src_stride_pixels 
)
Here is the caller graph for this function:

◆ sunxi_blank_console()

static void sunxi_blank_console ( struct sunxi_video _dispvars)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sunxi_disp_close()

static int sunxi_disp_close ( sunxi_disp_t ctx)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sunxi_disp_init()

static sunxi_disp_t* sunxi_disp_init ( const char *  device)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sunxi_get_refresh_rate()

static float sunxi_get_refresh_rate ( void data)
static

◆ sunxi_gfx_alive()

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

◆ sunxi_gfx_focus()

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

◆ sunxi_gfx_frame()

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

◆ sunxi_gfx_free()

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

◆ sunxi_gfx_get_poke_interface()

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

◆ sunxi_gfx_init()

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

◆ sunxi_gfx_set_nonblock_state()

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

◆ sunxi_gfx_set_rotation()

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

◆ sunxi_gfx_set_shader()

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

◆ sunxi_gfx_suppress_screensaver()

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

◆ sunxi_gfx_viewport_info()

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

◆ sunxi_layer_change_work_mode()

static int sunxi_layer_change_work_mode ( sunxi_disp_t ctx,
int  new_mode 
)
static
Here is the caller graph for this function:

◆ sunxi_layer_release()

static int sunxi_layer_release ( sunxi_disp_t ctx)
static
Here is the caller graph for this function:

◆ sunxi_layer_reserve()

static int sunxi_layer_reserve ( sunxi_disp_t ctx)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sunxi_layer_set_output_window()

static int sunxi_layer_set_output_window ( sunxi_disp_t ctx,
int  x,
int  y,
int  w,
int  h 
)
static
Here is the caller graph for this function:

◆ sunxi_layer_set_rgb_input_buffer()

static int sunxi_layer_set_rgb_input_buffer ( sunxi_disp_t ctx,
int  bpp,
uint32_t  offset_in_framebuffer,
int  width,
int  height,
int  stride 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sunxi_layer_show()

static int sunxi_layer_show ( sunxi_disp_t ctx)
static
Here is the caller graph for this function:

◆ sunxi_restore_console()

static void sunxi_restore_console ( struct sunxi_video _dispvars)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sunxi_set_aspect_ratio()

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

◆ sunxi_set_texture_enable()

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

◆ sunxi_set_texture_frame()

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

◆ sunxi_setup_scale()

static void sunxi_setup_scale ( void data,
unsigned  width,
unsigned  height,
unsigned  pitch 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sunxi_update_main()

static void sunxi_update_main ( const void frame,
struct sunxi_video _dispvars 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sunxi_vsync_thread_func()

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

Variable Documentation

◆ pixman_blit

void(* pixman_blit) (int width, int height, uint32_t *dst, int dst_stride_pixels, uint16_t *src, int src_stride_pixels)

◆ sunxi_poke_interface

const video_poke_interface_t sunxi_poke_interface
static
Initial value:
= {
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}
static void sunxi_set_texture_frame(void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha)
Definition: sunxi_gfx.c:885
static void sunxi_set_texture_enable(void *data, bool state, bool full_screen)
Definition: sunxi_gfx.c:864
static void sunxi_set_aspect_ratio(void *data, unsigned aspect_ratio_idx)
Definition: sunxi_gfx.c:925
#define NULL
Pointer to 0.
Definition: gctypes.h:65

◆ video_sunxi

video_driver_t video_sunxi
Initial value:
= {
NULL,
"sunxi",
NULL,
NULL,
NULL,
}
static void sunxi_gfx_free(void *data)
Definition: sunxi_gfx.c:684
static void sunxi_gfx_viewport_info(void *data, struct video_viewport *vp)
Definition: sunxi_gfx.c:841
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static void sunxi_gfx_set_rotation(void *data, unsigned rotation)
Definition: sunxi_gfx.c:827
static bool sunxi_gfx_focus(void *data)
Definition: sunxi_gfx.c:821
static bool sunxi_gfx_suppress_screensaver(void *data, bool enable)
Definition: sunxi_gfx.c:833
static bool sunxi_gfx_set_shader(void *data, enum rarch_shader_type type, const char *path)
Definition: sunxi_gfx.c:854
static void sunxi_gfx_get_poke_interface(void *data, const video_poke_interface_t **iface)
Definition: sunxi_gfx.c:971
static void * sunxi_gfx_init(const video_info_t *video, const input_driver_t **input, void **input_data)
Definition: sunxi_gfx.c:621
static void sunxi_gfx_set_nonblock_state(void *data, bool state)
Definition: sunxi_gfx.c:807
static bool sunxi_gfx_alive(void *data)
Definition: sunxi_gfx.c:815
static bool sunxi_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: sunxi_gfx.c:774