summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDhaval Patel <pdhaval@codeaurora.org>2014-08-18 12:57:19 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:33:22 -0700
commitc05ee5a7cdf5b264aa73e30c2003d6a65fb74cb4 (patch)
tree33acb1d6e2756e8226de30f37f30e072cad9e861
parent67ac4262d4222fe770f1e94b8baae4aa8324dc51 (diff)
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>
-rw-r--r--Documentation/devicetree/bindings/fb/mdss-mdp.txt18
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_splash_logo.c49
2 files changed, 52 insertions, 15 deletions
diff --git a/Documentation/devicetree/bindings/fb/mdss-mdp.txt b/Documentation/devicetree/bindings/fb/mdss-mdp.txt
index 0baf2991bc36..f1390f553938 100644
--- a/Documentation/devicetree/bindings/fb/mdss-mdp.txt
+++ b/Documentation/devicetree/bindings/fb/mdss-mdp.txt
@@ -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>;
+ };
};
};
diff --git a/drivers/video/fbdev/msm/mdss_mdp_splash_logo.c b/drivers/video/fbdev/msm/mdss_mdp_splash_logo.c
index 10242732e675..d648aca12c3b 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_splash_logo.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_splash_logo.c
@@ -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;
- }
-
- len = len / sizeof(u32);
+ if (len) {
+ 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])) {