Commit 3cdc0e8d authored by Christopher Harvey's avatar Christopher Harvey Committed by Dave Airlie

drm/mgag200: Convert counter delays to jiffies

Signed-off-by: default avatarChristopher Harvey <charvey@matrox.com>
Acked-by: default avatarJulia Lemire <jlemire@matrox.com>
Tested-by: default avatarJulia Lemire <jlemire@matrox.com>
Acked-by: default avatarMathieu Larouche <mathieu.larouche@matrox.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent fb70a669
...@@ -46,29 +46,26 @@ static void mga_crtc_load_lut(struct drm_crtc *crtc) ...@@ -46,29 +46,26 @@ static void mga_crtc_load_lut(struct drm_crtc *crtc)
static inline void mga_wait_vsync(struct mga_device *mdev) static inline void mga_wait_vsync(struct mga_device *mdev)
{ {
unsigned int count = 0; unsigned long timeout = jiffies + HZ/10;
unsigned int status = 0; unsigned int status = 0;
do { do {
status = RREG32(MGAREG_Status); status = RREG32(MGAREG_Status);
count++; } while ((status & 0x08) && time_before(jiffies, timeout));
} while ((status & 0x08) && (count < 250000)); timeout = jiffies + HZ/10;
count = 0;
status = 0; status = 0;
do { do {
status = RREG32(MGAREG_Status); status = RREG32(MGAREG_Status);
count++; } while (!(status & 0x08) && time_before(jiffies, timeout));
} while (!(status & 0x08) && (count < 250000));
} }
static inline void mga_wait_busy(struct mga_device *mdev) static inline void mga_wait_busy(struct mga_device *mdev)
{ {
unsigned int count = 0; unsigned long timeout = jiffies + HZ;
unsigned int status = 0; unsigned int status = 0;
do { do {
status = RREG8(MGAREG_Status + 2); status = RREG8(MGAREG_Status + 2);
count++; } while ((status & 0x01) && time_before(jiffies, timeout));
} while ((status & 0x01) && (count < 500000));
} }
/* /*
......
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