aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-04-16 16:57:46 -0400
committerDave Airlie <airlied@redhat.com>2009-04-19 19:28:20 -0400
commitd9c6f546469f33f9aa48ae5991c33da8cd535b37 (patch)
tree3566163c07452cec433ac00a58adf059c6d06219 /drivers
parent029a2edbd36f5e34ff1aebfba1bca31b5ac9899e (diff)
drm: count reaches -1
With a postfix decrement in the test count will reach -1 rather than 0, subsequent tests fail. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/via/via_dma.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpu/drm/via/via_dma.c b/drivers/gpu/drm/via/via_dma.c
index 7a339dba6a69..bfb92d283260 100644
--- a/drivers/gpu/drm/via/via_dma.c
+++ b/drivers/gpu/drm/via/via_dma.c
@@ -481,11 +481,13 @@ static int via_wait_idle(drm_via_private_t * dev_priv)
481{ 481{
482 int count = 10000000; 482 int count = 10000000;
483 483
484 while (!(VIA_READ(VIA_REG_STATUS) & VIA_VR_QUEUE_BUSY) && count--); 484 while (!(VIA_READ(VIA_REG_STATUS) & VIA_VR_QUEUE_BUSY) && --count)
485 ;
485 486
486 while (count-- && (VIA_READ(VIA_REG_STATUS) & 487 while (count && (VIA_READ(VIA_REG_STATUS) &
487 (VIA_CMD_RGTR_BUSY | VIA_2D_ENG_BUSY | 488 (VIA_CMD_RGTR_BUSY | VIA_2D_ENG_BUSY |
488 VIA_3D_ENG_BUSY))) ; 489 VIA_3D_ENG_BUSY)))
490 --count;
489 return count; 491 return count;
490} 492}
491 493
@@ -705,7 +707,7 @@ static int via_cmdbuf_size(struct drm_device *dev, void *data, struct drm_file *
705 switch (d_siz->func) { 707 switch (d_siz->func) {
706 case VIA_CMDBUF_SPACE: 708 case VIA_CMDBUF_SPACE:
707 while (((tmp_size = via_cmdbuf_space(dev_priv)) < d_siz->size) 709 while (((tmp_size = via_cmdbuf_space(dev_priv)) < d_siz->size)
708 && count--) { 710 && --count) {
709 if (!d_siz->wait) { 711 if (!d_siz->wait) {
710 break; 712 break;
711 } 713 }
@@ -717,7 +719,7 @@ static int via_cmdbuf_size(struct drm_device *dev, void *data, struct drm_file *
717 break; 719 break;
718 case VIA_CMDBUF_LAG: 720 case VIA_CMDBUF_LAG:
719 while (((tmp_size = via_cmdbuf_lag(dev_priv)) > d_siz->size) 721 while (((tmp_size = via_cmdbuf_lag(dev_priv)) > d_siz->size)
720 && count--) { 722 && --count) {
721 if (!d_siz->wait) { 723 if (!d_siz->wait) {
722 break; 724 break;
723 } 725 }