[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1004191716020.2733@casper.infradead.org>
Date: Mon, 19 Apr 2010 17:20:10 +0100 (BST)
From: James Simmons <jsimmons@...radead.org>
To: Marcin Slusarz <marcin.slusarz@...il.com>
cc: Dave Airlie <airlied@...hat.com>, linux-fbdev@...r.kernel.org,
nouveau@...ts.freedesktop.org, LKML <linux-kernel@...r.kernel.org>,
dri-devel <dri-devel@...ts.freedesktop.org>,
Peter Jones <pjones@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] vga16fb, drm: vga16fb->drm handoff
> More generic approach below - it should work for all drm drivers.
> Unfortunately vga16fb handoff has 2 other issues:
> - It can be compiled as module, so it can be loaded after KMS driver (and
> nothing prevents it right now)
> - vga16fb registration error path is iounmapping memory which was not
> ioremapped.
> I'm going to fix it soon.
Nak. See comments below.
> ---
> From: Marcin Slusarz <marcin.slusarz@...il.com>
> Subject: [PATCH] vga16fb, drm: vga16fb->drm handoff
>
> let vga16fb claim 0xA0000+0x10000 region as its aperture;
> drm drivers don't use it, so we have to detect it and kick
> vga16fb manually - but only if drm is driving the primary card
> (by checking IORESOURCE_ROM_SHADOW resource flag)
>
> Signed-off-by: Marcin Slusarz <marcin.slusarz@...il.com>
> ---
> drivers/gpu/drm/i915/intel_fb.c | 1 +
> drivers/gpu/drm/nouveau/nouveau_fbcon.c | 1 +
> drivers/gpu/drm/nouveau/nouveau_state.c | 3 ++-
> drivers/gpu/drm/radeon/radeon_fb.c | 1 +
> drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 1 +
> drivers/video/fbmem.c | 19 ++++++++++++++++---
> drivers/video/vga16fb.c | 26 +++++++++++++++++++-------
> include/linux/fb.h | 4 +++-
> 8 files changed, 44 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
> index 6dbc277..8e403be 100644
> --- a/drivers/gpu/drm/i915/intel_fb.c
> +++ b/drivers/gpu/drm/i915/intel_fb.c
> @@ -201,6 +201,7 @@ static int intelfb_create(struct drm_device *dev, uint32_t fb_width,
> info->apertures->ranges[0].size = pci_resource_len(dev->pdev, 2);
> else
> info->apertures->ranges[0].size = pci_resource_len(dev->pdev, 0);
> + info->pcidev = dev->pdev;
No pci junk in struct fb_info. It needs to be bus independent.
> diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
> index 7cfcd71..4628a59 100644
> --- a/drivers/video/fbmem.c
> +++ b/drivers/video/fbmem.c
> @@ -32,6 +32,7 @@
> #include <linux/device.h>
> #include <linux/efi.h>
> #include <linux/fb.h>
> +#include <linux/pci.h>
Please remove pci header.
> #include <asm/fb.h>
>
> @@ -1500,19 +1501,30 @@ static bool fb_do_apertures_overlap(struct apertures_struct *gena,
> return false;
> }
>
> -void remove_conflicting_framebuffers(struct apertures_struct *a, const char *name)
> +#define VGA_FB_PHYS 0xA0000
> +void remove_conflicting_framebuffers(struct apertures_struct *a,
> + const char *name, struct pci_dev *pcidev)
> {
> int i;
> + bool primary = false;
> +
> + if (pcidev)
> + primary = pcidev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW;
Not portable. Please use fb_is_primary_device(info) instead. It will also
make your code cleaner.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists