video: rockchip: fix compile warning: may be used uninitialized

Change-Id: Ia162b79443e8361d93575963c6603999ffc3e405
Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
This commit is contained in:
Huang Jiachai 2016-05-09 17:03:15 +08:00
parent a3926cf98e
commit e295c725bd
6 changed files with 92 additions and 90 deletions

View File

@ -74,9 +74,9 @@ static void yuv_to_rgb(int y, int u, int v, int *r, int *g, int *b)
int bmpencoder(void *__iomem *vaddr, int width, int height, u8 data_format,
void *data, void (*fn)(void *, void *, int))
{
uint32_t *d, *d1, *d2;
uint8_t *dst, *yrgb, *uv, *y1, *y2;
int y, u, v, r, g, b;
uint32_t *d = NULL, *d1 = NULL, *d2 = NULL;
uint8_t *dst = NULL, *yrgb = NULL, *uv = NULL, *y1 = NULL, *y2 = NULL;
int y = 0, u = 0, v = 0, r = 0, g = 0, b = 0;
int yu = width * 4 % 4;
int byteperline;

View File

@ -856,7 +856,7 @@ static int vop_post_csc_cfg(struct rk_lcdc_driver *dev_drv)
struct vop_device *vop_dev =
container_of(dev_drv, struct vop_device, driver);
int output_color = dev_drv->output_color;
int win_csc, overlay_mode;
int win_csc = 0, overlay_mode = 0;
u64 val;
if (VOP_CHIP(vop_dev) == VOP_RK322X) {
@ -1095,9 +1095,10 @@ static int vop_alpha_cfg(struct rk_lcdc_driver *dev_drv, int win_id)
struct alpha_config alpha_config;
u64 val;
int ppixel_alpha = 0, global_alpha = 0, i;
u32 src_alpha_ctl, dst_alpha_ctl;
u32 src_alpha_ctl = 0, dst_alpha_ctl = 0;
int alpha_en = 1;
memset(&alpha_config, 0, sizeof(struct alpha_config));
for (i = 0; i < win->area_num; i++) {
ppixel_alpha |= ((win->area[i].format == ARGB888) ||
(win->area[i].format == FBDC_ARGB_888) ||
@ -1915,7 +1916,7 @@ static int vop_load_screen(struct rk_lcdc_driver *dev_drv, bool initscreen)
struct vop_device *vop_dev =
container_of(dev_drv, struct vop_device, driver);
struct rk_screen *screen = dev_drv->cur_screen;
u64 val;
u64 val = 0;
if (unlikely(!vop_dev->clk_on)) {
pr_info("%s,clk_on = %d\n", __func__, vop_dev->clk_on);
@ -2319,27 +2320,27 @@ static int vop_pan_display(struct rk_lcdc_driver *dev_drv, int win_id)
static int vop_cal_scl_fac(struct rk_lcdc_win *win, struct rk_screen *screen)
{
u16 srcW;
u16 srcH;
u16 dstW;
u16 dstH;
u16 yrgb_srcW;
u16 yrgb_srcH;
u16 yrgb_dstW;
u16 yrgb_dstH;
u32 yrgb_vscalednmult;
u32 yrgb_xscl_factor;
u32 yrgb_yscl_factor;
u16 srcW = 0;
u16 srcH = 0;
u16 dstW = 0;
u16 dstH = 0;
u16 yrgb_srcW = 0;
u16 yrgb_srcH = 0;
u16 yrgb_dstW = 0;
u16 yrgb_dstH = 0;
u32 yrgb_vscalednmult = 0;
u32 yrgb_xscl_factor = 0;
u32 yrgb_yscl_factor = 0;
u8 yrgb_vsd_bil_gt2 = 0;
u8 yrgb_vsd_bil_gt4 = 0;
u16 cbcr_srcW;
u16 cbcr_srcH;
u16 cbcr_dstW;
u16 cbcr_dstH;
u32 cbcr_vscalednmult;
u32 cbcr_xscl_factor;
u32 cbcr_yscl_factor;
u16 cbcr_srcW = 0;
u16 cbcr_srcH = 0;
u16 cbcr_dstW = 0;
u16 cbcr_dstH = 0;
u32 cbcr_vscalednmult = 0;
u32 cbcr_xscl_factor = 0;
u32 cbcr_yscl_factor = 0;
u8 cbcr_vsd_bil_gt2 = 0;
u8 cbcr_vsd_bil_gt4 = 0;
u8 yuv_fmt = 0;
@ -2854,8 +2855,8 @@ static int dsp_y_pos(int mirror_en, struct rk_screen *screen,
static int win_0_1_set_par(struct vop_device *vop_dev,
struct rk_screen *screen, struct rk_lcdc_win *win)
{
u32 xact, yact, xvir, yvir, xpos, ypos;
u8 fmt_cfg = 0, swap_rb, swap_uv = 0;
u32 xact = 0, yact = 0, xvir = 0, yvir = 0, xpos = 0, ypos = 0;
u8 fmt_cfg = 0, swap_rb = 0, swap_uv = 0;
char fmt[9] = "NULL";
xpos = dsp_x_pos(win->xmirror, screen, &win->area[0]);
@ -3008,7 +3009,7 @@ static int win_2_3_set_par(struct vop_device *vop_dev,
struct rk_screen *screen, struct rk_lcdc_win *win)
{
int i;
u8 fmt_cfg, swap_rb;
u8 fmt_cfg = 0, swap_rb = 0;
char fmt[9] = "NULL";
if (VOP_CHIP(vop_dev) == VOP_RK322X) {
@ -3098,8 +3099,8 @@ static int win_2_3_set_par(struct vop_device *vop_dev,
static int hwc_set_par(struct vop_device *vop_dev,
struct rk_screen *screen, struct rk_lcdc_win *win)
{
u32 xact, yact, xvir, yvir, xpos, ypos;
u8 fmt_cfg = 0, swap_rb;
u32 xact = 0, yact = 0, xvir = 0, yvir = 0, xpos = 0, ypos = 0;
u8 fmt_cfg = 0, swap_rb = 0;
char fmt[9] = "NULL";
xpos = win->area[0].xpos + screen->mode.left_margin +
@ -3524,10 +3525,10 @@ static int vop_ovl_mgr(struct rk_lcdc_driver *dev_drv, int swap, bool set)
struct vop_device *vop_dev =
container_of(dev_drv, struct vop_device, driver);
struct rk_lcdc_win *win = NULL;
int i, ovl;
int i, ovl = 0;
u64 val;
int z_order_num = 0;
int layer0_sel, layer1_sel, layer2_sel, layer3_sel;
int layer0_sel = 0, layer1_sel = 1, layer2_sel = 2, layer3_sel = 3;
if (swap == 0) {
for (i = 0; i < dev_drv->lcdc_win_num; i++) {
@ -4296,7 +4297,7 @@ static int vop_get_bcsh_hue(struct rk_lcdc_driver *dev_drv, bcsh_hue_mode mode)
{
struct vop_device *vop_dev =
container_of(dev_drv, struct vop_device, driver);
u32 val;
u32 val = 0;
spin_lock(&vop_dev->reg_lock);
if (vop_dev->clk_on) {
@ -4410,7 +4411,7 @@ static int vop_set_bcsh_bcs(struct rk_lcdc_driver *dev_drv,
{
struct vop_device *vop_dev =
container_of(dev_drv, struct vop_device, driver);
u64 val;
u64 val = 0;
spin_lock(&vop_dev->reg_lock);
if (vop_dev->clk_on) {
@ -4446,7 +4447,7 @@ static int vop_get_bcsh_bcs(struct rk_lcdc_driver *dev_drv, bcsh_bcs_mode mode)
{
struct vop_device *vop_dev =
container_of(dev_drv, struct vop_device, driver);
u64 val;
u64 val = 0;
spin_lock(&vop_dev->reg_lock);
if (vop_dev->clk_on) {

View File

@ -372,7 +372,7 @@ static void lcdc_read_reg_defalut_cfg(struct lcdc_device *lcdc_dev)
struct rk_screen *screen = lcdc_dev->driver.cur_screen;
u32 h_pw_bp = screen->mode.hsync_len + screen->mode.left_margin;
u32 v_pw_bp = screen->mode.vsync_len + screen->mode.upper_margin;
u32 st_x, st_y;
u32 st_x = 0, st_y = 0;
struct rk_lcdc_win *win0 = lcdc_dev->driver.win[0];
spin_lock(&lcdc_dev->reg_lock);
@ -718,8 +718,9 @@ static int rk3368_lcdc_alpha_cfg(struct rk_lcdc_driver *dev_drv, int win_id)
struct alpha_config alpha_config;
u32 mask, val;
int ppixel_alpha = 0, global_alpha = 0, i;
u32 src_alpha_ctl, dst_alpha_ctl;
u32 src_alpha_ctl = 0, dst_alpha_ctl = 0;
memset(&alpha_config, 0, sizeof(struct alpha_config));
for (i = 0; i < win->area_num; i++) {
ppixel_alpha |= ((win->area[i].format == ARGB888) ||
(win->area[i].format == FBDC_ARGB_888) ||
@ -991,12 +992,12 @@ static int rk3368_init_fbdc_config(struct rk_lcdc_driver *dev_drv, int win_id)
struct lcdc_device *lcdc_dev =
container_of(dev_drv, struct lcdc_device, driver);
struct rk_lcdc_win *win = dev_drv->win[win_id];
u8 fbdc_dsp_width_ratio;
u16 fbdc_mb_vir_width, fbdc_mb_vir_height;
u16 fbdc_mb_width, fbdc_mb_height;
u16 fbdc_mb_xst, fbdc_mb_yst, fbdc_num_tiles;
u16 fbdc_cmp_index_init;
u8 mb_w_size, mb_h_size;
u8 fbdc_dsp_width_ratio = 0;
u16 fbdc_mb_vir_width = 0, fbdc_mb_vir_height = 0;
u16 fbdc_mb_width = 0, fbdc_mb_height = 0;
u16 fbdc_mb_xst = 0, fbdc_mb_yst = 0, fbdc_num_tiles = 0;
u16 fbdc_cmp_index_init = 0;
u8 mb_w_size = 0, mb_h_size = 0;
struct rk_screen *screen = dev_drv->cur_screen;
if (screen->mode.flag & FB_VMODE_INTERLACED) {
@ -1958,7 +1959,7 @@ static int rk3368_load_screen(struct rk_lcdc_driver *dev_drv, bool initscreen)
struct lcdc_device *lcdc_dev =
container_of(dev_drv, struct lcdc_device, driver);
struct rk_screen *screen = dev_drv->cur_screen;
u32 mask, val;
u32 mask = 0, val = 0;
if (unlikely(!lcdc_dev->clk_on)) {
pr_info("%s,clk_on = %d\n", __func__, lcdc_dev->clk_on);
@ -2482,27 +2483,27 @@ static int rk3368_lcdc_pan_display(struct rk_lcdc_driver *dev_drv, int win_id)
static int rk3368_lcdc_cal_scl_fac(struct rk_lcdc_win *win,
struct rk_screen *screen)
{
u16 srcW;
u16 srcH;
u16 dstW;
u16 dstH;
u16 yrgb_srcW;
u16 yrgb_srcH;
u16 yrgb_dstW;
u16 yrgb_dstH;
u32 yrgb_vscalednmult;
u32 yrgb_xscl_factor;
u32 yrgb_yscl_factor;
u16 srcW = 0;
u16 srcH = 0;
u16 dstW = 0;
u16 dstH = 0;
u16 yrgb_srcW = 0;
u16 yrgb_srcH = 0;
u16 yrgb_dstW = 0;
u16 yrgb_dstH = 0;
u32 yrgb_vscalednmult = 0;
u32 yrgb_xscl_factor = 0;
u32 yrgb_yscl_factor = 0;
u8 yrgb_vsd_bil_gt2 = 0;
u8 yrgb_vsd_bil_gt4 = 0;
u16 cbcr_srcW;
u16 cbcr_srcH;
u16 cbcr_dstW;
u16 cbcr_dstH;
u32 cbcr_vscalednmult;
u32 cbcr_xscl_factor;
u32 cbcr_yscl_factor;
u16 cbcr_srcW = 0;
u16 cbcr_srcH = 0;
u16 cbcr_dstW = 0;
u16 cbcr_dstH = 0;
u32 cbcr_vscalednmult = 0;
u32 cbcr_xscl_factor = 0;
u32 cbcr_yscl_factor = 0;
u8 cbcr_vsd_bil_gt2 = 0;
u8 cbcr_vsd_bil_gt4 = 0;
u8 yuv_fmt = 0;
@ -2971,8 +2972,8 @@ static int dsp_y_pos(int mirror_en, struct rk_screen *screen,
static int win_0_1_set_par(struct lcdc_device *lcdc_dev,
struct rk_screen *screen, struct rk_lcdc_win *win)
{
u32 xact, yact, xvir, yvir, xpos, ypos;
u8 fmt_cfg = 0, swap_rb, swap_uv = 0;
u32 xact = 0, yact = 0, xvir = 0, yvir = 0, xpos = 0, ypos = 0;
u8 fmt_cfg = 0, swap_rb = 0, swap_uv = 0;
char fmt[9] = "NULL";
xpos = dsp_x_pos(win->xmirror, screen, &win->area[0]);
@ -3102,7 +3103,7 @@ static int win_2_3_set_par(struct lcdc_device *lcdc_dev,
struct rk_screen *screen, struct rk_lcdc_win *win)
{
int i;
u8 fmt_cfg, swap_rb;
u8 fmt_cfg = 0, swap_rb = 0;
char fmt[9] = "NULL";
if (win->ymirror)
@ -3187,8 +3188,8 @@ static int win_2_3_set_par(struct lcdc_device *lcdc_dev,
static int hwc_set_par(struct lcdc_device *lcdc_dev,
struct rk_screen *screen, struct rk_lcdc_win *win)
{
u32 xact, yact, xvir, yvir, xpos, ypos;
u8 fmt_cfg = 0, swap_rb;
u32 xact = 0, yact = 0, xvir = 0, yvir = 0, xpos = 0, ypos = 0;
u8 fmt_cfg = 0, swap_rb = 0;
char fmt[9] = "NULL";
xpos = win->area[0].xpos + screen->mode.left_margin +
@ -3537,10 +3538,10 @@ static int rk3368_lcdc_ovl_mgr(struct rk_lcdc_driver *dev_drv, int swap,
struct lcdc_device *lcdc_dev =
container_of(dev_drv, struct lcdc_device, driver);
struct rk_lcdc_win *win = NULL;
int i, ovl;
int i, ovl = 0;
unsigned int mask, val;
int z_order_num = 0;
int layer0_sel, layer1_sel, layer2_sel, layer3_sel;
int layer0_sel = 0, layer1_sel = 1, layer2_sel = 2, layer3_sel = 3;
if (swap == 0) {
for (i = 0; i < 4; i++) {
@ -4371,7 +4372,7 @@ static int rk3368_lcdc_get_bcsh_hue(struct rk_lcdc_driver *dev_drv,
{
struct lcdc_device *lcdc_dev =
container_of(dev_drv, struct lcdc_device, driver);
u32 val;
u32 val = 0;
spin_lock(&lcdc_dev->reg_lock);
if (lcdc_dev->clk_on) {
@ -4417,7 +4418,7 @@ static int rk3368_lcdc_set_bcsh_bcs(struct rk_lcdc_driver *dev_drv,
{
struct lcdc_device *lcdc_dev =
container_of(dev_drv, struct lcdc_device, driver);
u32 mask, val;
u32 mask = 0, val = 0;
spin_lock(&lcdc_dev->reg_lock);
if (lcdc_dev->clk_on) {
@ -4462,7 +4463,7 @@ static int rk3368_lcdc_get_bcsh_bcs(struct rk_lcdc_driver *dev_drv,
{
struct lcdc_device *lcdc_dev =
container_of(dev_drv, struct lcdc_device, driver);
u32 val;
u32 val = 0;
spin_lock(&lcdc_dev->reg_lock);
if (lcdc_dev->clk_on) {

View File

@ -1985,7 +1985,7 @@ static int vop_dpi_win_sel(struct rk_lcdc_driver *dev_drv, int win_id)
static int vop_dpi_status(struct rk_lcdc_driver *dev_drv)
{
struct vop_device *vop_dev = to_vop_dev(dev_drv);
int status;
int status = 0;
spin_lock(&vop_dev->reg_lock);

View File

@ -208,7 +208,7 @@ int rk_fb_pixel_width(int data_format)
static int rk_fb_data_fmt(int data_format, int bits_per_pixel)
{
int fb_data_fmt;
int fb_data_fmt = 0;
if (data_format) {
switch (data_format) {
@ -2194,24 +2194,24 @@ static int rk_fb_set_win_buffer(struct fb_info *info,
struct rk_screen *screen = dev_drv->cur_screen;/*screen0;*/
struct fb_info *fbi;
int i, ion_fd, acq_fence_fd;
u32 xvir, yvir;
u32 xoffset, yoffset;
u32 xvir = 0, yvir = 0;
u32 xoffset = 0, yoffset = 0;
struct ion_handle *hdl;
size_t len;
int index_buf;
u8 fb_data_fmt;
u8 pixel_width;
u32 vir_width_bit;
u32 stride, uv_stride;
u32 stride_32bit_1;
u32 stride_32bit_2;
u16 uv_x_off, uv_y_off, uv_y_act;
int index_buf = 0;
u8 fb_data_fmt = 0;
u8 pixel_width = 0;
u32 vir_width_bit = 0;
u32 stride = 0, uv_stride = 0;
u32 stride_32bit_1 = 0;
u32 stride_32bit_2 = 0;
u16 uv_x_off = 0, uv_y_off = 0, uv_y_act = 0;
u8 is_pic_yuv = 0;
u8 ppixel_a = 0, global_a = 0;
ion_phys_addr_t phy_addr;
int ret = 0;
int buff_len;
int buff_len = 0;
reg_win_data->reg_area_data[0].smem_start = -1;
reg_win_data->area_num = 0;
@ -3185,9 +3185,9 @@ static int rk_fb_set_par(struct fb_info *info)
u32 xvir = var->xres_virtual;
u8 data_format = var->nonstd & 0xff;
u8 fb_data_fmt;
u8 pixel_width;
u8 pixel_width = 0;
u32 vir_width_bit;
u32 stride, uv_stride;
u32 stride, uv_stride = 0;
u32 stride_32bit_1;
u32 stride_32bit_2;
u16 uv_x_off, uv_y_off, uv_y_act;

View File

@ -688,7 +688,7 @@ static ssize_t show_overlay(struct device *dev,
struct fb_info *fbi = dev_get_drvdata(dev);
struct rk_fb_par *fb_par = (struct rk_fb_par *)fbi->par;
struct rk_lcdc_driver *dev_drv = fb_par->lcdc_drv;
int ovl;
int ovl = 0;
if (dev_drv->ops->ovl_mgr)
ovl = dev_drv->ops->ovl_mgr(dev_drv, 0, 0);
@ -727,7 +727,7 @@ static ssize_t show_fps(struct device *dev,
struct fb_info *fbi = dev_get_drvdata(dev);
struct rk_fb_par *fb_par = (struct rk_fb_par *)fbi->par;
struct rk_lcdc_driver *dev_drv = fb_par->lcdc_drv;
int fps;
int fps = 0;
if (dev_drv->ops->fps_mgr)
fps = dev_drv->ops->fps_mgr(dev_drv, 0, 0);
@ -958,7 +958,7 @@ static ssize_t set_dsp_cabc(struct device *dev, struct device_attribute *attr,
struct fb_info *fbi = dev_get_drvdata(dev);
struct rk_fb_par *fb_par = (struct rk_fb_par *)fbi->par;
struct rk_lcdc_driver *dev_drv = fb_par->lcdc_drv;
int space_max, ret, mode = 0, calc = 0, up = 0, down = 0, global = 0;
int space_max, ret = 0, mode = 0, calc = 0, up = 0, down = 0, global = 0;
const char *start = buf;
space_max = 10; /*max space number 10*/
@ -1005,7 +1005,7 @@ static ssize_t show_dsp_bcsh(struct device *dev,
struct fb_info *fbi = dev_get_drvdata(dev);
struct rk_fb_par *fb_par = (struct rk_fb_par *)fbi->par;
struct rk_lcdc_driver *dev_drv = fb_par->lcdc_drv;
int brightness, contrast, sat_con, sin_hue, cos_hue;
int brightness = 0, contrast = 0, sat_con = 0, sin_hue = 0, cos_hue = 0;
if (dev_drv->ops->get_dsp_bcsh_bcs) {
brightness = dev_drv->ops->get_dsp_bcsh_bcs(dev_drv,