diff options
Diffstat (limited to 'exynos4/hal/libhwcomposer/SecHWCUtils.h')
-rw-r--r-- | exynos4/hal/libhwcomposer/SecHWCUtils.h | 144 |
1 files changed, 52 insertions, 92 deletions
diff --git a/exynos4/hal/libhwcomposer/SecHWCUtils.h b/exynos4/hal/libhwcomposer/SecHWCUtils.h index 9873003..ac1c9ef 100644 --- a/exynos4/hal/libhwcomposer/SecHWCUtils.h +++ b/exynos4/hal/libhwcomposer/SecHWCUtils.h @@ -17,8 +17,8 @@ /* * * @author Rama, Meka(v.meka@samsung.com) - Sangwoo, Park(sw5771.park@samsung.com) - Jamie, Oh (jung-min.oh@samsung.com) + Sangwoo, Park(sw5771.park@samsung.com) + Jamie, Oh (jung-min.oh@samsung.com) * @date 2011-03-11 * */ @@ -34,33 +34,33 @@ #include <errno.h> #include <cutils/log.h> -#ifdef BOARD_USE_V4L2_ION -#include <ion.h> -#include "s5p_fimc_v4l2.h" -#include "sec_utils_v4l2.h" -#else #include <linux/videodev.h> +#include "videodev2.h" #include "s5p_fimc.h" #include "sec_utils.h" -#endif - -#include <linux/android_pmem.h> #include <sys/ioctl.h> #include <sys/mman.h> +#include <sys/resource.h> #include <hardware/gralloc.h> #include "linux/fb.h" #include "s3c_lcd.h" -#include "s3c_mem.h" #include "sec_format.h" -#define HWC_DEBUG +#define HWC_DEBUG 1 #if defined(BOARD_USES_FIMGAPI) #include "sec_g2d.h" -//#define SUB_TITLES_HWC #endif +#define SKIP_DUMMY_UI_LAY_DRAWING + +#ifdef SKIP_DUMMY_UI_LAY_DRAWING +#define GL_WA_OVLY_ALL +#define THRES_FOR_SWAP (3427) /* 60sec in Frames. 57fps * 60 = 3427 */ +#endif + +#define NUM_OF_DUMMY_WIN (4) #define NUM_OF_WIN (2) #define NUM_OF_WIN_BUF (2) #define NUM_OF_MEM_OBJ (1) @@ -72,27 +72,14 @@ #define MAX_RESIZING_RATIO_LIMIT (63) #ifdef SAMSUNG_EXYNOS4x12 -#ifdef BOARD_USE_V4L2_ION -#define PP_DEVICE_DEV_NAME "/dev/video4" -#else #define PP_DEVICE_DEV_NAME "/dev/video3" #endif -#endif #ifdef SAMSUNG_EXYNOS4210 #define PP_DEVICE_DEV_NAME "/dev/video1" #endif - -#define S3C_MEM_DEV_NAME "/dev/s3c-mem" -#define PMEM_DEVICE_DEV_NAME "/dev/pmem_gpu1" - -#ifdef BOARD_USE_V4L2_ION -#undef USE_HW_PMEM -#else -#define USE_HW_PMEM -#endif - -#define PMEM_SIZE (1920 * 1280 * 2) +/* cacheable configuration */ +#define V4L2_CID_CACHEABLE (V4L2_CID_BASE+40) struct sec_rect { int32_t x; @@ -127,34 +114,6 @@ inline int SEC_MAX(int x, int y) return ((x > y) ? x : y); } -struct s3c_mem_t { - int fd; - struct s3c_mem_alloc mem_alloc[NUM_OF_MEM_OBJ]; -}; - -#ifdef USE_HW_PMEM -typedef struct __sec_pmem_alloc { - int fd; - int total_size; - int offset; - int size; - unsigned int virt_addr; - unsigned int phys_addr; -} sec_pmem_alloc_t; - -typedef struct __sec_pmem { - int pmem_master_fd; - void *pmem_master_base; - int pmem_total_size; - sec_pmem_alloc_t sec_pmem_alloc[NUM_OF_MEM_OBJ]; -} sec_pmem_t; - -inline size_t roundUpToPageSize(size_t x) -{ - return (x + (PAGE_SIZE-1)) & ~(PAGE_SIZE-1); -} -#endif - struct hwc_win_info_t { int fd; int size; @@ -167,9 +126,6 @@ struct hwc_win_info_t { int layer_index; int status; int vsync; -#ifdef BOARD_USE_V4L2_ION - int ion_fd; -#endif struct fb_fix_screeninfo fix_info; struct fb_var_screeninfo var_info; @@ -187,24 +143,46 @@ enum { HWC_VIRT_MEM_TYPE, }; +#ifdef SKIP_DUMMY_UI_LAY_DRAWING +struct hwc_ui_lay_info{ + uint32_t layer_prev_buf; + int layer_index; + int status; +}; +#endif + struct hwc_context_t { - hwc_composer_device_t device; + hwc_composer_device_1_t device; /* our private state goes below here */ struct hwc_win_info_t win[NUM_OF_WIN]; - struct fb_var_screeninfo lcd_info; - s5p_fimc_t fimc; -#ifdef SUB_TITLES_HWC - sec_g2d_t g2d; +#ifdef SKIP_DUMMY_UI_LAY_DRAWING + struct hwc_ui_lay_info win_virt[NUM_OF_DUMMY_WIN]; + int fb_lay_skip_initialized; + int num_of_fb_lay_skip; +#ifdef GL_WA_OVLY_ALL + int ui_skip_frame_cnt; #endif - struct s3c_mem_t s3c_mem; -#ifdef USE_HW_PMEM - sec_pmem_t sec_pmem; #endif + + struct fb_var_screeninfo lcd_info; + s5p_fimc_t fimc; + hwc_procs_t *procs; + pthread_t uevent_thread; + pthread_t vsync_thread; + int num_of_fb_layer; int num_of_hwc_layer; - int num_2d_blit_layer; + int num_of_fb_layer_prev; + int num_2d_blit_layer; uint32_t layer_prev_buf[NUM_OF_WIN]; + + int num_of_ext_disp_layer; + int num_of_ext_disp_video_layer; + +#ifdef BOARD_USES_HDMI + int hdmi_cable_status; +#endif }; typedef enum _LOG_LEVEL { @@ -220,8 +198,8 @@ typedef enum _LOG_LEVEL { #else #define SEC_HWC_Log(a, ...) \ do { \ - if (a == HWC_LOG_ERROR) \ - ((void)_SEC_HWC_Log(a, SEC_HWC_LOG_TAG, __VA_ARGS__)); \ + if (a == HWC_LOG_ERROR) \ + ((void)_SEC_HWC_Log(a, SEC_HWC_LOG_TAG, __VA_ARGS__)); \ } while (0) #endif @@ -305,27 +283,9 @@ int window_get_global_lcd_info(int fd, struct fb_var_screeninfo *lcd_info); int createFimc (s5p_fimc_t *fimc); int destroyFimc(s5p_fimc_t *fimc); int runFimc(struct hwc_context_t *ctx, - struct sec_img *src_img, struct sec_rect *src_rect, - struct sec_img *dst_img, struct sec_rect *dst_rect, - uint32_t transform); - -#ifdef SUB_TITLES_HWC -int runG2d(struct hwc_context_t *ctx, - g2d_rect *src_rect, g2d_rect *dst_rect, - uint32_t transform); - -int destroyG2d(sec_g2d_t *g2d); -int createG2d(sec_g2d_t *g2d); -#endif - -int createMem (struct s3c_mem_t *mem, unsigned int index, unsigned int size); -int destroyMem(struct s3c_mem_t *mem); -int checkMem (struct s3c_mem_t *mem, unsigned int index, unsigned int size); - -#ifdef USE_HW_PMEM -int createPmem (sec_pmem_t *pm, unsigned int size); -int destroyPmem(sec_pmem_t *pm); -int checkPmem (sec_pmem_t *pm, unsigned int index, unsigned int size); -#endif + struct sec_img *src_img, struct sec_rect *src_rect, + struct sec_img *dst_img, struct sec_rect *dst_rect, + uint32_t transform); +int check_yuv_format(unsigned int color_format); #endif /* ANDROID_SEC_HWC_UTILS_H_*/ |