drivers/amlogic/media/osd: fix potentially incorrect hw/pxp modes
authoradamg <adamg88@users.noreply.github.com>
Fri, 22 Feb 2019 11:08:02 +0000 (11:08 +0000)
committerNick Xie <nick@khadas.com>
Fri, 12 Jul 2019 05:35:37 +0000 (13:35 +0800)
drivers/amlogic/media/osd/osd_fb.c

index e6dc88d..9b17748 100644 (file)
@@ -4178,24 +4178,28 @@ static int osd_probe(struct platform_device *pdev)
 
        }
 #endif
-
        /* get meson-fb resource from dt */
        prop = of_get_property(pdev->dev.of_node, "scale_mode", NULL);
-       if (prop)
+       if (prop) {
                prop_idx = of_read_ulong(prop, 1);
-       /* Todo: only osd0 */
-       osd_set_free_scale_mode_hw(DEV_OSD0, prop_idx);
+               /* Todo: only osd0 */
+               osd_set_free_scale_mode_hw(DEV_OSD0, prop_idx);
+       }
+
        prop = of_get_property(pdev->dev.of_node, "4k2k_fb", NULL);
-       if (prop)
+       if (prop) {
                prop_idx = of_read_ulong(prop, 1);
-       osd_set_4k2k_fb_mode_hw(prop_idx);
+               osd_set_4k2k_fb_mode_hw(prop_idx);
+       }
+
        /* get default display mode from dt */
-       ret = of_property_read_string(pdev->dev.of_node,
-               "display_mode_default", &str);
+       ret = of_property_read_string(pdev->dev.of_node, "display_mode_default", &str);
+
        prop = of_get_property(pdev->dev.of_node, "pxp_mode", NULL);
-       if (prop)
+       if (prop) {
                prop_idx = of_read_ulong(prop, 1);
-       osd_set_pxp_mode(prop_idx);
+               osd_set_pxp_mode(prop_idx);
+       }
 
        prop = of_get_property(pdev->dev.of_node, "ddr_urgent", NULL);
        if (prop) {
@@ -4203,9 +4207,11 @@ static int osd_probe(struct platform_device *pdev)
                osd_set_urgent(0, (prop_idx != 0) ? 1 : 0);
                osd_set_urgent(1, (prop_idx != 0) ? 1 : 0);
        }
+
        prop = of_get_property(pdev->dev.of_node, "mem_alloc", NULL);
-       if (prop)
+       if (prop) {
                b_alloc_mem = of_read_ulong(prop, 1);
+       }
 
        vinfo = get_current_vinfo();
        for (index = 0; index < osd_meson_dev.osd_count; index++) {