osd: add viu2 support for tl1 [1/1]

PD#172587

Problem:
add viu2 support for tl1.

Solution:
add viu2 support for tl1.

Verify:
verified by x301

Change-Id: Ie728f6ee7e0c4c4062e5e12e3d80515d99d020f8
Signed-off-by: pengcheng chen <pengcheng.chen@amlogic.com>

ff60d15 osd: calc osd parameters used num/den replace left/right shift
[1/1]
481d4f2 osd: set hdr size according osd blend0 out size  [1/1]
42b54ce osd: afbc decode error when loop viu1 to vdin [1/1]
91bda20 osd: fix afbc decoder error caused flicker in display [1/1]
799ba4c osd: fix hotplug hdmi causes system crash [1/1]
e9fadfe5 osd: fix osd afbc can't display on android5.1 [1/1]
1f8aa33 osd: frame just display on half screen [1/1]
7bcfa18 osd: set osd1 scaler before osd blend [1/1]
6913eaa osd: osd display color abnormal when run drm [1/1]
6862fb2 osd: add viu2 fence support [1/1]
f59b7a6 drm: a113d support drm issue [1/1]
50557a1 osd: reset afbcd flag when convert format value [1/1]
cfbcb3d osd: fix buidroot compile error issue [1/1]
6163540 osd: rdma write miss caused afbc mosaic [1/1]
032a712 osd: fix display frame offset caused osd display abnormal [1/1]
2c1269e osd: osd: recovey mode always blank [1/1]
3be570b osd: osd: reserve vs_ctrl bit for VPP [1/1]
40bfe97 osd: add viu2 support for tl1 [1/1]

osd: osd: reserve vs_ctrl bit for VPP [1/1]

PD#172587

Problem:
reserve vs_ctrl bit for VPP

Solution:
Avoid operating VPP_OFIFO_SIZE bit19 on OSD code

Verify:
verified on t962x2_x301

Change-Id: Ic450d6f64e2349d97d02f0802058b4031564fea4
Signed-off-by: Jian Cao <jian.cao@amlogic.com>

osd: osd: recovey mode always blank [1/1]

PD#TV-1287

Problem:
recovey mode always blank

Solution:
set right condition to enable free_scale

Verify:
verified on P321 board

Change-Id: I2f70b9c5436b30156f157a3297a11a2ef1cfec67
Signed-off-by: Jian Cao <jian.cao@amlogic.com>

osd: fix display frame offset caused osd display abnormal [1/1]

PD#OTT-1663

Problem:
display frame offset caused osd display abnormal

Solution:
remove unnecessary blend dst_data adjust

Verify:
Locally on raven

Change-Id: I38b97f6da750f5edea97416b4d7fc0172dea7466
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>

osd: rdma write miss caused afbc mosaic [1/1]

PD#SWPL-4502

Problem:
afbc mosaic when bandwidth is high, root cause is
rdma write regs missed.

Solution:
1. add vsync line detected, if rdma write nearly
vsync, wait vsync needed
2. add rdma write detected, if rdma write missed
wait vsync needed
3. add tl1/g12b afbc backup

Verify:
Locally on tl1

Change-Id: If4fd303c3808525fa44e1118742a3e26830323f5
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>

osd: fix buidroot compile error issue [1/1]

PD#SWPL-4502

Problem:
buidlroot compile error

Solution:
fix buidroot compile error issue

Verify:
buildroot make linux-build

Change-Id: I0277c2b3f439946ab680f4c34f30c16e31ea6034
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>

osd: reset afbcd flag when convert format value [1/1]

PD#SWPL-5185

Problem:
"fence color format error 28" when test weston-simple-egl

Solution:
reset afbcd flag when convert format value

Verify:
Locally on g12b_w400

Change-Id: I81a9394288026bc596f6b3438cec72ceaad7749f
Signed-off-by: Jian Cao <jian.cao@amlogic.com>

drm: a113d support drm issue [1/1]

PD#SH-397

Problem:
use  modetest to test A113D DRM function, displaying is incorrect

Solution:
add linear addr config for a113d drm mode

Verify:
verified on s400

Change-Id: Id6a2c6ad94bc0148815076561d9dc2ae8ded6884
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>

osd: add viu2 fence support [1/1]

PD#SWPL-6384

Problem:
viu2 not support fence

Solution:
add viu2 fence support.

Verify:
test pass on tl1

Change-Id: I94a5e483c88cace79b7386bb918c203ada6b8274
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>

osd: osd display color abnormal when run drm [1/1]

PD#SWPL-6867

Problem:
osd dispaly color abnormal because osd enable not update.

Solution:
update osd enalbe flag in drm process.

Verify:
Verified u212

Change-Id: I1c2e8b62d9d5af203c95d3d0ac940fb512dd8e5e
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>

osd: set osd1 scaler before osd blend [1/1]

PD#SWPL-6596

Problem:
bring up osd for TM2

Solution:
set osd1 scaler before osd blend

Verify:
Verified on T962e2_ab319

