mdss: mdp: parse memory handle for cont splash buffer

Continuous splash screen buffer is reserved in
target dtsi file for MSM8994 target. FB driver should
parse this memory handle using "linux,continuous-region"
to get the splash screen buffer address and size. This
avoids usage of "qcom,memory-reserve" entry which forces
user to provide duplicate information.

Change-Id: Ice6cddf6c71a2de9adf15a763434a310e07a3da6
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
This commit is contained in:
Dhaval Patel 2014-08-18 12:57:19 -07:00 committed by David Keitel
parent 67ac4262d4
commit c05ee5a7cd
2 changed files with 52 additions and 15 deletions

View file

@ -424,11 +424,18 @@ Subnode properties:
for the framebuffer used to display the splash screen.
This property is required whenever the continuous splash
screen feature is enabled for the corresponding
framebuffer device.
framebuffer device. It should be used for only 32bit
kernel.
- qcom,cont-splash-memory: Specifies the memory block region reserved for
continuous splash screen feature. This property should be
defined for corresponding framebuffer device if
"qcom,memblock-reserve" is not defined when continuous
splash screen feature is enabled.
- linux,contiguous-region: Phandle to the continuous memory region reserved for
frame-buffer. Size of this region is dependent on the
display panel resolution and buffering scheme.
Currently driver uses double buffering.
frame-buffer or continuous splash screen. Size of this
region is dependent on the display panel resolution and
buffering scheme for frame-buffer node. Currently driver
uses double buffering.
Example: Width = 1920, Height = 1080, BytesPerPixel = 4,
Number of frame-buffers reserved = 2.
@ -578,6 +585,9 @@ Example:
qcom,mdss-fb-split = <480 240>
linux,contiguous-region = <&fb_mem>;
qcom,mdss-fb-splash-logo-enabled:
qcom,cont-splash-memory {
linux,contiguous-region = <&cont_splash_mem>;
};
};
};

View file

@ -19,6 +19,7 @@
#include <linux/memblock.h>
#include <linux/bootmem.h>
#include <linux/iommu.h>
#include <linux/of_address.h>
#include <linux/fb.h>
#include <linux/dma-buf.h>
@ -591,25 +592,51 @@ static __ref int mdss_mdp_splash_parse_dt(struct msm_fb_data_type *mfd)
struct mdss_overlay_private *mdp5_mdata = mfd_to_mdp5_data(mfd);
int len = 0, rc = 0;
u32 offsets[2];
struct device_node *pnode, *child_node;
mfd->splash_info.splash_logo_enabled =
of_property_read_bool(pdev->dev.of_node,
"qcom,mdss-fb-splash-logo-enabled");
of_find_property(pdev->dev.of_node, "qcom,memblock-reserve", &len);
if (len < 1) {
pr_debug("mem reservation for splash screen fb not present\n");
rc = -EINVAL;
goto error;
}
if (len) {
len = len / sizeof(u32);
len = len / sizeof(u32);
rc = of_property_read_u32_array(pdev->dev.of_node,
rc = of_property_read_u32_array(pdev->dev.of_node,
"qcom,memblock-reserve", offsets, len);
if (rc) {
pr_debug("error reading mem reserve settings for fb\n");
goto error;
if (rc) {
pr_err("error reading mem reserve settings for fb\n");
goto error;
}
} else {
child_node = of_get_child_by_name(pdev->dev.of_node,
"qcom,cont-splash-memory");
if (!child_node) {
pr_err("splash mem child node is not present\n");
rc = -EINVAL;
goto error;
}
pnode = of_parse_phandle(child_node, "linux,contiguous-region",
0);
if (pnode != NULL) {
const u32 *addr;
u64 size;
addr = of_get_address(pnode, 0, &size, NULL);
if (!addr) {
pr_err("failed to parse the splash memory address\n");
of_node_put(pnode);
rc = -EINVAL;
goto error;
}
offsets[0] = (u32) of_read_ulong(addr, 2);
offsets[1] = (u32) size;
of_node_put(pnode);
} else {
pr_err("mem reservation for splash screen fb not present\n");
rc = -EINVAL;
goto error;
}
}
if (!memblock_is_reserved(offsets[0])) {