From: Dave Airlie <airlied@gmail.com>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: airlied@linux.ie, dri-devel@lists.sourceforge.net,
lkml <linux-kernel@vger.kernel.org>,
"Thomas Hellström" <thomas@tungstengraphics.com>
Subject: Re: [PATCH] drm: count reaches -1, tested 0
Date: Mon, 9 Feb 2009 12:28:35 +1000 [thread overview]
Message-ID: <21d7e9970902081828m709bd839va95b464cd72a4bdb@mail.gmail.com> (raw)
In-Reply-To: <498EEB42.1050509@gmail.com>
On Mon, Feb 9, 2009 at 12:25 AM, Roel Kluin <roel.kluin@gmail.com> wrote:
> With a postfix decrement count will reach -1 rather than 0,
> subsequent tests fail.
Thomas can you sign off on this?
Dave.
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/drivers/gpu/drm/via/via_dma.c b/drivers/gpu/drm/via/via_dma.c
> index 7a339db..600315c 100644
> --- a/drivers/gpu/drm/via/via_dma.c
> +++ b/drivers/gpu/drm/via/via_dma.c
> @@ -481,9 +481,9 @@ static int via_wait_idle(drm_via_private_t * dev_priv)
> {
> int count = 10000000;
>
> - while (!(VIA_READ(VIA_REG_STATUS) & VIA_VR_QUEUE_BUSY) && count--);
> + while (!(VIA_READ(VIA_REG_STATUS) & VIA_VR_QUEUE_BUSY) && --count);
>
> - while (count-- && (VIA_READ(VIA_REG_STATUS) &
> + while (--count && (VIA_READ(VIA_REG_STATUS) &
> (VIA_CMD_RGTR_BUSY | VIA_2D_ENG_BUSY |
> VIA_3D_ENG_BUSY))) ;
> return count;
> @@ -705,7 +705,7 @@ static int via_cmdbuf_size(struct drm_device *dev, void *data, struct drm_file *
> switch (d_siz->func) {
> case VIA_CMDBUF_SPACE:
> while (((tmp_size = via_cmdbuf_space(dev_priv)) < d_siz->size)
> - && count--) {
> + && --count) {
> if (!d_siz->wait) {
> break;
> }
> @@ -717,7 +717,7 @@ static int via_cmdbuf_size(struct drm_device *dev, void *data, struct drm_file *
> break;
> case VIA_CMDBUF_LAG:
> while (((tmp_size = via_cmdbuf_lag(dev_priv)) > d_siz->size)
> - && count--) {
> + && --count) {
> if (!d_siz->wait) {
> break;
> }
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
next prev parent reply other threads:[~2009-02-09 2:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-08 14:25 Roel Kluin
2009-02-09 2:28 ` Dave Airlie [this message]
2009-02-09 22:22 ` Thomas Hellström
2009-02-10 20:48 ` [PATCH v2] " Roel Kluin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=21d7e9970902081828m709bd839va95b464cd72a4bdb@mail.gmail.com \
--to=airlied@gmail.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=roel.kluin@gmail.com \
--cc=thomas@tungstengraphics.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®