dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Skeggs <bskeggs@redhat.com>
To: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/nouveau/bios: fix offset calculation for BMPv1 bioses
Date: Tue, 7 Jan 2014 17:01:03 -0500 (EST)	[thread overview]
Message-ID: <1825497174.26883457.1389132063453.JavaMail.root@redhat.com> (raw)
In-Reply-To: <1389116039-20361-1-git-send-email-imirkin@alum.mit.edu>

----- Original Message -----
> From: "Ilia Mirkin" <imirkin@alum.mit.edu>
> To: "Ben Skeggs" <bskeggs@redhat.com>
> Cc: dri-devel@lists.freedesktop.org, "Ilia Mirkin" <imirkin@alum.mit.edu>
> Sent: Wednesday, 8 January, 2014 3:33:59 AM
> Subject: [PATCH] drm/nouveau/bios: fix offset calculation for BMPv1 bioses
> 
> The only BIOS on record that needs the 14 offset has a bios major
> version 2 but BMP version 1.01. Another bunch of BIOSes that need the 18
> offset have BMP version 2.01 or 5.01 or higher. So instead of looking at the
> bios major version, look at the BMP version. BIOSes with BMP version 0
> do not contain a detectable script, so always return 0 for them.
I've merged the patch, thanks.

> 
> See https://bugs.freedesktop.org/show_bug.cgi?id=68835
> 
> Reported-by: Mauro Molinari <mauromol@tiscali.it>
> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
> ---
> 
> Unfortunately the bug reporter doesn't really know how to compile kernels and
> my bet is that the system his NV04 is in isn't exactly top-of-the-line, so a
> kernel compile would take forever.
> 
> I've made similar changes in nvbios, and it seems to now handle every
> nv04/nv05 bios in our repo, in addition to Mauro's, so I think these changes
> should be safe-ish. However I'm not tagging for stable yet, in case things
> don't pan out the way I expected. If Mauro tests a kernel with this and all's
> well, then I'll send a separate request to stable-ify this patch.
> 
> I'm betting that some old code used to check the bmp_version_major against 2,
> but that got changed to bios major in one of the rewrites, although I didn't
> go digging.
You are correct.  I confirmed this this morning.

> 
>  drivers/gpu/drm/nouveau/core/subdev/bios/init.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
> b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
> index 9f5b81e..df1b1b4 100644
> --- a/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
> +++ b/drivers/gpu/drm/nouveau/core/subdev/bios/init.c
> @@ -365,13 +365,13 @@ static u16
>  init_script(struct nouveau_bios *bios, int index)
>  {
>  	struct nvbios_init init = { .bios = bios };
> -	u16 data;
> +	u16 bmp_ver = bmp_version(bios), data;
>  
> -	if (bmp_version(bios) && bmp_version(bios) < 0x0510) {
> -		if (index > 1)
> +	if (bmp_ver && bmp_ver < 0x0510) {
> +		if (index > 1 || bmp_ver < 0x0100)
>  			return 0x0000;
>  
> -		data = bios->bmp_offset + (bios->version.major < 2 ? 14 : 18);
> +		data = bios->bmp_offset + (bmp_ver < 0x0200 ? 14 : 18);
>  		return nv_ro16(bios, data + (index * 2));
>  	}
>  
> --
> 1.8.3.2
> 
> 

      reply	other threads:[~2014-01-07 22:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 17:33 [PATCH] drm/nouveau/bios: fix offset calculation for BMPv1 bioses Ilia Mirkin
2014-01-07 22:01 ` Ben Skeggs [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=1825497174.26883457.1389132063453.JavaMail.root@redhat.com \
    --to=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=imirkin@alum.mit.edu \
    /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