osd: add hw cursor support in osd

PD#138714: osd: add hw cursor support in osd

Change-Id: I88ba3530cdc605ae5a0f0f31b21578b588c04ff1
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
This commit is contained in:
Pengcheng Chen
2017-05-11 13:58:47 +08:00
committed by Jianxin Pan
parent 0d8442c0b1
commit 262832b709
2 changed files with 17 additions and 4 deletions

View File

@@ -94,7 +94,7 @@ enum color_index_e {
#define FBIOPUT_OSD_ROTATE_ANGLE 0x4517
#define FBIOPUT_OSD_SYNC_ADD 0x4518
#define FBIOPUT_OSD_SYNC_RENDER_ADD 0x4519
#define FBIOPUT_OSD_CURSOR 0x451a
/* OSD color definition */
#define KEYCOLOR_FLAG_TARGET 1
#define KEYCOLOR_FLAG_ONHOLD 2

View File

@@ -312,8 +312,9 @@ struct ion_client *fb_ion_client;
struct ion_handle *fb_ion_handle[OSD_COUNT][OSD_MAX_BUF_NUM] = {
{NULL, NULL, NULL}, {NULL, NULL, NULL}
};
#ifdef CONFIG_AMLOGIC_MEDIA_FB_OSD2_CURSOR
static int osd_cursor(struct fb_info *fbi, struct fb_cursor *var);
#endif
phys_addr_t get_fb_rmem_paddr(int index)
{
if (index < 0 || index > 1)
@@ -654,6 +655,7 @@ static int osd_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
struct fb_sync_request_s sync_request;
struct fb_sync_request_render_s sync_request_render;
struct fb_dmabuf_export dmaexp;
struct fb_cursor cursor;
switch (cmd) {
case FBIOPUT_OSD_SRCKEY_ENABLE:
@@ -711,6 +713,9 @@ static int osd_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
case FBIOPUT_OSD_WINDOW_AXIS:
ret = copy_from_user(&osd_dst_axis, argp, 4 * sizeof(s32));
break;
case FBIOPUT_OSD_CURSOR:
ret = copy_from_user(&cursor, argp, sizeof(cursor));
break;
default:
osd_log_err("command 0x%x not supported (%s)\n",
cmd, current->comm);
@@ -930,6 +935,14 @@ static int osd_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
osd_wait_vsync_event();
ret = copy_to_user(argp, &ret, sizeof(u32));
break;
case FBIOPUT_OSD_CURSOR:
#ifdef CONFIG_AMLOGIC_MEDIA_FB_OSD2_CURSOR
osd_cursor(info, &cursor);
ret = copy_to_user(argp, &cursor, sizeof(cursor));
#else
ret = EINVAL;
#endif
break;
default:
break;
}
@@ -1026,7 +1039,7 @@ static int osd_open(struct fb_info *info, int arg)
#endif
fbdev = (struct osd_fb_dev_s *)info->par;
fbdev->open_count++;
osd_log_info("osd_open index=%d,open_count=%d\n",
osd_log_dbg("osd_open index=%d,open_count=%d\n",
fbdev->fb_index, fbdev->open_count);
if (info->screen_base != NULL)
return 0;