Commit 0e1a351d authored by Sam Ravnborg's avatar Sam Ravnborg

drm/radeon: drop dependency on drm_os_linux.h

The drm_os_linux.h header file is deprecated.
Drop all uses of symbols from this file.
All macros are just opencoded.
A few adjustments to include files was required as the obsolete
drm_os_linux.h included these headers.
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190608080241.4958-4-sam@ravnborg.org
parent a7d469cc
...@@ -3480,7 +3480,7 @@ int cik_ring_test(struct radeon_device *rdev, struct radeon_ring *ring) ...@@ -3480,7 +3480,7 @@ int cik_ring_test(struct radeon_device *rdev, struct radeon_ring *ring)
tmp = RREG32(scratch); tmp = RREG32(scratch);
if (tmp == 0xDEADBEEF) if (tmp == 0xDEADBEEF)
break; break;
DRM_UDELAY(1); udelay(1);
} }
if (i < rdev->usec_timeout) { if (i < rdev->usec_timeout) {
DRM_INFO("ring test on %d succeeded in %d usecs\n", ring->idx, i); DRM_INFO("ring test on %d succeeded in %d usecs\n", ring->idx, i);
...@@ -3825,7 +3825,7 @@ int cik_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) ...@@ -3825,7 +3825,7 @@ int cik_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
tmp = RREG32(scratch); tmp = RREG32(scratch);
if (tmp == 0xDEADBEEF) if (tmp == 0xDEADBEEF)
break; break;
DRM_UDELAY(1); udelay(1);
} }
if (i < rdev->usec_timeout) { if (i < rdev->usec_timeout) {
DRM_INFO("ib test on ring %d succeeded in %u usecs\n", ib.fence->ring, i); DRM_INFO("ib test on ring %d succeeded in %u usecs\n", ib.fence->ring, i);
......
...@@ -677,7 +677,7 @@ int cik_sdma_ring_test(struct radeon_device *rdev, ...@@ -677,7 +677,7 @@ int cik_sdma_ring_test(struct radeon_device *rdev,
tmp = le32_to_cpu(rdev->wb.wb[index/4]); tmp = le32_to_cpu(rdev->wb.wb[index/4]);
if (tmp == 0xDEADBEEF) if (tmp == 0xDEADBEEF)
break; break;
DRM_UDELAY(1); udelay(1);
} }
if (i < rdev->usec_timeout) { if (i < rdev->usec_timeout) {
...@@ -751,7 +751,7 @@ int cik_sdma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) ...@@ -751,7 +751,7 @@ int cik_sdma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
tmp = le32_to_cpu(rdev->wb.wb[index/4]); tmp = le32_to_cpu(rdev->wb.wb[index/4]);
if (tmp == 0xDEADBEEF) if (tmp == 0xDEADBEEF)
break; break;
DRM_UDELAY(1); udelay(1);
} }
if (i < rdev->usec_timeout) { if (i < rdev->usec_timeout) {
DRM_INFO("ib test on ring %d succeeded in %u usecs\n", ib.fence->ring, i); DRM_INFO("ib test on ring %d succeeded in %u usecs\n", ib.fence->ring, i);
......
...@@ -2470,7 +2470,7 @@ static int r100_rbbm_fifo_wait_for_entry(struct radeon_device *rdev, unsigned n) ...@@ -2470,7 +2470,7 @@ static int r100_rbbm_fifo_wait_for_entry(struct radeon_device *rdev, unsigned n)
if (tmp >= n) { if (tmp >= n) {
return 0; return 0;
} }
DRM_UDELAY(1); udelay(1);
} }
return -1; return -1;
} }
...@@ -2488,7 +2488,7 @@ int r100_gui_wait_for_idle(struct radeon_device *rdev) ...@@ -2488,7 +2488,7 @@ int r100_gui_wait_for_idle(struct radeon_device *rdev)
if (!(tmp & RADEON_RBBM_ACTIVE)) { if (!(tmp & RADEON_RBBM_ACTIVE)) {
return 0; return 0;
} }
DRM_UDELAY(1); udelay(1);
} }
return -1; return -1;
} }
...@@ -2504,7 +2504,7 @@ int r100_mc_wait_for_idle(struct radeon_device *rdev) ...@@ -2504,7 +2504,7 @@ int r100_mc_wait_for_idle(struct radeon_device *rdev)
if (tmp & RADEON_MC_IDLE) { if (tmp & RADEON_MC_IDLE) {
return 0; return 0;
} }
DRM_UDELAY(1); udelay(1);
} }
return -1; return -1;
} }
...@@ -3669,7 +3669,7 @@ int r100_ring_test(struct radeon_device *rdev, struct radeon_ring *ring) ...@@ -3669,7 +3669,7 @@ int r100_ring_test(struct radeon_device *rdev, struct radeon_ring *ring)
if (tmp == 0xDEADBEEF) { if (tmp == 0xDEADBEEF) {
break; break;
} }
DRM_UDELAY(1); udelay(1);
} }
if (i < rdev->usec_timeout) { if (i < rdev->usec_timeout) {
DRM_INFO("ring test succeeded in %d usecs\n", i); DRM_INFO("ring test succeeded in %d usecs\n", i);
...@@ -3746,7 +3746,7 @@ int r100_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) ...@@ -3746,7 +3746,7 @@ int r100_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
if (tmp == 0xDEADBEEF) { if (tmp == 0xDEADBEEF) {
break; break;
} }
DRM_UDELAY(1); udelay(1);
} }
if (i < rdev->usec_timeout) { if (i < rdev->usec_timeout) {
DRM_INFO("ib test succeeded in %u usecs\n", i); DRM_INFO("ib test succeeded in %u usecs\n", i);
......
...@@ -350,7 +350,7 @@ int r300_mc_wait_for_idle(struct radeon_device *rdev) ...@@ -350,7 +350,7 @@ int r300_mc_wait_for_idle(struct radeon_device *rdev)
if (tmp & R300_MC_IDLE) { if (tmp & R300_MC_IDLE) {
return 0; return 0;
} }
DRM_UDELAY(1); udelay(1);
} }
return -1; return -1;
} }
......
...@@ -44,7 +44,7 @@ int r520_mc_wait_for_idle(struct radeon_device *rdev) ...@@ -44,7 +44,7 @@ int r520_mc_wait_for_idle(struct radeon_device *rdev)
if (tmp & R520_MC_STATUS_IDLE) { if (tmp & R520_MC_STATUS_IDLE) {
return 0; return 0;
} }
DRM_UDELAY(1); udelay(1);
} }
return -1; return -1;
} }
......
...@@ -2840,7 +2840,7 @@ int r600_ring_test(struct radeon_device *rdev, struct radeon_ring *ring) ...@@ -2840,7 +2840,7 @@ int r600_ring_test(struct radeon_device *rdev, struct radeon_ring *ring)
tmp = RREG32(scratch); tmp = RREG32(scratch);
if (tmp == 0xDEADBEEF) if (tmp == 0xDEADBEEF)
break; break;
DRM_UDELAY(1); udelay(1);
} }
if (i < rdev->usec_timeout) { if (i < rdev->usec_timeout) {
DRM_INFO("ring test on %d succeeded in %d usecs\n", ring->idx, i); DRM_INFO("ring test on %d succeeded in %d usecs\n", ring->idx, i);
...@@ -3433,7 +3433,7 @@ int r600_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) ...@@ -3433,7 +3433,7 @@ int r600_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
tmp = RREG32(scratch); tmp = RREG32(scratch);
if (tmp == 0xDEADBEEF) if (tmp == 0xDEADBEEF)
break; break;
DRM_UDELAY(1); udelay(1);
} }
if (i < rdev->usec_timeout) { if (i < rdev->usec_timeout) {
DRM_INFO("ib test on ring %d succeeded in %u usecs\n", ib.fence->ring, i); DRM_INFO("ib test on ring %d succeeded in %u usecs\n", ib.fence->ring, i);
......
...@@ -261,7 +261,7 @@ int r600_dma_ring_test(struct radeon_device *rdev, ...@@ -261,7 +261,7 @@ int r600_dma_ring_test(struct radeon_device *rdev,
tmp = le32_to_cpu(rdev->wb.wb[index/4]); tmp = le32_to_cpu(rdev->wb.wb[index/4]);
if (tmp == 0xDEADBEEF) if (tmp == 0xDEADBEEF)
break; break;
DRM_UDELAY(1); udelay(1);
} }
if (i < rdev->usec_timeout) { if (i < rdev->usec_timeout) {
...@@ -382,7 +382,7 @@ int r600_dma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) ...@@ -382,7 +382,7 @@ int r600_dma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring)
tmp = le32_to_cpu(rdev->wb.wb[index/4]); tmp = le32_to_cpu(rdev->wb.wb[index/4]);
if (tmp == 0xDEADBEEF) if (tmp == 0xDEADBEEF)
break; break;
DRM_UDELAY(1); udelay(1);
} }
if (i < rdev->usec_timeout) { if (i < rdev->usec_timeout) {
DRM_INFO("ib test on ring %d succeeded in %u usecs\n", ib.fence->ring, i); DRM_INFO("ib test on ring %d succeeded in %u usecs\n", ib.fence->ring, i);
......
...@@ -28,13 +28,17 @@ ...@@ -28,13 +28,17 @@
* Jerome Glisse <glisse@freedesktop.org> * Jerome Glisse <glisse@freedesktop.org>
* Dave Airlie * Dave Airlie
*/ */
#include <linux/seq_file.h>
#include <linux/atomic.h> #include <linux/atomic.h>
#include <linux/wait.h> #include <linux/firmware.h>
#include <linux/kref.h> #include <linux/kref.h>
#include <linux/sched/signal.h>
#include <linux/seq_file.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/firmware.h> #include <linux/wait.h>
#include <drm/drmP.h> #include <drm/drmP.h>
#include "radeon_reg.h" #include "radeon_reg.h"
#include "radeon.h" #include "radeon.h"
#include "radeon_trace.h" #include "radeon_trace.h"
......
...@@ -771,7 +771,7 @@ int radeon_vce_ring_test(struct radeon_device *rdev, struct radeon_ring *ring) ...@@ -771,7 +771,7 @@ int radeon_vce_ring_test(struct radeon_device *rdev, struct radeon_ring *ring)
for (i = 0; i < rdev->usec_timeout; i++) { for (i = 0; i < rdev->usec_timeout; i++) {
if (vce_v1_0_get_rptr(rdev, ring) != rptr) if (vce_v1_0_get_rptr(rdev, ring) != rptr)
break; break;
DRM_UDELAY(1); udelay(1);
} }
if (i < rdev->usec_timeout) { if (i < rdev->usec_timeout) {
......
...@@ -67,7 +67,7 @@ void rs400_gart_tlb_flush(struct radeon_device *rdev) ...@@ -67,7 +67,7 @@ void rs400_gart_tlb_flush(struct radeon_device *rdev)
tmp = RREG32_MC(RS480_GART_CACHE_CNTRL); tmp = RREG32_MC(RS480_GART_CACHE_CNTRL);
if ((tmp & RS480_GART_CACHE_INVALIDATE) == 0) if ((tmp & RS480_GART_CACHE_INVALIDATE) == 0)
break; break;
DRM_UDELAY(1); udelay(1);
timeout--; timeout--;
} while (timeout > 0); } while (timeout > 0);
WREG32_MC(RS480_GART_CACHE_CNTRL, 0); WREG32_MC(RS480_GART_CACHE_CNTRL, 0);
...@@ -245,7 +245,7 @@ int rs400_mc_wait_for_idle(struct radeon_device *rdev) ...@@ -245,7 +245,7 @@ int rs400_mc_wait_for_idle(struct radeon_device *rdev)
if (tmp & RADEON_MC_IDLE) { if (tmp & RADEON_MC_IDLE) {
return 0; return 0;
} }
DRM_UDELAY(1); udelay(1);
} }
return -1; return -1;
} }
......
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
* close to the one of the R600 family (R600 likely being an evolution * close to the one of the R600 family (R600 likely being an evolution
* of the RS600 GART block). * of the RS600 GART block).
*/ */
#include <linux/io-64-nonatomic-lo-hi.h>
#include <drm/drmP.h> #include <drm/drmP.h>
#include "radeon.h" #include "radeon.h"
#include "radeon_asic.h" #include "radeon_asic.h"
......
...@@ -138,7 +138,7 @@ int rv515_mc_wait_for_idle(struct radeon_device *rdev) ...@@ -138,7 +138,7 @@ int rv515_mc_wait_for_idle(struct radeon_device *rdev)
if (tmp & MC_STATUS_IDLE) { if (tmp & MC_STATUS_IDLE) {
return 0; return 0;
} }
DRM_UDELAY(1); udelay(1);
} }
return -1; return -1;
} }
......
...@@ -438,7 +438,7 @@ int uvd_v1_0_ring_test(struct radeon_device *rdev, struct radeon_ring *ring) ...@@ -438,7 +438,7 @@ int uvd_v1_0_ring_test(struct radeon_device *rdev, struct radeon_ring *ring)
tmp = RREG32(UVD_CONTEXT_ID); tmp = RREG32(UVD_CONTEXT_ID);
if (tmp == 0xDEADBEEF) if (tmp == 0xDEADBEEF)
break; break;
DRM_UDELAY(1); udelay(1);
} }
if (i < rdev->usec_timeout) { if (i < rdev->usec_timeout) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment