hdmitx_common: add hdmitx_sysfs_common [1/1]

PD#SWPL-92851

Problem:
tx20&tx21 should share same sysfs implement

Solution:
create hdmitx_sysfs_common to share sysfs implement.

Verify:
verify on OHM.

Tests:
DRM-TX-4, DRM-TX-5

Change-Id: I0edc39ea8bd26bbee6ddfcea0146dfaa95b394f2
Signed-off-by: sky zhou <sky.zhou@amlogic.com>
This commit is contained in:
sky zhou
2022-09-21 17:38:24 +08:00
committed by Sky Zhou
parent bbb52bbfd3
commit ea8949c2c0
24 changed files with 370 additions and 401 deletions
+39 -39
View File
@@ -63,35 +63,35 @@ static struct drm_display_mode dummy_mode = {
};
struct hdmitx_color_attr dv_color_attr_list[] = {
{COLORSPACE_YUV444, 8}, //"444,8bit"
{COLORSPACE_RESERVED, COLORDEPTH_RESERVED}
{HDMI_COLORSPACE_YUV444, 8}, //"444,8bit"
{HDMI_COLORSPACE_RESERVED6, COLORDEPTH_RESERVED}
};
struct hdmitx_color_attr dv_ll_color_attr_list[] = {
{COLORSPACE_YUV422, 12}, //"422,12bit"
{COLORSPACE_RESERVED, COLORDEPTH_RESERVED}
{HDMI_COLORSPACE_YUV422, 12}, //"422,12bit"
{HDMI_COLORSPACE_RESERVED6, COLORDEPTH_RESERVED}
};
/* this is prior selected list of
* 4k2k50hz, 4k2k60hz smpte50hz, smpte60hz
*/
struct hdmitx_color_attr color_attr_list[] = {
{COLORSPACE_YUV420, 10}, //"420,10bit"
{COLORSPACE_YUV422, 12}, //"422,12bit"
{COLORSPACE_YUV420, 8}, //"420,8bit"
{COLORSPACE_YUV444, 8}, //"444,8bit"
{COLORSPACE_RGB444, 8}, //"rgb,8bit"
{COLORSPACE_RESERVED, COLORDEPTH_RESERVED}
{HDMI_COLORSPACE_YUV420, 10}, //"420,10bit"
{HDMI_COLORSPACE_YUV422, 12}, //"422,12bit"
{HDMI_COLORSPACE_YUV420, 8}, //"420,8bit"
{HDMI_COLORSPACE_YUV444, 8}, //"444,8bit"
{HDMI_COLORSPACE_RGB, 8}, //"rgb,8bit"
{HDMI_COLORSPACE_RESERVED6, COLORDEPTH_RESERVED}
};
/* this is prior selected list of other display mode */
struct hdmitx_color_attr other_color_attr_list[] = {
{COLORSPACE_YUV444, 10}, //"444,10bit"
{COLORSPACE_YUV422, 12}, //"422,12bit"
{COLORSPACE_RGB444, 10}, //"rgb,10bit"
{COLORSPACE_YUV444, 8}, //"444,8bit"
{COLORSPACE_RGB444, 8}, //"rgb,8bit"
{COLORSPACE_RESERVED, COLORDEPTH_RESERVED}
{HDMI_COLORSPACE_YUV444, 10}, //"444,10bit"
{HDMI_COLORSPACE_YUV422, 12}, //"422,12bit"
{HDMI_COLORSPACE_RGB, 10}, //"rgb,10bit"
{HDMI_COLORSPACE_YUV444, 8}, //"444,8bit"
{HDMI_COLORSPACE_RGB, 8}, //"rgb,8bit"
{HDMI_COLORSPACE_RESERVED6, COLORDEPTH_RESERVED}
};
#define MODE_4K2K24HZ "2160p24hz"
@@ -107,20 +107,20 @@ struct hdmitx_color_attr other_color_attr_list[] = {
void convert_attrstr(char *attr_str,
struct hdmitx_color_attr *attr_param)
{
attr_param->colorformat = COLORSPACE_RESERVED;
attr_param->colorformat = HDMI_COLORSPACE_RESERVED6;
attr_param->bitdepth = COLORDEPTH_RESERVED;
if (strstr(attr_str, "420"))
attr_param->colorformat = COLORSPACE_YUV420;
attr_param->colorformat = HDMI_COLORSPACE_YUV420;
else if (strstr(attr_str, "422"))
attr_param->colorformat = COLORSPACE_YUV422;
attr_param->colorformat = HDMI_COLORSPACE_YUV422;
else if (strstr(attr_str, "444"))
attr_param->colorformat = COLORSPACE_YUV444;
attr_param->colorformat = HDMI_COLORSPACE_YUV444;
else if (strstr(attr_str, "rgb"))
attr_param->colorformat = COLORSPACE_RGB444;
attr_param->colorformat = HDMI_COLORSPACE_RGB;
/*parse colorspace success*/
if (attr_param->colorformat != COLORSPACE_RESERVED) {
if (attr_param->colorformat != HDMI_COLORSPACE_RESERVED6) {
if (strstr(attr_str, "12bit"))
attr_param->bitdepth = 12;
else if (strstr(attr_str, "10bit"))
@@ -135,16 +135,16 @@ static void build_hdmitx_attr_str(char *attr_str, u32 format, u32 bit_depth)
const char *colorspace;
switch (format) {
case COLORSPACE_YUV420:
case HDMI_COLORSPACE_YUV420:
colorspace = "420";
break;
case COLORSPACE_YUV422:
case HDMI_COLORSPACE_YUV422:
colorspace = "422";
break;
case COLORSPACE_YUV444:
case HDMI_COLORSPACE_YUV444:
colorspace = "444";
break;
case COLORSPACE_RGB444:
case HDMI_COLORSPACE_RGB:
colorspace = "rgb";
break;
default:
@@ -191,14 +191,14 @@ static bool meson_hdmitx_test_color_attr(struct am_meson_crtc_state *crtc_state,
char attr_str[HDMITX_ATTR_LEN_MAX];
u8 max_bpc = conn_state->base.max_bpc;
if (test_attr->colorformat == COLORSPACE_RESERVED ||
if (test_attr->colorformat == HDMI_COLORSPACE_RESERVED6 ||
test_attr->bitdepth > max_bpc)
return false;
attr_list = meson_hdmitx_get_candidate_attr_list(crtc_state);
do {
if (attr_list->colorformat == COLORSPACE_RESERVED)
if (attr_list->colorformat == HDMI_COLORSPACE_RESERVED6)
break;
if (attr_list->colorformat == test_attr->colorformat &&
@@ -215,7 +215,7 @@ static bool meson_hdmitx_test_color_attr(struct am_meson_crtc_state *crtc_state,
}
} while (attr_list++);
if (attr_list->colorformat == COLORSPACE_RESERVED)
if (attr_list->colorformat == HDMI_COLORSPACE_RESERVED6)
return false;
else
return true;
@@ -237,7 +237,7 @@ static int meson_hdmitx_decide_color_attr
attr_list = meson_hdmitx_get_candidate_attr_list(crtc_state);
do {
if (attr_list->colorformat == COLORSPACE_RESERVED)
if (attr_list->colorformat == HDMI_COLORSPACE_RESERVED6)
break;
if (attr_list->bitdepth <= max_bpc) {
@@ -255,9 +255,9 @@ static int meson_hdmitx_decide_color_attr
}
}
} while (attr_list++);
if (attr_list->colorformat == COLORSPACE_RESERVED) {
if (attr_list->colorformat == HDMI_COLORSPACE_RESERVED6) {
DRM_ERROR("%s no attr found, reset to 444,8bit.\n", __func__);
attr->colorformat = COLORSPACE_RGB444;
attr->colorformat = HDMI_COLORSPACE_RGB;
attr->bitdepth = 8;
}
@@ -592,7 +592,7 @@ struct drm_connector_state *meson_hdmitx_atomic_duplicate_state
new_state->update = false;
new_state->color_force = false;
new_state->color_attr_para.colorformat = COLORSPACE_RESERVED;
new_state->color_attr_para.colorformat = HDMI_COLORSPACE_RESERVED6;
new_state->color_attr_para.bitdepth = COLORDEPTH_RESERVED;
new_state->pref_hdr_policy = cur_state->pref_hdr_policy;
@@ -1163,7 +1163,7 @@ void meson_hdmitx_encoder_atomic_mode_set(struct drm_encoder *encoder,
}
if (!hdmitx_state->color_force) {
if (attr->colorformat != COLORSPACE_RESERVED) {
if (attr->colorformat != HDMI_COLORSPACE_RESERVED6) {
if (meson_hdmitx_test_color_attr(meson_crtc_state,
hdmitx_state, attr)) {
update_attr = false;
@@ -1317,11 +1317,11 @@ MODULE_DEVICE_TABLE(of, am_meson_hdmi_dt_ids);
/* Optional colorspace properties. */
static const struct drm_prop_enum_list hdmi_color_space_enum_list[] = {
{ COLORSPACE_RGB444, "RGB" },
{ COLORSPACE_YUV422, "422" },
{ COLORSPACE_YUV444, "444" },
{ COLORSPACE_YUV420, "420" },
{ COLORSPACE_RESERVED, "COLORSPACE_RESERVED" }
{ HDMI_COLORSPACE_RGB, "RGB" },
{ HDMI_COLORSPACE_YUV422, "422" },
{ HDMI_COLORSPACE_YUV444, "444" },
{ HDMI_COLORSPACE_YUV420, "420" },
{ HDMI_COLORSPACE_RESERVED6, "HDMI_COLORSPACE_RESERVED6" }
};
static void meson_hdmitx_init_colorspace_property(struct drm_device *drm_dev,
+1 -1
View File
@@ -27,7 +27,7 @@ enum {
};
struct hdmitx_color_attr {
int colorformat;
enum hdmi_colorspace colorformat;
int bitdepth;
};
@@ -3176,15 +3176,15 @@ static struct parse_cd parse_cd_[] = {
};
static struct parse_cs parse_cs_[] = {
{COLORSPACE_RGB444, "rgb",},
{COLORSPACE_YUV422, "422",},
{COLORSPACE_YUV444, "444",},
{COLORSPACE_YUV420, "420",},
{HDMI_COLORSPACE_RGB, "rgb",},
{HDMI_COLORSPACE_YUV422, "422",},
{HDMI_COLORSPACE_YUV444, "444",},
{HDMI_COLORSPACE_YUV420, "420",},
};
static struct parse_cr parse_cr_[] = {
{COLORRANGE_LIM, "limit",},
{COLORRANGE_FUL, "full",},
{HDMI_QUANTIZATION_RANGE_LIMITED, "limit",},
{HDMI_QUANTIZATION_RANGE_FULL, "full",},
};
const char *hdmi_get_str_cd(struct hdmi_format_para *para)
@@ -3245,7 +3245,7 @@ static void hdmi_parse_attr(struct hdmi_format_para *para, char const *name)
}
/* set default value */
if (i == sizeof(parse_cs_) / sizeof(struct parse_cs))
para->cs = COLORSPACE_YUV444;
para->cs = HDMI_COLORSPACE_YUV444;
/* parse color range */
for (i = 0; i < sizeof(parse_cr_) / sizeof(struct parse_cr); i++) {
@@ -3256,7 +3256,7 @@ static void hdmi_parse_attr(struct hdmi_format_para *para, char const *name)
}
/* set default value */
if (i == sizeof(parse_cr_) / sizeof(struct parse_cr))
para->cr = COLORRANGE_FUL;
para->cr = HDMI_QUANTIZATION_RANGE_FULL;
}
/*
@@ -3303,10 +3303,10 @@ struct hdmi_format_para *hdmi_get_fmt_name(char const *name, char const *attr)
hdmi_parse_attr(para, attr);
}
if (strstr(name, "420"))
para->cs = COLORSPACE_YUV420;
para->cs = HDMI_COLORSPACE_YUV420;
/* only 2160p60/50hz smpte60/50hz have Y420 mode */
if (para->cs == COLORSPACE_YUV420) {
if (para->cs == HDMI_COLORSPACE_YUV420) {
switch ((para->vic) & 0xff) {
case HDMI_3840x2160p50_16x9:
case HDMI_3840x2160p60_16x9:
@@ -3372,10 +3372,10 @@ struct hdmi_format_para *hdmi_tst_fmt_name(char const *name, char const *attr)
hdmi_parse_attr(&tst_para, attr);
}
if (strstr(name, "420"))
tst_para.cs = COLORSPACE_YUV420;
tst_para.cs = HDMI_COLORSPACE_YUV420;
/* only 2160p60/50hz smpte60/50hz have Y420 mode */
if (tst_para.cs == COLORSPACE_YUV420) {
if (tst_para.cs == HDMI_COLORSPACE_YUV420) {
switch ((tst_para.vic) & 0xff) {
case HDMI_3840x2160p50_16x9:
case HDMI_3840x2160p60_16x9:
@@ -3936,9 +3936,9 @@ static const unsigned char coef_yc444_rgb_24bit_709[] = {
};
static const struct hdmi_csc_coef_table hdmi_csc_coef[] = {
{COLORSPACE_YUV444, COLORSPACE_RGB444, COLORDEPTH_24B, 0,
{HDMI_COLORSPACE_YUV444, HDMI_COLORSPACE_RGB, COLORDEPTH_24B, 0,
sizeof(coef_yc444_rgb_24bit_601), coef_yc444_rgb_24bit_601},
{COLORSPACE_YUV444, COLORSPACE_RGB444, COLORDEPTH_24B, 1,
{HDMI_COLORSPACE_YUV444, HDMI_COLORSPACE_RGB, COLORDEPTH_24B, 1,
sizeof(coef_yc444_rgb_24bit_709), coef_yc444_rgb_24bit_709},
};
@@ -3090,14 +3090,14 @@ bool hdmitx_edid_check_valid_mode(struct hdmitx_dev *hdev,
case HDMI_4096x2160p60_256x135:
case HDMI_3840x2160p50_64x27:
case HDMI_3840x2160p60_64x27:
if (para->cs == COLORSPACE_RGB444 ||
para->cs == COLORSPACE_YUV444)
if (para->cs == HDMI_COLORSPACE_RGB ||
para->cs == HDMI_COLORSPACE_YUV444)
if (para->cd != COLORDEPTH_24B)
return 0;
break;
case HDMI_720x480i60_16x9:
case HDMI_720x576i50_16x9:
if (para->cs == COLORSPACE_YUV422)
if (para->cs == HDMI_COLORSPACE_YUV422)
return 0;
default:
break;
@@ -3119,7 +3119,7 @@ bool hdmitx_edid_check_valid_mode(struct hdmitx_dev *hdev,
if (para->vic >= HDMITX_VESA_OFFSET) {
if (para->cd != COLORDEPTH_24B)
return 0;
if (para->cs != COLORSPACE_RGB444)
if (para->cs != HDMI_COLORSPACE_RGB)
return 0;
for (i = 0; vesa_t[i] && i < VESA_MAX_TIMING; i++) {
struct hdmi_format_para *param = NULL;
@@ -3156,9 +3156,9 @@ bool hdmitx_edid_check_valid_mode(struct hdmitx_dev *hdev,
}
calc_tmds_clk = para->tmds_clk;
if (para->cs == COLORSPACE_YUV420)
if (para->cs == HDMI_COLORSPACE_YUV420)
calc_tmds_clk = calc_tmds_clk / 2;
if (para->cs != COLORSPACE_YUV422) {
if (para->cs != HDMI_COLORSPACE_YUV422) {
switch (para->cd) {
case COLORDEPTH_30B:
calc_tmds_clk = calc_tmds_clk * 5 / 4;
@@ -3184,7 +3184,7 @@ bool hdmitx_edid_check_valid_mode(struct hdmitx_dev *hdev,
else
return 0;
if (para->cs == COLORSPACE_YUV444) {
if (para->cs == HDMI_COLORSPACE_YUV444) {
/* Rx may not support Y444 */
if (!(prxcap->native_Mode & (1 << 5)))
return 0;
@@ -3200,13 +3200,13 @@ bool hdmitx_edid_check_valid_mode(struct hdmitx_dev *hdev,
valid = 0;
return valid;
}
if (para->cs == COLORSPACE_YUV422) {
if (para->cs == HDMI_COLORSPACE_YUV422) {
/* Rx may not support Y422 */
if (!(prxcap->native_Mode & (1 << 4)))
return 0;
return 1;
}
if (para->cs == COLORSPACE_RGB444) {
if (para->cs == HDMI_COLORSPACE_RGB) {
/* Always assume RX supports RGB444 */
if (prxcap->dc_30bit || dv->sup_10b_12b_444 == 0x1)
rx_rgb_max_dc = COLORDEPTH_30B;
@@ -3218,7 +3218,7 @@ bool hdmitx_edid_check_valid_mode(struct hdmitx_dev *hdev,
valid = 0;
return valid;
}
if (para->cs == COLORSPACE_YUV420) {
if (para->cs == HDMI_COLORSPACE_YUV420) {
if (!is_rx_support_y420(hdev))
return 0;
if (prxcap->dc_30bit_420)
@@ -60,6 +60,7 @@
#include <drm/amlogic/meson_drm_bind.h>
#include <hdmitx_boot_parameters.h>
#include <hdmitx_drm_hook.h>
#include <hdmitx_sysfs_common.h>
#include <linux/amlogic/media/vout/hdmitx_common/hdmitx_common.h>
#define DEVICE_NAME "amhdmitx"
@@ -766,54 +767,14 @@ static ssize_t disp_mode_store(struct device *dev,
return count;
}
static ssize_t attr_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
int pos = 0;
struct hdmitx_common *tx_comm = &hdmitx_device.tx_comm;
if (!memcmp(tx_comm->fmt_attr, "default,", 7)) {
memset(tx_comm->fmt_attr, 0,
sizeof(tx_comm->fmt_attr));
hdmitx_fmt_attr(&hdmitx_device);
}
pos += snprintf(buf + pos, PAGE_SIZE, "%s\n\r", tx_comm->fmt_attr);
return pos;
}
ssize_t attr_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct hdmitx_common *tx_comm = &hdmitx_device.tx_comm;
strncpy(tx_comm->fmt_attr, buf, sizeof(tx_comm->fmt_attr));
tx_comm->fmt_attr[15] = '\0';
if (!memcmp(tx_comm->fmt_attr, "rgb", 3))
hdmitx_device.para->cs = COLORSPACE_RGB444;
else if (!memcmp(tx_comm->fmt_attr, "422", 3))
hdmitx_device.para->cs = COLORSPACE_YUV422;
else if (!memcmp(tx_comm->fmt_attr, "420", 3))
hdmitx_device.para->cs = COLORSPACE_YUV420;
else
hdmitx_device.para->cs = COLORSPACE_YUV444;
return count;
}
void setup20_attr(const char *buf)
{
char attr[16] = {0};
struct hdmitx_common *tx_comm = &hdmitx_device.tx_comm;
memcpy(attr, buf, sizeof(attr));
memcpy(tx_comm->fmt_attr, attr, sizeof(tx_comm->fmt_attr));
hdmitx_setup_attr(&hdmitx_device.tx_comm, buf);
}
void get20_attr(char attr[16])
{
struct hdmitx_common *tx_comm = &hdmitx_device.tx_comm;
memcpy(attr, tx_comm->fmt_attr, sizeof(tx_comm->fmt_attr));
hdmitx_get_attr(&hdmitx_device.tx_comm, attr);
}
/* for android application data exchange / swap */
@@ -2068,13 +2029,13 @@ static void hdmitx_set_vsif_pkt(enum eotf_type type,
if (tunnel_mode == RGB_8BIT) {
hdev->hwop.cntlconfig(hdev,
CONF_AVI_RGBYCC_INDIC,
COLORSPACE_RGB444);
HDMI_COLORSPACE_RGB);
hdev->hwop.cntlconfig(hdev, CONF_AVI_Q01,
RGB_RANGE_FUL);
} else {
hdev->hwop.cntlconfig(hdev,
CONF_AVI_RGBYCC_INDIC,
COLORSPACE_YUV422);
HDMI_COLORSPACE_YUV422);
hdev->hwop.cntlconfig(hdev, CONF_AVI_YQ01,
YCC_RANGE_FUL);
}
@@ -2174,13 +2135,13 @@ static void hdmitx_set_vsif_pkt(enum eotf_type type,
if (tunnel_mode == RGB_8BIT) {/*RGB444*/
hdev->hwop.cntlconfig(hdev,
CONF_AVI_RGBYCC_INDIC,
COLORSPACE_RGB444);
HDMI_COLORSPACE_RGB);
hdev->hwop.cntlconfig(hdev, CONF_AVI_Q01,
RGB_RANGE_FUL);
} else {/*YUV422*/
hdev->hwop.cntlconfig(hdev,
CONF_AVI_RGBYCC_INDIC,
COLORSPACE_YUV422);
HDMI_COLORSPACE_YUV422);
hdev->hwop.cntlconfig(hdev, CONF_AVI_YQ01,
YCC_RANGE_FUL);
}
@@ -2200,20 +2161,20 @@ static void hdmitx_set_vsif_pkt(enum eotf_type type,
if (tunnel_mode == RGB_10_12BIT) {/*10/12bit RGB444*/
hdev->hwop.cntlconfig(hdev,
CONF_AVI_RGBYCC_INDIC,
COLORSPACE_RGB444);
HDMI_COLORSPACE_RGB);
hdev->hwop.cntlconfig(hdev, CONF_AVI_Q01,
RGB_RANGE_LIM);
} else if (tunnel_mode == YUV444_10_12BIT) {
/*10/12bit YUV444*/
hdev->hwop.cntlconfig(hdev,
CONF_AVI_RGBYCC_INDIC,
COLORSPACE_YUV444);
HDMI_COLORSPACE_YUV444);
hdev->hwop.cntlconfig(hdev, CONF_AVI_YQ01,
YCC_RANGE_LIM);
} else {/*YUV422*/
hdev->hwop.cntlconfig(hdev,
CONF_AVI_RGBYCC_INDIC,
COLORSPACE_YUV422);
HDMI_COLORSPACE_YUV422);
hdev->hwop.cntlconfig(hdev, CONF_AVI_YQ01,
YCC_RANGE_LIM);
}
@@ -2641,16 +2602,16 @@ static ssize_t config_show(struct device *dev,
pos += snprintf(buf + pos, PAGE_SIZE, "colordepth: %s\n",
conf);
switch (hdev->para->cs) {
case COLORSPACE_RGB444:
case HDMI_COLORSPACE_RGB:
conf = "RGB";
break;
case COLORSPACE_YUV422:
case HDMI_COLORSPACE_YUV422:
conf = "422";
break;
case COLORSPACE_YUV444:
case HDMI_COLORSPACE_YUV444:
conf = "444";
break;
case COLORSPACE_YUV420:
case HDMI_COLORSPACE_YUV420:
conf = "420";
break;
default:
@@ -4842,16 +4803,6 @@ next: /* Detect RX support HDCP14 */
return pos;
}
static ssize_t hpd_state_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
int pos = 0;
pos += snprintf(buf + pos, PAGE_SIZE, "%d",
hdmitx_device.tx_comm.hpd_state);
return pos;
}
static ssize_t rxsense_state_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -5324,9 +5275,11 @@ static ssize_t hdmi_config_info_show(struct device *dev,
vic = hdmitx_device.hwop.getstate(&hdmitx_device, STAT_VIDEO_VIC, 0);
pr_info("out:%s\n", hdmitx_edid_vic_tab_map_string(vic));
/*
pos = attr_show(dev, attr, buf);
buf[pos] = '\0';
pr_info("attr\nin:%s\t", buf);
*/
pos = create_hdmitx_out_attr(buf);
buf[pos] = '\0';
@@ -5426,11 +5379,12 @@ static ssize_t hdmirx_info_show(struct device *dev,
pr_info("************hdmirx_info************\n\n");
/*
pos = hpd_state_show(dev, attr, buf);
buf[pos] = '\0';
pr_info("******hpd_edid_parsing******\n");
pr_info("hpd:%s\t", buf);
*/
pos = edid_parsing_show(dev, attr, buf);
buf[pos] = '\0';
pr_info("edid_parsing:%s\n", buf);
@@ -5650,7 +5604,6 @@ static ssize_t hdmi_hsty_config_show(struct device *dev,
}
static DEVICE_ATTR_RW(disp_mode);
static DEVICE_ATTR_RW(attr);
static DEVICE_ATTR_RW(aud_mode);
static DEVICE_ATTR_RW(vid_mute);
static DEVICE_ATTR_RW(edid);
@@ -5704,7 +5657,6 @@ static DEVICE_ATTR_RW(hdcp_ctrl);
static DEVICE_ATTR_RO(disp_cap_3d);
static DEVICE_ATTR_RO(hdcp_ksv_info);
static DEVICE_ATTR_RO(hdcp_ver);
static DEVICE_ATTR_RO(hpd_state);
static DEVICE_ATTR_RO(hdmi_used);
static DEVICE_ATTR_RO(rhpd_state);
static DEVICE_ATTR_RO(rxsense_state);
@@ -6457,9 +6409,9 @@ static bool is_cur_tmds_div40(struct hdmitx_dev *hdev)
}
pr_info("hdmitx: tmds clock %d\n", para2->tmds_clk / 1000);
act_clk = para2->tmds_clk / 1000;
if (para2->cs == COLORSPACE_YUV420)
if (para2->cs == HDMI_COLORSPACE_YUV420)
act_clk = act_clk / 2;
if (para2->cs != COLORSPACE_YUV422) {
if (para2->cs != HDMI_COLORSPACE_YUV422) {
switch (para2->cd) {
case COLORDEPTH_30B:
act_clk = act_clk * 5 / 4;
@@ -6566,21 +6518,21 @@ static void hdmitx_fmt_attr(struct hdmitx_dev *hdev)
return;
}
if (hdev->para->cd == COLORDEPTH_RESERVED &&
hdev->para->cs == COLORSPACE_RESERVED) {
hdev->para->cs == HDMI_COLORSPACE_RESERVED6) {
strcpy(tx_comm->fmt_attr, "default");
} else {
memset(tx_comm->fmt_attr, 0, sizeof(tx_comm->fmt_attr));
switch (hdev->para->cs) {
case COLORSPACE_RGB444:
case HDMI_COLORSPACE_RGB:
memcpy(tx_comm->fmt_attr, "rgb,", 5);
break;
case COLORSPACE_YUV422:
case HDMI_COLORSPACE_YUV422:
memcpy(tx_comm->fmt_attr, "422,", 5);
break;
case COLORSPACE_YUV444:
case HDMI_COLORSPACE_YUV444:
memcpy(tx_comm->fmt_attr, "444,", 5);
break;
case COLORSPACE_YUV420:
case HDMI_COLORSPACE_YUV420:
memcpy(tx_comm->fmt_attr, "420,", 5);
break;
default:
@@ -7055,7 +7007,6 @@ static int amhdmitx_probe(struct platform_device *pdev)
}
hdev->hdtx_dev = dev;
ret = device_create_file(dev, &dev_attr_disp_mode);
ret = device_create_file(dev, &dev_attr_attr);
ret = device_create_file(dev, &dev_attr_aud_mode);
ret = device_create_file(dev, &dev_attr_vid_mute);
ret = device_create_file(dev, &dev_attr_edid);
@@ -7104,7 +7055,6 @@ static int amhdmitx_probe(struct platform_device *pdev)
ret = device_create_file(dev, &dev_attr_hdcp_rptxlstore);
ret = device_create_file(dev, &dev_attr_div40);
ret = device_create_file(dev, &dev_attr_hdcp_ctrl);
ret = device_create_file(dev, &dev_attr_hpd_state);
ret = device_create_file(dev, &dev_attr_hdmi_used);
ret = device_create_file(dev, &dev_attr_rhpd_state);
ret = device_create_file(dev, &dev_attr_max_exceed);
@@ -7222,6 +7172,9 @@ static int amhdmitx_probe(struct platform_device *pdev)
pr_info(SYS "%s end\n", __func__);
hdmitx_hook_drm(&pdev->dev);
/*everything is ready, create sysfs here.*/
hdmitx_sysfs_common_create(dev, tx_comm);
return r;
}
@@ -7229,6 +7182,9 @@ static int amhdmitx_remove(struct platform_device *pdev)
{
struct device *dev = hdmitx_device.hdtx_dev;
/*remove sysfs before uninit/*/
hdmitx_sysfs_common_destroy(dev);
/*unbind from drm.*/
hdmitx_unhook_drm(&pdev->dev);
@@ -7251,7 +7207,6 @@ static int amhdmitx_remove(struct platform_device *pdev)
/* Remove the cdev */
device_remove_file(dev, &dev_attr_disp_mode);
device_remove_file(dev, &dev_attr_attr);
device_remove_file(dev, &dev_attr_aud_mode);
device_remove_file(dev, &dev_attr_vid_mute);
device_remove_file(dev, &dev_attr_edid);
@@ -7275,7 +7230,6 @@ static int amhdmitx_remove(struct platform_device *pdev)
device_remove_file(dev, &dev_attr_allm_mode);
device_remove_file(dev, &dev_attr_contenttype_cap);
device_remove_file(dev, &dev_attr_contenttype_mode);
device_remove_file(dev, &dev_attr_hpd_state);
device_remove_file(dev, &dev_attr_hdmi_used);
device_remove_file(dev, &dev_attr_fake_plug);
device_remove_file(dev, &dev_attr_rhpd_state);
@@ -29,7 +29,7 @@ static void hdmi_set_vend_spec_infofram(struct hdmitx_dev *hdev,
static struct hdmitx_vidpara hdmi_tx_video_params[] = {
{
.VIC = HDMI_640x480p60,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -40,7 +40,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_480p60,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -51,7 +51,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_480p60_16x9,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -62,7 +62,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_480p60_16x9_rpt,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = HDMI_4_TIMES_REPEAT,
@@ -73,7 +73,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_720p60,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -84,7 +84,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_1080i60,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -95,7 +95,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_480i60,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = HDMI_2_TIMES_REPEAT,
@@ -106,7 +106,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_480i60_16x9,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = HDMI_2_TIMES_REPEAT,
@@ -117,7 +117,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_480i60_16x9_rpt,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = HDMI_4_TIMES_REPEAT,
@@ -128,7 +128,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_1440x480p60,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -139,7 +139,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_1080p60,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -150,7 +150,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_576p50,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -161,7 +161,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_576p50_16x9,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -172,7 +172,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_576p50_16x9_rpt,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = HDMI_4_TIMES_REPEAT,
@@ -183,7 +183,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_720p50,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -194,7 +194,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_1080i50,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -205,7 +205,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_576i50,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = HDMI_2_TIMES_REPEAT,
@@ -216,7 +216,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_576i50_16x9,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = HDMI_2_TIMES_REPEAT,
@@ -227,7 +227,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_576i50_16x9_rpt,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = HDMI_4_TIMES_REPEAT,
@@ -238,7 +238,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_1080p50,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -249,7 +249,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_1080p24,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -260,7 +260,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_1080p25,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -271,7 +271,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_1080p30,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -282,7 +282,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_1080p120,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -293,7 +293,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4k2k_30,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -304,7 +304,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4k2k_25,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -315,7 +315,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4k2k_24,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -326,7 +326,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4k2k_smpte_24,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -337,7 +337,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4096x2160p25_256x135,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -348,7 +348,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4096x2160p30_256x135,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -359,7 +359,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4096x2160p50_256x135,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -370,7 +370,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4096x2160p60_256x135,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -381,7 +381,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4k2k_60,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -392,7 +392,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4k2k_50,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -403,7 +403,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4k2k_60,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -414,7 +414,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4k2k_50,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -425,7 +425,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4k2k_60,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -436,7 +436,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4k2k_50,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -447,7 +447,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4k2k_60_y420,
.color_prefer = COLORSPACE_YUV420,
.color_prefer = HDMI_COLORSPACE_YUV420,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -458,7 +458,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4k2k_50_y420,
.color_prefer = COLORSPACE_YUV420,
.color_prefer = HDMI_COLORSPACE_YUV420,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -469,7 +469,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4k2k_smpte_60_y420,
.color_prefer = COLORSPACE_YUV420,
.color_prefer = HDMI_COLORSPACE_YUV420,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -480,7 +480,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_4k2k_smpte_50_y420,
.color_prefer = COLORSPACE_YUV420,
.color_prefer = HDMI_COLORSPACE_YUV420,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -491,7 +491,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_2560x1080p50_64x27,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -502,7 +502,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMI_2560x1080p60_64x27,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -513,7 +513,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_640x480p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -524,7 +524,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_800x480p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -535,7 +535,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_800x600p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -546,7 +546,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_854x480p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -557,7 +557,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_852x480p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -568,7 +568,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1024x600p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -579,7 +579,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1024x768p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -590,7 +590,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1152x864p75hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -601,7 +601,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1280x600p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -612,7 +612,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1280x768p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -623,7 +623,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1280x800p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -634,7 +634,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1280x960p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -645,7 +645,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1280x1024p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -656,7 +656,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1360x768p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -667,7 +667,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1366x768p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -678,7 +678,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1400x1050p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -689,7 +689,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1440x900p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -700,7 +700,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1440x2560p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -711,7 +711,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1600x900p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -722,7 +722,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1600x1200p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -733,7 +733,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1680x1050p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -744,7 +744,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_1920x1200p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -755,7 +755,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_2048x1080p24hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -766,7 +766,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_2160x1200p90hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -777,7 +777,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_2560x1080p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -788,7 +788,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_2560x1440p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -799,7 +799,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_2560x1600p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -810,7 +810,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_2560x1440p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_BAR_VERT_HORIZ,
.repeat_time = NO_REPEAT,
@@ -821,7 +821,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_3440x1440p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_INVALID,
.repeat_time = NO_REPEAT,
@@ -832,7 +832,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_2400x1200p90hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_INVALID,
.repeat_time = NO_REPEAT,
@@ -843,7 +843,7 @@ static struct hdmitx_vidpara hdmi_tx_video_params[] = {
},
{
.VIC = HDMIV_3840x1080p60hz,
.color_prefer = COLORSPACE_RGB444,
.color_prefer = HDMI_COLORSPACE_RGB,
.color_depth = COLORDEPTH_24B,
.bar_info = B_INVALID,
.repeat_time = NO_REPEAT,
@@ -877,9 +877,9 @@ static void hdmi_tx_construct_avi_packet(struct hdmitx_vidpara *video_param,
ss = video_param->ss;
bar_info = video_param->bar_info;
if (video_param->color == COLORSPACE_YUV444)
if (video_param->color == HDMI_COLORSPACE_YUV444)
color = 2;
else if (video_param->color == COLORSPACE_YUV422)
else if (video_param->color == HDMI_COLORSPACE_YUV422)
color = 1;
else
color = 0;
@@ -957,13 +957,13 @@ int hdmitx_set_display(struct hdmitx_dev *hdev, enum hdmi_vic videocode)
switch (hdev->rxcap.native_Mode & 0x30) {
case 0x20:/*bit5==1, then support YCBCR444 + RGB*/
case 0x30:
param->color = COLORSPACE_YUV444;
param->color = HDMI_COLORSPACE_YUV444;
break;
case 0x10:/*bit4==1, then support YCBCR422 + RGB*/
param->color = COLORSPACE_YUV422;
param->color = HDMI_COLORSPACE_YUV422;
break;
default:
param->color = COLORSPACE_RGB444;
param->color = HDMI_COLORSPACE_RGB;
}
/* For Y420 modes */
switch (videocode) {
@@ -971,19 +971,19 @@ int hdmitx_set_display(struct hdmitx_dev *hdev, enum hdmi_vic videocode)
case HDMI_3840x2160p60_16x9_Y420:
case HDMI_4096x2160p50_256x135_Y420:
case HDMI_4096x2160p60_256x135_Y420:
param->color = COLORSPACE_YUV420;
param->color = HDMI_COLORSPACE_YUV420;
break;
default:
break;
}
if (param->color == COLORSPACE_RGB444) {
if (param->color == HDMI_COLORSPACE_RGB) {
hdev->para->cs = hdev->cur_video_param->color;
pr_info(VID "rx edid only support RGB format\n");
}
if (videocode >= HDMITX_VESA_OFFSET) {
hdev->para->cs = COLORSPACE_RGB444;
hdev->para->cs = HDMI_COLORSPACE_RGB;
hdev->para->cd = COLORDEPTH_24B;
pr_info("hdmitx: VESA only support RGB format\n");
}
@@ -99,7 +99,7 @@ static enum hdmi_vic get_vic_from_pkt(void);
/* VSYNC polarity: active high */
#define VSYNC_POLARITY 1
/* Pixel format: 0=RGB444; 1=YCbCr444; 2=Rsrv; 3=YCbCr422. */
#define TX_INPUT_COLOR_FORMAT COLORSPACE_YUV444
#define TX_INPUT_COLOR_FORMAT HDMI_COLORSPACE_YUV444
/* Pixel range: 0=16-235/240; 1=16-240; 2=1-254; 3=0-255. */
#define TX_INPUT_COLOR_RANGE 0
/* Pixel bit width: 4=24-bit; 5=30-bit; 6=36-bit; 7=48-bit. */
@@ -478,20 +478,20 @@ static void hdmi_hwp_init(struct hdmitx_dev *hdev)
/* Get uboot output color space from AVI */
switch (hdmitx_rd_reg(HDMITX_DWC_FC_AVICONF0) & 0x3) {
case 1:
hdev->para->cs = COLORSPACE_YUV422;
hdev->para->cs = HDMI_COLORSPACE_YUV422;
break;
case 2:
hdev->para->cs = COLORSPACE_YUV444;
hdev->para->cs = HDMI_COLORSPACE_YUV444;
break;
case 3:
hdev->para->cs = COLORSPACE_YUV420;
hdev->para->cs = HDMI_COLORSPACE_YUV420;
break;
default:
hdev->para->cs = COLORSPACE_RGB444;
hdev->para->cs = HDMI_COLORSPACE_RGB;
break;
}
/* If color space is not 422, then get depth from VP_PR_CD */
if (hdev->para->cs != COLORSPACE_YUV422) {
if (hdev->para->cs != HDMI_COLORSPACE_YUV422) {
switch ((hdmitx_rd_reg(HDMITX_DWC_VP_PR_CD) >> 4) &
0xf) {
case 5:
@@ -526,7 +526,7 @@ static void hdmi_hwp_init(struct hdmitx_dev *hdev)
}
} else {
hdev->para->cd = COLORDEPTH_RESERVED;
hdev->para->cs = COLORSPACE_RESERVED;
hdev->para->cs = HDMI_COLORSPACE_RESERVED6;
/* reset HDMITX APB & TX & PHY */
hdmitx_sys_reset();
if (hdev->data->chip_type < MESON_CPU_ID_G12A) {
@@ -1967,7 +1967,7 @@ do { \
case HDMI_3840x2160p60_16x9:
case HDMI_4096x2160p50_256x135:
case HDMI_4096x2160p60_256x135:
if (hdev->para->cs != COLORSPACE_YUV420)
if (hdev->para->cs != HDMI_COLORSPACE_YUV420)
set_phy_by_mode(HDMI_PHYPARA_6G);
else
if (hdev->para->cd == COLORDEPTH_36B)
@@ -1996,7 +1996,7 @@ do { \
case HDMI_4k2k_smpte_24:
case HDMI_4096x2160p25_256x135:
case HDMI_4096x2160p30_256x135:
if (hdev->para->cs == COLORSPACE_YUV422 ||
if (hdev->para->cs == HDMI_COLORSPACE_YUV422 ||
hdev->para->cd == COLORDEPTH_24B)
set_phy_by_mode(HDMI_PHYPARA_3G);
else
@@ -2044,7 +2044,7 @@ static void hdmitx_set_scdc(struct hdmitx_dev *hdev)
case HDMI_3840x2160p60_16x9:
case HDMI_4096x2160p50_256x135:
case HDMI_4096x2160p60_256x135:
if (hdev->para->cs == COLORSPACE_YUV420 &&
if (hdev->para->cs == HDMI_COLORSPACE_YUV420 &&
hdev->para->cd == COLORDEPTH_24B)
hdev->para->tmds_clk_div40 = 0;
else
@@ -2070,7 +2070,7 @@ static void hdmitx_set_scdc(struct hdmitx_dev *hdev)
case HDMI_3840x2160p30_16x9:
case HDMI_3840x2160p30_64x27:
case HDMI_4096x2160p30_256x135:
if (hdev->para->cs == COLORSPACE_YUV422 ||
if (hdev->para->cs == HDMI_COLORSPACE_YUV422 ||
hdev->para->cd == COLORDEPTH_24B)
hdev->para->tmds_clk_div40 = 0;
else
@@ -2133,11 +2133,11 @@ void hdmitx_set_enc_hw(struct hdmitx_dev *hdev)
/* [ 3: 2] chroma_dnsmp. 0=use pixel 0; 1=use pixel 1; 2=use average. */
/* [ 5] hdmi_dith_md: random noise selector. */
hd_write_reg(P_VPU_HDMI_FMT_CTRL, (((TX_INPUT_COLOR_FORMAT ==
COLORSPACE_YUV420) ? 2 : 0) << 0) | (2 << 2) |
HDMI_COLORSPACE_YUV420) ? 2 : 0) << 0) | (2 << 2) |
(0 << 4) | /* [4]dith_en: disable dithering */
(0 << 5) |
(0 << 6)); /* [ 9: 6] hdmi_dith10_cntl. */
if (hdev->para->cs == COLORSPACE_YUV420) {
if (hdev->para->cs == HDMI_COLORSPACE_YUV420) {
hd_set_reg_bits(P_VPU_HDMI_FMT_CTRL, 2, 0, 2);
hd_set_reg_bits(P_VPU_HDMI_SETTING, 0, 4, 4);
hd_set_reg_bits(P_VPU_HDMI_SETTING, 1, 8, 1);
@@ -2146,7 +2146,7 @@ void hdmitx_set_enc_hw(struct hdmitx_dev *hdev)
hd_set_reg_bits(P_VPU_HDMI_SETTING, 0, 8, 1);
}
if (hdev->para->cs == COLORSPACE_YUV422) {
if (hdev->para->cs == HDMI_COLORSPACE_YUV422) {
hd_set_reg_bits(P_VPU_HDMI_FMT_CTRL, 1, 0, 2);
hd_set_reg_bits(P_VPU_HDMI_SETTING, 0, 4, 4);
}
@@ -2651,7 +2651,7 @@ static void set_aud_acr_pkt(struct hdmitx_dev *hdev,
char_rate = hdev->para->timing.frac_freq;
else
char_rate = hdev->para->timing.pixel_freq;
if (hdev->para->cs == COLORSPACE_YUV422)
if (hdev->para->cs == HDMI_COLORSPACE_YUV422)
aud_n_para = hdmi_get_aud_n_paras(audio_param->sample_rate,
COLORDEPTH_24B, char_rate);
else
@@ -3092,7 +3092,7 @@ static void mode420_half_horizontal_para(void)
static void hdmitx_set_fake_vic(struct hdmitx_dev *hdev)
{
hdev->para->cs = COLORSPACE_YUV444;
hdev->para->cs = HDMI_COLORSPACE_YUV444;
hdev->cur_VIC = HDMI_VIC_FAKE;
set_vmode_clk(hdev);
}
@@ -4061,7 +4061,7 @@ static int hdmitx_hdmi_dvi_config(struct hdmitx_dev *hdev,
{
if (dvi_mode == 1) {
hdmitx_csc_config(TX_INPUT_COLOR_FORMAT,
COLORSPACE_RGB444, TX_COLOR_DEPTH);
HDMI_COLORSPACE_RGB, TX_COLOR_DEPTH);
/* set dvi flag */
hdmitx_set_reg_bits(HDMITX_DWC_FC_INVIDCONF, 0, 3, 1);
@@ -4645,7 +4645,7 @@ static void config_hdmi20_tx(enum hdmi_vic vic,
hdmitx_wr_reg(HDMITX_TOP_BIST_CNTL, data32);
/* Configure video */
if (input_color_format == COLORSPACE_RGB444) {
if (input_color_format == HDMI_COLORSPACE_RGB) {
if (color_depth == COLORDEPTH_24B)
vid_map = 0x01;
else if (color_depth == COLORDEPTH_30B)
@@ -4654,9 +4654,9 @@ static void config_hdmi20_tx(enum hdmi_vic vic,
vid_map = 0x05;
else
vid_map = 0x07;
} else if (((input_color_format == COLORSPACE_YUV444) ||
(input_color_format == COLORSPACE_YUV420)) &&
(output_color_format != COLORSPACE_YUV422)) {
} else if (((input_color_format == HDMI_COLORSPACE_YUV444) ||
(input_color_format == HDMI_COLORSPACE_YUV420)) &&
(output_color_format != HDMI_COLORSPACE_YUV422)) {
if (color_depth == COLORDEPTH_24B)
vid_map = 0x09;
else if (color_depth == COLORDEPTH_30B)
@@ -4691,7 +4691,7 @@ static void config_hdmi20_tx(enum hdmi_vic vic,
case HDMI_720x576i200_16x9:
case HDMI_720x480i240_4x3:
case HDMI_720x480i240_16x9:
if (output_color_format == COLORSPACE_YUV422) {
if (output_color_format == HDMI_COLORSPACE_YUV422) {
if (color_depth == COLORDEPTH_24B)
vid_map = 0x09;
if (color_depth == COLORDEPTH_30B)
@@ -4729,8 +4729,8 @@ static void config_hdmi20_tx(enum hdmi_vic vic,
hdmitx_wr_reg(HDMITX_DWC_MC_FLOWCTRL, data32);
data32 = 0;
data32 |= ((((input_color_format == COLORSPACE_YUV422) &&
(output_color_format != COLORSPACE_YUV422)) ? 2 : 0) << 4);
data32 |= ((((input_color_format == HDMI_COLORSPACE_YUV422) &&
(output_color_format != HDMI_COLORSPACE_YUV422)) ? 2 : 0) << 4);
hdmitx_wr_reg(HDMITX_DWC_CSC_CFG, data32);
hdmitx_csc_config(input_color_format, output_color_format, color_depth);
/* The time of the LG49UF6600 TV processing AVI infoframe is particular.
@@ -4744,7 +4744,7 @@ static void config_hdmi20_tx(enum hdmi_vic vic,
/* Video Packet color depth and pixel repetition */
data32 = 0;
data32 |= (((output_color_format == COLORSPACE_YUV422) ?
data32 |= (((output_color_format == HDMI_COLORSPACE_YUV422) ?
COLORDEPTH_24B : color_depth) << 4);
data32 |= (0 << 0);
/* HDMI1.4 CTS7-19, CD of GCP for Y422 should be 0 */
@@ -4765,7 +4765,7 @@ static void config_hdmi20_tx(enum hdmi_vic vic,
data32 |= (((color_depth == COLORDEPTH_30B) ? 1 :
(color_depth == COLORDEPTH_36B) ? 2 : 0) << 0);
hdmitx_wr_reg(HDMITX_DWC_VP_REMAP, data32);
if (output_color_format == COLORSPACE_YUV422) {
if (output_color_format == HDMI_COLORSPACE_YUV422) {
switch (color_depth) {
case COLORDEPTH_36B:
tmp = 2;
@@ -4783,15 +4783,15 @@ static void config_hdmi20_tx(enum hdmi_vic vic,
/* Video Packet configuration */
data32 = 0;
data32 |= ((((output_color_format != COLORSPACE_YUV422) &&
data32 |= ((((output_color_format != HDMI_COLORSPACE_YUV422) &&
(color_depth == COLORDEPTH_24B)) ? 1 : 0) << 6);
data32 |= ((((output_color_format == COLORSPACE_YUV422) ||
data32 |= ((((output_color_format == HDMI_COLORSPACE_YUV422) ||
(color_depth == COLORDEPTH_24B)) ? 0 : 1) << 5);
data32 |= (0 << 4);
data32 |= (((output_color_format == COLORSPACE_YUV422) ? 1 : 0)
data32 |= (((output_color_format == HDMI_COLORSPACE_YUV422) ? 1 : 0)
<< 3);
data32 |= (1 << 2);
data32 |= (((output_color_format == COLORSPACE_YUV422) ? 1 :
data32 |= (((output_color_format == HDMI_COLORSPACE_YUV422) ? 1 :
(color_depth == COLORDEPTH_24B) ? 2 : 0) << 0);
hdmitx_wr_reg(HDMITX_DWC_VP_CONF, data32);
@@ -4913,7 +4913,7 @@ static void config_hdmi20_tx(enum hdmi_vic vic,
data32 = t->v_sync & 0x3f;
hdmitx_wr_reg(HDMITX_DWC_FC_VSYNCINWIDTH, data32);
if (hdev->para->cs == COLORSPACE_YUV420)
if (hdev->para->cs == HDMI_COLORSPACE_YUV420)
mode420_half_horizontal_para();
/* control period duration (typ 12 tmds periods) */
@@ -4944,16 +4944,16 @@ static void config_hdmi20_tx(enum hdmi_vic vic,
data32 |= (0x2 << 0); /* FIXED YCBCR 444 */
hdmitx_wr_reg(HDMITX_DWC_FC_AVICONF0, data32);
switch (output_color_format) {
case COLORSPACE_RGB444:
case HDMI_COLORSPACE_RGB:
tmp = 0;
break;
case COLORSPACE_YUV422:
case HDMI_COLORSPACE_YUV422:
tmp = 1;
break;
case COLORSPACE_YUV420:
case HDMI_COLORSPACE_YUV420:
tmp = 3;
break;
case COLORSPACE_YUV444:
case HDMI_COLORSPACE_YUV444:
default:
tmp = 2;
break;
@@ -5004,7 +5004,7 @@ static void config_hdmi20_tx(enum hdmi_vic vic,
hdev->hwop.cntlconfig(hdev, CONF_AVI_BT2020, SET_AVI_BT2020);
data32 = 0;
data32 |= (((0 == COLORRANGE_FUL) ? 1 : 0) << 2);
data32 |= (((0 == HDMI_QUANTIZATION_RANGE_FULL) ? 1 : 0) << 2);
data32 |= (0 << 0);
hdmitx_wr_reg(HDMITX_DWC_FC_AVICONF3, data32);
@@ -5311,12 +5311,12 @@ static void hdmitx_csc_config(unsigned char input_color_format,
unsigned long csc_coeff_c1, csc_coeff_c2, csc_coeff_c3, csc_coeff_c4;
unsigned long data32;
conv_en = (((input_color_format == COLORSPACE_RGB444) ||
(output_color_format == COLORSPACE_RGB444)) &&
conv_en = (((input_color_format == HDMI_COLORSPACE_RGB) ||
(output_color_format == HDMI_COLORSPACE_RGB)) &&
(input_color_format != output_color_format)) ? 1 : 0;
if (conv_en) {
if (output_color_format == COLORSPACE_RGB444) {
if (output_color_format == HDMI_COLORSPACE_RGB) {
csc_coeff_a1 = 0x2000;
csc_coeff_a2 = 0x6926;
csc_coeff_a3 = 0x74fd;
@@ -5340,7 +5340,7 @@ static void hdmitx_csc_config(unsigned char input_color_format,
(color_depth == COLORDEPTH_36B) ? 0x63a6 :
(color_depth == COLORDEPTH_48B) ? 0x63a6 : 0x7e3b;
csc_scale = 1;
} else { /* input_color_format == COLORSPACE_RGB444 */
} else { /* input_color_format == HDMI_COLORSPACE_RGB */
csc_coeff_a1 = 0x2591;
csc_coeff_a2 = 0x1322;
csc_coeff_a3 = 0x074b;
@@ -5412,16 +5412,16 @@ static void hdmitx_csc_config(unsigned char input_color_format,
/* set rgb_ycc indicator */
switch (output_color_format) {
case COLORSPACE_RGB444:
case HDMI_COLORSPACE_RGB:
rgb_ycc_indicator = 0x0;
break;
case COLORSPACE_YUV422:
case HDMI_COLORSPACE_YUV422:
rgb_ycc_indicator = 0x1;
break;
case COLORSPACE_YUV420:
case HDMI_COLORSPACE_YUV420:
rgb_ycc_indicator = 0x3;
break;
case COLORSPACE_YUV444:
case HDMI_COLORSPACE_YUV444:
default:
rgb_ycc_indicator = 0x2;
break;
@@ -911,11 +911,11 @@ static void hdmitx_set_clk_(struct hdmitx_dev *hdev)
int j = 0;
struct hw_enc_clk_val_group *p_enc = NULL;
enum hdmi_vic vic = hdev->cur_VIC;
enum hdmi_color_space cs = hdev->para->cs;
enum hdmi_colorspace cs = hdev->para->cs;
enum hdmi_color_depth cd = hdev->para->cd;
/* YUV 422 always use 24B mode */
if (cs == COLORSPACE_YUV422)
if (cs == HDMI_COLORSPACE_YUV422)
cd = COLORDEPTH_24B;
if (hdev->flag_3dfp) {
@@ -94,7 +94,7 @@ static bool set_hpll_hclk_v1(unsigned int m, unsigned int frac_val)
hdev->para->vic == HDMI_3840x2160p60_16x9 ||
hdev->para->vic == HDMI_3840x2160p50_64x27 ||
hdev->para->vic == HDMI_3840x2160p60_64x27) &&
hdev->para->cs != COLORSPACE_YUV420) {
hdev->para->cs != HDMI_COLORSPACE_YUV420) {
hd_write_reg(P_HHI_HDMI_PLL_CNTL3, 0x6a685c00);
hd_write_reg(P_HHI_HDMI_PLL_CNTL4, 0x11551293);
} else {
@@ -110,7 +110,7 @@ static bool set_hpll_hclk_v1(unsigned int m, unsigned int frac_val)
hdev->para->vic == HDMI_3840x2160p60_64x27 ||
hdev->para->vic == HDMI_4096x2160p50_256x135 ||
hdev->para->vic == HDMI_4096x2160p60_256x135) &&
hdev->para->cs != COLORSPACE_YUV420) {
hdev->para->cs != HDMI_COLORSPACE_YUV420) {
hd_write_reg(P_HHI_HDMI_PLL_CNTL3, 0x6a685c00);
hd_write_reg(P_HHI_HDMI_PLL_CNTL4, 0x11551293);
} else {
@@ -171,7 +171,7 @@ static bool set_hpll_hclk_v3(unsigned int m, unsigned int frac_val)
static inline int is_dongle_mode(struct hdmitx_dev *hdev)
{
return hdev->dongle_mode &&
(hdev->para->cs == COLORSPACE_YUV422 ||
(hdev->para->cs == HDMI_COLORSPACE_YUV422 ||
hdev->para->cd == COLORDEPTH_24B) &&
(hdev->cur_VIC == HDMI_1280x720p50_16x9 ||
hdev->cur_VIC == HDMI_1280x720p60_16x9 ||
@@ -52,7 +52,7 @@ static bool set_hpll_hclk_v1(unsigned int m, unsigned int frac_val)
hdev->para->vic == HDMI_3840x2160p60_16x9 ||
hdev->para->vic == HDMI_3840x2160p50_64x27 ||
hdev->para->vic == HDMI_3840x2160p60_64x27) &&
hdev->para->cs != COLORSPACE_YUV420) {
hdev->para->cs != HDMI_COLORSPACE_YUV420) {
hd_write_reg(P_ANACTRL_HDMIPLL_CTRL3, 0x6a685c00);
hd_write_reg(P_ANACTRL_HDMIPLL_CTRL4, 0x11551293);
} else {
@@ -67,7 +67,7 @@ static bool set_hpll_hclk_v1(unsigned int m, unsigned int frac_val)
hdev->para->vic == HDMI_3840x2160p60_64x27 ||
hdev->para->vic == HDMI_4096x2160p50_256x135 ||
hdev->para->vic == HDMI_4096x2160p60_256x135) &&
hdev->para->cs != COLORSPACE_YUV420) {
hdev->para->cs != HDMI_COLORSPACE_YUV420) {
hd_write_reg(P_ANACTRL_HDMIPLL_CTRL3, 0x6a685c00);
hd_write_reg(P_ANACTRL_HDMIPLL_CTRL4, 0x11551293);
} else {
+5 -5
View File
@@ -33,15 +33,15 @@ static struct parse_cs parse_cs_[] = {
};
static struct parse_cr parse_cr_[] = {
{COLORRANGE_LIM, "limit",},
{COLORRANGE_FUL, "full",},
{HDMI_QUANTIZATION_RANGE_LIMITED, "limit",},
{HDMI_QUANTIZATION_RANGE_FULL, "full",},
};
/* parse the name string to cs/cd/cr */
static void _parse_hdmi_attr(char const *name,
enum hdmi_colorspace *cs,
enum hdmi_color_depth *cd,
enum hdmi_color_range *cr)
enum hdmi_quantization_range *cr)
{
int i;
@@ -51,7 +51,7 @@ static void _parse_hdmi_attr(char const *name,
/* assign defalut value*/
*cs = HDMI_COLORSPACE_RGB;
*cd = COLORDEPTH_24B;
*cr = COLORRANGE_FUL;
*cr = HDMI_QUANTIZATION_RANGE_FULL;
return;
}
@@ -86,7 +86,7 @@ static void _parse_hdmi_attr(char const *name,
}
/* set default value */
if (i == sizeof(parse_cr_) / sizeof(struct parse_cr))
*cr = COLORRANGE_FUL;
*cr = HDMI_QUANTIZATION_RANGE_FULL;
}
static u32 _calc_tmds_clk(u32 pixel_freq, enum hdmi_colorspace cs,
+9 -66
View File
@@ -56,6 +56,7 @@
#include <../../vin/tvin/tvin_global.h>
#include <hdmitx_boot_parameters.h>
#include <hdmitx_drm_hook.h>
#include <hdmitx_sysfs_common.h>
#define HDMI_TX_COUNT 32
#define HDMI_TX_POOL_NUM 6
@@ -769,60 +770,14 @@ static ssize_t disp_mode_store(struct device *dev,
return count;
}
static ssize_t attr_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
int pos = 0;
struct hdmitx_dev *hdev = get_hdmitx21_device();
struct hdmitx_common *tx_comm = &hdev->tx_comm;
if (!memcmp(tx_comm->fmt_attr, "default,", 7)) {
memset(tx_comm->fmt_attr, 0,
sizeof(tx_comm->fmt_attr));
hdmitx21_fmt_attr(hdev);
}
pos += snprintf(buf + pos, PAGE_SIZE, "%s\n\r", tx_comm->fmt_attr);
return pos;
}
static ssize_t attr_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct hdmitx_dev *hdev = get_hdmitx21_device();
struct hdmitx_common *tx_comm = &hdev->tx_comm;
strncpy(tx_comm->fmt_attr, buf, sizeof(tx_comm->fmt_attr));
tx_comm->fmt_attr[15] = '\0';
if (!memcmp(tx_comm->fmt_attr, "rgb", 3))
hdev->para->cs = HDMI_COLORSPACE_RGB;
else if (!memcmp(tx_comm->fmt_attr, "422", 3))
hdev->para->cs = HDMI_COLORSPACE_YUV422;
else if (!memcmp(tx_comm->fmt_attr, "420", 3))
hdev->para->cs = HDMI_COLORSPACE_YUV420;
else
hdev->para->cs = HDMI_COLORSPACE_YUV444;
return count;
}
/*aud_mode attr*/
void setup21_attr(const char *buf)
{
char attr[16] = {0};
struct hdmitx_dev *hdev = get_hdmitx21_device();
struct hdmitx_common *tx_comm = &hdev->tx_comm;
memcpy(attr, buf, sizeof(attr));
memcpy(tx_comm->fmt_attr, attr, sizeof(tx_comm->fmt_attr));
hdmitx_setup_attr(&get_hdmitx21_device()->tx_comm, buf);
}
void get21_attr(char attr[16])
{
struct hdmitx_dev *hdev = get_hdmitx21_device();
struct hdmitx_common *tx_comm = &hdev->tx_comm;
memcpy(attr, tx_comm->fmt_attr, sizeof(tx_comm->fmt_attr));
hdmitx_get_attr(&get_hdmitx21_device()->tx_comm, attr);
}
/*edid attr*/
@@ -3983,17 +3938,6 @@ static ssize_t hdcp_ver_show(struct device *dev,
return pos;
}
static ssize_t hpd_state_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
int pos = 0;
struct hdmitx_dev *hdev = get_hdmitx21_device();
pos += snprintf(buf + pos, PAGE_SIZE, "%d",
hdev->tx_comm.hpd_state);
return pos;
}
static ssize_t rxsense_state_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -4138,7 +4082,6 @@ static ssize_t hdmitx21_show(struct device *dev,
}
static DEVICE_ATTR_RW(disp_mode);
static DEVICE_ATTR_RW(attr);
static DEVICE_ATTR_RW(vid_mute);
static DEVICE_ATTR_RW(edid);
static DEVICE_ATTR_RO(rawedid);
@@ -4177,7 +4120,6 @@ static DEVICE_ATTR_RW(hdcp_type_policy);
static DEVICE_ATTR_RW(hdcp_lstore);
static DEVICE_ATTR_RO(hdmi_repeater_tx);
static DEVICE_ATTR_RW(div40);
static DEVICE_ATTR_RO(hpd_state);
static DEVICE_ATTR_RO(hdmi_used);
static DEVICE_ATTR_RO(rxsense_state);
static DEVICE_ATTR_RW(fake_plug);
@@ -5485,7 +5427,6 @@ static int amhdmitx_probe(struct platform_device *pdev)
}
hdev->hdtx_dev = dev;
ret = device_create_file(dev, &dev_attr_disp_mode);
ret = device_create_file(dev, &dev_attr_attr);
ret = device_create_file(dev, &dev_attr_vid_mute);
ret = device_create_file(dev, &dev_attr_edid);
ret = device_create_file(dev, &dev_attr_rawedid);
@@ -5518,7 +5459,6 @@ static int amhdmitx_probe(struct platform_device *pdev)
ret = device_create_file(dev, &dev_attr_hdmi_repeater_tx);
ret = device_create_file(dev, &dev_attr_hdcp_lstore);
ret = device_create_file(dev, &dev_attr_div40);
ret = device_create_file(dev, &dev_attr_hpd_state);
ret = device_create_file(dev, &dev_attr_hdmi_used);
ret = device_create_file(dev, &dev_attr_fake_plug);
ret = device_create_file(dev, &dev_attr_ready);
@@ -5623,10 +5563,12 @@ static int amhdmitx_probe(struct platform_device *pdev)
/*bind to drm.*/
hdmitx_hook_drm(&pdev->dev);
tee_comm_dev_reg(hdev);
pr_info("%s end\n", __func__);
/*everything is ready, create sysfs here.*/
hdmitx_sysfs_common_create(dev, &hdev->tx_comm);
return r;
}
@@ -5635,6 +5577,9 @@ static int amhdmitx_remove(struct platform_device *pdev)
struct hdmitx_dev *hdev = get_hdmitx21_device();
struct device *dev = hdev->hdtx_dev;
/*remove sysfs before uninit/*/
hdmitx_sysfs_common_destroy(dev);
tee_comm_dev_unreg(hdev);
/*unbind from drm.*/
hdmitx_unhook_drm(&pdev->dev);
@@ -5661,7 +5606,6 @@ static int amhdmitx_remove(struct platform_device *pdev)
/* Remove the cdev */
device_remove_file(dev, &dev_attr_disp_mode);
device_remove_file(dev, &dev_attr_attr);
device_remove_file(dev, &dev_attr_vid_mute);
device_remove_file(dev, &dev_attr_edid);
device_remove_file(dev, &dev_attr_rawedid);
@@ -5685,7 +5629,6 @@ static int amhdmitx_remove(struct platform_device *pdev)
device_remove_file(dev, &dev_attr_contenttype_cap);
device_remove_file(dev, &dev_attr_contenttype_mode);
device_remove_file(dev, &dev_attr_ll_mode);
device_remove_file(dev, &dev_attr_hpd_state);
device_remove_file(dev, &dev_attr_hdmi_used);
device_remove_file(dev, &dev_attr_fake_plug);
device_remove_file(dev, &dev_attr_ready);
+1 -1
View File
@@ -116,7 +116,7 @@ int hdmitx21_set_display(struct hdmitx_dev *hdev, enum hdmi_vic videocode)
case HDMI_97_3840x2160p60_16x9:
case HDMI_101_4096x2160p50_256x135:
case HDMI_102_4096x2160p60_256x135:
//param->cs = COLORSPACE_YUV420; /* TODO */
//param->cs = HDMI_COLORSPACE_YUV420; /* TODO */
break;
default:
break;
+2 -7
View File
@@ -2059,11 +2059,6 @@ static void hdmi_phy_wakeup(struct hdmitx_dev *hdev)
#define HDMI_COLOR_DEPTH_36B 6
#define HDMI_COLOR_DEPTH_48B 7
#define HDMI_COLOR_FORMAT_RGB 0
#define HDMI_COLORSPACE_YUV422 1
#define HDMI_COLOR_FORMAT_444 2
#define HDMI_COLORSPACE_YUV420 3
#define HDMI_COLOR_RANGE_LIM 0
#define HDMI_COLOR_RANGE_FUL 1
@@ -2086,10 +2081,10 @@ static void config_hdmi21_tx(struct hdmitx_dev *hdev)
u8 color_depth = COLORDEPTH_24B; // Pixel bit width: 4=24-bit; 5=30-bit; 6=36-bit; 7=48-bit.
// Pixel format: 0=RGB444; 1=YCbCr422; 2=YCbCr444; 3=YCbCr420.
u8 input_color_format = HDMI_COLORSPACE_YUV444;
u8 input_color_range = COLORRANGE_LIM; // Pixel range: 0=limited; 1=full.
u8 input_color_range = HDMI_QUANTIZATION_RANGE_LIMITED; // Pixel range: 0=limited; 1=full.
// Pixel format: 0=RGB444; 1=YCbCr422; 2=YCbCr444; 3=YCbCr420.
u8 output_color_format = HDMI_COLORSPACE_YUV444;
u8 output_color_range = COLORRANGE_LIM; // Pixel range: 0=limited; 1=full.
u8 output_color_range = HDMI_QUANTIZATION_RANGE_LIMITED; // Pixel range: 0=limited; 1=full.
u32 active_pixels = 1920; // Number of active pixels per line
u32 active_lines = 1080; // Number of active lines per field
// 0=I2S 2-channel; 1=I2S 4 x 2-channel; 2=channel 0/1, 4/5 valid.
+2 -1
View File
@@ -2,4 +2,5 @@
$(MEDIA_MODULE_NAME)-$(CONFIG_AMLOGIC_HDMITX_COMMON) += vout/hdmitx_common/hdmitx_boot_parameters.o \
vout/hdmitx_common/hdmitx_common.o \
vout/hdmitx_common/hdmitx_drm_hook.o
vout/hdmitx_common/hdmitx_drm_hook.o \
vout/hdmitx_common/hdmitx_sysfs_common.o
@@ -52,7 +52,7 @@ int hdmitx_setup_attr(struct hdmitx_common *tx_comm, const char *buf)
{
char attr[16] = {0};
memcpy(attr, buf, sizeof(attr) - 1);
memcpy(attr, buf, sizeof(attr));
memcpy(tx_comm->fmt_attr, attr, sizeof(tx_comm->fmt_attr));
return 0;
}
@@ -0,0 +1,72 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
* Copyright (c) 2019 Amlogic, Inc. All rights reserved.
*/
#include "hdmitx_sysfs_common.h"
/*!!Only one instance supported.*/
static struct hdmitx_common *global_tx_common;
/************************common sysfs*************************/
static ssize_t attr_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
int pos = 0;
char fmt_attr[16];
hdmitx_get_attr(global_tx_common, fmt_attr);
pos = snprintf(buf, PAGE_SIZE, "%s\n\r", fmt_attr);
return pos;
}
static ssize_t attr_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
hdmitx_setup_attr(global_tx_common, buf);
return count;
}
static DEVICE_ATTR_RW(attr);
static ssize_t hpd_state_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
int pos = 0;
pos += snprintf(buf + pos, PAGE_SIZE, "%d",
global_tx_common->hpd_state);
return pos;
}
static DEVICE_ATTR_RO(hpd_state);
/*************************tx20 sysfs*************************/
/*************************tx21 sysfs*************************/
int hdmitx_sysfs_common_create(struct device *dev,
struct hdmitx_common *tx_comm)
{
int ret = 0;
global_tx_common = tx_comm;
ret = device_create_file(dev, &dev_attr_attr);
ret = device_create_file(dev, &dev_attr_hpd_state);
return ret;
}
int hdmitx_sysfs_common_destroy(struct device *dev)
{
device_remove_file(dev, &dev_attr_attr);
device_remove_file(dev, &dev_attr_hpd_state);
global_tx_common = 0;
return 0;
}
@@ -0,0 +1,16 @@
/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
/*
* Copyright (c) 2019 Amlogic, Inc. All rights reserved.
*/
#ifndef __HDMITX_SYSFS_COMMON_H
#define __HDMITX_SYSFS_COMMON_H
#include <linux/amlogic/media/vout/hdmitx_common/hdmitx_common.h>
int hdmitx_sysfs_common_create(struct device *dev,
struct hdmitx_common *tx_comm);
int hdmitx_sysfs_common_destroy(struct device *dev);
#endif
@@ -8,6 +8,7 @@
#include <linux/amlogic/media/vout/vinfo.h>
#include <linux/amlogic/media/vout/hdmi_tx_ext.h>
#include <linux/amlogic/media/vout/hdmitx_common/hdmitx_common.h>
/* HDMI VIC definitions */
@@ -298,22 +299,6 @@ struct hdmi_cea_timing {
unsigned short v_sync_ln;
};
enum hdmi_color_depth {
COLORDEPTH_24B = 4,
COLORDEPTH_30B = 5,
COLORDEPTH_36B = 6,
COLORDEPTH_48B = 7,
COLORDEPTH_RESERVED,
};
enum hdmi_color_space {
COLORSPACE_RGB444 = 0,
COLORSPACE_YUV422 = 1,
COLORSPACE_YUV444 = 2,
COLORSPACE_YUV420 = 3,
COLORSPACE_RESERVED,
};
enum hdmi_hdr_status {
HDR10PLUS_VSIF = 0,
dolbyvision_std = 1,
@@ -324,11 +309,6 @@ enum hdmi_hdr_status {
SDR,
};
enum hdmi_color_range {
COLORRANGE_LIM,
COLORRANGE_FUL,
};
enum hdmi_3d_type {
T3D_FRAME_PACKING = 0,
T3D_FIELD_ALTER = 1,
@@ -352,8 +332,8 @@ struct hdmi_format_para {
unsigned char *sname;
char ext_name[32];
enum hdmi_color_depth cd; /* cd8, cd10 or cd12 */
enum hdmi_color_space cs; /* rgb, y444, y422, y420 */
enum hdmi_color_range cr; /* limit, full */
enum hdmi_colorspace cs; /* rgb, y444, y422, y420 */
enum hdmi_quantization_range cr; /* limit, full */
unsigned int pixel_repetition_factor;
unsigned int progress_mode:1;
unsigned int scrambler_en:1;
@@ -561,12 +541,12 @@ struct parse_cd {
};
struct parse_cs {
enum hdmi_color_space cs;
enum hdmi_colorspace cs;
const char *name;
};
struct parse_cr {
enum hdmi_color_range cr;
enum hdmi_quantization_range cr;
const char *name;
};
@@ -67,7 +67,7 @@ enum hdmi_scaling {
struct hdmi_videoinfo {
enum hdmi_vic VIC;
enum hdmi_color_space color;
enum hdmi_colorspace color;
enum hdmi_color_depth color_depth;
enum hdmi_barinfo bar_info;
enum hdmi_pixel_repeat repeat_time;
@@ -190,8 +190,8 @@ struct hdmitx_supspeakerformat {
struct hdmitx_vidpara {
unsigned int VIC;
enum hdmi_color_space color_prefer;
enum hdmi_color_space color;
enum hdmi_colorspace color_prefer;
enum hdmi_colorspace color;
enum hdmi_color_depth color_depth;
enum hdmi_barinfo bar_info;
enum hdmi_pixel_repeat repeat_time;
@@ -569,7 +569,7 @@ struct hdmitx_dev {
#define CONF_AVI_BT2020 (CMD_CONF_OFFSET + 0X2000 + 0x00)
#define CLR_AVI_BT2020 0x0
#define SET_AVI_BT2020 0x1
/* set value as COLORSPACE_RGB444, YUV422, YUV444, YUV420 */
/* set value as HDMI_COLORSPACE_RGB, YUV422, YUV444, YUV420 */
#define CONF_AVI_RGBYCC_INDIC (CMD_CONF_OFFSET + 0X2000 + 0x01)
#define CONF_AVI_Q01 (CMD_CONF_OFFSET + 0X2000 + 0x02)
#define RGB_RANGE_DEFAULT 0
@@ -9,6 +9,7 @@
#include <linux/hdmi.h>
#include <linux/amlogic/media/vout/vinfo.h>
#include <linux/amlogic/media/vout/hdmi_tx_ext.h>
#include <linux/amlogic/media/vout/hdmitx_common/hdmitx_common.h>
/* HDMI VIC definitions */
@@ -291,19 +292,6 @@ struct hdmi_timing {
unsigned short v_pixel;
};
enum hdmi_color_depth {
COLORDEPTH_24B = 4,
COLORDEPTH_30B = 5,
COLORDEPTH_36B = 6,
COLORDEPTH_48B = 7,
COLORDEPTH_RESERVED,
};
enum hdmi_color_range {
COLORRANGE_LIM,
COLORRANGE_FUL,
};
enum hdmi_3d_type {
T3D_FRAME_PACKING = 0,
T3D_FIELD_ALTER = 1,
@@ -324,7 +312,7 @@ enum hdmi_3d_type {
struct hdmi_format_para {
enum hdmi_color_depth cd; /* cd8, cd10 or cd12 */
enum hdmi_colorspace cs; /* 0/1/2/3: rgb/422/444/420 */
enum hdmi_color_range cr; /* limit, full */
enum hdmi_quantization_range cr; /* limit, full */
u32 scrambler_en:1;
u32 tmds_clk_div40:1;
u32 tmds_clk; /* Unit: 1000 */
@@ -502,7 +490,7 @@ struct parse_cs {
};
struct parse_cr {
enum hdmi_color_range cr;
enum hdmi_quantization_range cr;
const char *name;
};
@@ -491,7 +491,7 @@ struct hdmitx_dev {
#define CONF_HDMI_DVI_MODE (CMD_CONF_OFFSET + 0x02)
#define HDMI_MODE 0x1
#define DVI_MODE 0x2
/* set value as COLORSPACE_RGB444, YUV422, YUV444, YUV420 */
/* set value as HDMI_COLORSPACE_RGB, YUV422, YUV444, YUV420 */
#define CONF_CT_MODE (CMD_CONF_OFFSET + 0X2000 + 0x04)
#define SET_CT_OFF 0
#define SET_CT_GAME 1
@@ -8,8 +8,28 @@
#include <linux/types.h>
#include <linux/mutex.h>
#include <linux/hdmi.h>
#include <drm/amlogic/meson_connector_dev.h>
enum hdmi_color_depth {
COLORDEPTH_24B = 4,
COLORDEPTH_30B = 5,
COLORDEPTH_36B = 6,
COLORDEPTH_48B = 7,
COLORDEPTH_RESERVED,
};
struct hdmi_format_para_new {
enum hdmi_color_depth cd; /* cd8, cd10 or cd12 */
enum hdmi_colorspace cs; /* 0/1/2/3: rgb/422/444/420 */
enum hdmi_quantization_range cr; /* limit, full */
u32 scrambler_en:1;
u32 tmds_clk_div40:1;
u32 tmds_clk; /* Unit: 1000 */
};
struct hdmitx_common {
u32 hdr_priority;
char hdmichecksum[11];