Change-Id: I9e7d5fa83b2edc8e9359371695ea46fa3b39e09c
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>

osd: frame just display on half screen [1/1]

PD#SWPL-7039

Problem:
bring up osd for TM2
frame just display on half screen

Solution:
fix field_out_en value from array

Verify:
Verified on T962e2_ab319

Change-Id: Id07f3d813242f031125fcac11d3fa05205895448
Signed-off-by: Jian Cao <jian.cao@amlogic.com>

osd: fix osd afbc can't display on android5.1 [1/1]

PD#SWPL-6869

Problem:
afbc can't display with android5.1, because blank enable
called before afbc set, which make osd enable not updated
and afbc not enable when hwc post frame

Solution:
if mali afbc enable, call osd enable.

Verify:
verified on x301

Change-Id: I1d727a586a66c6e7848d09dfb5c5b74ff7a2e3e6
Signed-off-by: Shuide Chen <shuide.chen@amlogic.com>

osd: fix hotplug hdmi causes system crash [1/1]

PD#SWPL-7009

Problem:
hotplug hdmi causes system crash
when unplug hdmi display mode is null, hwc hasn't received
event and post frame normal but osd vsync lost, which caused
wait hw vsync timeout(1s), and fd leak.

Solution:
when process every frame, if display mode is null, exit frame process
just process fence.

Verify:
verified on Raven, franklin

Change-Id: Icbe7cd76776e46a6ed79c6cee3ea05772cc5f9d2
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>

osd: fix afbc decoder error caused flicker in display [1/1]

PD#OTT-3000

Problem:
afbc decoder error caused flicker in display.

Solution:
close osd prefetch.

Verify:
Verified with raven

Change-Id: I44356c028b41e251f7a98b5e931b2cbd583b0829
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>

osd: afbc decode error when loop viu1 to vdin [1/1]

PD#TV-5024

Problem:
afbc decode error when loop viu1 to vdin.

Solution:
set osd hold line to max if vinfo is dummy_panel

Verify:
Tl1 X301

Change-Id: I0ebb312d381accb1890233164f071a095310d2f1
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>

osd: set hdr size according osd blend0 out size  [1/1]

PD#IPTV-2395

Problem:
osd last line have abnormal data

Solution:
set hdr size according osd blend0 out size

Verify:
Verfied on u212

Change-Id: Iad738b16fce066270c78213f1b696a802e1b8da6
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>

osd: calc osd parameters used num/den replace left/right shift  [1/1]

PD#OTT-3615

Problem:
a line on the right displayed

Solution:
calc osd parameters used num/den replace left/right shift

Verify:
Verfied on u212

Change-Id: If59d9de0bb3c525d2b67d05ec449d458fbbcdfe2
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
This commit is contained in:
pengcheng chen
2018-11-20 09:42:44 +08:00
committed by Luan Yuan
parent 65e78e6f26
commit ad7a5ae992
7 changed files with 1753 additions and 1049 deletions

View File

