msm: mdss: notify all hw blocks supported formats to user mode.
Exhibit supported formats of all pipes and writeback block through sysfs node of mdp capabilities. CRs-Fixed: 984465 Change-Id: I1dc11268995e7f3d8efdc7d3e7cf3a1951ff44a5 Signed-off-by: Ramkumar Radhakrishnan <ramkumar@codeaurora.org> Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org> [dkeitel@codeaurora.org: fix minor conflict.] Signed-off-by: David Keitel <dkeitel@codeaurora.org>
This commit is contained in:
parent
bf4e52b19e
commit
22ae58fca4
5 changed files with 159 additions and 18 deletions
|
@ -1407,6 +1407,12 @@ static void mdss_mdp_hw_rev_caps_init(struct mdss_data_type *mdata)
|
|||
|
||||
if (mdata->mdp_rev < MDSS_MDP_HW_REV_103)
|
||||
mdss_set_quirk(mdata, MDSS_QUIRK_DOWNSCALE_HANG);
|
||||
|
||||
if (mdata->mdp_rev < MDSS_MDP_HW_REV_102 ||
|
||||
mdata->mdp_rev == MDSS_MDP_HW_REV_200)
|
||||
mdss_set_quirk(mdata, MDSS_QUIRK_FMT_PACK_PATTERN);
|
||||
|
||||
mdss_mdp_set_supported_formats(mdata);
|
||||
}
|
||||
|
||||
static void mdss_hw_rev_init(struct mdss_data_type *mdata)
|
||||
|
@ -1770,15 +1776,21 @@ static void __update_sspp_info(struct mdss_mdp_pipe *pipe,
|
|||
int pipe_cnt, char *type, char *buf, int *cnt)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
size_t len = PAGE_SIZE;
|
||||
int num_bytes = BITS_TO_BYTES(MDP_IMGTYPE_LIMIT);
|
||||
|
||||
#define SPRINT(fmt, ...) \
|
||||
(*cnt += scnprintf(buf + *cnt, len - *cnt, fmt, ##__VA_ARGS__))
|
||||
|
||||
for (i = 0; i < pipe_cnt; i++) {
|
||||
SPRINT("pipe_num:%d pipe_type:%s pipe_ndx:%d pipe_is_handoff:%d display_id:%d\n",
|
||||
SPRINT("pipe_num:%d pipe_type:%s pipe_ndx:%d pipe_is_handoff:%d display_id:%d ",
|
||||
pipe->num, type, pipe->ndx, pipe->is_handed_off,
|
||||
mdss_mdp_get_display_id(pipe));
|
||||
SPRINT("fmts_supported:");
|
||||
for (j = 0; j < num_bytes && pipe; j++)
|
||||
SPRINT("%d,", pipe->supported_formats[j]);
|
||||
SPRINT("\n");
|
||||
pipe++;
|
||||
}
|
||||
#undef SPRINT
|
||||
|
@ -1797,7 +1809,29 @@ static void mdss_mdp_update_sspp_info(struct mdss_data_type *mdata,
|
|||
"cursor", buf, cnt);
|
||||
}
|
||||
|
||||
static ssize_t mdss_mdp_show_capabilities(struct device *dev,
|
||||
static void mdss_mdp_update_wb_info(struct mdss_data_type *mdata,
|
||||
char *buf, int *cnt)
|
||||
{
|
||||
#define SPRINT(fmt, ...) \
|
||||
(*cnt += scnprintf(buf + *cnt, len - *cnt, fmt, ##__VA_ARGS__))
|
||||
size_t len = PAGE_SIZE;
|
||||
int i;
|
||||
int num_bytes = BITS_TO_BYTES(MDP_IMGTYPE_LIMIT);
|
||||
|
||||
SPRINT("rot_input_fmts=");
|
||||
for (i = 0; i < num_bytes && mdata->wb; i++)
|
||||
SPRINT("%d ", mdata->wb->supported_input_formats[i]);
|
||||
SPRINT("\nrot_output_fmts=");
|
||||
for (i = 0; i < num_bytes && mdata->wb; i++)
|
||||
SPRINT("%d ", mdata->wb->supported_input_formats[i]);
|
||||
SPRINT("\nwb_output_fmts=");
|
||||
for (i = 0; i < num_bytes && mdata->wb; i++)
|
||||
SPRINT("%d ", mdata->wb->supported_output_formats[i]);
|
||||
SPRINT("\n");
|
||||
#undef SPRINT
|
||||
}
|
||||
|
||||
ssize_t mdss_mdp_show_capabilities(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct mdss_data_type *mdata = dev_get_drvdata(dev);
|
||||
|
@ -1812,6 +1846,8 @@ static ssize_t mdss_mdp_show_capabilities(struct device *dev,
|
|||
SPRINT("pipe_count:%d\n", mdata->nvig_pipes + mdata->nrgb_pipes +
|
||||
mdata->ndma_pipes + mdata->ncursor_pipes);
|
||||
mdss_mdp_update_sspp_info(mdata, buf, &cnt);
|
||||
mdss_mdp_update_wb_info(mdata, buf, &cnt);
|
||||
/* TODO : need to remove num pipes info */
|
||||
SPRINT("rgb_pipes=%d\n", mdata->nrgb_pipes);
|
||||
SPRINT("vig_pipes=%d\n", mdata->nvig_pipes);
|
||||
SPRINT("dma_pipes=%d\n", mdata->ndma_pipes);
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
|
||||
#define VALID_ROT_WB_FORMAT BIT(0)
|
||||
#define VALID_MDP_WB_INTF_FORMAT BIT(1)
|
||||
#define VALID_MDP_CURSOR_FORMAT BIT(2)
|
||||
|
||||
#define C3_ALPHA 3 /* alpha */
|
||||
#define C2_R_Cr 2 /* R/Cr */
|
||||
|
@ -87,6 +88,8 @@
|
|||
#define HW_CURSOR_STAGE(mdata) \
|
||||
(((mdata)->max_target_zorder + MDSS_MDP_STAGE_0) - 1)
|
||||
|
||||
#define BITS_TO_BYTES(x) DIV_ROUND_UP(x, BITS_PER_BYTE)
|
||||
|
||||
enum mdss_mdp_perf_state_type {
|
||||
PERF_SW_COMMIT_STATE = 0,
|
||||
PERF_HW_MDP_STATE,
|
||||
|
@ -242,6 +245,8 @@ struct mdss_mdp_writeback {
|
|||
char __iomem *base;
|
||||
u32 caps;
|
||||
struct kref kref;
|
||||
u8 supported_input_formats[BITS_TO_BYTES(MDP_IMGTYPE_LIMIT)];
|
||||
u8 supported_output_formats[BITS_TO_BYTES(MDP_IMGTYPE_LIMIT)];
|
||||
};
|
||||
|
||||
struct mdss_mdp_ctl_intfs_ops {
|
||||
|
@ -641,6 +646,7 @@ struct mdss_mdp_pipe {
|
|||
wait_queue_head_t free_waitq;
|
||||
u32 frame_rate;
|
||||
u8 csc_coeff_set;
|
||||
u8 supported_formats[BITS_TO_BYTES(MDP_IMGTYPE_LIMIT)];
|
||||
};
|
||||
|
||||
struct mdss_mdp_writeback_arg {
|
||||
|
@ -1512,6 +1518,8 @@ void mdss_mdp_wb_free(struct mdss_mdp_writeback *wb);
|
|||
void mdss_mdp_ctl_dsc_setup(struct mdss_mdp_ctl *ctl,
|
||||
struct mdss_panel_info *pinfo);
|
||||
|
||||
void mdss_mdp_set_supported_formats(struct mdss_data_type *mdata);
|
||||
|
||||
#ifdef CONFIG_FB_MSM_MDP_NONE
|
||||
struct mdss_data_type *mdss_mdp_get_mdata(void)
|
||||
{
|
||||
|
|
|
@ -1034,6 +1034,7 @@ static void __dump_pipe(struct seq_file *s, struct mdss_mdp_pipe *pipe)
|
|||
struct mdss_mdp_data *buf;
|
||||
int format;
|
||||
int smps[4];
|
||||
int i;
|
||||
|
||||
seq_printf(s, "\nSSPP #%d type=%s ndx=%x flags=0x%08x play_cnt=%u xin_id=%d\n",
|
||||
pipe->num, mdss_mdp_pipetype2str(pipe->type),
|
||||
|
@ -1064,6 +1065,11 @@ static void __dump_pipe(struct seq_file *s, struct mdss_mdp_pipe *pipe)
|
|||
seq_printf(s, "\tSMP allocated=[%d %d] reserved=[%d %d]\n",
|
||||
smps[0], smps[1], smps[2], smps[3]);
|
||||
|
||||
seq_puts(s, "\tSupported formats = ");
|
||||
for (i = 0; i < BITS_TO_BYTES(MDP_IMGTYPE_LIMIT); i++)
|
||||
seq_printf(s, "0x%02X ", pipe->supported_formats[i]);
|
||||
seq_puts(s, "\n");
|
||||
|
||||
seq_puts(s, "Data:\n");
|
||||
|
||||
list_for_each_entry(buf, &pipe->buf_queue, pipe_list)
|
||||
|
|
|
@ -231,17 +231,17 @@ static struct mdss_mdp_format_params mdss_mdp_format_map[] = {
|
|||
VALID_MDP_WB_INTF_FORMAT, C1_B_Cb, C0_G_Y, C2_R_Cr),
|
||||
|
||||
FMT_RGB_8888(MDP_XRGB_8888, MDSS_MDP_FETCH_LINEAR, VALID_ROT_WB_FORMAT |
|
||||
VALID_MDP_WB_INTF_FORMAT, 0, C3_ALPHA, C2_R_Cr, C0_G_Y,
|
||||
C1_B_Cb),
|
||||
FMT_RGB_8888(MDP_ARGB_8888, MDSS_MDP_FETCH_LINEAR, VALID_ROT_WB_FORMAT,
|
||||
1, C3_ALPHA, C2_R_Cr, C0_G_Y, C1_B_Cb),
|
||||
FMT_RGB_8888(MDP_RGBA_8888, MDSS_MDP_FETCH_LINEAR, VALID_ROT_WB_FORMAT,
|
||||
1, C2_R_Cr, C0_G_Y, C1_B_Cb, C3_ALPHA),
|
||||
VALID_MDP_WB_INTF_FORMAT | VALID_MDP_CURSOR_FORMAT, 0,
|
||||
C3_ALPHA, C2_R_Cr, C0_G_Y, C1_B_Cb),
|
||||
FMT_RGB_8888(MDP_ARGB_8888, MDSS_MDP_FETCH_LINEAR, VALID_ROT_WB_FORMAT |
|
||||
VALID_MDP_CURSOR_FORMAT, 1, C3_ALPHA, C2_R_Cr, C0_G_Y, C1_B_Cb),
|
||||
FMT_RGB_8888(MDP_RGBA_8888, MDSS_MDP_FETCH_LINEAR, VALID_ROT_WB_FORMAT |
|
||||
VALID_MDP_CURSOR_FORMAT, 1, C2_R_Cr, C0_G_Y, C1_B_Cb, C3_ALPHA),
|
||||
FMT_RGB_8888(MDP_RGBX_8888, MDSS_MDP_FETCH_LINEAR, VALID_ROT_WB_FORMAT |
|
||||
VALID_MDP_WB_INTF_FORMAT, 0, C2_R_Cr, C0_G_Y, C1_B_Cb,
|
||||
C3_ALPHA),
|
||||
FMT_RGB_8888(MDP_BGRA_8888, MDSS_MDP_FETCH_LINEAR, VALID_ROT_WB_FORMAT,
|
||||
1, C1_B_Cb, C0_G_Y, C2_R_Cr, C3_ALPHA),
|
||||
FMT_RGB_8888(MDP_BGRA_8888, MDSS_MDP_FETCH_LINEAR, VALID_ROT_WB_FORMAT |
|
||||
VALID_MDP_CURSOR_FORMAT, 1, C1_B_Cb, C0_G_Y, C2_R_Cr, C3_ALPHA),
|
||||
FMT_RGB_8888(MDP_BGRX_8888, MDSS_MDP_FETCH_LINEAR, VALID_ROT_WB_FORMAT |
|
||||
VALID_MDP_WB_INTF_FORMAT, 0, C1_B_Cb, C0_G_Y, C2_R_Cr,
|
||||
C3_ALPHA),
|
||||
|
@ -333,14 +333,14 @@ static struct mdss_mdp_format_params mdss_mdp_format_map[] = {
|
|||
.fetch_mode = MDSS_MDP_FETCH_LINEAR,
|
||||
.element = { C2_R_Cr, C0_G_Y, C1_B_Cb, C0_G_Y },
|
||||
},
|
||||
FMT_RGB_1555(MDP_RGBA_5551, 1, VALID_ROT_WB_FORMAT,
|
||||
C3_ALPHA, C1_B_Cb, C0_G_Y, C2_R_Cr),
|
||||
FMT_RGB_1555(MDP_ARGB_1555, 1, VALID_ROT_WB_FORMAT,
|
||||
C1_B_Cb, C0_G_Y, C2_R_Cr, C3_ALPHA),
|
||||
FMT_RGB_4444(MDP_RGBA_4444, 1, VALID_ROT_WB_FORMAT,
|
||||
C3_ALPHA, C1_B_Cb, C0_G_Y, C2_R_Cr),
|
||||
FMT_RGB_4444(MDP_ARGB_4444, 1, VALID_ROT_WB_FORMAT,
|
||||
C1_B_Cb, C0_G_Y, C2_R_Cr, C3_ALPHA),
|
||||
FMT_RGB_1555(MDP_RGBA_5551, 1, VALID_ROT_WB_FORMAT |
|
||||
VALID_MDP_CURSOR_FORMAT, C3_ALPHA, C1_B_Cb, C0_G_Y, C2_R_Cr),
|
||||
FMT_RGB_1555(MDP_ARGB_1555, 1, VALID_ROT_WB_FORMAT |
|
||||
VALID_MDP_CURSOR_FORMAT, C1_B_Cb, C0_G_Y, C2_R_Cr, C3_ALPHA),
|
||||
FMT_RGB_4444(MDP_RGBA_4444, 1, VALID_ROT_WB_FORMAT |
|
||||
VALID_MDP_CURSOR_FORMAT, C3_ALPHA, C1_B_Cb, C0_G_Y, C2_R_Cr),
|
||||
FMT_RGB_4444(MDP_ARGB_4444, 1, VALID_ROT_WB_FORMAT |
|
||||
VALID_MDP_CURSOR_FORMAT, C1_B_Cb, C0_G_Y, C2_R_Cr, C3_ALPHA),
|
||||
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -306,6 +306,97 @@ void mdss_mdp_format_flag_removal(u32 *table, u32 num, u32 remove_bits)
|
|||
}
|
||||
}
|
||||
|
||||
void mdss_mdp_set_supported_formats(struct mdss_data_type *mdata)
|
||||
{
|
||||
#define SET_BIT(value, bit_num) \
|
||||
{ \
|
||||
value[bit_num >> 3] |= (1 << (bit_num & 7)); \
|
||||
} \
|
||||
|
||||
struct mdss_mdp_pipe *vig_pipes = mdata->vig_pipes;
|
||||
struct mdss_mdp_pipe *rgb_pipes = mdata->rgb_pipes;
|
||||
struct mdss_mdp_pipe *dma_pipes = mdata->dma_pipes;
|
||||
struct mdss_mdp_pipe *cur_pipes = mdata->cursor_pipes;
|
||||
struct mdss_mdp_writeback *wb = mdata->wb;
|
||||
bool has_tile = mdata->highest_bank_bit && !mdata->has_ubwc;
|
||||
bool has_ubwc = mdata->has_ubwc;
|
||||
int i;
|
||||
int j;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(mdss_mdp_format_map); i++) {
|
||||
struct mdss_mdp_format_params *fmt = &mdss_mdp_format_map[i];
|
||||
|
||||
if ((fmt->fetch_mode == MDSS_MDP_FETCH_TILE && has_tile) ||
|
||||
(fmt->fetch_mode == MDSS_MDP_FETCH_LINEAR)) {
|
||||
for (j = 0; j < mdata->nvig_pipes; j++)
|
||||
SET_BIT(vig_pipes[j].supported_formats,
|
||||
fmt->format);
|
||||
|
||||
if (fmt->flag & VALID_ROT_WB_FORMAT) {
|
||||
for (j = 0; j < mdata->nwb; j++)
|
||||
SET_BIT(wb[j].supported_input_formats,
|
||||
fmt->format);
|
||||
}
|
||||
if (fmt->flag & VALID_MDP_WB_INTF_FORMAT) {
|
||||
for (j = 0; j < mdata->nwb; j++)
|
||||
SET_BIT(wb[j].supported_output_formats,
|
||||
fmt->format);
|
||||
}
|
||||
if (fmt->flag & VALID_MDP_CURSOR_FORMAT &&
|
||||
mdata->ncursor_pipes) {
|
||||
for (j = 0; j < mdata->ncursor_pipes; j++)
|
||||
SET_BIT(cur_pipes[j].supported_formats,
|
||||
fmt->format);
|
||||
}
|
||||
|
||||
if (!fmt->is_yuv) {
|
||||
for (j = 0; j < mdata->nrgb_pipes; j++)
|
||||
SET_BIT(rgb_pipes[j].supported_formats,
|
||||
fmt->format);
|
||||
|
||||
for (j = 0; j < mdata->ndma_pipes; j++)
|
||||
SET_BIT(dma_pipes[j].supported_formats,
|
||||
fmt->format);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(mdss_mdp_format_ubwc_map) && has_ubwc; i++) {
|
||||
struct mdss_mdp_format_params *fmt =
|
||||
&mdss_mdp_format_ubwc_map[i].mdp_format;
|
||||
|
||||
for (j = 0; j < mdata->nvig_pipes; j++)
|
||||
SET_BIT(vig_pipes[j].supported_formats, fmt->format);
|
||||
|
||||
if (fmt->flag & VALID_ROT_WB_FORMAT) {
|
||||
for (j = 0; j < mdata->nwb; j++)
|
||||
SET_BIT(wb[j].supported_input_formats,
|
||||
fmt->format);
|
||||
}
|
||||
if (fmt->flag & VALID_MDP_WB_INTF_FORMAT) {
|
||||
for (j = 0; j < mdata->nwb; j++)
|
||||
SET_BIT(wb[j].supported_output_formats,
|
||||
fmt->format);
|
||||
}
|
||||
if (fmt->flag & VALID_MDP_CURSOR_FORMAT &&
|
||||
mdata->ncursor_pipes) {
|
||||
for (j = 0; j < mdata->ncursor_pipes; j++)
|
||||
SET_BIT(cur_pipes[j].supported_formats,
|
||||
fmt->format);
|
||||
}
|
||||
|
||||
if (!fmt->is_yuv) {
|
||||
for (j = 0; j < mdata->nrgb_pipes; j++)
|
||||
SET_BIT(rgb_pipes[j].supported_formats,
|
||||
fmt->format);
|
||||
|
||||
for (j = 0; j < mdata->ndma_pipes; j++)
|
||||
SET_BIT(dma_pipes[j].supported_formats,
|
||||
fmt->format);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct mdss_mdp_format_params *mdss_mdp_get_format_params(u32 format)
|
||||
{
|
||||
struct mdss_mdp_format_params *fmt = NULL;
|
||||
|
|
Loading…
Add table
Reference in a new issue