return count;
}
+static ssize_t show_afbc_err_cnt(
+ struct device *device, struct device_attribute *attr,
+ char *buf)
+{
+ u32 err_cnt;
+
+ osd_get_afbc_err_cnt(&err_cnt);
+
+ return snprintf(buf, PAGE_SIZE, "%d\n", err_cnt);
+}
+
static inline int str2lower(char *str)
{
while (*str != '\0') {
NULL, store_osd_single_step_mode),
__ATTR(osd_single_step, 0220,
NULL, store_osd_single_step),
-
+ __ATTR(afbc_err_cnt, 0444,
+ show_afbc_err_cnt, NULL),
};
static struct device_attribute osd_attrs_viu2[] = {
status = VSYNCOSD_RD_MPEG_REG(VPU_MAFBC_IRQ_RAW_STATUS);
if (status & 0x3c) {
osd_log_dbg("afbc error happened\n");
+ osd_hw.afbc_err_cnt++;
error = true;
}
+ status = VSYNCOSD_WR_MPEG_REG(VPU_MAFBC_IRQ_CLEAR, 0x3f);
return error;
}
static u32 osd_get_hw_reset_flag(void)
if (afbc_enable &&
osd_hw.afbc_force_reset)
hw_reset_flag |= HW_RESET_MALI_AFBCD_REGS;
- if (afbc_enable &&
- osd_hw.afbc_status_err_reset &&
- mali_afbc_get_error())
+ if (afbc_enable && mali_afbc_get_error() &&
+ osd_hw.afbc_status_err_reset)
hw_reset_flag |= HW_RESET_MALI_AFBCD_REGS;
}
break;
osd_wait_vsync_hw();
}
+void osd_get_afbc_err_cnt(u32 *err_cnt)
+{
+ *err_cnt = osd_hw.afbc_err_cnt;
+}
+
int osd_get_capbility(u32 index)
{
u32 capbility = 0;
remove_from_update_list(index, DISP_OSD_REVERSE);
}
+static int get_viu2_src_format(void)
+{
+ return RGBA;
+}
+
static void osd_update_disp_osd_rotate(u32 index)
{
u32 rotate_en = osd_hw.osd_rotate[index];
- u32 src_fmt = RGBA;
+ u32 src_fmt;
u32 x_start, x_end, y_start, y_end;
u32 src_width, src_height;
u32 rot_hsize, blk_vsize, rd_blk_hsize;
if (osd_hw.osd_meson_dev.cpu_id < __MESON_CPU_MAJOR_ID_G12B)
return;
+ src_fmt = get_viu2_src_format();
src_data.x = 0;
src_data.y = 0;
src_data.w = osd_hw.fb_gem[index].xres;
osd_hw.osd_deband_enable = 1;
osd_hw.out_fence_fd = -1;
osd_hw.blend_bypass = 0;
+ osd_hw.afbc_err_cnt = 0;
if (osd_hw.osd_meson_dev.osd_ver == OSD_SIMPLE) {
data32 = osd_reg_read(
hw_osd_reg_array[OSD1].osd_fifo_ctrl_stat);