drm/rockchip: ebc_dev: release version v2.15

support 5bit waveform and ebc buf for regal mode

Signed-off-by: Zorro Liu <lyx@rock-chips.com>
Change-Id: Icdb2874ac062d548dc9534383f25d03e67a2b720
This commit is contained in:
Zorro Liu
2021-11-23 11:09:44 +08:00
committed by Tao Huang
parent 92a6441ba1
commit d91d0c5c66
8 changed files with 22548 additions and 18773 deletions

View File

@@ -69,56 +69,62 @@ int ebc_remove_from_dsp_buf_list(struct ebc_buf_s *remove_buf)
return BUF_SUCCESS;
}
int ebc_add_to_dsp_buf_list(struct ebc_buf_s *dsp_buf)
static void do_dsp_buf_list(struct ebc_buf_s *dsp_buf)
{
struct ebc_buf_s *temp_buf;
int temp_pos;
int is_full_mode = 0;
mutex_lock(&ebc_buf_info.dsp_buf_lock);
if (ebc_buf_info.dsp_buf_list) {
switch (dsp_buf->buf_mode) {
case EPD_OVERLAY:
switch (dsp_buf->buf_mode) {
case EPD_OVERLAY:
break;
case EPD_A2_ENTER:
case EPD_SUSPEND:
case EPD_RESUME:
case EPD_POWER_OFF:
case EPD_RESET:
case EPD_FORCE_FULL:
/*
* add system display buf to dsp buf list directly when dsp buf list is not full,
* otherwise, we need to remove some bufs from dsp buf list.
*/
if (ebc_buf_info.dsp_buf_list->nb_elt < ebc_buf_info.dsp_buf_list->maxelements)
break;
case EPD_A2_ENTER:
case EPD_SUSPEND:
case EPD_RESUME:
case EPD_POWER_OFF:
case EPD_RESET:
case EPD_FORCE_FULL:
/*
* add system display buf to dsp buf list directly when dsp buf list is not full,
* otherwise, we need to remove some bufs from dsp buf list.
*/
if (ebc_buf_info.dsp_buf_list->nb_elt < ebc_buf_info.dsp_buf_list->maxelements)
break;
/* fallthrough */
default:
if (ebc_buf_info.dsp_buf_list->nb_elt > 1) {
temp_pos = ebc_buf_info.dsp_buf_list->nb_elt;
while (--temp_pos) {
temp_buf = (struct ebc_buf_s *)buf_list_get(ebc_buf_info.dsp_buf_list, temp_pos);
if (temp_buf->buf_mode == EPD_OVERLAY) {
continue;
} else if (((temp_buf->buf_mode >= EPD_FULL_GC16) && (temp_buf->buf_mode <= EPD_DU4))
|| (temp_buf->buf_mode == EPD_AUTO)
|| (temp_buf->buf_mode == EPD_AUTO_DU)
|| (temp_buf->buf_mode == EPD_AUTO_DU4)) {
buf_list_remove(ebc_buf_info.dsp_buf_list, temp_pos);
ebc_buf_release(temp_buf);
} else if ((1 == is_full_mode)
&& (temp_buf->buf_mode != EPD_SUSPEND)
&& (temp_buf->buf_mode != EPD_RESUME)
&& (temp_buf->buf_mode != EPD_POWER_OFF)) {
buf_list_remove(ebc_buf_info.dsp_buf_list, temp_pos);
ebc_buf_release(temp_buf);
} else {
is_full_mode = 1;
}
/* fallthrough */
default:
if (ebc_buf_info.dsp_buf_list->nb_elt > 1) {
temp_pos = ebc_buf_info.dsp_buf_list->nb_elt;
while (--temp_pos) {
temp_buf = (struct ebc_buf_s *)buf_list_get(ebc_buf_info.dsp_buf_list, temp_pos);
if ((temp_buf->buf_mode == EPD_OVERLAY) || (temp_buf->needpic == WF_5BIT)) {
continue;
} else if (((temp_buf->buf_mode >= EPD_FULL_GC16) && (temp_buf->buf_mode <= EPD_DU4))
|| (temp_buf->buf_mode == EPD_AUTO)
|| (temp_buf->buf_mode == EPD_AUTO_DU)
|| (temp_buf->buf_mode == EPD_AUTO_DU4)) {
buf_list_remove(ebc_buf_info.dsp_buf_list, temp_pos);
ebc_buf_release(temp_buf);
} else if ((1 == is_full_mode)
&& (temp_buf->buf_mode != EPD_SUSPEND)
&& (temp_buf->buf_mode != EPD_RESUME)
&& (temp_buf->buf_mode != EPD_POWER_OFF)) {
buf_list_remove(ebc_buf_info.dsp_buf_list, temp_pos);
ebc_buf_release(temp_buf);
} else {
is_full_mode = 1;
}
}
break;
}
break;
}
}
int ebc_add_to_dsp_buf_list(struct ebc_buf_s *dsp_buf)
{
mutex_lock(&ebc_buf_info.dsp_buf_lock);
if (ebc_buf_info.dsp_buf_list) {
if (dsp_buf->needpic != WF_5BIT)
do_dsp_buf_list(dsp_buf);
if (-1 == buf_list_add(ebc_buf_info.dsp_buf_list, (int *)dsp_buf, -1)) {
ebc_buf_release(dsp_buf);
@@ -128,7 +134,6 @@ int ebc_add_to_dsp_buf_list(struct ebc_buf_s *dsp_buf)
if (dsp_buf->status != buf_osd)
dsp_buf->status = buf_dsp;
}
mutex_unlock(&ebc_buf_info.dsp_buf_lock);

View File

@@ -30,6 +30,7 @@ struct ebc_buf_s {
int win_y1;
int win_x2;
int win_y2;
int needpic;
};
struct ebc_buf_s *ebc_osd_buf_get(void);

View File

@@ -25,6 +25,9 @@
#define EBC_SUCCESS (0)
#define EBC_ERROR (-1)
#define WF_4BIT 16
#define WF_5BIT 32
/*
* ebc status notify
*/
@@ -98,6 +101,7 @@ struct ebc_buf_info {
int win_y2;
int width_mm;
int height_mm;
int needpic;
};
#if IS_ENABLED(CONFIG_ROCKCHIP_EBC_DEV)

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,7 @@
#include "../ebc_dev.h"
#include "epd_lut.h"
static int (*lut_get)(struct epd_lut_data *, enum epd_lut_type, int);
static int (*lut_get)(struct epd_lut_data *, enum epd_lut_type, int, int);
int epd_lut_from_mem_init(void *waveform)
{
@@ -66,7 +66,7 @@ const char *epd_lut_get_wf_version(void)
return NULL;
}
int epd_lut_get(struct epd_lut_data *output, enum epd_lut_type lut_type, int temperture)
int epd_lut_get(struct epd_lut_data *output, enum epd_lut_type lut_type, int temperture, int needpic)
{
return lut_get(output, lut_type, temperture);
return lut_get(output, lut_type, temperture, needpic);
}

View File

@@ -48,19 +48,19 @@ struct epd_lut_data {
int epd_lut_from_mem_init(void *waveform);
int epd_lut_from_file_init(struct device *dev, void *waveform, int size);
const char *epd_lut_get_wf_version(void);
int epd_lut_get(struct epd_lut_data *output, enum epd_lut_type lut_type, int temperture);
int epd_lut_get(struct epd_lut_data *output, enum epd_lut_type lut_type, int temperture, int needpic);
/*
* PVI Waveform Interfaces
*/
int pvi_wf_input(void *waveform_file);
const char *pvi_wf_get_version(void);
int pvi_wf_get_lut(struct epd_lut_data *output, enum epd_lut_type lut_type, int temperture);
int pvi_wf_get_lut(struct epd_lut_data *output, enum epd_lut_type lut_type, int temperture, int needpic);
/*
* RKF Waveform Interfaces
*/
int rkf_wf_input(void *waveform_file);
const char *rkf_wf_get_version(void);
int rkf_wf_get_lut(struct epd_lut_data *output, enum epd_lut_type lut_type, int temperture);
int rkf_wf_get_lut(struct epd_lut_data *output, enum epd_lut_type lut_type, int temperture, int needpic);
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff