> Date: Tue, 21 Aug 2012 19:17:08 +0200
> From: Martin Pieuchot <[email protected]>
>
> Diff below is mostly a rewrite of vgafb_pci_probe() to determine the
> memory and mmio regions based on previously initialized BAR structures.
> But it also includes the glue to attach drm(4) to vgafb(4).
>
> It reuses the following functions from vga(4), the last three are
> required by any drm(4) driver:
> - vga_pci_bar_init()
> - vga_pci_bar_info()
> - vga_pci_bar_map()
> - vga_pci_bar_unmap()
Looks like by "reuses" you mean "copies". That tends to be a bad idea
since results in diverging code. WOuldn't it be better to split out
these functions into their own file (vga_pci_common.c) and share them
between vga(4) and vgafb(4)?
> I kept amd64's major numbers for agp/drm, is that ok?
Should be fine.
> Index: macppc/conf.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/macppc/macppc/conf.c,v
> retrieving revision 1.47
> diff -u -p -r1.47 conf.c
> --- macppc/conf.c 6 Apr 2012 15:10:40 -0000 1.47
> +++ macppc/conf.c 21 Aug 2012 09:51:19 -0000
> @@ -119,6 +119,8 @@ cdev_decl(nnpfs_dev);
>
> #include "apm.h"
> #include "bthub.h"
> +#include "drm.h"
> +cdev_decl(drm);
>
> #include "wsmux.h"
>
> @@ -243,6 +245,12 @@ struct cdevsw cdevsw[] = {
> cdev_vscsi_init(NVSCSI,vscsi), /* 83: vscsi */
> cdev_disk_init(1,diskmap), /* 84: disk mapper */
> cdev_pppx_init(NPPPX,pppx), /* 85: pppx */
> +#ifdef NAGP
> + cdev_agp_init(NAGP,agp), /* 86: agp */
> +#else
> + cdev_notdef(),
> +#endif
Hmm, that #ifdef shouldn't be necessary since agp is declared with
needs-flag in dev/pci/files.agp. I guess the problem is that you
don't include that file in arch/macppc/conf/files.macppc. Perhaps if you don't
expect to mess around with agp on macppc anytime soon, but want to reserve the
major number, you should just add this as
cdev_notdef(), /* 86: agp */