From: Mathieu Larouche <mathieu.larouche@matrox.com>
To: Michal Srb <msrb@suse.com>, dri-devel@lists.freedesktop.org
Cc: Dave Airlie <airlied@redhat.com>, Matt Russo <Matt.Russo@matrox.com>
Subject: Re: mgag200: Wrong looking code in mga_probe_vram
Date: Wed, 18 Oct 2017 07:49:27 -0400 [thread overview]
Message-ID: <59E73FC7.2010808@matrox.com> (raw)
In-Reply-To: <11691338.pzimoKDfCV@sheogorath.suse.cz>
On 11/10/2017 5:27 AM, Michal Srb wrote:
> Hi,
>
> While reading the mgag200 driver I noticed something that looks wrong.
>
> In mgag200_main.c mga_probe_vram function:
>
> orig1 = ioread8(mem + offset);
> orig2 = ioread8(mem + offset + 0x100);
>
> ...
>
> iowrite16(orig1, mem + offset);
> iowrite16(orig2, mem + offset + 0x100);
>
> I do not understand how exactly the probing works, but ioread8 followed by
> iowrite16 does not look correct.
>
> The corresponding function in xf86-video-mga UMS driver is MGACountRam. It
> does the equivalent of read 16, write 16. So in case you can confirm that the
> kernel driver is correct, it would probably mean the user space driver is
> wrong.
>
> Thanks,
> Michal Srb
>
Hi,
I agree with you, there's an issue there. The first two lines should be
ioread16(). The goal of this routine is to detect the amount of memory
available since it varies in some products. Basically, it stores the
initial value, write a value and read it back, then it restores the
initial value. In this case, only half of the value will be restored.
Mathieu
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2017-10-18 11:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-11 9:27 mgag200: Wrong looking code in mga_probe_vram Michal Srb
2017-10-18 11:49 ` Mathieu Larouche [this message]
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=59E73FC7.2010808@matrox.com \
--to=mathieu.larouche@matrox.com \
--cc=Matt.Russo@matrox.com \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=msrb@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.