@@ -106,7 +106,6 @@ enum color_index_e {
#define FBIOPUT_OSD_CURSOR \
_IOWR(FB_IOC_MAGIC, 0x0, struct fb_cursor_user)
/* OSD color definition */
#define KEYCOLOR_FLAG_TARGET 1
#define KEYCOLOR_FLAG_ONHOLD 2
@@ -114,6 +113,8 @@ enum color_index_e {
#define HW_OSD_COUNT 4
#define OSD_BLEND_LAYERS 4
#define VIU_COUNT 2
/* OSD block definition */
#define HW_OSD_BLOCK_COUNT 4
#define HW_OSD_BLOCK_REG_COUNT (HW_OSD_BLOCK_COUNT*2)
@@ -509,6 +510,7 @@ struct osd_device_data_s {
u32 vpp_fifo_len;
u32 dummy_data;
u32 has_viu2;
u32 osd0_sc_independ;
u32 viu1_osd_count;
u32 viu2_index;
struct clk *vpu_clkc;
@@ -611,8 +613,10 @@ struct hw_osd_blending_s {
bool osd1_freescale_disable;
u32 vinfo_width;
u32 vinfo_height;
u32 screen_ratio_w;
u32 screen_ratio_h;
u32 screen_ratio_w_num;
u32 screen_ratio_w_den;
u32 screen_ratio_h_num;
u32 screen_ratio_h_den;
struct dispdata_s dst_data;
struct layer_blend_reg_s blend_reg;
struct layer_blend_s layer_blend;
@@ -707,7 +711,7 @@ struct hw_para_s {
u32 scan_mode[HW_OSD_COUNT];
u32 order[HW_OSD_COUNT];
u32 premult_en[HW_OSD_COUNT];
struct display_flip_info_s disp_info;
struct display_flip_info_s disp_info[VIU_COUNT];
struct osd_3d_mode_s mode_3d[HW_OSD_COUNT];
u32 updated[HW_OSD_COUNT];
/* u32 block_windows[HW_OSD_COUNT][HW_OSD_BLOCK_REG_COUNT]; */
@@ -722,7 +726,7 @@ struct hw_para_s {
int use_h_filter_mode[HW_OSD_COUNT];
int use_v_filter_mode[HW_OSD_COUNT];
struct hw_list_s reg[HW_REG_INDEX_MAX];
u32 field_out_en;
u32 field_out_en[VIU_COUNT];
u32 scale_workaround;
u32 fb_for_4k2k;
u32 antiflicker_mode;
@@ -734,21 +738,21 @@ struct hw_para_s {
struct osd_device_data_s osd_meson_dev;
u32 urgent[HW_OSD_COUNT];
u32 osd_deband_enable;
u32 osd_fps;
u32 osd_fps_start;
u32 osd_fps[VIU_COUNT];
u32 osd_fps_start[VIU_COUNT];
u32 osd_display_debug;
ulong screen_base[HW_OSD_COUNT];
ulong screen_size[HW_OSD_COUNT];
ulong screen_base_backup[HW_OSD_COUNT];
ulong screen_size_backup[HW_OSD_COUNT];
u32 vinfo_width;
u32 vinfo_height;
u32 vinfo_width[VIU_COUNT];
u32 vinfo_height[VIU_COUNT];
u32 fb_drvier_probe;
u32 afbc_force_reset;
u32 afbc_regs_backup;
u32 afbc_status_err_reset;
u32 afbc_use_latch;
u32 hwc_enable;
u32 hwc_enable[VIU_COUNT];
u32 osd_use_latch[HW_OSD_COUNT];
u32 hw_cursor_en;
u32 hw_rdma_en;
@@ -761,8 +765,8 @@ struct hw_para_s {
u32 viu_type;
u32 line_n_rdma;
struct hw_debug_s osd_debug;
int out_fence_fd;
int out_fence_fd[VIU_COUNT];
int in_fd[HW_OSD_COUNT];
struct osd_fence_fun_s osd_fence[2];
struct osd_fence_fun_s osd_fence[VIU_COUNT][2];
};
#endif /* _OSD_H_ */

View File

@@ -66,7 +66,9 @@ static void osd_debug_dump_value(void)
osd_log_info("--- OSD ---\n");
osd_log_info("bot_type: %d\n", hwpara->bot_type);
osd_log_info("field_out_en: %d\n", hwpara->field_out_en);
osd_log_info("field_out_en: %d\n", hwpara->field_out_en[VIU1]);
if (osd_hw.osd_meson_dev.has_viu2)
osd_log_info("field_out_en: %d\n", hwpara->field_out_en[VIU2]);
if (hwpara->osd_meson_dev.osd_ver == OSD_HIGH_ONE) {
struct hw_osd_blending_s *blend_para = NULL;
@@ -345,7 +347,7 @@ static void osd_debug_dump_register_all(void)
if (osd_hw.osd_meson_dev.cpu_id >= __MESON_CPU_MAJOR_ID_G12B) {
if (osd_hw.osd_meson_dev.has_viu2 &&
osd_hw.powered[OSD4]) {
osd_hw.powered[osd_hw.osd_meson_dev.viu2_index]) {
reg = VPP2_MISC;
osd_log_info("reg[0x%x]: 0x%08x\n",
reg, osd_reg_read(reg));

View File

@@ -563,11 +563,13 @@ static ssize_t osd_hwc_enable_read_file(struct file *file,
char __user *userbuf,
size_t count, loff_t *ppos)
{
struct seq_file *s = file->private_data;
int osd_id = *(int *)s;
char buf[128];
ssize_t len;
unsigned int hwc_enable = 0;
osd_get_hwc_enable(&hwc_enable);
osd_get_hwc_enable(osd_id, &hwc_enable);
len = snprintf(buf, 128, "%d\n", hwc_enable);
return simple_read_from_buffer(userbuf, count, ppos, buf, len);
}
@@ -576,6 +578,8 @@ static ssize_t osd_hwc_enable_write_file(struct file *file,
const char __user *userbuf,
size_t count, loff_t *ppos)
{
struct seq_file *s = file->private_data;
int osd_id = *(int *)s;
char buf[128];
unsigned int hwc_enable = 0;
int ret = 0;
@@ -586,7 +590,7 @@ static ssize_t osd_hwc_enable_write_file(struct file *file,
buf[count] = 0;
ret = kstrtoint(buf, 0, &hwc_enable);
osd_log_info("hwc enable: %d\n", hwc_enable);
osd_set_hwc_enable(hwc_enable);
osd_set_hwc_enable(osd_id, hwc_enable);
return count;
}
@@ -594,6 +598,8 @@ static ssize_t osd_do_hwc_write_file(struct file *file,
const char __user *userbuf,
size_t count, loff_t *ppos)
{
struct seq_file *s = file->private_data;
int osd_id = *(int *)s;
char buf[128];
unsigned int do_hwc = 0;
int ret = 0;
@@ -605,7 +611,7 @@ static ssize_t osd_do_hwc_write_file(struct file *file,
ret = kstrtoint(buf, 0, &do_hwc);
osd_log_info("do_hwc: %d\n", do_hwc);
if (do_hwc)
osd_do_hwc();
osd_do_hwc(osd_id);
return count;
}

View File

@@ -652,19 +652,24 @@ static int osd_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
static int osd_set_par(struct fb_info *info)
{
const struct vinfo_s *vinfo;
const struct vinfo_s *vinfo = NULL;
struct osd_fb_dev_s *fbdev = (struct osd_fb_dev_s *)info->par;
struct osd_ctl_s *osd_ctrl = &fbdev->osd_ctl;
u32 virt_end_x, virt_end_y;
u32 output_index;
if (fbdev->fb_index <= OSD3) {
output_index = get_output_device_id(fbdev->fb_index);
if (fbdev->fb_index < osd_hw.osd_meson_dev.viu1_osd_count) {
vinfo = get_current_vinfo();
if (!vinfo) {
osd_log_err("current vinfo NULL\n");
return -1;
}
} else {
#ifdef CONFIG_AMLOGIC_VOUT2_SERVE
vinfo = get_current_vinfo2();
#endif
if (!vinfo) {
osd_log_err("current vinfo NULL\n");
return -1;
@@ -849,7 +854,7 @@ static int osd_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
arg & 0xffff ? 1 : 0);
break;
case FBIOGET_OSD_FLUSH_RATE:
osd_get_flush_rate_hw(&flush_rate);
osd_get_flush_rate_hw(info->node, &flush_rate);
if (copy_to_user(argp, &flush_rate, sizeof(u32)))
return -EFAULT;
break;
@@ -1059,12 +1064,12 @@ static int osd_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
#endif
break;
case FBIOPUT_OSD_HWC_ENABLE:
osd_set_hwc_enable(hwc_enable);
osd_set_hwc_enable(info->node, hwc_enable);
ret = 0;
break;
case FBIOPUT_OSD_DO_HWC:
do_hwc_cmd.out_fen_fd =
osd_sync_do_hwc(&do_hwc_cmd);
osd_sync_do_hwc(info->node, &do_hwc_cmd);
ret = copy_to_user(argp,
&do_hwc_cmd,
sizeof(struct do_hwc_cmd_s));
@@ -1461,7 +1466,7 @@ static int osd_open(struct fb_info *info, int arg)
fb_index = fbdev->fb_index;
if ((osd_meson_dev.has_viu2)
&& (fb_index == OSD4)) {
&& (fb_index == osd_meson_dev.viu2_index)) {
int vpu_clkc_rate;
/* select mux0, if select mux1, mux0 must be set */
@@ -1853,13 +1858,14 @@ static int osd_cursor(struct fb_info *fbi, struct fb_cursor *var)
{
s16 startx = 0, starty = 0;
struct osd_fb_dev_s *fb_dev = gp_fbdev_list[1];
u32 output_index;
if (fb_dev) {
startx = fb_dev->osd_ctl.disp_start_x;
starty = fb_dev->osd_ctl.disp_start_y;
}
if (osd_hw.hwc_enable)
output_index = get_output_device_id(fbi->node);
if (osd_hw.hwc_enable[output_index])
osd_cursor_hw_no_scale(fbi->node, (s16)var->hot.x,
(s16)var->hot.y, (s16)startx, (s16)starty,
fbi->var.xres, fbi->var.yres);
@@ -1944,18 +1950,22 @@ int osd_notify_callback(struct notifier_block *block, unsigned long cmd,
if ((!strcmp(vinfo->name, "invalid")) ||
(!strcmp(vinfo->name, "null")))
return -1;
osd_hw.vinfo_width = vinfo->width;
osd_hw.vinfo_height = vinfo->field_height;
osd_hw.field_out_en = is_interlaced(vinfo);
osd_hw.vinfo_width[VIU1] = vinfo->width;
osd_hw.vinfo_height[VIU1] = vinfo->field_height;
osd_hw.field_out_en[VIU1] = is_interlaced(vinfo);
switch (cmd) {
case VOUT_EVENT_MODE_CHANGE:
set_osd_logo_freescaler();
if (!strcmp(vinfo->name, "dummy_panel"))
osd_set_hold_line(MAX_HOLD_LINE);
else
osd_set_hold_line(DEFAULT_HOLD_LINE);
if (osd_hw.osd_meson_dev.cpu_id == __MESON_CPU_MAJOR_ID_G12B &&
is_meson_rev_b())
set_reset_rdma_trigger_line();
if ((osd_meson_dev.osd_ver == OSD_NORMAL)
|| (osd_meson_dev.osd_ver == OSD_SIMPLE)
|| (osd_hw.hwc_enable == 0)) {
|| (osd_hw.hwc_enable[VIU1] == 0)) {
for (i = 0; i < osd_meson_dev.viu1_osd_count; i++) {
fb_dev = gp_fbdev_list[i];
if (fb_dev == NULL)
@@ -1986,7 +1996,7 @@ int osd_notify_callback(struct notifier_block *block, unsigned long cmd,
case VOUT_EVENT_OSD_DISP_AXIS:
if ((osd_meson_dev.osd_ver == OSD_NORMAL)
|| (osd_meson_dev.osd_ver == OSD_SIMPLE)
|| (osd_hw.hwc_enable == 0)) {
|| (osd_hw.hwc_enable[VIU1] == 0)) {
disp_rect = (struct disp_rect_s *)para;
for (i = 0; i < osd_meson_dev.viu1_osd_count; i++) {
@@ -2037,111 +2047,6 @@ int osd_notify_callback(struct notifier_block *block, unsigned long cmd,
return 0;
}
#if 0
int osd_notify_callback(struct notifier_block *block, unsigned long cmd,
void *para)
{
struct vinfo_s *vinfo;
struct osd_fb_dev_s *fb_dev;
int i, blank;
struct disp_rect_s *disp_rect;
vinfo = get_current_vinfo();
if (!vinfo) {
osd_log_err("current vinfo NULL\n");
return -1;
}
osd_log_info("current vmode=%s, cmd: 0x%lx\n",
vinfo->name, cmd);
if ((!strcmp(vinfo->name, "invalid")) ||
(!strcmp(vinfo->name, "null")))
return -1;
osd_hw.vinfo_width = vinfo->width;
osd_hw.vinfo_height = vinfo->field_height;
osd_hw.field_out_en = is_interlaced(vinfo);
switch (cmd) {
case VOUT_EVENT_MODE_CHANGE:
set_osd_logo_freescaler();
for (i = 0; i < osd_meson_dev.viu1_osd_count; i++) {
fb_dev = gp_fbdev_list[i];
if (fb_dev == NULL)
continue;
set_default_display_axis(&fb_dev->fb_info->var,
&fb_dev->osd_ctl, vinfo);
console_lock();
osddev_update_disp_axis(fb_dev, 1);
if ((osd_meson_dev.osd_ver == OSD_NORMAL)
|| (osd_meson_dev.osd_ver == OSD_SIMPLE))
osd_set_antiflicker_hw(DEV_OSD1, vinfo,
gp_fbdev_list
[DEV_OSD1]->fb_info->var.yres);
else if (osd_meson_dev.osd_ver == OSD_HIGH_ONE)
osd_set_antiflicker_hw(i, vinfo,
gp_fbdev_list[i]->fb_info->var.yres);
osd_reg_write(VPP_POSTBLEND_H_SIZE, vinfo->width);
console_unlock();
}
break;
case VOUT_EVENT_OSD_BLANK:
blank = *(int *)para;
for (i = 0; i < osd_meson_dev.viu1_osd_count; i++) {
fb_dev = gp_fbdev_list[i];
if (fb_dev == NULL)
continue;
console_lock();
osd_blank(blank, fb_dev->fb_info);
console_unlock();
}
break;
case VOUT_EVENT_OSD_DISP_AXIS:
disp_rect = (struct disp_rect_s *)para;
for (i = 0; i < osd_meson_dev.viu1_osd_count; i++) {
if (!disp_rect)
break;
/* vout serve send only two layer axis */
if (i >= 2)
break;
fb_dev = gp_fbdev_list[i];
/*
* if osd layer preblend,
* it's position is controlled by vpp.
if (fb_dev->preblend_enable)
break;
*/
fb_dev->osd_ctl.disp_start_x = disp_rect->x;
fb_dev->osd_ctl.disp_start_y = disp_rect->y;
osd_log_dbg("set disp axis: x:%d y:%d w:%d h:%d\n",
disp_rect->x, disp_rect->y,
disp_rect->w, disp_rect->h);
if (disp_rect->x + disp_rect->w > vinfo->width)
fb_dev->osd_ctl.disp_end_x = vinfo->width - 1;
else
fb_dev->osd_ctl.disp_end_x =
fb_dev->osd_ctl.disp_start_x +
disp_rect->w - 1;
if (disp_rect->y + disp_rect->h > vinfo->height)
fb_dev->osd_ctl.disp_end_y = vinfo->height - 1;
else
fb_dev->osd_ctl.disp_end_y =
fb_dev->osd_ctl.disp_start_y +
disp_rect->h - 1;
disp_rect++;
osd_log_dbg("new disp axis: x0:%d y0:%d x1:%d y1:%d\n",
fb_dev->osd_ctl.disp_start_x,
fb_dev->osd_ctl.disp_start_y,
fb_dev->osd_ctl.disp_end_x,
fb_dev->osd_ctl.disp_end_y);
console_lock();
osddev_update_disp_axis(fb_dev, 0);
console_unlock();
}
break;
}
return 0;
}
#endif
int osd_notify_callback_viu2(struct notifier_block *block, unsigned long cmd,
void *para)
{
@@ -2162,6 +2067,8 @@ int osd_notify_callback_viu2(struct notifier_block *block, unsigned long cmd,
vinfo->name, cmd);
if (!strcmp(vinfo->name, "invalid"))
return -1;
osd_hw.vinfo_width[VIU2] = vinfo->width;
osd_hw.vinfo_height[VIU2] = vinfo->field_height;
i = osd_meson_dev.viu2_index;
switch (cmd) {
case VOUT_EVENT_MODE_CHANGE:
@@ -2796,9 +2703,10 @@ static ssize_t show_flush_rate(struct device *device,
struct device_attribute *attr,
char *buf)
{
struct fb_info *fb_info = dev_get_drvdata(device);
u32 flush_rate = 0;
osd_get_flush_rate_hw(&flush_rate);
osd_get_flush_rate_hw(fb_info->node, &flush_rate);
return snprintf(buf, PAGE_SIZE, "flush_rate:[%d]\n", flush_rate);
}
@@ -2850,15 +2758,22 @@ static ssize_t store_antiflicker(struct device *device,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct vinfo_s *vinfo;
struct vinfo_s *vinfo = NULL;
unsigned int osd_antiflicker = 0;
struct fb_info *fb_info = dev_get_drvdata(device);
int res = 0;
int ret = 0;
u32 output_index;
ret = kstrtoint(buf, 0, &res);
osd_antiflicker = res;
vinfo = get_current_vinfo();
output_index = get_output_device_id(fb_info->node);
if (output_index == VIU1)
vinfo = get_current_vinfo();
#ifdef CONFIG_AMLOGIC_VOUT2_SERVE
else if (output_index == VIU2)
vinfo = get_current_vinfo2();
#endif
if (!vinfo) {
osd_log_err("get current vinfo NULL\n");
return 0;
@@ -2974,9 +2889,10 @@ static ssize_t show_osd_fps(struct device *device,
struct device_attribute *attr,
char *buf)
{
struct fb_info *fb_info = dev_get_drvdata(device);
u32 osd_fps;
osd_get_fps(&osd_fps);
osd_get_fps(fb_info->node, &osd_fps);
return snprintf(buf, 40, "%d\n",
osd_fps);
}
@@ -2985,11 +2901,12 @@ static ssize_t store_osd_fps(struct device *device,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct fb_info *fb_info = dev_get_drvdata(device);
int res = 0;
int ret = 0;
ret = kstrtoint(buf, 0, &res);
osd_set_fps(res);
osd_set_fps(fb_info->node, res);
return count;
}
@@ -3076,9 +2993,10 @@ static ssize_t show_osd_background_size(struct device *device,
struct device_attribute *attr,
char *buf)
{
struct fb_info *fb_info = dev_get_drvdata(device);
struct display_flip_info_s disp_info;
osd_get_background_size(&disp_info);
osd_get_background_size(fb_info->node, &disp_info);
return snprintf(buf, 80, "%d %d %d %d %d %d %d %d\n",
disp_info.background_w,
disp_info.background_h,
@@ -3094,12 +3012,14 @@ static ssize_t store_osd_background_size(struct device *device,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct fb_info *fb_info = dev_get_drvdata(device);
int parsed[8];
if (likely(parse_para(buf, 8, parsed) == 8)) {
if (likely(parse_para(buf, 8, parsed) == 8))
osd_set_background_size(
fb_info->node,
(struct display_flip_info_s *)&parsed);
} else
else
osd_log_err("set background size error\n");
return count;
@@ -3162,9 +3082,10 @@ static ssize_t show_osd_hwc_enalbe(struct device *device,
struct device_attribute *attr,
char *buf)
{
struct fb_info *fb_info = dev_get_drvdata(device);
u32 hwc_enalbe;
osd_get_hwc_enable(&hwc_enalbe);
osd_get_hwc_enable(fb_info->node, &hwc_enalbe);
return snprintf(buf, 40, "%d\n",
hwc_enalbe);
}
@@ -3173,13 +3094,14 @@ static ssize_t store_osd_hwc_enalbe(struct device *device,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct fb_info *fb_info = dev_get_drvdata(device);
int res = 0;
int ret = 0;
ret = kstrtoint(buf, 0, &res);
if (ret < 0)
return -EINVAL;
osd_set_hwc_enable(res);
osd_set_hwc_enable(fb_info->node, res);
return count;
}
@@ -3188,6 +3110,7 @@ static ssize_t store_do_hwc(struct device *device,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct fb_info *fb_info = dev_get_drvdata(device);
int res = 0;
int ret = 0;
@@ -3195,7 +3118,7 @@ static ssize_t store_do_hwc(struct device *device,
if (ret < 0)
return -EINVAL;
if (res)
osd_do_hwc();
osd_do_hwc(fb_info->node);
return count;
}
@@ -3229,13 +3152,14 @@ static ssize_t store_osd_single_step_mode(struct device *device,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct fb_info *fb_info = dev_get_drvdata(device);
int res = 0;
int ret = 0;
ret = kstrtoint(buf, 0, &res);
if (ret < 0)
return -EINVAL;
osd_set_single_step_mode(res);
osd_set_single_step_mode(fb_info->node, res);
return count;
}
@@ -3244,13 +3168,14 @@ static ssize_t store_osd_single_step(struct device *device,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct fb_info *fb_info = dev_get_drvdata(device);
int res = 0;
int ret = 0;
ret = kstrtoint(buf, 0, &res);
if (ret < 0)
return -EINVAL;
osd_set_single_step(res);
osd_set_single_step(fb_info->node, res);
return count;
}
@@ -3819,6 +3744,7 @@ static struct osd_device_data_s osd_gxbb = {
.vpp_fifo_len = 0x77f,
.dummy_data = 0x00808000,
.has_viu2 = 0,
.osd0_sc_independ = 0,
};
static struct osd_device_data_s osd_gxtvbb = {
@@ -3834,6 +3760,7 @@ static struct osd_device_data_s osd_gxtvbb = {
.vpp_fifo_len = 0xfff,
.dummy_data = 0x0,
.has_viu2 = 0,
.osd0_sc_independ = 0,
};
static struct osd_device_data_s osd_gxl = {
@@ -3849,6 +3776,7 @@ static struct osd_device_data_s osd_gxl = {
.vpp_fifo_len = 0x77f,
.dummy_data = 0x00808000,
.has_viu2 = 0,
.osd0_sc_independ = 0,
};
static struct osd_device_data_s osd_gxm = {
@@ -3864,6 +3792,7 @@ static struct osd_device_data_s osd_gxm = {
.vpp_fifo_len = 0xfff,
.dummy_data = 0x00202000,/* dummy data is different */
.has_viu2 = 0,
.osd0_sc_independ = 0,
};
static struct osd_device_data_s osd_txl = {
@@ -3879,6 +3808,7 @@ static struct osd_device_data_s osd_txl = {
.vpp_fifo_len = 0x77f,
.dummy_data = 0x00808000,
.has_viu2 = 0,
.osd0_sc_independ = 0,
};
static struct osd_device_data_s osd_txlx = {
@@ -3894,6 +3824,7 @@ static struct osd_device_data_s osd_txlx = {
.vpp_fifo_len = 0x77f,
.dummy_data = 0x00808000,
.has_viu2 = 0,
.osd0_sc_independ = 0,
};
static struct osd_device_data_s osd_axg = {
@@ -3910,6 +3841,7 @@ static struct osd_device_data_s osd_axg = {
.vpp_fifo_len = 0x400,
.dummy_data = 0x00808000,
.has_viu2 = 0,
.osd0_sc_independ = 0,
};
static struct osd_device_data_s osd_g12a = {
@@ -3925,6 +3857,7 @@ static struct osd_device_data_s osd_g12a = {
.vpp_fifo_len = 0xfff,/* 2048 */
.dummy_data = 0x00808000,
.has_viu2 = 1,
.osd0_sc_independ = 0,
};
static struct osd_device_data_s osd_g12b = {
@@ -3940,6 +3873,7 @@ static struct osd_device_data_s osd_g12b = {
.vpp_fifo_len = 0xfff,/* 2048 */
.dummy_data = 0x00808000,
.has_viu2 = 1,
.osd0_sc_independ = 0,
};
static struct osd_device_data_s osd_tl1 = {
@@ -3955,6 +3889,7 @@ static struct osd_device_data_s osd_tl1 = {
.vpp_fifo_len = 0xfff,/* 2048 */
.dummy_data = 0x00808000,
.has_viu2 = 1,
.osd0_sc_independ = 0,
};
static struct osd_device_data_s osd_sm1 = {
@@ -3970,6 +3905,7 @@ static struct osd_device_data_s osd_sm1 = {
.vpp_fifo_len = 0xfff,/* 2048 */
.dummy_data = 0x00808000,
.has_viu2 = 1,
.osd0_sc_independ = 0,
};
static struct osd_device_data_s osd_tm2 = {
@@ -3980,11 +3916,12 @@ static struct osd_device_data_s osd_tm2 = {
.has_deband = 1,
.has_lut = 1,
.has_rdma = 1,
.has_dolby_vision = 1,
.has_dolby_vision = 0,
.osd_fifo_len = 64, /* fifo len 64*8 = 512 */
.vpp_fifo_len = 0xfff,/* 2048 */
.dummy_data = 0x00808000,
.has_viu2 = 1,
.osd0_sc_independ = 1,
};
static const struct of_device_id meson_fb_dt_match[] = {
@@ -4082,7 +4019,6 @@ static int osd_probe(struct platform_device *pdev)
return -ENODEV;
}
}
/* get interrupt resource */
int_viu_vsync = platform_get_irq_byname(pdev, "viu-vsync");
if (int_viu_vsync == -ENXIO) {

File diff suppressed because it is too large Load Diff

View File

@@ -23,6 +23,8 @@
#include "osd_sync.h"
#include "osd_drm.h"
#define MAX_HOLD_LINE 0x1f
#define DEFAULT_HOLD_LINE 0x04
//#define REG_OFFSET (0x20)
#define OSD_RELATIVE_BITS 0x33330
#include "osd_rdma.h"
@@ -102,7 +104,7 @@ extern void osd_set_block_mode_hw(u32 index, u32 mode);
extern void osd_enable_3d_mode_hw(u32 index, u32 enable);
extern void osd_set_2x_scale_hw(u32 index, u16 h_scale_enable,
u16 v_scale_enable);
extern void osd_get_flush_rate_hw(u32 *break_rate);
extern void osd_get_flush_rate_hw(u32 index, u32 *break_rate);
extern void osd_set_reverse_hw(u32 index, u32 reverse, u32 update);
extern void osd_get_reverse_hw(u32 index, u32 *reverse);
extern void osd_set_antiflicker_hw(u32 index, struct vinfo_s *vinfo, u32 yres);
@@ -126,7 +128,7 @@ extern int osd_sync_request_render(u32 index, u32 yres,
struct sync_req_render_s *request,
u32 phys_addr,
size_t len);
extern int osd_sync_do_hwc(struct do_hwc_cmd_s *hwc_cmd);
int osd_sync_do_hwc(u32 output_index, struct do_hwc_cmd_s *hwc_cmd);
extern s64 osd_wait_vsync_event(void);
extern void osd_cursor_hw(u32 index, s16 x, s16 y, s16 xstart, s16 ystart,
u32 osd_w, u32 osd_h);
@@ -165,8 +167,8 @@ extern void osd_get_urgent(u32 index, u32 *urgent);
extern void osd_set_urgent(u32 index, u32 urgent);
void osd_get_deband(u32 *osd_deband_enable);
void osd_set_deband(u32 osd_deband_enable);
void osd_get_fps(u32 *osd_fps);
void osd_set_fps(u32 osd_fps_start);
void osd_get_fps(u32 index, u32 *osd_fps);
void osd_set_fps(u32 index, u32 osd_fps_start);
extern void osd_get_info(u32 index, u32 *addr, u32 *width, u32 *height);
void osd_update_scan_mode(void);
void osd_update_3d_mode(void);
@@ -180,15 +182,15 @@ int set_osd_logo_freescaler(void);
int is_interlaced(struct vinfo_s *vinfo);
void osd_get_display_debug(u32 *osd_display_debug_enable);
void osd_set_display_debug(u32 osd_display_debug_enable);
void osd_get_background_size(struct display_flip_info_s *disp_info);
void osd_set_background_size(struct display_flip_info_s *disp_info);
void osd_get_background_size(u32 index, struct display_flip_info_s *disp_info);
void osd_set_background_size(u32 index, struct display_flip_info_s *disp_info);
void osd_get_hdr_used(u32 *val);
void osd_set_hdr_used(u32 val);
void osd_get_afbc_format(u32 index, u32 *format, u32 *inter_format);
void osd_set_afbc_format(u32 index, u32 format, u32 inter_format);
void osd_get_hwc_enable(u32 *hwc_enable);
void osd_set_hwc_enable(u32 hwc_enable);
void osd_do_hwc(void);
void osd_get_hwc_enable(u32 index, u32 *hwc_enable);
void osd_set_hwc_enable(u32 index, u32 hwc_enable);
void osd_do_hwc(u32 index);
int osd_get_capbility(u32 index);
void osd_backup_screen_info(
u32 index,
@@ -204,12 +206,12 @@ ssize_t dd_vmap_write(u32 index, const char __user *buf,
int osd_set_clear(u32 index);
void osd_page_flip(struct osd_plane_map_s *plane_map);
void walk_through_update_list(void);
int osd_setting_blend(void);
void osd_set_hwc_enable(u32 hwc_enable);
int osd_setting_blend(u32 output_index);
void osd_set_hwc_enable(u32 index, u32 hwc_enable);
void osd_set_urgent_info(u32 ports, u32 basic_urgent);
void osd_get_urgent_info(u32 *ports, u32 *basic_urgent);
void osd_set_single_step_mode(u32 osd_single_step_mode);
void osd_set_single_step(u32 osd_single_step);
void osd_set_single_step_mode(u32 index, u32 osd_single_step_mode);
void osd_set_single_step(u32 index, u32 osd_single_step);
void output_save_info(void);
void osd_get_rotate(u32 index, u32 *osd_rotate);
void osd_set_rotate(u32 index, u32 osd_rotate);
@@ -218,4 +220,6 @@ void osd_get_dimm_info(u32 index, u32 *osd_dimm_layer, u32 *osd_dimm_color);
void osd_set_dimm_info(u32 index, u32 osd_dimm_layer, u32 osd_dimm_color);
u32 osd_get_line_n_rdma(void);
void osd_set_line_n_rdma(u32 line_n_rdma);
u32 get_output_device_id(u32 index);
void osd_set_hold_line(int hold_line);
#endif

View File

@@ -392,7 +392,7 @@
#define VPP_OSD_SCALE_COEF_IDX 0x1dcc
#define VPP_OSD_SCALE_COEF 0x1dcd
#define VPP_INT_LINE_NUM 0x1dce
#define VPP_OSD_SCALE_CTRL 0x1dff
/* osd2 scaler */
#define OSD2_VSC_PHASE_STEP 0x3d00
#define OSD2_VSC_INI_PHASE 0x3d01