if (copy_to_user(argp, &enable, sizeof(enable)))
return -EFAULT;
break;
- case RK_FBIOSET_OVERLAY_STATE:
+ case RK_FBIOSET_OVERLAY_STA:
if (copy_from_user(&ovl, argp, sizeof(ovl)))
return -EFAULT;
dev_drv->ops->ovl_mgr(dev_drv, ovl, 1);
break;
- case RK_FBIOGET_OVERLAY_STATE:
+ case RK_FBIOGET_OVERLAY_STA:
ovl = dev_drv->ops->ovl_mgr(dev_drv, 0, 0);
if (copy_to_user(argp, &ovl, sizeof(ovl)))
return -EFAULT;
if (copy_to_user(argp, &dsp_addr, sizeof(dsp_addr)))
return -EFAULT;
break;
- case RK_FBIOGET_LIST_STAT:
+ case RK_FBIOGET_LIST_STA:
list_stat = rk_fb_get_list_stat(dev_drv);
if (copy_to_user(argp, &list_stat, sizeof(list_stat)))
return -EFAULT;
break;
-
+ case RK_FBIOGET_IOMMU_STA:
+ if (copy_to_user(argp, &dev_drv->iommu_enabled,
+ sizeof(dev_drv->iommu_enabled)))
+ return -EFAULT;
+ break;
#if defined(CONFIG_ION_ROCKCHIP)
case RK_FBIOSET_DMABUF_FD:
{
struct ion_handle *handle;
ion_phys_addr_t phy_addr;
size_t len;
-
- handle = ion_alloc(rk_fb->ion_client, (size_t)fb_mem_size, 0, ION_HEAP(ION_CMA_HEAP_ID), 0);
- if (IS_ERR(handle)) {
- dev_err(fbi->device, "failed to ion_alloc:%ld\n",PTR_ERR(handle));
- return -ENOMEM;
- }
+ if (dev_drv->iommu_enabled)
+ handle = ion_alloc(rk_fb->ion_client, (size_t)fb_mem_size, 0, ION_HEAP(ION_VMALLOC_HEAP_ID), 0);
+ else
+ handle = ion_alloc(rk_fb->ion_client, (size_t)fb_mem_size, 0, ION_HEAP(ION_CMA_HEAP_ID), 0);
+ if (IS_ERR(handle)) {
+ dev_err(fbi->device, "failed to ion_alloc:%ld\n",PTR_ERR(handle));
+ return -ENOMEM;
+ }
win->area[0].dma_buf = ion_share_dma_buf(rk_fb->ion_client, handle);
if (IS_ERR_OR_NULL(win->area[0].dma_buf)) {
printk("ion_share_dma_buf() failed\n");
#define FB0_IOCTL_CLOSE_BUF 0x6019
#endif
-#define RK_FBIOGET_PANEL_SIZE 0x5001
-#define RK_FBIOSET_YUV_ADDR 0x5002
-#define RK_FBIOGET_SCREEN_STATE 0X4620
-#define RK_FBIOGET_16OR32 0X4621
-#define RK_FBIOGET_IDLEFBUff_16OR32 0X4622
-#define RK_FBIOSET_COMPOSE_LAYER_COUNTS 0X4623
-
-#define RK_FBIOGET_DMABUF_FD 0x5003
-#define RK_FBIOSET_DMABUF_FD 0x5004
-#define RK_FB_IOCTL_SET_I2P_ODD_ADDR 0x5005
-#define RK_FB_IOCTL_SET_I2P_EVEN_ADDR 0x5006
-#define RK_FBIOSET_OVERLAY_STATE 0x5018
-#define RK_FBIOGET_OVERLAY_STATE 0X4619
-#define RK_FBIOSET_ENABLE 0x5019
-#define RK_FBIOGET_ENABLE 0x5020
-#define RK_FBIOSET_CONFIG_DONE 0x4628
-#define RK_FBIOSET_VSYNC_ENABLE 0x4629
-#define RK_FBIOPUT_NUM_BUFFERS 0x4625
-#define RK_FBIOPUT_COLOR_KEY_CFG 0x4626
-#define RK_FBIOGET_DSP_ADDR 0x4630
-#define RK_FBIOGET_LIST_STAT 0X4631
+#define RK_FBIOGET_PANEL_SIZE 0x5001
+#define RK_FBIOSET_YUV_ADDR 0x5002
+#define RK_FBIOGET_SCREEN_STATE 0X4620
+#define RK_FBIOGET_16OR32 0X4621
+#define RK_FBIOGET_IDLEFBUff_16OR32 0X4622
+#define RK_FBIOSET_COMPOSE_LAYER_COUNTS 0X4623
+
+#define RK_FBIOGET_DMABUF_FD 0x5003
+#define RK_FBIOSET_DMABUF_FD 0x5004
+#define RK_FB_IOCTL_SET_I2P_ODD_ADDR 0x5005
+#define RK_FB_IOCTL_SET_I2P_EVEN_ADDR 0x5006
+#define RK_FBIOSET_OVERLAY_STA 0x5018
+#define RK_FBIOGET_OVERLAY_STA 0X4619
+#define RK_FBIOSET_ENABLE 0x5019
+#define RK_FBIOGET_ENABLE 0x5020
+#define RK_FBIOSET_CONFIG_DONE 0x4628
+#define RK_FBIOSET_VSYNC_ENABLE 0x4629
+#define RK_FBIOPUT_NUM_BUFFERS 0x4625
+#define RK_FBIOPUT_COLOR_KEY_CFG 0x4626
+#define RK_FBIOGET_DSP_ADDR 0x4630
+#define RK_FBIOGET_LIST_STA 0X4631
+#define RK_FBIOGET_IOMMU_STA 0x4632
/**rk fb events**/