drm/rockchip: ebc_dev: release version v1.02

1.improve first overlay frame
2.add ebc on/off notify
3.overlay use osd buf

Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: I33e9f9ed9d4eb78148ebb5c2ad178eb95c28ee63
This commit is contained in:
Zorro Liu
2021-01-27 15:12:00 +08:00
committed by Tao Huang
parent eb27d7ba43
commit 668fc59a25
4 changed files with 15174 additions and 14432 deletions

View File

@@ -27,6 +27,7 @@ struct buf_info_s {
struct buf_list_s *dsp_buf_list; /* dispplay buffer list. */
int dsp_buf_list_status;
struct ebc_buf_s *osd_buf;
struct mutex dsp_lock;
};
@@ -39,10 +40,14 @@ int ebc_buf_release(struct ebc_buf_s *release_buf)
struct ebc_buf_s *temp_buf = release_buf;
if (temp_buf) {
temp_buf->status = buf_idle;
if (1 == ebc_buf_info.use_buf_is_empty) {
ebc_buf_info.use_buf_is_empty = 0;
wake_up_interruptible_sync(&ebc_buf_wq);
if (temp_buf->status == buf_osd) {
kfree(temp_buf);
} else {
temp_buf->status = buf_idle;
if (1 == ebc_buf_info.use_buf_is_empty) {
ebc_buf_info.use_buf_is_empty = 0;
wake_up_interruptible_sync(&ebc_buf_wq);
}
}
}
@@ -158,6 +163,28 @@ struct ebc_buf_s *ebc_dsp_buf_get(void)
return buf;
}
struct ebc_buf_s *ebc_osd_buf_get(void)
{
if (ebc_buf_info.osd_buf)
return ebc_buf_info.osd_buf;
return NULL;
}
struct ebc_buf_s *ebc_osd_buf_clone(void)
{
struct ebc_buf_s *temp_buf;
temp_buf = kzalloc(sizeof(*temp_buf), GFP_KERNEL);
if (NULL == temp_buf)
return NULL;
temp_buf->virt_addr = ebc_buf_info.osd_buf->virt_addr;
temp_buf->phy_addr = ebc_buf_info.osd_buf->phy_addr;
temp_buf->status = buf_osd;
return temp_buf;
}
struct ebc_buf_s *ebc_empty_buf_get(void)
{
struct ebc_buf_s *temp_buf;
@@ -251,7 +278,7 @@ int ebc_buf_init(unsigned long phy_start, char *mem_start, int men_len, int dest
ebc_buf_info.phy_mem_base = phy_start;
use_len += dest_buf_len;
while (use_len <= men_len) {
temp_buf = kmalloc(sizeof(struct ebc_buf_s), GFP_KERNEL);
temp_buf = kzalloc(sizeof(*temp_buf), GFP_KERNEL);
if (NULL == temp_buf) {
res = BUF_ERROR;
goto exit;
@@ -276,6 +303,18 @@ int ebc_buf_init(unsigned long phy_start, char *mem_start, int men_len, int dest
}
ebc_buf_info.buf_total_num = ebc_buf_info.buf_list->nb_elt;
if (use_len <= men_len) {
temp_buf = kzalloc(sizeof(*temp_buf), GFP_KERNEL);
if (NULL == temp_buf) {
res = BUF_ERROR;
goto exit;
}
temp_buf->virt_addr = temp_addr;
temp_buf->phy_addr = phy_start;
temp_buf->len = dest_buf_len;
temp_buf->status = buf_osd;
ebc_buf_info.osd_buf = temp_buf;
}
return BUF_SUCCESS;
exit:

View File

@@ -15,7 +15,8 @@ enum ebc_buf_status {
buf_idle = 0, //empty buf can be used
buf_user = 1, //buf get by user
buf_dsp = 2, //buf on dsp list
buf_error = 3,
buf_osd = 3, //buf is osd buf
buf_error = 4,
};
struct ebc_buf_s {
@@ -31,6 +32,8 @@ struct ebc_buf_s {
int win_y2;
};
struct ebc_buf_s *ebc_osd_buf_get(void);
struct ebc_buf_s *ebc_osd_buf_clone(void);
int ebc_buf_release(struct ebc_buf_s *release_buf);
int ebc_remove_from_dsp_buf_list(struct ebc_buf_s *remove_buf);
int ebc_add_to_dsp_buf_list(struct ebc_buf_s *dsp_buf);

View File

@@ -42,6 +42,8 @@
#define EBC_SET_FULL_MODE_NUM (0x7003)
#define EBC_ENABLE_OVERLAY (0x7004)
#define EBC_DISABLE_OVERLAY (0x7005)
#define EBC_GET_OSD_BUFFER (0x7006)
#define EBC_SEND_OSD_BUFFER (0x7007)
/*
* IMPORTANT: Those values is corresponding to android hardware program,

File diff suppressed because it is too large Load Diff