All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de>
To: Bjorn Helgaas <bjorn_helgaas@hp.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] AGP 4/7: add generic print of AGP version & mode
Date: Wed, 8 Jan 2003 17:11:48 +0100	[thread overview]
Message-ID: <20030108171148.I628@nightmaster.csn.tu-chemnitz.de> (raw)
In-Reply-To: <200301071338.17372.bjorn_helgaas@hp.com>; from bjorn_helgaas@hp.com on Tue, Jan 07, 2003 at 01:38:17PM -0700

Hi Bjorn,
hi lkml,

On Tue, Jan 07, 2003 at 01:38:17PM -0700, Bjorn Helgaas wrote:
> diff -Nru a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
> --- a/drivers/char/agp/generic.c	Tue Jan  7 12:52:25 2003
> +++ b/drivers/char/agp/generic.c	Tue Jan  7 12:52:25 2003
> @@ -314,15 +314,22 @@
>  
>  /* Generic Agp routines - Start */
>  
> -void agp_device_command(u32 command)
> +void agp_device_command(u32 command, int agp_v3)

Why not agp_version?

>  {
>  	struct pci_dev *device;
> +	int mode;
> +
> +	mode = command & 0x7;
> +	if (agp_v3)
> +		mode *= 4;
>  
>  	pci_for_each_dev(device) {
>  		u8 agp = pci_find_capability(device, PCI_CAP_ID_AGP);
>  		if (!agp)
>  			continue;
>  
> +		printk(KERN_INFO PFX "Putting AGP V%d device at %s into %dx mode\n",
> +				agp_v3 ? 3 : 2, device->slot_name, mode);

Why not use agp_version directly here?

>  		pci_write_config_dword(device, agp + 8, command);
>  	}
>  }

And always supply AGP_VERSION_1, AGP_VERSION_2, AGP_VERSION_3 and
so or simply numbers to that command?

This offers a lot of possibilities:

   - Version checking (drivers can deny commands not suitable for
     this interface, if this checking is enabled)

   - Support for AGP_VERSION_4 can be implemented without
     obfuscating the interface for older (non-compliant) drivers.

   - One check less ;-)

   - Cleaner Code

Regards

Ingo Oeser
-- 
Science is what we can tell a computer. Art is everything else. --- D.E.Knuth

      reply	other threads:[~2003-01-08 16:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-07 20:38 [PATCH] AGP 4/7: add generic print of AGP version & mode Bjorn Helgaas
2003-01-08 16:11 ` Ingo Oeser [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=20030108171148.I628@nightmaster.csn.tu-chemnitz.de \
    --to=ingo.oeser@informatik.tu-chemnitz.de \
    --cc=bjorn_helgaas@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    /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.