forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/gpu/drm/savage/savage_bci.c
....@@ -22,8 +22,17 @@
2222 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2323 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2424 */
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>
2634 #include <drm/savage_drm.h>
35
+
2736 #include "savage_drv.h"
2837
2938 /* Need a long timeout for shadow status updates can take a while
....@@ -53,7 +62,7 @@
5362 status = dev_priv->status_ptr[0];
5463 if ((status & mask) < threshold)
5564 return 0;
56
- DRM_UDELAY(1);
65
+ udelay(1);
5766 }
5867
5968 #if SAVAGE_BCI_DEBUG
....@@ -74,7 +83,7 @@
7483 status = SAVAGE_READ(SAVAGE_STATUS_WORD0);
7584 if ((status & SAVAGE_FIFO_USED_MASK_S3D) <= maxUsed)
7685 return 0;
77
- DRM_UDELAY(1);
86
+ udelay(1);
7887 }
7988
8089 #if SAVAGE_BCI_DEBUG
....@@ -95,7 +104,7 @@
95104 status = SAVAGE_READ(SAVAGE_ALT_STATUS_WORD0);
96105 if ((status & SAVAGE_FIFO_USED_MASK_S4) <= maxUsed)
97106 return 0;
98
- DRM_UDELAY(1);
107
+ udelay(1);
99108 }
100109
101110 #if SAVAGE_BCI_DEBUG
....@@ -128,7 +137,7 @@
128137 if ((((status & 0xffff) - e) & 0xffff) <= 0x7fff ||
129138 (status & 0xffff) == 0)
130139 return 0;
131
- DRM_UDELAY(1);
140
+ udelay(1);
132141 }
133142
134143 #if SAVAGE_BCI_DEBUG
....@@ -150,7 +159,7 @@
150159 if ((((status & 0xffff) - e) & 0xffff) <= 0x7fff ||
151160 (status & 0xffff) == 0)
152161 return 0;
153
- DRM_UDELAY(1);
162
+ udelay(1);
154163 }
155164
156165 #if SAVAGE_BCI_DEBUG
....@@ -1014,7 +1023,7 @@
10141023 */
10151024 if (d->send_count != 0) {
10161025 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);
10181027 return -EINVAL;
10191028 }
10201029
....@@ -1022,7 +1031,7 @@
10221031 */
10231032 if (d->request_count < 0 || d->request_count > dma->buf_count) {
10241033 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);
10261035 return -EINVAL;
10271036 }
10281037