gpu: nvgpu: add conversion function for poll masks

In order to enable the movement of clk arbitrator to common
code, we need to remove the linux specific POLL* defines
and instead use NVGPU defines. Add a conversion function
for the same.
Also remove debugfs include, while at it.

Jira VQRM-3741

Change-Id: I3c367625f9fa5fb8480d01bdaf6233df8cc2c722
Signed-off-by: Sourab Gupta <sourabg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1704885
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Sourab Gupta
2018-04-29 14:37:32 +05:30
committed by mobile promotions
parent 0ad40e83db
commit 3dabdf3e6d
3 changed files with 34 additions and 10 deletions

View File

@@ -62,6 +62,24 @@ static int nvgpu_clk_arb_release_completion_dev(struct inode *inode,
return 0;
}
static inline unsigned int nvgpu_convert_poll_mask(unsigned int nvgpu_poll_mask)
{
unsigned int poll_mask = 0;
if (nvgpu_poll_mask & NVGPU_POLLIN)
poll_mask |= POLLIN;
if (nvgpu_poll_mask & NVGPU_POLLPRI)
poll_mask |= POLLPRI;
if (nvgpu_poll_mask & NVGPU_POLLOUT)
poll_mask |= POLLOUT;
if (nvgpu_poll_mask & NVGPU_POLLRDNORM)
poll_mask |= POLLRDNORM;
if (nvgpu_poll_mask & NVGPU_POLLHUP)
poll_mask |= POLLHUP;
return poll_mask;
}
static unsigned int nvgpu_clk_arb_poll_dev(struct file *filp, poll_table *wait)
{
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)
nvgpu_log(dev->session->g, gpu_dbg_fn | gpu_dbg_clk_arb, " ");
poll_wait(filp, &dev->readout_wq.wq, wait);
return nvgpu_atomic_xchg(&dev->poll_mask, 0);
return nvgpu_convert_poll_mask(nvgpu_atomic_xchg(&dev->poll_mask, 0));
}
static int nvgpu_clk_arb_release_event_dev(struct inode *inode,