rk3288: limit the decode video width from 3840 to 4096
authorljf <ljf@rock-chips.com>
Fri, 28 Mar 2014 07:50:30 +0000 (15:50 +0800)
committerljf <ljf@rock-chips.com>
Fri, 28 Mar 2014 07:50:30 +0000 (15:50 +0800)
arch/arm/mach-rockchip/vcodec_service.c

index 005ad7359c9c8500484f2ef21ae1cf6c86eb2281..4e6de90854a85d8fe443fc37f5fe6f993a8ed0b9 100755 (executable)
@@ -801,12 +801,12 @@ static void reg_deinit(struct vpu_service_info *pservice, vpu_reg *reg)
     }\r
 #endif    \r
     \r
-       kfree(reg);\r
+    kfree(reg);\r
 }\r
 \r
 static void reg_from_wait_to_run(struct vpu_service_info *pservice, vpu_reg *reg)\r
 {\r
-       list_del_init(&reg->status_link);\r
+    list_del_init(&reg->status_link);\r
        list_add_tail(&reg->status_link, &pservice->running);\r
 \r
        list_del_init(&reg->session_link);\r
@@ -1380,14 +1380,14 @@ static int vcodec_probe(struct platform_device *pdev)
     of_property_read_string(np, "name", (const char**)&prop);\r
     dev_set_name(dev, prop);\r
 \r
-       if (strcmp(dev_name(dev), "hevc_service") == 0) {\r
-               pservice->dev_id = VCODEC_DEVICE_ID_HEVC;\r
+    if (strcmp(dev_name(dev), "hevc_service") == 0) {\r
+        pservice->dev_id = VCODEC_DEVICE_ID_HEVC;\r
     } else if (strcmp(dev_name(dev), "vpu_service") == 0) {\r
-               pservice->dev_id = VCODEC_DEVICE_ID_VPU;\r
+        pservice->dev_id = VCODEC_DEVICE_ID_VPU;\r
     } else {\r
-               dev_err(dev, "Unknown device %s to probe\n", dev_name(dev));\r
-               return -1;\r
-       }\r
+        dev_err(dev, "Unknown device %s to probe\n", dev_name(dev));\r
+        return -1;\r
+    }\r
 \r
     wake_lock_init(&pservice->wake_lock, WAKE_LOCK_SUSPEND, "vpu");\r
     INIT_LIST_HEAD(&pservice->waiting);\r
@@ -1521,13 +1521,13 @@ static int vcodec_probe(struct platform_device *pdev)
     pr_info("init success\n");\r
 \r
 #if defined(CONFIG_VCODEC_MMU) & defined(CONFIG_ION_ROCKCHIP)\r
-       pservice->ion_client = rockchip_ion_client_create("vpu");\r
-       if (IS_ERR(pservice->ion_client)) {\r
-               dev_err(&pdev->dev, "failed to create ion client for vcodec");\r
-               return PTR_ERR(pservice->ion_client);\r
-       } else {\r
-               dev_info(&pdev->dev, "vcodec ion client create success!\n");\r
-       }\r
+    pservice->ion_client = rockchip_ion_client_create("vpu");\r
+    if (IS_ERR(pservice->ion_client)) {\r
+        dev_err(&pdev->dev, "failed to create ion client for vcodec");\r
+        return PTR_ERR(pservice->ion_client);\r
+    } else {\r
+        dev_info(&pdev->dev, "vcodec ion client create success!\n");\r
+    }\r
     \r
     sprintf(mmu_dev_dts_name, "iommu,%s", dev_name(dev));\r
     \r
@@ -1616,14 +1616,14 @@ static int vcodec_remove(struct platform_device *pdev)
 \r
 #if defined(CONFIG_OF)\r
 static const struct of_device_id vcodec_service_dt_ids[] = {\r
-       {.compatible = "vpu_service",},\r
-       {.compatible = "rockchip,hevc_service",},\r
+    {.compatible = "vpu_service",},\r
+    {.compatible = "rockchip,hevc_service",},\r
     {},\r
 };\r
 #endif\r
 \r
 static struct platform_driver vcodec_driver = {\r
-       .probe     = vcodec_probe,\r
+    .probe     = vcodec_probe,\r
     .remove       = vcodec_remove,\r
     .driver = {\r
         .name = "vcodec",\r
@@ -1631,14 +1631,15 @@ static struct platform_driver vcodec_driver = {
 #if defined(CONFIG_OF)\r
         .of_match_table = of_match_ptr(vcodec_service_dt_ids),\r
 #endif\r
-       },\r
+    },\r
 };\r
 \r
 static void get_hw_info(struct vpu_service_info *pservice)\r
 {\r
-    if (pservice->dev_id == VCODEC_DEVICE_ID_VPU) {\r
-        VPUHwDecConfig_t *dec = &pservice->dec_config;\r
-        VPUHwEncConfig_t *enc = &pservice->enc_config;\r
+    VPUHwDecConfig_t *dec = &pservice->dec_config;\r
+    VPUHwEncConfig_t *enc = &pservice->enc_config;\r
+\r
+    if (pservice->dev_id == VCODEC_DEVICE_ID_VPU) {            \r
         u32 configReg   = pservice->dec_dev.hwregs[VPU_DEC_HWCFG0];\r
         u32 asicID      = pservice->dec_dev.hwregs[0];\r
     \r
@@ -1656,7 +1657,7 @@ static void get_hw_info(struct vpu_service_info *pservice)
         if (!soc_is_rk3190() && !soc_is_rk3288()) {\r
             dec->maxDecPicWidth = configReg & 0x07FFU;\r
         } else {\r
-            dec->maxDecPicWidth = 3840;\r
+            dec->maxDecPicWidth = 4096;\r
         }\r
     \r
         /* 2nd Config register */\r