Loading Documentation/devicetree/bindings/fb/mdss-mdp.txt +9 −0 Original line number Diff line number Diff line Loading @@ -289,6 +289,11 @@ Optional properties: total numbers of MMBs per pipe while values, if any, following first one denotes indexes of MMBs to that RGB pipe. - qcom,mdss-pipe-vig-fixed-mmb: Array of indexes describing fixed Memory Macro Blocks (MMBs) for vig pipes. First value denotes total numbers of MMBs per pipe while values, if any, following first one denotes indexes of MMBs to that VIG pipe. - qcom,mdss-pipe-sw-reset-off: Property to indicate offset to the register which holds sw_reset bitmap for different MDSS components. Loading Loading @@ -476,6 +481,10 @@ Example: <2 2 3>, <2 4 5>, <2 6 7>; qcom,mdss-pipe-vig-fixed-mmb = <1 8>, <1 9>, <1 10>, <1 11>; qcom,mdss-smp-data = <22 4096>; qcom,mdss-rot-block-size = <64>; qcom,mdss-rotator-ot-limit = <2>; Loading drivers/video/msm/mdss/mdss_mdp.c +57 −35 Original line number Diff line number Diff line Loading @@ -2269,6 +2269,50 @@ parse_fail: return rc; } static int mdss_mdp_update_smp_map(struct platform_device *pdev, const u32 *data, int len, int pipe_cnt, struct mdss_mdp_pipe *pipes) { struct mdss_data_type *mdata = platform_get_drvdata(pdev); int i, j, k; u32 cnt, mmb; len /= sizeof(u32); for (i = 0, k = 0; i < len; k++) { struct mdss_mdp_pipe *pipe = NULL; if (k >= pipe_cnt) { pr_err("invalid fixed mmbs\n"); return -EINVAL; } pipe = &pipes[k]; cnt = be32_to_cpu(data[i++]); if (cnt == 0) continue; for (j = 0; j < cnt; j++) { mmb = be32_to_cpu(data[i++]); if (mmb > mdata->smp_mb_cnt) { pr_err("overflow mmb:%d pipe:%d: max:%d\n", mmb, k, mdata->smp_mb_cnt); return -EINVAL; } set_bit(mmb, pipe->smp_map[0].fixed); } if (bitmap_intersects(pipe->smp_map[0].fixed, mdata->mmb_alloc_map, mdata->smp_mb_cnt)) { pr_err("overlapping fixed mmb map\n"); return -EINVAL; } bitmap_or(mdata->mmb_alloc_map, pipe->smp_map[0].fixed, mdata->mmb_alloc_map, mdata->smp_mb_cnt); } return 0; } static int mdss_mdp_parse_dt_smp(struct platform_device *pdev) { struct mdss_data_type *mdata = platform_get_drvdata(pdev); Loading Loading @@ -2301,44 +2345,22 @@ static int mdss_mdp_parse_dt_smp(struct platform_device *pdev) arr = of_get_property(pdev->dev.of_node, "qcom,mdss-pipe-rgb-fixed-mmb", &len); if (arr) { int i, j, k; u32 cnt, mmb; len /= sizeof(u32); for (i = 0, k = 0; i < len; k++) { struct mdss_mdp_pipe *pipe = NULL; rc = mdss_mdp_update_smp_map(pdev, arr, len, mdata->nrgb_pipes, mdata->rgb_pipes); if (k >= mdata->nrgb_pipes) { pr_err("invalid fixed mmbs for rgb pipes\n"); return -EINVAL; if (rc) pr_warn("unable to update smp map for RGB pipes\n"); } pipe = &mdata->rgb_pipes[k]; cnt = be32_to_cpu(arr[i++]); if (cnt == 0) continue; arr = of_get_property(pdev->dev.of_node, "qcom,mdss-pipe-vig-fixed-mmb", &len); if (arr) { rc = mdss_mdp_update_smp_map(pdev, arr, len, mdata->nvig_pipes, mdata->vig_pipes); for (j = 0; j < cnt; j++) { mmb = be32_to_cpu(arr[i++]); if (mmb > mdata->smp_mb_cnt) { pr_err("overflow mmb%d: rgb%d: max%d\n", mmb, k, mdata->smp_mb_cnt); return -EINVAL; } /* rgb pipes fetches only single plane */ set_bit(mmb, pipe->smp_map[0].fixed); } if (bitmap_intersects(pipe->smp_map[0].fixed, mdata->mmb_alloc_map, mdata->smp_mb_cnt)) { pr_err("overlapping fixed mmb map\n"); return -EINVAL; } bitmap_or(mdata->mmb_alloc_map, pipe->smp_map[0].fixed, mdata->mmb_alloc_map, mdata->smp_mb_cnt); } if (rc) pr_warn("unable to update smp map for VIG pipes\n"); } return rc; } Loading Loading
Documentation/devicetree/bindings/fb/mdss-mdp.txt +9 −0 Original line number Diff line number Diff line Loading @@ -289,6 +289,11 @@ Optional properties: total numbers of MMBs per pipe while values, if any, following first one denotes indexes of MMBs to that RGB pipe. - qcom,mdss-pipe-vig-fixed-mmb: Array of indexes describing fixed Memory Macro Blocks (MMBs) for vig pipes. First value denotes total numbers of MMBs per pipe while values, if any, following first one denotes indexes of MMBs to that VIG pipe. - qcom,mdss-pipe-sw-reset-off: Property to indicate offset to the register which holds sw_reset bitmap for different MDSS components. Loading Loading @@ -476,6 +481,10 @@ Example: <2 2 3>, <2 4 5>, <2 6 7>; qcom,mdss-pipe-vig-fixed-mmb = <1 8>, <1 9>, <1 10>, <1 11>; qcom,mdss-smp-data = <22 4096>; qcom,mdss-rot-block-size = <64>; qcom,mdss-rotator-ot-limit = <2>; Loading
drivers/video/msm/mdss/mdss_mdp.c +57 −35 Original line number Diff line number Diff line Loading @@ -2269,6 +2269,50 @@ parse_fail: return rc; } static int mdss_mdp_update_smp_map(struct platform_device *pdev, const u32 *data, int len, int pipe_cnt, struct mdss_mdp_pipe *pipes) { struct mdss_data_type *mdata = platform_get_drvdata(pdev); int i, j, k; u32 cnt, mmb; len /= sizeof(u32); for (i = 0, k = 0; i < len; k++) { struct mdss_mdp_pipe *pipe = NULL; if (k >= pipe_cnt) { pr_err("invalid fixed mmbs\n"); return -EINVAL; } pipe = &pipes[k]; cnt = be32_to_cpu(data[i++]); if (cnt == 0) continue; for (j = 0; j < cnt; j++) { mmb = be32_to_cpu(data[i++]); if (mmb > mdata->smp_mb_cnt) { pr_err("overflow mmb:%d pipe:%d: max:%d\n", mmb, k, mdata->smp_mb_cnt); return -EINVAL; } set_bit(mmb, pipe->smp_map[0].fixed); } if (bitmap_intersects(pipe->smp_map[0].fixed, mdata->mmb_alloc_map, mdata->smp_mb_cnt)) { pr_err("overlapping fixed mmb map\n"); return -EINVAL; } bitmap_or(mdata->mmb_alloc_map, pipe->smp_map[0].fixed, mdata->mmb_alloc_map, mdata->smp_mb_cnt); } return 0; } static int mdss_mdp_parse_dt_smp(struct platform_device *pdev) { struct mdss_data_type *mdata = platform_get_drvdata(pdev); Loading Loading @@ -2301,44 +2345,22 @@ static int mdss_mdp_parse_dt_smp(struct platform_device *pdev) arr = of_get_property(pdev->dev.of_node, "qcom,mdss-pipe-rgb-fixed-mmb", &len); if (arr) { int i, j, k; u32 cnt, mmb; len /= sizeof(u32); for (i = 0, k = 0; i < len; k++) { struct mdss_mdp_pipe *pipe = NULL; rc = mdss_mdp_update_smp_map(pdev, arr, len, mdata->nrgb_pipes, mdata->rgb_pipes); if (k >= mdata->nrgb_pipes) { pr_err("invalid fixed mmbs for rgb pipes\n"); return -EINVAL; if (rc) pr_warn("unable to update smp map for RGB pipes\n"); } pipe = &mdata->rgb_pipes[k]; cnt = be32_to_cpu(arr[i++]); if (cnt == 0) continue; arr = of_get_property(pdev->dev.of_node, "qcom,mdss-pipe-vig-fixed-mmb", &len); if (arr) { rc = mdss_mdp_update_smp_map(pdev, arr, len, mdata->nvig_pipes, mdata->vig_pipes); for (j = 0; j < cnt; j++) { mmb = be32_to_cpu(arr[i++]); if (mmb > mdata->smp_mb_cnt) { pr_err("overflow mmb%d: rgb%d: max%d\n", mmb, k, mdata->smp_mb_cnt); return -EINVAL; } /* rgb pipes fetches only single plane */ set_bit(mmb, pipe->smp_map[0].fixed); } if (bitmap_intersects(pipe->smp_map[0].fixed, mdata->mmb_alloc_map, mdata->smp_mb_cnt)) { pr_err("overlapping fixed mmb map\n"); return -EINVAL; } bitmap_or(mdata->mmb_alloc_map, pipe->smp_map[0].fixed, mdata->mmb_alloc_map, mdata->smp_mb_cnt); } if (rc) pr_warn("unable to update smp map for VIG pipes\n"); } return rc; } Loading