summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/ioctl_clk_arb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/ioctl_clk_arb.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_clk_arb.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_clk_arb.c b/drivers/gpu/nvgpu/common/linux/ioctl_clk_arb.c
index 40a5b11c..2bf2e653 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_clk_arb.c
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_clk_arb.c
@@ -62,6 +62,24 @@ static int nvgpu_clk_arb_release_completion_dev(struct inode *inode,
62 return 0; 62 return 0;
63} 63}
64 64
65static inline unsigned int nvgpu_convert_poll_mask(unsigned int nvgpu_poll_mask)
66{
67 unsigned int poll_mask = 0;
68
69 if (nvgpu_poll_mask & NVGPU_POLLIN)
70 poll_mask |= POLLIN;
71 if (nvgpu_poll_mask & NVGPU_POLLPRI)
72 poll_mask |= POLLPRI;
73 if (nvgpu_poll_mask & NVGPU_POLLOUT)
74 poll_mask |= POLLOUT;
75 if (nvgpu_poll_mask & NVGPU_POLLRDNORM)
76 poll_mask |= POLLRDNORM;
77 if (nvgpu_poll_mask & NVGPU_POLLHUP)
78 poll_mask |= POLLHUP;
79
80 return poll_mask;
81}
82
65static unsigned int nvgpu_clk_arb_poll_dev(struct file *filp, poll_table *wait) 83static unsigned int nvgpu_clk_arb_poll_dev(struct file *filp, poll_table *wait)
66{ 84{
67 struct nvgpu_clk_dev *dev = filp->private_data; 85 struct nvgpu_clk_dev *dev = filp->private_data;
@@ -69,7 +87,7 @@ static unsigned int nvgpu_clk_arb_poll_dev(struct file *filp, poll_table *wait)
69 nvgpu_log(dev->session->g, gpu_dbg_fn | gpu_dbg_clk_arb, " "); 87 nvgpu_log(dev->session->g, gpu_dbg_fn | gpu_dbg_clk_arb, " ");
70 88
71 poll_wait(filp, &dev->readout_wq.wq, wait); 89 poll_wait(filp, &dev->readout_wq.wq, wait);
72 return nvgpu_atomic_xchg(&dev->poll_mask, 0); 90 return nvgpu_convert_poll_mask(nvgpu_atomic_xchg(&dev->poll_mask, 0));
73} 91}
74 92
75static int nvgpu_clk_arb_release_event_dev(struct inode *inode, 93static int nvgpu_clk_arb_release_event_dev(struct inode *inode,