mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 22:52:35 +02:00
rk3288: add a interface for user space to query iommu status
This commit is contained in:
parent
a78e027a84
commit
3fc20e7896
|
|
@ -43,8 +43,8 @@
|
|||
#include <linux/rockchip_ion.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ROCKCHIP_IOMMU)
|
||||
//#define CONFIG_VCODEC_MMU
|
||||
#if defined(CONFIG_ROCKCHIP_IOMMU) & defined(CONFIG_ION_ROCKCHIP)
|
||||
#define CONFIG_VCODEC_MMU
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_VCODEC_MMU
|
||||
|
|
@ -304,7 +304,7 @@ typedef struct vpu_service_info {
|
|||
struct dentry *debugfs_file_regs;
|
||||
|
||||
u32 irq_status;
|
||||
#if defined(CONFIG_ION_ROCKCHIP)
|
||||
#if defined(CONFIG_VCODEC_MMU)
|
||||
struct ion_client * ion_client;
|
||||
#endif
|
||||
|
||||
|
|
@ -1227,6 +1227,18 @@ static long vpu_service_ioctl(struct file *filp, unsigned int cmd, unsigned long
|
|||
mutex_unlock(&pservice->lock);
|
||||
break;
|
||||
}
|
||||
case VPU_IOC_PROBE_IOMMU_STATUS: {
|
||||
#if defined(CONFIG_VCODEC_MMU)
|
||||
int iommu_enable = 1;
|
||||
#else
|
||||
int iommu_enable = 0;
|
||||
#endif
|
||||
if (copy_to_user((void __user *)arg, &iommu_enable, sizeof(int))) {
|
||||
pr_err("error: VPU_IOC_PROBE_IOMMU_STATUS copy_to_user failed\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default : {
|
||||
pr_err("error: unknow vpu service ioctl cmd %x\n", cmd);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@
|
|||
#define VPU_IOC_SET_REG _IOW(VPU_IOC_MAGIC, 3, unsigned long)
|
||||
#define VPU_IOC_GET_REG _IOW(VPU_IOC_MAGIC, 4, unsigned long)
|
||||
|
||||
#define VPU_IOC_PROBE_IOMMU_STATUS _IOR(VPU_IOC_MAGIC, 5, unsigned long)
|
||||
|
||||
typedef enum VPU_CLIENT_TYPE {
|
||||
VPU_ENC = 0x0,
|
||||
VPU_DEC = 0x1,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user