[Mesa-dev] [PATCH 2/2] r300g: Fix queries on big endian hosts.

Michel Dänzer michel at daenzer.net
Wed Nov 2 11:05:24 PDT 2011


On Mit, 2011-11-02 at 10:36 -0700, Corbin Simpson wrote: 
> 2011/11/2 Michel Dänzer <michel at daenzer.net>:
> > From: Michel Dänzer <michel.daenzer at amd.com>
> >
> > Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> > ---
> >  src/gallium/drivers/r300/r300_query.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/src/gallium/drivers/r300/r300_query.c b/src/gallium/drivers/r300/r300_query.c
> > index 9e784b5..b92410f 100644
> > --- a/src/gallium/drivers/r300/r300_query.c
> > +++ b/src/gallium/drivers/r300/r300_query.c
> > @@ -132,7 +132,7 @@ static boolean r300_get_query_result(struct pipe_context* pipe,
> >     /* Sum up the results. */
> >     temp = 0;
> >     for (i = 0; i < q->num_results; i++) {
> > -        temp += *map;
> > +        temp += util_le32_to_cpu(*map);
> >         map++;
> >     }
> 
> Nice catch! Only one thing: comment might help future maintainers
> understand this. Feel free to push as-is.

I guess a comment can't hurt, so I added one before pushing.


> I can't test this, as I have no big-endian hardware, but it looks very correct.
> 
> Reviewed-by: Corbin Simpson <MostAwesomeDude at gmail.com>

Thanks!


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the mesa-dev mailing list