VCODEC: detect hevc resolution to determine the running frequency.
authorAlpha Lin <alpha.lin@rock-chips.com>
Mon, 10 Aug 2015 08:05:12 +0000 (16:05 +0800)
committerAlpha Lin <alpha.lin@rock-chips.com>
Tue, 11 Aug 2015 08:13:14 +0000 (16:13 +0800)
Signed-off-by: Alpha Lin <alpha.lin@rock-chips.com>
arch/arm/mach-rockchip/vcodec_service.c

index cb260d89d414f9abdfdc578b76e43dad87979551..d4b7f22c94222af13149a3072bb53ae451da5162 100755 (executable)
@@ -1000,6 +1000,12 @@ static inline int reg_probe_width(vpu_reg *reg)
        return width_in_mb * 16;
 }
 
+static inline int reg_probe_hevc_y_stride(vpu_reg *reg)
+{
+       int y_virstride = reg->reg[8];
+       return y_virstride;
+}
+
 #if defined(CONFIG_VCODEC_MMU)
 static int vcodec_fd_to_iova(struct vpu_subdev_data *data, vpu_reg *reg,int fd)
 {
@@ -1292,6 +1298,10 @@ static vpu_reg *reg_init(struct vpu_subdev_data *data,
                                        }
                                }
                        }
+                       if (data->hw_info->hw_id == HEVC_ID) {
+                               if (reg_probe_hevc_y_stride(reg) > 60000)
+                                       reg->freq = VPU_FREQ_400M;
+                       }
                        if (reg->type == VPU_PP) {
                                reg->freq = VPU_FREQ_400M;
                        }