| .. | .. |
|---|
| 22 | 22 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|---|
| 23 | 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|---|
| 24 | 24 | */ |
|---|
| 25 | | -#include <drm/drmP.h> |
|---|
| 25 | + |
|---|
| 26 | +#include <linux/delay.h> |
|---|
| 27 | +#include <linux/pci.h> |
|---|
| 28 | +#include <linux/slab.h> |
|---|
| 29 | +#include <linux/uaccess.h> |
|---|
| 30 | + |
|---|
| 31 | +#include <drm/drm_device.h> |
|---|
| 32 | +#include <drm/drm_file.h> |
|---|
| 33 | +#include <drm/drm_print.h> |
|---|
| 26 | 34 | #include <drm/savage_drm.h> |
|---|
| 35 | + |
|---|
| 27 | 36 | #include "savage_drv.h" |
|---|
| 28 | 37 | |
|---|
| 29 | 38 | /* Need a long timeout for shadow status updates can take a while |
|---|
| .. | .. |
|---|
| 53 | 62 | status = dev_priv->status_ptr[0]; |
|---|
| 54 | 63 | if ((status & mask) < threshold) |
|---|
| 55 | 64 | return 0; |
|---|
| 56 | | - DRM_UDELAY(1); |
|---|
| 65 | + udelay(1); |
|---|
| 57 | 66 | } |
|---|
| 58 | 67 | |
|---|
| 59 | 68 | #if SAVAGE_BCI_DEBUG |
|---|
| .. | .. |
|---|
| 74 | 83 | status = SAVAGE_READ(SAVAGE_STATUS_WORD0); |
|---|
| 75 | 84 | if ((status & SAVAGE_FIFO_USED_MASK_S3D) <= maxUsed) |
|---|
| 76 | 85 | return 0; |
|---|
| 77 | | - DRM_UDELAY(1); |
|---|
| 86 | + udelay(1); |
|---|
| 78 | 87 | } |
|---|
| 79 | 88 | |
|---|
| 80 | 89 | #if SAVAGE_BCI_DEBUG |
|---|
| .. | .. |
|---|
| 95 | 104 | status = SAVAGE_READ(SAVAGE_ALT_STATUS_WORD0); |
|---|
| 96 | 105 | if ((status & SAVAGE_FIFO_USED_MASK_S4) <= maxUsed) |
|---|
| 97 | 106 | return 0; |
|---|
| 98 | | - DRM_UDELAY(1); |
|---|
| 107 | + udelay(1); |
|---|
| 99 | 108 | } |
|---|
| 100 | 109 | |
|---|
| 101 | 110 | #if SAVAGE_BCI_DEBUG |
|---|
| .. | .. |
|---|
| 128 | 137 | if ((((status & 0xffff) - e) & 0xffff) <= 0x7fff || |
|---|
| 129 | 138 | (status & 0xffff) == 0) |
|---|
| 130 | 139 | return 0; |
|---|
| 131 | | - DRM_UDELAY(1); |
|---|
| 140 | + udelay(1); |
|---|
| 132 | 141 | } |
|---|
| 133 | 142 | |
|---|
| 134 | 143 | #if SAVAGE_BCI_DEBUG |
|---|
| .. | .. |
|---|
| 150 | 159 | if ((((status & 0xffff) - e) & 0xffff) <= 0x7fff || |
|---|
| 151 | 160 | (status & 0xffff) == 0) |
|---|
| 152 | 161 | return 0; |
|---|
| 153 | | - DRM_UDELAY(1); |
|---|
| 162 | + udelay(1); |
|---|
| 154 | 163 | } |
|---|
| 155 | 164 | |
|---|
| 156 | 165 | #if SAVAGE_BCI_DEBUG |
|---|
| .. | .. |
|---|
| 1014 | 1023 | */ |
|---|
| 1015 | 1024 | if (d->send_count != 0) { |
|---|
| 1016 | 1025 | DRM_ERROR("Process %d trying to send %d buffers via drmDMA\n", |
|---|
| 1017 | | - DRM_CURRENTPID, d->send_count); |
|---|
| 1026 | + task_pid_nr(current), d->send_count); |
|---|
| 1018 | 1027 | return -EINVAL; |
|---|
| 1019 | 1028 | } |
|---|
| 1020 | 1029 | |
|---|
| .. | .. |
|---|
| 1022 | 1031 | */ |
|---|
| 1023 | 1032 | if (d->request_count < 0 || d->request_count > dma->buf_count) { |
|---|
| 1024 | 1033 | DRM_ERROR("Process %d trying to get %d buffers (of %d max)\n", |
|---|
| 1025 | | - DRM_CURRENTPID, d->request_count, dma->buf_count); |
|---|
| 1034 | + task_pid_nr(current), d->request_count, dma->buf_count); |
|---|
| 1026 | 1035 | return -EINVAL; |
|---|
| 1027 | 1036 | } |
|---|
| 1028 | 1037 | |
|---|