From: yxj Date: Mon, 4 Mar 2013 02:42:32 +0000 (+0800) Subject: rk fb:add get_format_string to convert format to string for debug X-Git-Tag: firefly_0821_release~7483 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c4e42611437d3f08926beb2ba203aa47d53e2219;p=firefly-linux-kernel-4.4.55.git rk fb:add get_format_string to convert format to string for debug --- diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index 5beda751db89..17c1db1c25c4 100644 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -54,16 +54,47 @@ static struct rk_fb_rgb def_rgb_16 = { }; -/*************************************************************************** -fb0-----------lcdc0------------win1 for ui -fb1-----------lcdc0------------win0 for video,win0 support 3d display -fb2-----------lcdc1------------win1 for ui -fb3-----------lcdc1-------------win0 for video ,win0 support 3d display - -defautl:we alloc three buffer,one for fb0 and fb2 display ui,one for ipp rotate - fb1 and fb3 are used for video play,the buffer is alloc by android,and - pass the phy addr to fix.smem_start by ioctl -****************************************************************************/ +char * get_format_string(enum data_format format,char *fmt) +{ + if(!fmt) + return NULL; + switch(format) + { + case ARGB888: + strcpy(fmt,"ARGB888"); + break; + case RGB888: + strcpy(fmt,"RGB888"); + break; + case RGB565: + strcpy(fmt,"RGB565"); + break; + case YUV420: + strcpy(fmt,"YUV420"); + break; + case YUV422: + strcpy(fmt,"YUV422"); + break; + case YUV444: + strcpy(fmt,"YUV444"); + break; + case XRGB888: + strcpy(fmt,"XRGB888"); + break; + case XBGR888: + strcpy(fmt,"XBGR888"); + break; + case ABGR888: + strcpy(fmt,"XBGR888"); + break; + default: + strcpy(fmt,"invalid"); + break; + } + + return fmt; + +} diff --git a/include/linux/rk_fb.h b/include/linux/rk_fb.h index 6ed2e8103735..4903854f2285 100644 --- a/include/linux/rk_fb.h +++ b/include/linux/rk_fb.h @@ -303,6 +303,8 @@ extern struct rk_lcdc_device_driver * rk_get_lcdc_drv(char *name); extern int rk_fb_switch_screen(rk_screen *screen ,int enable ,int lcdc_id); extern int rk_fb_disp_scale(u8 scale_x, u8 scale_y,u8 lcdc_id); extern int rkfb_create_sysfs(struct fb_info *fbi); +extern char * get_format_string(enum data_format,char *fmt); + static int inline rk_fb_calc_fps(rk_screen *screen,u32 pixclock) { int x, y; @@ -402,4 +404,5 @@ static int inline __rk_platform_add_display_devices(struct platform_device *fb, return 0; } + #endif