mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
drm/rockchip: ebc_dev: release version v2.22
use tid_name to singed buf user, so we can check buf usage, and recyle Signed-off-by: Zorro Liu <lyx@rock-chips.com> Change-Id: Iccf48bc30fbbf1ab44ac33babc9f00500b647623
This commit is contained in:
@@ -196,7 +196,7 @@ struct ebc_buf_s *ebc_osd_buf_clone(void)
|
||||
return temp_buf;
|
||||
}
|
||||
|
||||
struct ebc_buf_s *ebc_empty_buf_get(void)
|
||||
struct ebc_buf_s *ebc_empty_buf_get(const char *tid_name)
|
||||
{
|
||||
struct ebc_buf_s *temp_buf = NULL;
|
||||
int temp_pos;
|
||||
@@ -210,11 +210,12 @@ struct ebc_buf_s *ebc_empty_buf_get(void)
|
||||
if (temp_buf) {
|
||||
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
|
||||
memcpy(temp_buf->tid_name, tid_name, TASK_COMM_LEN - 1); //store user thread name
|
||||
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))) {
|
||||
else if ((temp_buf->status == buf_user) && (!strncmp(temp_buf->tid_name, tid_name, TASK_COMM_LEN - 1))) {
|
||||
printk("[%s]: one tid only can get one buf at one time\n", tid_name);
|
||||
goto OUT;
|
||||
}
|
||||
}
|
||||
@@ -248,7 +249,7 @@ int ebc_buf_state_show(char *buf)
|
||||
if (ebc_buf_info.buf_list) {
|
||||
for (i = 0; i < ebc_buf_info.buf_list->nb_elt; i++) {
|
||||
temp_buf = (struct ebc_buf_s *)buf_list_get(ebc_buf_info.buf_list, i);
|
||||
ret += sprintf(buf + ret, "ebc_buf[%d]: s = %d, m = %d\n", i, temp_buf->status, temp_buf->buf_mode);
|
||||
ret += sprintf(buf + ret, "ebc_buf[%d]: s = %d, m = %d, tid = %s\n", i, temp_buf->status, temp_buf->buf_mode, temp_buf->tid_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ int ebc_add_to_dsp_buf_list(struct ebc_buf_s *dsp_buf);
|
||||
int ebc_get_dsp_list_enum_num(void);
|
||||
struct ebc_buf_s *ebc_dsp_buf_get(void);
|
||||
struct ebc_buf_s *ebc_find_buf_by_phy_addr(unsigned long phy_addr);
|
||||
struct ebc_buf_s *ebc_empty_buf_get(void);
|
||||
struct ebc_buf_s *ebc_empty_buf_get(const char *tid_name);
|
||||
unsigned long ebc_phy_buf_base_get(void);
|
||||
char *ebc_virt_buf_base_get(void);
|
||||
int ebc_buf_state_show(char *buf);
|
||||
|
||||
@@ -102,6 +102,7 @@ struct ebc_buf_info {
|
||||
int width_mm;
|
||||
int height_mm;
|
||||
int needpic;
|
||||
char tid_name[16];
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_ROCKCHIP_EBC_DEV)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user