mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
drm/rockchip: ebc_dev: release version v1.07
1.resize auto framecount, one byte per 16 pixels 2.do not change framecount value in refresh new function 3.remove ebc_refresh_task thread 4.add mutex to protect empty buf get 5.improve temperture get Signed-off-by: Zorro Liu <lyx@rock-chips.com> Change-Id: I80c245594cc87cc6717bafadc27562d66368eb04
This commit is contained in:
@@ -29,7 +29,8 @@ struct buf_info_s {
|
||||
int dsp_buf_list_status;
|
||||
struct ebc_buf_s *osd_buf;
|
||||
|
||||
struct mutex dsp_lock;
|
||||
struct mutex dsp_buf_lock;
|
||||
struct mutex ebc_buf_lock;
|
||||
};
|
||||
|
||||
static struct buf_info_s ebc_buf_info;
|
||||
@@ -56,14 +57,14 @@ int ebc_buf_release(struct ebc_buf_s *release_buf)
|
||||
|
||||
int ebc_remove_from_dsp_buf_list(struct ebc_buf_s *remove_buf)
|
||||
{
|
||||
mutex_lock(&ebc_buf_info.dsp_lock);
|
||||
mutex_lock(&ebc_buf_info.dsp_buf_lock);
|
||||
if (ebc_buf_info.dsp_buf_list) {
|
||||
int pos;
|
||||
|
||||
pos = buf_list_get_pos(ebc_buf_info.dsp_buf_list, (int *)remove_buf);
|
||||
buf_list_remove(ebc_buf_info.dsp_buf_list, pos);
|
||||
}
|
||||
mutex_unlock(&ebc_buf_info.dsp_lock);
|
||||
mutex_unlock(&ebc_buf_info.dsp_buf_lock);
|
||||
|
||||
return BUF_SUCCESS;
|
||||
}
|
||||
@@ -74,7 +75,7 @@ int ebc_add_to_dsp_buf_list(struct ebc_buf_s *dsp_buf)
|
||||
int temp_pos;
|
||||
int is_full_mode = 0;
|
||||
|
||||
mutex_lock(&ebc_buf_info.dsp_lock);
|
||||
mutex_lock(&ebc_buf_info.dsp_buf_lock);
|
||||
if (ebc_buf_info.dsp_buf_list) {
|
||||
switch (dsp_buf->buf_mode) {
|
||||
case EPD_DU:
|
||||
@@ -120,11 +121,11 @@ int ebc_add_to_dsp_buf_list(struct ebc_buf_s *dsp_buf)
|
||||
|
||||
dsp_buf->status = buf_dsp;
|
||||
if (-1 == buf_list_add(ebc_buf_info.dsp_buf_list, (int *)dsp_buf, -1)) {
|
||||
mutex_unlock(&ebc_buf_info.dsp_lock);
|
||||
mutex_unlock(&ebc_buf_info.dsp_buf_lock);
|
||||
return BUF_ERROR;
|
||||
}
|
||||
}
|
||||
mutex_unlock(&ebc_buf_info.dsp_lock);
|
||||
mutex_unlock(&ebc_buf_info.dsp_buf_lock);
|
||||
|
||||
return BUF_SUCCESS;
|
||||
}
|
||||
@@ -155,10 +156,10 @@ struct ebc_buf_s *ebc_dsp_buf_get(void)
|
||||
{
|
||||
struct ebc_buf_s *buf = NULL;
|
||||
|
||||
mutex_lock(&ebc_buf_info.dsp_lock);
|
||||
mutex_lock(&ebc_buf_info.dsp_buf_lock);
|
||||
if (ebc_buf_info.dsp_buf_list && (ebc_buf_info.dsp_buf_list->nb_elt > 0))
|
||||
buf = (struct ebc_buf_s *)buf_list_get(ebc_buf_info.dsp_buf_list, 0);
|
||||
mutex_unlock(&ebc_buf_info.dsp_lock);
|
||||
mutex_unlock(&ebc_buf_info.dsp_buf_lock);
|
||||
|
||||
return buf;
|
||||
}
|
||||
@@ -187,10 +188,11 @@ struct ebc_buf_s *ebc_osd_buf_clone(void)
|
||||
|
||||
struct ebc_buf_s *ebc_empty_buf_get(void)
|
||||
{
|
||||
struct ebc_buf_s *temp_buf;
|
||||
struct ebc_buf_s *temp_buf = NULL;
|
||||
int temp_pos;
|
||||
|
||||
if (ebc_buf_info.buf_list) {
|
||||
mutex_lock(&ebc_buf_info.ebc_buf_lock);
|
||||
while (ebc_buf_info.buf_list) {
|
||||
temp_pos = 0;
|
||||
|
||||
while (temp_pos < ebc_buf_info.buf_list->nb_elt) {
|
||||
@@ -199,22 +201,22 @@ struct ebc_buf_s *ebc_empty_buf_get(void)
|
||||
if (temp_buf->status == buf_idle) {
|
||||
temp_buf->status = buf_user;
|
||||
memcpy(temp_buf->tid_name, current->comm, TASK_COMM_LEN); //store user thread name
|
||||
return temp_buf;
|
||||
goto OUT;
|
||||
}
|
||||
// one tid only can get one buf at one time
|
||||
else if ((temp_buf->status == buf_user) && (!strncmp(temp_buf->tid_name, current->comm, TASK_COMM_LEN - 7))) {
|
||||
return temp_buf;
|
||||
goto OUT;
|
||||
}
|
||||
}
|
||||
}
|
||||
ebc_buf_info.use_buf_is_empty = 1;
|
||||
|
||||
wait_event_interruptible(ebc_buf_wq, ebc_buf_info.use_buf_is_empty != 1);
|
||||
|
||||
return ebc_empty_buf_get();
|
||||
}
|
||||
|
||||
return NULL;
|
||||
OUT:
|
||||
mutex_unlock(&ebc_buf_info.ebc_buf_lock);
|
||||
return temp_buf;
|
||||
}
|
||||
|
||||
unsigned long ebc_phy_buf_base_get(void)
|
||||
@@ -260,7 +262,8 @@ int ebc_buf_init(unsigned long phy_start, char *mem_start, int men_len, int dest
|
||||
if (NULL == mem_start)
|
||||
return BUF_ERROR;
|
||||
|
||||
mutex_init(&ebc_buf_info.dsp_lock);
|
||||
mutex_init(&ebc_buf_info.dsp_buf_lock);
|
||||
mutex_init(&ebc_buf_info.ebc_buf_lock);
|
||||
|
||||
if (buf_list_init(&ebc_buf_info.buf_list, BUF_LIST_MAX_NUMBER))
|
||||
return BUF_ERROR;
|
||||
|
||||
@@ -69,8 +69,6 @@ enum panel_refresh_mode {
|
||||
EPD_SUSPEND = 15,
|
||||
EPD_RESUME = 16,
|
||||
EPD_POWER_OFF = 17,
|
||||
EPD_PART_EINK = 18,
|
||||
EPD_FULL_EINK = 19,
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user