msm: mdss: add max mixer width property in dt
Max mixer width supported varies for different targets. Add support for max mixer property in the device tree. Change-Id: I2cbbb947eada13b89349702065d732dd54ed6ba3 Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
This commit is contained in:
parent
9591650248
commit
f43bc79630
7 changed files with 31 additions and 16 deletions
|
@ -214,6 +214,10 @@ Bus Scaling Data:
|
|||
is determined by the line width, bytes per pixel and
|
||||
scaling ratio, this number shall be included in prefill bandwidth
|
||||
calculation.
|
||||
- qcom,max-mixer-width: Specify maximum MDP mixer width that the device supports.
|
||||
This is a mandatory property, if not specified then
|
||||
mdp probe will fail.
|
||||
|
||||
Optional properties:
|
||||
- batfet-supply : Phandle for battery FET regulator device node.
|
||||
- vdd-cx-supply : Phandle for vdd CX regulator device node.
|
||||
|
@ -437,7 +441,7 @@ Example:
|
|||
|
||||
qcom,max-bandwidth-low-kbps = <2300000>;
|
||||
qcom,max-bandwidth-high-kbps = <3000000>;
|
||||
|
||||
qcom,max-mixer-width = <2048>;
|
||||
qcom,max-clk-rate = <320000000>;
|
||||
qcom,vbif-settings = <0x0004 0x00000001>,
|
||||
<0x00D8 0x00000707>;
|
||||
|
|
|
@ -182,6 +182,7 @@ struct mdss_data_type {
|
|||
struct mdss_mdp_mixer *mixer_wb;
|
||||
u32 nmixers_intf;
|
||||
u32 nmixers_wb;
|
||||
u32 max_mixer_width;
|
||||
|
||||
struct mdss_mdp_ctl *ctl_off;
|
||||
u32 nctl;
|
||||
|
|
|
@ -2049,6 +2049,13 @@ static int mdss_mdp_parse_dt_mixer(struct platform_device *pdev)
|
|||
"qcom,mdss-pingpong-off");
|
||||
nmixers = mdata->nmixers_intf + mdata->nmixers_wb;
|
||||
|
||||
rc = of_property_read_u32(pdev->dev.of_node,
|
||||
"qcom,max-mixer-width", &mdata->max_mixer_width);
|
||||
if (rc) {
|
||||
pr_err("device tree err: failed to get max mixer width\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (mdata->nmixers_intf != ndspp) {
|
||||
pr_err("device tree err: unequal no of dspp and intf mixers\n");
|
||||
return -EINVAL;
|
||||
|
|
|
@ -33,13 +33,11 @@
|
|||
|
||||
#define MDP_CLK_DEFAULT_RATE 200000000
|
||||
#define PHASE_STEP_SHIFT 21
|
||||
#define MAX_MIXER_WIDTH 2048
|
||||
#define MAX_LINE_BUFFER_WIDTH 2048
|
||||
#define MAX_MIXER_HEIGHT 0xFFFF
|
||||
#define MAX_IMG_WIDTH 0x3FFF
|
||||
#define MAX_IMG_HEIGHT 0x3FFF
|
||||
#define AHB_CLK_OFFSET 0x2B4
|
||||
#define MAX_DST_W MAX_MIXER_WIDTH
|
||||
#define MAX_DST_H MAX_MIXER_HEIGHT
|
||||
#define MAX_DOWNSCALE_RATIO 4
|
||||
#define MAX_UPSCALE_RATIO 20
|
||||
|
|
|
@ -1450,6 +1450,7 @@ int mdss_mdp_ctl_setup(struct mdss_mdp_ctl *ctl)
|
|||
struct mdss_mdp_ctl *split_ctl;
|
||||
u32 width, height;
|
||||
int split_fb;
|
||||
u32 max_mixer_width;
|
||||
|
||||
if (!ctl || !ctl->panel_data) {
|
||||
pr_err("invalid ctl handle\n");
|
||||
|
@ -1460,16 +1461,17 @@ int mdss_mdp_ctl_setup(struct mdss_mdp_ctl *ctl)
|
|||
|
||||
width = ctl->panel_data->panel_info.xres;
|
||||
height = ctl->panel_data->panel_info.yres;
|
||||
max_mixer_width = ctl->mdata->max_mixer_width;
|
||||
|
||||
split_fb = (ctl->mfd->split_fb_left &&
|
||||
ctl->mfd->split_fb_right &&
|
||||
(ctl->mfd->split_fb_left <= MAX_MIXER_WIDTH) &&
|
||||
(ctl->mfd->split_fb_right <= MAX_MIXER_WIDTH)) ? 1 : 0;
|
||||
pr_debug("max=%d xres=%d left=%d right=%d\n", MAX_MIXER_WIDTH,
|
||||
(ctl->mfd->split_fb_left <= max_mixer_width) &&
|
||||
(ctl->mfd->split_fb_right <= max_mixer_width)) ? 1 : 0;
|
||||
pr_debug("max=%d xres=%d left=%d right=%d\n", max_mixer_width,
|
||||
width, ctl->mfd->split_fb_left, ctl->mfd->split_fb_right);
|
||||
|
||||
if ((split_ctl && (width > MAX_MIXER_WIDTH)) ||
|
||||
(width > (2 * MAX_MIXER_WIDTH))) {
|
||||
if ((split_ctl && (width > max_mixer_width)) ||
|
||||
(width > (2 * max_mixer_width))) {
|
||||
pr_err("Unsupported panel resolution: %dx%d\n", width, height);
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
@ -1481,7 +1483,7 @@ int mdss_mdp_ctl_setup(struct mdss_mdp_ctl *ctl)
|
|||
if (!ctl->mixer_left) {
|
||||
ctl->mixer_left =
|
||||
mdss_mdp_mixer_alloc(ctl, MDSS_MDP_MIXER_TYPE_INTF,
|
||||
((width > MAX_MIXER_WIDTH) || split_fb), 0);
|
||||
((width > max_mixer_width) || split_fb), 0);
|
||||
if (!ctl->mixer_left) {
|
||||
pr_err("unable to allocate layer mixer\n");
|
||||
return -ENOMEM;
|
||||
|
@ -1494,7 +1496,7 @@ int mdss_mdp_ctl_setup(struct mdss_mdp_ctl *ctl)
|
|||
|
||||
if (split_fb)
|
||||
width = ctl->mfd->split_fb_left;
|
||||
else if (width > MAX_MIXER_WIDTH)
|
||||
else if (width > max_mixer_width)
|
||||
width /= 2;
|
||||
|
||||
ctl->mixer_left->width = width;
|
||||
|
@ -1701,7 +1703,7 @@ int mdss_mdp_ctl_split_display_setup(struct mdss_mdp_ctl *ctl,
|
|||
if (!ctl || !pdata)
|
||||
return -ENODEV;
|
||||
|
||||
if (pdata->panel_info.xres > MAX_MIXER_WIDTH) {
|
||||
if (pdata->panel_info.xres > ctl->mdata->max_mixer_width) {
|
||||
pr_err("Unsupported second panel resolution: %dx%d\n",
|
||||
pdata->panel_info.xres, pdata->panel_info.yres);
|
||||
return -ENOTSUPP;
|
||||
|
|
|
@ -287,7 +287,7 @@ int mdss_mdp_overlay_req_check(struct msm_fb_data_type *mfd,
|
|||
src_w = req->src_rect.w >> req->horz_deci;
|
||||
src_h = req->src_rect.h >> req->vert_deci;
|
||||
|
||||
if (src_w > MAX_MIXER_WIDTH) {
|
||||
if (src_w > mdata->max_mixer_width) {
|
||||
pr_err("invalid source width=%d HDec=%d\n",
|
||||
req->src_rect.w, req->horz_deci);
|
||||
return -EINVAL;
|
||||
|
@ -487,7 +487,8 @@ int mdss_mdp_overlay_pipe_setup(struct msm_fb_data_type *mfd,
|
|||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
if ((req->dst_rect.w > MAX_DST_W) || (req->dst_rect.h > MAX_DST_H)) {
|
||||
if ((req->dst_rect.w > mdata->max_mixer_width) ||
|
||||
(req->dst_rect.h > MAX_DST_H)) {
|
||||
pr_err("exceeded max mixer supported resolution %dx%d\n",
|
||||
req->dst_rect.w, req->dst_rect.h);
|
||||
return -EOVERFLOW;
|
||||
|
@ -1748,6 +1749,7 @@ static void mdss_mdp_overlay_pan_display(struct msm_fb_data_type *mfd)
|
|||
struct mdss_mdp_pipe *pipe;
|
||||
struct fb_info *fbi;
|
||||
struct mdss_overlay_private *mdp5_data;
|
||||
struct mdss_data_type *mdata = mfd_to_mdata(mfd);
|
||||
u32 offset;
|
||||
int bpp, ret;
|
||||
|
||||
|
@ -1821,7 +1823,7 @@ static void mdss_mdp_overlay_pan_display(struct msm_fb_data_type *mfd)
|
|||
pipe->has_buf = 1;
|
||||
mdss_mdp_pipe_unmap(pipe);
|
||||
|
||||
if (fbi->var.xres > MAX_MIXER_WIDTH || mfd->split_display) {
|
||||
if (fbi->var.xres > mdata->max_mixer_width || mfd->split_display) {
|
||||
ret = mdss_mdp_overlay_get_fb_pipe(mfd, &pipe,
|
||||
MDSS_MDP_MIXER_MUX_RIGHT);
|
||||
if (ret) {
|
||||
|
|
|
@ -442,6 +442,7 @@ int mdss_mdp_rotator_setup(struct msm_fb_data_type *mfd,
|
|||
struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(mfd);
|
||||
struct mdss_mdp_rotator_session *rot = NULL;
|
||||
struct mdss_mdp_format_params *fmt;
|
||||
struct mdss_data_type *mdata = mfd_to_mdata(mfd);
|
||||
u32 bwc_enabled;
|
||||
int ret = 0;
|
||||
|
||||
|
@ -521,7 +522,7 @@ int mdss_mdp_rotator_setup(struct msm_fb_data_type *mfd,
|
|||
if (rot->flags & MDP_ROT_90)
|
||||
swap(rot->dst.w, rot->dst.h);
|
||||
|
||||
if (rot->src_rect.w > MAX_MIXER_WIDTH) {
|
||||
if (rot->src_rect.w > mdata->max_mixer_width) {
|
||||
struct mdss_mdp_rotator_session *tmp;
|
||||
u32 width;
|
||||
|
||||
|
@ -536,7 +537,7 @@ int mdss_mdp_rotator_setup(struct msm_fb_data_type *mfd,
|
|||
pr_debug("setting up split rotation src=%dx%d\n",
|
||||
rot->src_rect.w, rot->src_rect.h);
|
||||
|
||||
if (width > (MAX_MIXER_WIDTH * 2)) {
|
||||
if (width > (mdata->max_mixer_width * 2)) {
|
||||
pr_err("unsupported source width %d\n", width);
|
||||
ret = -EOVERFLOW;
|
||||
goto rot_err;
|
||||
|
|
Loading…
Add table
Reference in a new issue