* Re: [PATCH v3] s3fb: add DDC support
From: Ondrej Zary @ 2011-04-04 9:25 UTC (permalink / raw)
To: Paul Mundt; +Cc: Ondrej Zajicek, linux-fbdev, Kernel development list
In-Reply-To: <20110404084200.GD28208@linux-sh.org>
On Monday 04 April 2011, Paul Mundt wrote:
> On Mon, Apr 04, 2011 at 10:33:16AM +0200, Ondrej Zajicek wrote:
> > On Sun, Apr 03, 2011 at 10:36:15PM +0200, Ondrej Zary wrote:
> > > Add I2C support for the DDC bus and also default mode initialization by
> > > reading monitor EDID to the s3fb driver.
> > >
> > > Tested on Trio64V+ (2 cards), Trio64V2/DX, Virge (3 cards),
> > > Virge/DX (3 cards), Virge/GX2, Trio3D/2X (4 cards), Trio3D.
> > >
> > > Will probably not work on Trio32 - my 2 cards have DDC support in BIOS
> > > that looks different from the other cards but the DDC pins on the VGA
> > > connector are not connected.
> > >
> > > Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
> >
> > Acked-by: Ondrej Zajicek <santiago@crfreenet.org>
>
> Is there much reason to leave this optional? Or are you simply waiting
> for testing feedback from Trio32 users before default-enabling it?
>
> It would generally be nice to avoid these sorts of config options for a
> specific driver if it already is quite capable of handling the
> unsupported cases and has a reasonable fallback on defaults via the error
> path.
If the config option is not desired, I'll remove it, I don't like it either.
Just did it like some other fb drivers do. The only reason why someone would
want to disable DDC is probably to have I2C-less kernel.
If the EDID cannot be read (old monitor connected or DDC pins not connected
like on Trio32 cards) or the card does not have enough memory (1280x1024 LCD
on a 1MB card), the driver falls back to 640x480-8@60.
--
Ondrej Zary
^ permalink raw reply
* Re: [PATCH v3] s3fb: add DDC support
From: Paul Mundt @ 2011-04-04 8:42 UTC (permalink / raw)
To: Ondrej Zajicek; +Cc: Ondrej Zary, linux-fbdev, Kernel development list
In-Reply-To: <20110404083316.GB9431@localhost>
On Mon, Apr 04, 2011 at 10:33:16AM +0200, Ondrej Zajicek wrote:
> On Sun, Apr 03, 2011 at 10:36:15PM +0200, Ondrej Zary wrote:
> > Add I2C support for the DDC bus and also default mode initialization by
> > reading monitor EDID to the s3fb driver.
> >
> > Tested on Trio64V+ (2 cards), Trio64V2/DX, Virge (3 cards),
> > Virge/DX (3 cards), Virge/GX2, Trio3D/2X (4 cards), Trio3D.
> >
> > Will probably not work on Trio32 - my 2 cards have DDC support in BIOS that
> > looks different from the other cards but the DDC pins on the VGA connector
> > are not connected.
> >
> > Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
>
> Acked-by: Ondrej Zajicek <santiago@crfreenet.org>
>
Is there much reason to leave this optional? Or are you simply waiting
for testing feedback from Trio32 users before default-enabling it?
It would generally be nice to avoid these sorts of config options for a
specific driver if it already is quite capable of handling the
unsupported cases and has a reasonable fallback on defaults via the error
path.
^ permalink raw reply
* Re: [PATCH] s3fb: fix Virge/GX2
From: Ondrej Zajicek @ 2011-04-04 8:33 UTC (permalink / raw)
To: Ondrej Zary; +Cc: linux-fbdev, Kernel development list, Paul Mundt
In-Reply-To: <201103292107.11969.linux@rainbow-software.org>
[-- Attachment #1: Type: text/plain, Size: 1265 bytes --]
On Tue, Mar 29, 2011 at 09:07:08PM +0200, Ondrej Zary wrote:
> Fix Virge/GX2 support in s3fb:
> - fix IDs: 86C357 is GX2, 86C359 is GX2+, 86C356 probably does not exist
> - add memory size detection
> - drive it the same way as Trio3D/2X
>
> The original IDs most likely came from S3 website which claims that:
> - 356 is Virge/GX2 with ID=8A10, driver included in Windows 2K, XP
> - 357 is Virge/GX2+ with ID=8A11, driver included in Windows ME
> - 359 is Virge/GX2+ with ID=8A12, driver included in Windows ME
> but:
> - google search for 86C356 only reveals references to Trio3D (probably
> because of a typo - Trio3D is 86C365)
> - my card is clearly marked as 86C357, Virge/GX2 and has ID=8A10
> - there is no driver for IDs 8A11 and 8A12 in Windows ME
> - there is a driver for ID 8A10 in Windows ME that says it's GX2 (357)
>
> Tested with #9 Reality 334 (86C357 Virge/GX2, ID=0x8A10).
>
> Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Acked-by: Ondrej Zajicek <santiago@crfreenet.org>
--
Elen sila lumenn' omentielvo
Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [PATCH v3] s3fb: add DDC support
From: Ondrej Zajicek @ 2011-04-04 8:33 UTC (permalink / raw)
To: Ondrej Zary; +Cc: linux-fbdev, Kernel development list, Paul Mundt
In-Reply-To: <201104032236.18936.linux@rainbow-software.org>
[-- Attachment #1: Type: text/plain, Size: 846 bytes --]
On Sun, Apr 03, 2011 at 10:36:15PM +0200, Ondrej Zary wrote:
> Add I2C support for the DDC bus and also default mode initialization by
> reading monitor EDID to the s3fb driver.
>
> Tested on Trio64V+ (2 cards), Trio64V2/DX, Virge (3 cards),
> Virge/DX (3 cards), Virge/GX2, Trio3D/2X (4 cards), Trio3D.
>
> Will probably not work on Trio32 - my 2 cards have DDC support in BIOS that
> looks different from the other cards but the DDC pins on the VGA connector
> are not connected.
>
> Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Acked-by: Ondrej Zajicek <santiago@crfreenet.org>
--
Elen sila lumenn' omentielvo
Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: PATCH: New Matrox PCI ID
From: Dave Airlie @ 2011-04-03 21:29 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <4D98DD1C.4080300@digadd.de>
On Mon, Apr 4, 2011 at 6:48 AM, Christian Schmidt <charlie@digadd.de> wrote:
> Hi,
>
> The attached patch adds the PCI ID for the Matrox G200eW. Console
> Framebuffer selection via video= parameter works.
>
> Regards,
> Christian
>
NAK.
There is a patch to rip out matrox g200ev support since it never worked.
so I'm not sure why adding 200eW would be a plan.
Dave.
^ permalink raw reply
* PATCH: New Matrox PCI ID
From: Christian Schmidt @ 2011-04-03 20:48 UTC (permalink / raw)
To: linux-fbdev
[-- Attachment #1: Type: text/plain, Size: 141 bytes --]
Hi,
The attached patch adds the PCI ID for the Matrox G200eW. Console
Framebuffer selection via video= parameter works.
Regards,
Christian
[-- Attachment #2: matrox.patch --]
[-- Type: text/plain, Size: 1426 bytes --]
diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c
index a082deb..0461dd4 100644
--- a/drivers/video/matrox/matroxfb_base.c
+++ b/drivers/video/matrox/matroxfb_base.c
@@ -1468,6 +1468,13 @@ static struct board {
MGA_G200,
&vbG200,
"MGA-G200eV (PCI)"},
+ {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G200EW_PCI, 0xFF,
+ 0, 0,
+ DEVF_G200,
+ 230000,
+ MGA_G200,
+ &vbG200,
+ "MGA-G200eW (PCI)"},
{PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G200_PCI, 0xFF,
0, 0,
DEVF_G200,
@@ -2121,6 +2128,8 @@ static struct pci_device_id matroxfb_devices[] = {
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G200EV_PCI,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+ {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G200EW_PCI,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G200_PCI,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G200_AGP,
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 3adb06e..b80877e 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -604,6 +604,7 @@
#define PCI_DEVICE_ID_MATROX_G200_AGP 0x0521
#define PCI_DEVICE_ID_MATROX_G400 0x0525
#define PCI_DEVICE_ID_MATROX_G200EV_PCI 0x0530
+#define PCI_DEVICE_ID_MATROX_G200EW_PCI 0x0532
#define PCI_DEVICE_ID_MATROX_G550 0x2527
#define PCI_DEVICE_ID_MATROX_VIA 0x4536
^ permalink raw reply related
* [PATCH v3] s3fb: add DDC support
From: Ondrej Zary @ 2011-04-03 20:36 UTC (permalink / raw)
To: Ondrej Zajicek; +Cc: linux-fbdev, Kernel development list, Paul Mundt
Add I2C support for the DDC bus and also default mode initialization by
reading monitor EDID to the s3fb driver.
Tested on Trio64V+ (2 cards), Trio64V2/DX, Virge (3 cards),
Virge/DX (3 cards), Virge/GX2, Trio3D/2X (4 cards), Trio3D.
Will probably not work on Trio32 - my 2 cards have DDC support in BIOS that
looks different from the other cards but the DDC pins on the VGA connector
are not connected.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
--- linux-2.6.38-rc4-/drivers/video/s3fb.c 2011-03-31 20:57:57.000000000 +0200
+++ linux-2.6.38-rc4/drivers/video/s3fb.c 2011-04-03 20:32:46.000000000 +0200
@@ -25,6 +25,10 @@
#include <linux/console.h> /* Why should fb driver call console functions? because console_lock() */
#include <video/vga.h>
+#include <linux/i2c.h>
+#include <linux/i2c-id.h>
+#include <linux/i2c-algo-bit.h>
+
#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
#endif
@@ -36,6 +40,12 @@ struct s3fb_info {
struct mutex open_lock;
unsigned int ref_count;
u32 pseudo_palette[16];
+#ifdef CONFIG_FB_S3_DDC
+ u8 __iomem *mmio;
+ bool ddc_registered;
+ struct i2c_adapter ddc_adapter;
+ struct i2c_algo_bit_data ddc_algo;
+#endif
};
@@ -105,6 +115,9 @@ static const char * const s3_names[] = {
#define CHIP_UNDECIDED_FLAG 0x80
#define CHIP_MASK 0xFF
+#define MMIO_OFFSET 0x1000000
+#define MMIO_SIZE 0x10000
+
/* CRT timing register sets */
static const struct vga_regset s3_h_total_regs[] = {{0x00, 0, 7}, {0x5D, 0, 0}, VGA_REGSET_END};
@@ -140,7 +153,7 @@ static const struct svga_timing_regs s3_
/* Module parameters */
-static char *mode_option __devinitdata = "640x480-8@60";
+static char *mode_option __devinitdata;
#ifdef CONFIG_MTRR
static int mtrr __devinitdata = 1;
@@ -169,6 +182,119 @@ MODULE_PARM_DESC(fasttext, "Enable S3 fa
/* ------------------------------------------------------------------------- */
+#ifdef CONFIG_FB_S3_DDC
+
+#define DDC_REG 0xaa /* Trio 3D/1X/2X */
+#define DDC_MMIO_REG 0xff20 /* all other chips */
+#define DDC_SCL_OUT (1 << 0)
+#define DDC_SDA_OUT (1 << 1)
+#define DDC_SCL_IN (1 << 2)
+#define DDC_SDA_IN (1 << 3)
+#define DDC_DRIVE_EN (1 << 4)
+
+static bool s3fb_ddc_needs_mmio(int chip)
+{
+ return !(chip = CHIP_360_TRIO3D_1X ||
+ chip = CHIP_362_TRIO3D_2X ||
+ chip = CHIP_368_TRIO3D_2X);
+}
+
+static u8 s3fb_ddc_read(struct s3fb_info *par)
+{
+ if (s3fb_ddc_needs_mmio(par->chip))
+ return readb(par->mmio + DDC_MMIO_REG);
+ else
+ return vga_rcrt(par->state.vgabase, DDC_REG);
+}
+
+static void s3fb_ddc_write(struct s3fb_info *par, u8 val)
+{
+ if (s3fb_ddc_needs_mmio(par->chip))
+ writeb(val, par->mmio + DDC_MMIO_REG);
+ else
+ vga_wcrt(par->state.vgabase, DDC_REG, val);
+}
+
+static void s3fb_ddc_setscl(void *data, int val)
+{
+ struct s3fb_info *par = data;
+ unsigned char reg;
+
+ reg = s3fb_ddc_read(par) | DDC_DRIVE_EN;
+ if (val)
+ reg |= DDC_SCL_OUT;
+ else
+ reg &= ~DDC_SCL_OUT;
+ s3fb_ddc_write(par, reg);
+}
+
+static void s3fb_ddc_setsda(void *data, int val)
+{
+ struct s3fb_info *par = data;
+ unsigned char reg;
+
+ reg = s3fb_ddc_read(par) | DDC_DRIVE_EN;
+ if (val)
+ reg |= DDC_SDA_OUT;
+ else
+ reg &= ~DDC_SDA_OUT;
+ s3fb_ddc_write(par, reg);
+}
+
+static int s3fb_ddc_getscl(void *data)
+{
+ struct s3fb_info *par = data;
+
+ return !!(s3fb_ddc_read(par) & DDC_SCL_IN);
+}
+
+static int s3fb_ddc_getsda(void *data)
+{
+ struct s3fb_info *par = data;
+
+ return !!(s3fb_ddc_read(par) & DDC_SDA_IN);
+}
+
+static int __devinit s3fb_setup_ddc_bus(struct fb_info *info)
+{
+ struct s3fb_info *par = info->par;
+
+ strlcpy(par->ddc_adapter.name, info->fix.id,
+ sizeof(par->ddc_adapter.name));
+ par->ddc_adapter.owner = THIS_MODULE;
+ par->ddc_adapter.class = I2C_CLASS_DDC;
+ par->ddc_adapter.algo_data = &par->ddc_algo;
+ par->ddc_adapter.dev.parent = info->device;
+ par->ddc_algo.setsda = s3fb_ddc_setsda;
+ par->ddc_algo.setscl = s3fb_ddc_setscl;
+ par->ddc_algo.getsda = s3fb_ddc_getsda;
+ par->ddc_algo.getscl = s3fb_ddc_getscl;
+ par->ddc_algo.udelay = 10;
+ par->ddc_algo.timeout = 20;
+ par->ddc_algo.data = par;
+
+ i2c_set_adapdata(&par->ddc_adapter, par);
+
+ /*
+ * some Virge cards have external MUX to switch chip I2C bus between
+ * DDC and extension pins - switch it do DDC
+ */
+/* vga_wseq(par->state.vgabase, 0x08, 0x06); - not needed, already unlocked */
+ if (par->chip = CHIP_357_VIRGE_GX2 ||
+ par->chip = CHIP_359_VIRGE_GX2P)
+ svga_wseq_mask(par->state.vgabase, 0x0d, 0x01, 0x03);
+ else
+ svga_wseq_mask(par->state.vgabase, 0x0d, 0x00, 0x03);
+ /* some Virge need this or the DDC is ignored */
+ svga_wcrt_mask(par->state.vgabase, 0x5c, 0x03, 0x03);
+
+ return i2c_bit_add_bus(&par->ddc_adapter);
+}
+#endif /* CONFIG_FB_S3_DDC */
+
+
+/* ------------------------------------------------------------------------- */
+
/* Set font in S3 fast text mode */
static void s3fb_settile_fast(struct fb_info *info, struct fb_tilemap *map)
@@ -994,6 +1120,7 @@ static int __devinit s3_pci_probe(struct
struct s3fb_info *par;
int rc;
u8 regval, cr38, cr39;
+ bool found = false;
/* Ignore secondary VGA device because there is no VGA arbitration */
if (! svga_primary_device(dev)) {
@@ -1117,15 +1244,64 @@ static int __devinit s3_pci_probe(struct
info->fix.ypanstep = 0;
info->fix.accel = FB_ACCEL_NONE;
info->pseudo_palette = (void*) (par->pseudo_palette);
+ info->var.bits_per_pixel = 8;
+
+#ifdef CONFIG_FB_S3_DDC
+ /* Enable MMIO if needed */
+ if (s3fb_ddc_needs_mmio(par->chip)) {
+ par->mmio = ioremap(info->fix.smem_start + MMIO_OFFSET, MMIO_SIZE);
+ if (par->mmio)
+ svga_wcrt_mask(par->state.vgabase, 0x53, 0x08, 0x08); /* enable MMIO */
+ else
+ dev_err(info->device, "unable to map MMIO at 0x%lx, disabling DDC",
+ info->fix.smem_start + MMIO_OFFSET);
+ }
+ if (!s3fb_ddc_needs_mmio(par->chip) || par->mmio)
+ if (s3fb_setup_ddc_bus(info) = 0) {
+ u8 *edid = fb_ddc_read(&par->ddc_adapter);
+ par->ddc_registered = true;
+ if (edid) {
+ fb_edid_to_monspecs(edid, &info->monspecs);
+ kfree(edid);
+ if (!info->monspecs.modedb)
+ dev_err(info->device, "error getting mode database\n");
+ else {
+ const struct fb_videomode *m;
+
+ fb_videomode_to_modelist(info->monspecs.modedb,
+ info->monspecs.modedb_len,
+ &info->modelist);
+ m = fb_find_best_display(&info->monspecs, &info->modelist);
+ if (m) {
+ fb_videomode_to_var(&info->var, m);
+ /* fill all other info->var's fields */
+ if (s3fb_check_var(&info->var, info) = 0)
+ found = true;
+ }
+ }
+ }
+ }
+#endif
+ if (!mode_option && !found)
+ mode_option = "640x480-8@60";
/* Prepare startup mode */
- rc = fb_find_mode(&(info->var), info, mode_option, NULL, 0, NULL, 8);
- if (! ((rc = 1) || (rc = 2))) {
- rc = -EINVAL;
- dev_err(info->device, "mode %s not found\n", mode_option);
- goto err_find_mode;
+ if (mode_option) {
+ rc = fb_find_mode(&info->var, info, mode_option,
+ info->monspecs.modedb, info->monspecs.modedb_len,
+ NULL, info->var.bits_per_pixel);
+ if (!rc || rc = 4) {
+ rc = -EINVAL;
+ dev_err(info->device, "mode %s not found\n", mode_option);
+ fb_destroy_modedb(info->monspecs.modedb);
+ info->monspecs.modedb = NULL;
+ goto err_find_mode;
+ }
}
+ fb_destroy_modedb(info->monspecs.modedb);
+ info->monspecs.modedb = NULL;
+
/* maximize virtual vertical size for fast scrolling */
info->var.yres_virtual = info->fix.smem_len * 8 /
(info->var.bits_per_pixel * info->var.xres_virtual);
@@ -1171,6 +1347,12 @@ err_reg_fb:
fb_dealloc_cmap(&info->cmap);
err_alloc_cmap:
err_find_mode:
+#ifdef CONFIG_FB_S3_DDC
+ if (par->ddc_registered)
+ i2c_del_adapter(&par->ddc_adapter);
+ if (par->mmio)
+ iounmap(par->mmio);
+#endif
pci_iounmap(dev, info->screen_base);
err_iomap:
pci_release_regions(dev);
@@ -1202,6 +1384,13 @@ static void __devexit s3_pci_remove(stru
unregister_framebuffer(info);
fb_dealloc_cmap(&info->cmap);
+#ifdef CONFIG_FB_S3_DDC
+ if (par->ddc_registered)
+ i2c_del_adapter(&par->ddc_adapter);
+ if (par->mmio)
+ iounmap(par->mmio);
+#endif
+
pci_iounmap(dev, info->screen_base);
pci_release_regions(dev);
/* pci_disable_device(dev); */
--- linux-2.6.38-rc4-orig/drivers/video/Kconfig 2011-02-08 01:03:55.000000000 +0100
+++ linux-2.6.38-rc4/drivers/video/Kconfig 2011-04-03 20:28:26.000000000 +0200
@@ -1508,6 +1508,14 @@ config FB_S3
---help---
Driver for graphics boards with S3 Trio / S3 Virge chip.
+config FB_S3_DDC
+ bool "DDC for S3 support"
+ depends on FB_S3
+ select FB_DDC
+ default y
+ help
+ Say Y here if you want DDC support for your S3 graphics card.
+
config FB_SAVAGE
tristate "S3 Savage support"
depends on FB && PCI && EXPERIMENTAL
--
Ondrej Zary
^ permalink raw reply
* [PATCH] savagefb: Remove obsolete else clause in savage_setup_i2c_bus
From: Tormod Volden @ 2011-04-03 12:54 UTC (permalink / raw)
To: linux-fbdev
From: Tormod Volden <debian.tormod@gmail.com>
The else clause was not needed after the cleanup in commit
b8901b091db260b0f0101d6395ce5c6016835a47
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
---
I could probably have sent this to some janitor list instead?
Tormod
drivers/video/savage/savagefb-i2c.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c
index 5e7acda..bb71fea 100644
--- a/drivers/video/savage/savagefb-i2c.c
+++ b/drivers/video/savage/savagefb-i2c.c
@@ -159,8 +159,7 @@ static int savage_setup_i2c_bus(struct savagefb_i2c_chan *chan,
else
dev_warn(&chan->par->pcidev->dev,
"Failed to register I2C bus %s.\n", name);
- } else
- chan->par = NULL;
+ }
return rc;
}
--
1.7.0.4
^ permalink raw reply related
* [PATCH 2/2] savagefb: Set up I2C based on chip family instead of card id
From: Tormod Volden @ 2011-04-03 12:54 UTC (permalink / raw)
To: linux-fbdev
From: Tormod Volden <debian.tormod@gmail.com>
In practice this means enabling I2C (for DDC2) on all prosavage cards,
like the xorg ddx does. The savage4 and savage2000 families have only
one member each, so there is no change for those.
Tested on TwisterK.
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
---
Since this seems to work fine in xorg, I do not expect any surprises.
However, the framebuffer might now come up in higher resolution
and refresh rate (as allowed by the EDID) than the old defaults.
This might uncover broken EDIDs or other mode bugs.
WRT my own testing, I can see that the EDID is read out successfully,
but the external monitor goes black and complains with the chosen mode.
(For the record, the same happened with the non-edid default mode.)
This is because of other bugs in the mode calculations or the
monitor itself I am testing on. With xorg the monitor comes up,
because xorg picks a lower refresh rate by default.
Tormod
drivers/video/savage/savagefb-i2c.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c
index 58c8a3c..5e7acda 100644
--- a/drivers/video/savage/savagefb-i2c.c
+++ b/drivers/video/savage/savagefb-i2c.c
@@ -170,9 +170,8 @@ void savagefb_create_i2c_busses(struct fb_info *info)
struct savagefb_par *par = info->par;
par->chan.par = par;
- switch(info->fix.accel) {
- case FB_ACCEL_PROSAVAGE_DDRK:
- case FB_ACCEL_PROSAVAGE_PM:
+ switch (par->chip) {
+ case S3_PROSAVAGE:
par->chan.reg = CR_SERIAL2;
par->chan.ioaddr = par->mmio.vbase;
par->chan.algo.setsda = prosavage_gpio_setsda;
@@ -180,7 +179,7 @@ void savagefb_create_i2c_busses(struct fb_info *info)
par->chan.algo.getsda = prosavage_gpio_getsda;
par->chan.algo.getscl = prosavage_gpio_getscl;
break;
- case FB_ACCEL_SAVAGE4:
+ case S3_SAVAGE4:
par->chan.reg = CR_SERIAL1;
if (par->pcidev->revision > 1 && !(VGArCR(0xa6, par) & 0x40))
par->chan.reg = CR_SERIAL2;
@@ -190,7 +189,7 @@ void savagefb_create_i2c_busses(struct fb_info *info)
par->chan.algo.getsda = prosavage_gpio_getsda;
par->chan.algo.getscl = prosavage_gpio_getscl;
break;
- case FB_ACCEL_SAVAGE2000:
+ case S3_SAVAGE2000:
par->chan.reg = MM_SERIAL1;
par->chan.ioaddr = par->mmio.vbase;
par->chan.algo.setsda = savage4_gpio_setsda;
--
1.7.0.4
^ permalink raw reply related
* [PATCH 1/2] savagefb: Replace magic register address with define
From: Tormod Volden @ 2011-04-03 12:54 UTC (permalink / raw)
To: linux-fbdev
From: Tormod Volden <debian.tormod@gmail.com>
MM_SERIAL1 was already defined, but not used.
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
---
Hi,
There was this unused define, and the one single use of the constant, so
I think somebody just forgot to use it.
Regards,
Tormod
drivers/video/savage/savagefb-i2c.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c
index b16e613..58c8a3c 100644
--- a/drivers/video/savage/savagefb-i2c.c
+++ b/drivers/video/savage/savagefb-i2c.c
@@ -191,7 +191,7 @@ void savagefb_create_i2c_busses(struct fb_info *info)
par->chan.algo.getscl = prosavage_gpio_getscl;
break;
case FB_ACCEL_SAVAGE2000:
- par->chan.reg = 0xff20;
+ par->chan.reg = MM_SERIAL1;
par->chan.ioaddr = par->mmio.vbase;
par->chan.algo.setsda = savage4_gpio_setsda;
par->chan.algo.setscl = savage4_gpio_setscl;
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH 6/6] drivers/video/bfin-lq035q1-fb.c: introduce missing kfree
From: Mike Frysinger @ 2011-04-02 5:05 UTC (permalink / raw)
To: Julia Lawall; +Cc: Paul Mundt, kernel-janitors, linux-fbdev, linux-kernel
In-Reply-To: <1301667827-20056-6-git-send-email-julia@diku.dk>
On Fri, Apr 1, 2011 at 10:23, Julia Lawall wrote:
> Error handling code following a kmalloc should free the allocated data.
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
^ permalink raw reply
* udlfb.c dlfb_ops_ioctl - missing copy_from_user's ?
From: Dr. David Alan Gilbert @ 2011-04-01 19:47 UTC (permalink / raw)
To: linux-fbdev
Hi,
I was running sparse() over the kernel and it noticed
a few casts in dlfb_ops_ioctl that got me looking.
In the DLFB_IOCTL_RETURN_EDID case copy_to_user is used to write to
the data pointed to by arg, but in the DLFB_IOCTL_REPORT_DAMAGE
case the data is accessed directly:
/* TODO: Help propose a standard fb.h ioctl to report mmap damage */
if (cmd = DLFB_IOCTL_REPORT_DAMAGE) {
/*
* If we have a damage-aware client, turn fb_defio "off"
* To avoid perf imact of unecessary page fault handling.
* Done by resetting the delay for this fb_info to a very
* long period. Pages will become writable and stay that way.
* Reset to normal value when all clients have closed this fb.
*/
if (info->fbdefio)
info->fbdefio->delay = DL_DEFIO_WRITE_DISABLE;
area = (struct dloarea *)arg;
if (area->x < 0)
area->x = 0;
It looks to me like making area a local variable and then copy_from_user'ing
it from arg is needed. I don't think there is anything further up in the
call chain that is doing the copy is there?
(On a more minor note, in dlfb_ops_open the line:
if ((user = 0) & (!console))
looks like it should really be && - not that I think it makes any
difference.)
Dave (please cc, not subscribed to linux-fbdev)
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ gro.gilbert @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
^ permalink raw reply
* [PATCH 6/6] drivers/video/bfin-lq035q1-fb.c: introduce missing kfree
From: Julia Lawall @ 2011-04-01 14:23 UTC (permalink / raw)
To: Paul Mundt; +Cc: kernel-janitors, linux-fbdev, linux-kernel
Error handling code following a kmalloc should free the allocated data.
The semantic match that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,f1,l;
position p1,p2;
expression *ptr != NULL;
@@
x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x = NULL) S
<... when != x
when != if (...) { <+...x...+> }
(
x->f1 = E
|
(x->f1 = NULL || ...)
|
f(...,x->f1,...)
)
...>
(
return \(0\|<+...x...+>\|ptr\);
|
return@p2 ...;
)
@script:python@
p1 << r.p1;
p2 << r.p2;
@@
print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
drivers/video/bfin-lq035q1-fb.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/video/bfin-lq035q1-fb.c b/drivers/video/bfin-lq035q1-fb.c
index c8e1f04..23b6c4b 100644
--- a/drivers/video/bfin-lq035q1-fb.c
+++ b/drivers/video/bfin-lq035q1-fb.c
@@ -154,8 +154,10 @@ static int __devinit lq035q1_spidev_probe(struct spi_device *spi)
ret = lq035q1_control(spi, LQ035_SHUT_CTL, LQ035_ON);
ret |= lq035q1_control(spi, LQ035_DRIVER_OUTPUT_CTL, ctl->mode);
- if (ret)
+ if (ret) {
+ kfree(ctl);
return ret;
+ }
spi_set_drvdata(spi, ctl);
^ permalink raw reply related
* [PATCH 5/5] OMAP: DSS2: use omap_dss_register_driver_probe() in selected drivers
From: Tomi Valkeinen @ 2011-04-01 10:00 UTC (permalink / raw)
To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen
In-Reply-To: <1301652030-32223-1-git-send-email-tomi.valkeinen@ti.com>
Use omap_dss_register_driver_probe() in plain dss panel drivers, which
allows us to use __init for the driver probe functions.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/displays/panel-generic-dpi.c | 6 +++---
.../video/omap2/displays/panel-sharp-ls037v7dw01.c | 6 +++---
drivers/video/omap2/displays/panel-taal.c | 5 ++---
3 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c
index e359f93..010ea4e 100644
--- a/drivers/video/omap2/displays/panel-generic-dpi.c
+++ b/drivers/video/omap2/displays/panel-generic-dpi.c
@@ -246,7 +246,7 @@ static void generic_dpi_panel_power_off(struct omap_dss_device *dssdev)
omapdss_dpi_display_disable(dssdev);
}
-static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
+static int __init generic_dpi_panel_probe(struct omap_dss_device *dssdev)
{
struct panel_generic_dpi_data *panel_data = get_panel_data(dssdev);
struct panel_config *panel_config = NULL;
@@ -357,7 +357,6 @@ static int generic_dpi_panel_check_timings(struct omap_dss_device *dssdev,
}
static struct omap_dss_driver dpi_driver = {
- .probe = generic_dpi_panel_probe,
.remove = __exit_p(generic_dpi_panel_remove),
.enable = generic_dpi_panel_enable,
@@ -377,7 +376,8 @@ static struct omap_dss_driver dpi_driver = {
static int __init generic_dpi_panel_drv_init(void)
{
- return omap_dss_register_driver(&dpi_driver);
+ return omap_dss_register_driver_probe(&dpi_driver,
+ generic_dpi_panel_probe);
}
static void __exit generic_dpi_panel_drv_exit(void)
diff --git a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
index c772747..2cf3c9f 100644
--- a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
+++ b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
@@ -79,7 +79,7 @@ static const struct backlight_ops sharp_ls_bl_ops = {
-static int sharp_ls_panel_probe(struct omap_dss_device *dssdev)
+static int __init sharp_ls_panel_probe(struct omap_dss_device *dssdev)
{
struct backlight_properties props;
struct backlight_device *bl;
@@ -204,7 +204,6 @@ static int sharp_ls_panel_resume(struct omap_dss_device *dssdev)
}
static struct omap_dss_driver sharp_ls_driver = {
- .probe = sharp_ls_panel_probe,
.remove = __exit_p(sharp_ls_panel_remove),
.enable = sharp_ls_panel_enable,
@@ -220,7 +219,8 @@ static struct omap_dss_driver sharp_ls_driver = {
static int __init sharp_ls_panel_drv_init(void)
{
- return omap_dss_register_driver(&sharp_ls_driver);
+ return omap_dss_register_driver_probe(&sharp_ls_driver,
+ sharp_ls_panel_probe);
}
static void __exit sharp_ls_panel_drv_exit(void)
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index 490998f..d62821e 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -661,7 +661,7 @@ static void taal_hw_reset(struct omap_dss_device *dssdev)
msleep(td->panel_config->sleep.hw_reset);
}
-static int taal_probe(struct omap_dss_device *dssdev)
+static int __init taal_probe(struct omap_dss_device *dssdev)
{
struct backlight_properties props;
struct taal_data *td;
@@ -1556,7 +1556,6 @@ static enum omap_dss_update_mode taal_get_update_mode(
}
static struct omap_dss_driver taal_driver = {
- .probe = taal_probe,
.remove = __exit_p(taal_remove),
.enable = taal_enable,
@@ -1593,7 +1592,7 @@ static struct omap_dss_driver taal_driver = {
static int __init taal_init(void)
{
- omap_dss_register_driver(&taal_driver);
+ omap_dss_register_driver_probe(&taal_driver, taal_probe);
return 0;
}
--
1.7.1
^ permalink raw reply related
* [PATCH 4/5] OMAP: DSS2: Add omap_dss_register_driver_probe()
From: Tomi Valkeinen @ 2011-04-01 10:00 UTC (permalink / raw)
To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen
In-Reply-To: <1301652030-32223-1-git-send-email-tomi.valkeinen@ti.com>
Implement omap_dss_register_driver_probe() function, which is similar to
platform_driver_probe(). omap_dss_register_driver_probe will add the
driver and probe devices in one go, thus enabling us to use __init for
panel probe functions.
Also, if no devices are found in omap_dss_register_driver_probe(), the
function will return -ENODEV, which causes the panel driver module to be
unloaded.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
arch/arm/plat-omap/include/plat/display.h | 2 +
drivers/video/omap2/dss/core.c | 44 +++++++++++++++++++++++++++++
2 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h
index e239a0d..226a78f 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -517,6 +517,8 @@ struct omap_dss_driver {
};
int omap_dss_register_driver(struct omap_dss_driver *);
+int omap_dss_register_driver_probe(struct omap_dss_driver *,
+ int (*probe)(struct omap_dss_device *));
void omap_dss_unregister_driver(struct omap_dss_driver *);
void omap_dss_get_device(struct omap_dss_device *dssdev);
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 3584e3e..b3eba14 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -447,6 +447,50 @@ void omap_dss_unregister_driver(struct omap_dss_driver *dssdriver)
}
EXPORT_SYMBOL(omap_dss_unregister_driver);
+static int omap_dss_driver_probe_fail(struct device *dev)
+{
+ return -ENXIO;
+}
+
+static int find_any_dev(struct device *dev, void *data)
+{
+ struct omap_dss_driver *dssdrv = data;
+ return dev->driver = &dssdrv->driver;
+}
+
+int omap_dss_register_driver_probe(struct omap_dss_driver *dssdriver,
+ int (*probe)(struct omap_dss_device *))
+{
+ int r;
+
+ /* make sure driver won't have bind/unbind attributes */
+ dssdriver->driver.suppress_bind_attrs = true;
+
+ /* temporary section violation during probe() */
+ dssdriver->probe = probe;
+ r = omap_dss_register_driver(dssdriver);
+
+ /* fixup that section violation */
+
+ dssdriver->probe = NULL;
+ dssdriver->driver.probe = omap_dss_driver_probe_fail;
+
+ if (r)
+ return r;
+
+ /* find any device using this driver */
+ r = bus_for_each_dev(&dss_bus_type, NULL, dssdriver, find_any_dev);
+
+ if (r = 0) {
+ /* no devices for this driver */
+ omap_dss_unregister_driver(dssdriver);
+ return -ENODEV;
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL(omap_dss_register_driver_probe);
+
/* DEVICE */
static void reset_device(struct device *dev, int check)
{
--
1.7.1
^ permalink raw reply related
* [PATCH 3/5] OMAP: DSS2: use __exit for selected panel drivers
From: Tomi Valkeinen @ 2011-04-01 10:00 UTC (permalink / raw)
To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen
In-Reply-To: <1301652030-32223-1-git-send-email-tomi.valkeinen@ti.com>
We can use __exit for the driver remove function in plain dss panels
(ie. those that do not need i2c or spi).
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/displays/panel-generic-dpi.c | 4 ++--
.../video/omap2/displays/panel-sharp-ls037v7dw01.c | 4 ++--
drivers/video/omap2/displays/panel-taal.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c
index 4a9b9ff..e359f93 100644
--- a/drivers/video/omap2/displays/panel-generic-dpi.c
+++ b/drivers/video/omap2/displays/panel-generic-dpi.c
@@ -285,7 +285,7 @@ static int generic_dpi_panel_probe(struct omap_dss_device *dssdev)
return 0;
}
-static void generic_dpi_panel_remove(struct omap_dss_device *dssdev)
+static void __exit generic_dpi_panel_remove(struct omap_dss_device *dssdev)
{
struct panel_drv_data *drv_data = dev_get_drvdata(&dssdev->dev);
@@ -358,7 +358,7 @@ static int generic_dpi_panel_check_timings(struct omap_dss_device *dssdev,
static struct omap_dss_driver dpi_driver = {
.probe = generic_dpi_panel_probe,
- .remove = generic_dpi_panel_remove,
+ .remove = __exit_p(generic_dpi_panel_remove),
.enable = generic_dpi_panel_enable,
.disable = generic_dpi_panel_disable,
diff --git a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
index d2b35d2..c772747 100644
--- a/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
+++ b/drivers/video/omap2/displays/panel-sharp-ls037v7dw01.c
@@ -120,7 +120,7 @@ static int sharp_ls_panel_probe(struct omap_dss_device *dssdev)
return 0;
}
-static void sharp_ls_panel_remove(struct omap_dss_device *dssdev)
+static void __exit sharp_ls_panel_remove(struct omap_dss_device *dssdev)
{
struct sharp_data *sd = dev_get_drvdata(&dssdev->dev);
struct backlight_device *bl = sd->bl;
@@ -205,7 +205,7 @@ static int sharp_ls_panel_resume(struct omap_dss_device *dssdev)
static struct omap_dss_driver sharp_ls_driver = {
.probe = sharp_ls_panel_probe,
- .remove = sharp_ls_panel_remove,
+ .remove = __exit_p(sharp_ls_panel_remove),
.enable = sharp_ls_panel_enable,
.disable = sharp_ls_panel_disable,
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index adc9900..490998f 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -819,7 +819,7 @@ err:
return r;
}
-static void taal_remove(struct omap_dss_device *dssdev)
+static void __exit taal_remove(struct omap_dss_device *dssdev)
{
struct taal_data *td = dev_get_drvdata(&dssdev->dev);
struct nokia_dsi_panel_data *panel_data = get_panel_data(dssdev);
@@ -1557,7 +1557,7 @@ static enum omap_dss_update_mode taal_get_update_mode(
static struct omap_dss_driver taal_driver = {
.probe = taal_probe,
- .remove = taal_remove,
+ .remove = __exit_p(taal_remove),
.enable = taal_enable,
.disable = taal_disable,
--
1.7.1
^ permalink raw reply related
* [PATCH 2/5] OMAP: DSS2: add __inits to omapdss driver
From: Tomi Valkeinen @ 2011-04-01 10:00 UTC (permalink / raw)
To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen
In-Reply-To: <1301652030-32223-1-git-send-email-tomi.valkeinen@ti.com>
We can use platform_driver_probe() instead of platform_driver_register()
and thus add __init to many functions in omapdss driver.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/core.c | 15 +++++++--------
drivers/video/omap2/dss/dispc.c | 7 +++----
drivers/video/omap2/dss/dpi.c | 2 +-
drivers/video/omap2/dss/dsi.c | 7 +++----
drivers/video/omap2/dss/dss.c | 9 ++++-----
drivers/video/omap2/dss/dss_features.c | 2 +-
drivers/video/omap2/dss/hdmi.c | 8 ++++----
drivers/video/omap2/dss/manager.c | 2 +-
drivers/video/omap2/dss/overlay.c | 2 +-
drivers/video/omap2/dss/rfbi.c | 7 +++----
drivers/video/omap2/dss/sdi.c | 2 +-
drivers/video/omap2/dss/venc.c | 7 +++----
12 files changed, 32 insertions(+), 38 deletions(-)
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 9bcb0b8..3584e3e 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -109,7 +109,7 @@ static const struct file_operations dss_debug_fops = {
static struct dentry *dss_debugfs_dir;
-static int dss_initialize_debugfs(void)
+static int __init dss_initialize_debugfs(void)
{
dss_debugfs_dir = debugfs_create_dir("omapdss", NULL);
if (IS_ERR(dss_debugfs_dir)) {
@@ -156,7 +156,7 @@ static void dss_uninitialize_debugfs(void)
debugfs_remove_recursive(dss_debugfs_dir);
}
#else /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */
-static inline int dss_initialize_debugfs(void)
+static inline int __init dss_initialize_debugfs(void)
{
return 0;
}
@@ -166,7 +166,7 @@ static inline void dss_uninitialize_debugfs(void)
#endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */
/* PLATFORM DEVICE */
-static int omap_dss_probe(struct platform_device *pdev)
+static int __init omap_dss_probe(struct platform_device *pdev)
{
struct omap_dss_board_info *pdata = pdev->dev.platform_data;
int r;
@@ -307,7 +307,6 @@ static int omap_dss_resume(struct platform_device *pdev)
}
static struct platform_driver omap_dss_driver = {
- .probe = omap_dss_probe,
.remove = omap_dss_remove,
.shutdown = omap_dss_shutdown,
.suspend = omap_dss_suspend,
@@ -483,7 +482,7 @@ static void omap_dss_dev_release(struct device *dev)
reset_device(dev, 0);
}
-static int omap_dss_register_device(struct omap_dss_device *dssdev)
+static int __init omap_dss_register_device(struct omap_dss_device *dssdev)
{
static int dev_num;
@@ -503,7 +502,7 @@ static void omap_dss_unregister_device(struct omap_dss_device *dssdev)
}
/* BUS */
-static int omap_dss_bus_register(void)
+static int __init omap_dss_bus_register(void)
{
int r;
@@ -542,7 +541,7 @@ static int __init omap_dss_init(void)
if (r)
return r;
- r = platform_driver_register(&omap_dss_driver);
+ r = platform_driver_probe(&omap_dss_driver, omap_dss_probe);
if (r) {
omap_dss_bus_unregister();
return r;
@@ -578,7 +577,7 @@ static int __init omap_dss_init(void)
static int __init omap_dss_init2(void)
{
- return platform_driver_register(&omap_dss_driver);
+ return platform_driver_probe(&omap_dss_driver, omap_dss_probe);
}
core_initcall(omap_dss_init);
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 7804779..8cfc9f0 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3419,7 +3419,7 @@ int dispc_setup_plane(enum omap_plane plane,
}
/* DISPC HW IP initialisation */
-static int omap_dispchw_probe(struct platform_device *pdev)
+static int __init omap_dispchw_probe(struct platform_device *pdev)
{
u32 rev;
int r = 0;
@@ -3491,7 +3491,6 @@ static int omap_dispchw_remove(struct platform_device *pdev)
}
static struct platform_driver omap_dispchw_driver = {
- .probe = omap_dispchw_probe,
.remove = omap_dispchw_remove,
.driver = {
.name = "omapdss_dispc",
@@ -3499,9 +3498,9 @@ static struct platform_driver omap_dispchw_driver = {
},
};
-int dispc_init_platform_driver(void)
+int __init dispc_init_platform_driver(void)
{
- return platform_driver_register(&omap_dispchw_driver);
+ return platform_driver_probe(&omap_dispchw_driver, omap_dispchw_probe);
}
void dispc_uninit_platform_driver(void)
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 2d3ca4c..4e8ea50 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -319,7 +319,7 @@ int dpi_init_display(struct omap_dss_device *dssdev)
return 0;
}
-int dpi_init(void)
+int __init dpi_init(void)
{
return 0;
}
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 23d9bbe..102bd70 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -3819,7 +3819,7 @@ static void dsi_exit(void)
}
/* DSI1 HW IP initialisation */
-static int omap_dsi1hw_probe(struct platform_device *pdev)
+static int __init omap_dsi1hw_probe(struct platform_device *pdev)
{
int r;
dsi.pdev = pdev;
@@ -3839,7 +3839,6 @@ static int omap_dsi1hw_remove(struct platform_device *pdev)
}
static struct platform_driver omap_dsi1hw_driver = {
- .probe = omap_dsi1hw_probe,
.remove = omap_dsi1hw_remove,
.driver = {
.name = "omapdss_dsi1",
@@ -3847,9 +3846,9 @@ static struct platform_driver omap_dsi1hw_driver = {
},
};
-int dsi_init_platform_driver(void)
+int __init dsi_init_platform_driver(void)
{
- return platform_driver_register(&omap_dsi1hw_driver);
+ return platform_driver_probe(&omap_dsi1hw_driver, omap_dsi1hw_probe);
}
void dsi_uninit_platform_driver(void)
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 9a73af6..428cc8f 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -635,7 +635,7 @@ void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select hdmi)
REG_FLD_MOD(DSS_CONTROL, hdmi, 15, 15); /* VENC_HDMI_SWITCH */
}
-static int dss_init(void)
+static int __init dss_init(void)
{
int r;
u32 rev;
@@ -1088,7 +1088,7 @@ void dss_debug_dump_clocks(struct seq_file *s)
/* DSS HW IP initialisation */
-static int omap_dsshw_probe(struct platform_device *pdev)
+static int __init omap_dsshw_probe(struct platform_device *pdev)
{
int r;
@@ -1152,7 +1152,6 @@ static int omap_dsshw_remove(struct platform_device *pdev)
}
static struct platform_driver omap_dsshw_driver = {
- .probe = omap_dsshw_probe,
.remove = omap_dsshw_remove,
.driver = {
.name = "omapdss_dss",
@@ -1160,9 +1159,9 @@ static struct platform_driver omap_dsshw_driver = {
},
};
-int dss_init_platform_driver(void)
+int __init dss_init_platform_driver(void)
{
- return platform_driver_register(&omap_dsshw_driver);
+ return platform_driver_probe(&omap_dsshw_driver, omap_dsshw_probe);
}
void dss_uninit_platform_driver(void)
diff --git a/drivers/video/omap2/dss/dss_features.c b/drivers/video/omap2/dss/dss_features.c
index 179a7a4..f30b917 100644
--- a/drivers/video/omap2/dss/dss_features.c
+++ b/drivers/video/omap2/dss/dss_features.c
@@ -360,7 +360,7 @@ void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end)
*end = omap_current_dss_features->reg_fields[id].end;
}
-void dss_features_init(void)
+void __init dss_features_init(void)
{
if (cpu_is_omap24xx())
omap_current_dss_features = &omap2_dss_features;
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 0d44f07..ce07539 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -1276,7 +1276,7 @@ void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev)
}
/* HDMI HW IP initialisation */
-static int omapdss_hdmihw_probe(struct platform_device *pdev)
+static int __init omapdss_hdmihw_probe(struct platform_device *pdev)
{
struct resource *hdmi_mem;
@@ -1313,7 +1313,6 @@ static int omapdss_hdmihw_remove(struct platform_device *pdev)
}
static struct platform_driver omapdss_hdmihw_driver = {
- .probe = omapdss_hdmihw_probe,
.remove = omapdss_hdmihw_remove,
.driver = {
.name = "omapdss_hdmi",
@@ -1321,9 +1320,10 @@ static struct platform_driver omapdss_hdmihw_driver = {
},
};
-int hdmi_init_platform_driver(void)
+int __init hdmi_init_platform_driver(void)
{
- return platform_driver_register(&omapdss_hdmihw_driver);
+ return platform_driver_probe(&omapdss_hdmihw_driver,
+ omapdss_hdmihw_probe);
}
void hdmi_uninit_platform_driver(void)
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index bcd37ec..08152a7 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -1475,7 +1475,7 @@ static void omap_dss_add_overlay_manager(struct omap_overlay_manager *manager)
list_add_tail(&manager->list, &manager_list);
}
-int dss_init_overlay_managers(struct platform_device *pdev)
+int __init dss_init_overlay_managers(struct platform_device *pdev)
{
int i, r;
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index f1aca6d..96f304a 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -570,7 +570,7 @@ void dss_overlay_setup_l4_manager(struct omap_overlay_manager *mgr)
}
#endif
-void dss_init_overlays(struct platform_device *pdev)
+void __init dss_init_overlays(struct platform_device *pdev)
{
int i, r;
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 5ea17f4..8bbe83e 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -1013,7 +1013,7 @@ int rfbi_init_display(struct omap_dss_device *dssdev)
}
/* RFBI HW IP initialisation */
-static int omap_rfbihw_probe(struct platform_device *pdev)
+static int __init omap_rfbihw_probe(struct platform_device *pdev)
{
u32 rev;
u32 l;
@@ -1065,7 +1065,6 @@ static int omap_rfbihw_remove(struct platform_device *pdev)
}
static struct platform_driver omap_rfbihw_driver = {
- .probe = omap_rfbihw_probe,
.remove = omap_rfbihw_remove,
.driver = {
.name = "omapdss_rfbi",
@@ -1073,9 +1072,9 @@ static struct platform_driver omap_rfbihw_driver = {
},
};
-int rfbi_init_platform_driver(void)
+int __init rfbi_init_platform_driver(void)
{
- return platform_driver_register(&omap_rfbihw_driver);
+ return platform_driver_probe(&omap_rfbihw_driver, omap_rfbihw_probe);
}
void rfbi_uninit_platform_driver(void)
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index 54a53e6..87d5a7e 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -160,7 +160,7 @@ int sdi_init_display(struct omap_dss_device *dssdev)
return 0;
}
-int sdi_init(void)
+int __init sdi_init(void)
{
return 0;
}
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 8e35a5b..c56c16b 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -714,7 +714,7 @@ void venc_dump_regs(struct seq_file *s)
}
/* VENC HW IP initialisation */
-static int omap_venchw_probe(struct platform_device *pdev)
+static int __init omap_venchw_probe(struct platform_device *pdev)
{
u8 rev_id;
struct resource *venc_mem;
@@ -759,7 +759,6 @@ static int omap_venchw_remove(struct platform_device *pdev)
}
static struct platform_driver omap_venchw_driver = {
- .probe = omap_venchw_probe,
.remove = omap_venchw_remove,
.driver = {
.name = "omapdss_venc",
@@ -767,12 +766,12 @@ static struct platform_driver omap_venchw_driver = {
},
};
-int venc_init_platform_driver(void)
+int __init venc_init_platform_driver(void)
{
if (cpu_is_omap44xx())
return 0;
- return platform_driver_register(&omap_venchw_driver);
+ return platform_driver_probe(&omap_venchw_driver, omap_venchw_probe);
}
void venc_uninit_platform_driver(void)
--
1.7.1
^ permalink raw reply related
* [PATCH 1/5] OMAP: DSS2: make omap_dss_(un)register_device static
From: Tomi Valkeinen @ 2011-04-01 10:00 UTC (permalink / raw)
To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen
In-Reply-To: <1301652030-32223-1-git-send-email-tomi.valkeinen@ti.com>
omap_dss_register_device and omap_dss_unregister_device can only be
called from core.c, so we can make it static.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
arch/arm/plat-omap/include/plat/display.h | 3 ---
drivers/video/omap2/dss/core.c | 7 +++++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h
index 5e04ddc..e239a0d 100644
--- a/arch/arm/plat-omap/include/plat/display.h
+++ b/arch/arm/plat-omap/include/plat/display.h
@@ -519,9 +519,6 @@ struct omap_dss_driver {
int omap_dss_register_driver(struct omap_dss_driver *);
void omap_dss_unregister_driver(struct omap_dss_driver *);
-int omap_dss_register_device(struct omap_dss_device *);
-void omap_dss_unregister_device(struct omap_dss_device *);
-
void omap_dss_get_device(struct omap_dss_device *dssdev);
void omap_dss_put_device(struct omap_dss_device *dssdev);
#define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) != NULL)
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 1aa2ed1..9bcb0b8 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -54,6 +54,9 @@ unsigned int dss_debug;
module_param_named(debug, dss_debug, bool, 0644);
#endif
+static int omap_dss_register_device(struct omap_dss_device *);
+static void omap_dss_unregister_device(struct omap_dss_device *);
+
/* REGULATORS */
struct regulator *dss_get_vdds_dsi(void)
@@ -480,7 +483,7 @@ static void omap_dss_dev_release(struct device *dev)
reset_device(dev, 0);
}
-int omap_dss_register_device(struct omap_dss_device *dssdev)
+static int omap_dss_register_device(struct omap_dss_device *dssdev)
{
static int dev_num;
@@ -494,7 +497,7 @@ int omap_dss_register_device(struct omap_dss_device *dssdev)
return device_register(&dssdev->dev);
}
-void omap_dss_unregister_device(struct omap_dss_device *dssdev)
+static void omap_dss_unregister_device(struct omap_dss_device *dssdev)
{
device_unregister(&dssdev->dev);
}
--
1.7.1
^ permalink raw reply related
* [PATCH 0/5] OMAP: DSS: add __inits and __exits
From: Tomi Valkeinen @ 2011-04-01 10:00 UTC (permalink / raw)
To: linux-omap, linux-fbdev; +Cc: Tomi Valkeinen
These patches add __inits and __exits to multiple functions in omapdss and
panel drivers. Also omap_dss_register_driver_probe() is added which allows us
to define panel driver probe functions as __init.
This moved almost 7kB from .text section to .init section on my configuration.
Tomi Valkeinen (5):
OMAP: DSS2: make omap_dss_(un)register_device static
OMAP: DSS2: add __inits to omapdss driver
OMAP: DSS2: use __exit for selected panel drivers
OMAP: DSS2: Add omap_dss_register_driver_probe()
OMAP: DSS2: use omap_dss_register_driver_probe() in selected drivers
arch/arm/plat-omap/include/plat/display.h | 5 +-
drivers/video/omap2/displays/panel-generic-dpi.c | 10 ++--
.../video/omap2/displays/panel-sharp-ls037v7dw01.c | 10 ++--
drivers/video/omap2/displays/panel-taal.c | 9 +--
drivers/video/omap2/dss/core.c | 64 +++++++++++++++++---
drivers/video/omap2/dss/dispc.c | 7 +-
drivers/video/omap2/dss/dpi.c | 2 +-
drivers/video/omap2/dss/dsi.c | 7 +-
drivers/video/omap2/dss/dss.c | 9 +--
drivers/video/omap2/dss/dss_features.c | 2 +-
drivers/video/omap2/dss/hdmi.c | 8 +-
drivers/video/omap2/dss/manager.c | 2 +-
drivers/video/omap2/dss/overlay.c | 2 +-
drivers/video/omap2/dss/rfbi.c | 7 +-
drivers/video/omap2/dss/sdi.c | 2 +-
drivers/video/omap2/dss/venc.c | 7 +-
16 files changed, 96 insertions(+), 57 deletions(-)
^ permalink raw reply
* Re: [PATCH 1/9] OMAP: DSS2: move dss device clock configuration
From: Archit Taneja @ 2011-04-01 9:38 UTC (permalink / raw)
To: Valkeinen, Tomi; +Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
In-Reply-To: <1301647184.3393.29.camel@deskari>
On Friday 01 April 2011 02:09 PM, Valkeinen, Tomi wrote:
> On Fri, 2011-04-01 at 13:49 +0530, Archit Taneja wrote:
>
>> But there are some parameters which might get common across dss devices.
>> Things like dispc clock source, dispc core clock divider will be shared
>> across the panels. We had discussed the possibility of declaring this
>> common info in omap_dss_board_info or as a separate common_clocks
>> structure. Each device could pick this filled up common_clocks struct,
>> or fill it up its own way (for the use cases which has only one panel on
>> at a time). I was wondering if it would be easy to move to this approach
>> with your patch. dispc itself would now have some common clock stuff and
>> per panel clock stuff. Is that a very clean approach?
>
> I don't know =). I think the simplest solution is to have full divisor
> info for each dss_device. And it's up to the board file writer to make
> sure the divisors match for all the displays that can be enabled at the
> same time.
>
> I don't think that is perfect, but trying to share the data sounds a bit
> confusing. Especially as there are just a divisor and a clock source
> that are shared. If we have a lot of common data, then a shared struct
> would of course be better.
>
>> Anyway, I think it would be good to have a channel struct, as there are
>> more things to put in dispc clocks, it should look something like:
>>
>> struct clocks {
>> struct {
>> struct {
>> u16 lck_div;
>> u16 pck_div;
>> enum clock_source lcd_clk_src;
>> } channel;
>> ...
>> ...
>> u16 core_clk_div;
>> } dispc;
>> ...
>> ...
>> };
>
> In my original patch I had:
>
> struct {
> struct {
> u16 fck_div;
> } dss;
>
> struct {
> u16 lck_div;
> u16 pck_div;
>
> bool fclk_from_dsi_pll;
> } dispc;
>
> ...
> };
>
> Which I removed due to comments and slight confusion how to handle the
> DSS_FCLK divisor and the clock source.
>
> Adding the clock source there needs some more work, moving the enum to
> public include file, and implementing the support. If you agree that
> this patch in its current form is an improvement, I'd like to go forward
> with this and work on the clock source later.
Yeah it is, sure.
Archit
^ permalink raw reply
* Re: [PATCH] unicore32 framebuffer fix: get videomemory by __get_free_pages() and make it floatable
From: Arnd Bergmann @ 2011-04-01 9:07 UTC (permalink / raw)
To: Guan Xuetao; +Cc: 'Paul Mundt', linux-kernel, linux-fbdev
In-Reply-To: <003d01cbf046$f4947ca0$ddbd75e0$@mprc.pku.edu.cn>
On Friday 01 April 2011, Guan Xuetao wrote:
> 1. get videomemory by __get_free_pages() in fb-puv3.c
> 2. remove resource reservation for old fixed UNIGFX_MMAP & UVC_MMAP space
> 3. remove unused macros: PKUNTIY_UNIGFX_MMAP_BASE, PKUNITY_UNIGFX_MMAP_SIZE,
> PKUNITY_UVC_MMAP_BASE, PKUNITY_UVC_MMAP_SIZE and KUSER_UNIGFX_BASE
> 4. remove unused header linux/vmalloc.h in fb-puv3.h
>
> Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply
* Re: [PATCH 1/9] OMAP: DSS2: move dss device clock configuration
From: Tomi Valkeinen @ 2011-04-01 8:39 UTC (permalink / raw)
To: Archit Taneja; +Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
In-Reply-To: <4D958A91.90807@ti.com>
On Fri, 2011-04-01 at 13:49 +0530, Archit Taneja wrote:
> But there are some parameters which might get common across dss devices.
> Things like dispc clock source, dispc core clock divider will be shared
> across the panels. We had discussed the possibility of declaring this
> common info in omap_dss_board_info or as a separate common_clocks
> structure. Each device could pick this filled up common_clocks struct,
> or fill it up its own way (for the use cases which has only one panel on
> at a time). I was wondering if it would be easy to move to this approach
> with your patch. dispc itself would now have some common clock stuff and
> per panel clock stuff. Is that a very clean approach?
I don't know =). I think the simplest solution is to have full divisor
info for each dss_device. And it's up to the board file writer to make
sure the divisors match for all the displays that can be enabled at the
same time.
I don't think that is perfect, but trying to share the data sounds a bit
confusing. Especially as there are just a divisor and a clock source
that are shared. If we have a lot of common data, then a shared struct
would of course be better.
> Anyway, I think it would be good to have a channel struct, as there are
> more things to put in dispc clocks, it should look something like:
>
> struct clocks {
> struct {
> struct {
> u16 lck_div;
> u16 pck_div;
> enum clock_source lcd_clk_src;
> } channel;
> ...
> ...
> u16 core_clk_div;
> } dispc;
> ...
> ...
> };
In my original patch I had:
struct {
struct {
u16 fck_div;
} dss;
struct {
u16 lck_div;
u16 pck_div;
bool fclk_from_dsi_pll;
} dispc;
...
};
Which I removed due to comments and slight confusion how to handle the
DSS_FCLK divisor and the clock source.
Adding the clock source there needs some more work, moving the enum to
public include file, and implementing the support. If you agree that
this patch in its current form is an improvement, I'd like to go forward
with this and work on the clock source later.
Tomi
^ permalink raw reply
* Re: [PATCH 1/9] OMAP: DSS2: move dss device clock configuration
From: Archit Taneja @ 2011-04-01 8:31 UTC (permalink / raw)
To: Valkeinen, Tomi; +Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
In-Reply-To: <1301644231.3393.20.camel@deskari>
On Friday 01 April 2011 01:20 PM, Valkeinen, Tomi wrote:
> On Fri, 2011-04-01 at 13:21 +0530, Archit Taneja wrote:
>> On Friday 01 April 2011 12:37 PM, Valkeinen, Tomi wrote:
>>> On Fri, 2011-04-01 at 12:35 +0530, Archit Taneja wrote:
>>>> On Thursday 31 March 2011 03:40 PM, Valkeinen, Tomi wrote:
>>>>> Clock configuration was defined inside dssdev.phy.dsi struct. The clock
>>>>> config doesn't really belong there, and so it's moved to dssdev.clock
>>>>> struct.
>>>>>
>>>>> Now the explicit clock configuration could also be used for other
>>>>> interfaces than DSI, although there's no support for it currently.
>>>>>
>>>>> Signed-off-by: Tomi Valkeinen<tomi.valkeinen@ti.com>
>>>>> ---
>>>>> arch/arm/mach-omap2/board-4430sdp.c | 14 +++++++++-----
>>>>> arch/arm/plat-omap/include/plat/display.h | 28 ++++++++++++++++------------
>>>>> drivers/video/omap2/dss/dsi.c | 14 +++++++-------
>>>>> 3 files changed, 32 insertions(+), 24 deletions(-)
>>>>>
<snip>
>> I meant something like:
>>
>> ...
>> struct {
>> struct {
>> struct {
>> u16 lck_div;
>> u16 pck_div;
>> } channel[MAX_CHANNELS];
>> } dispc;
>>
>> ...
>>
>> struct {
>>
>> } dsi;
>>
>> } clocks;
>> ...
>>
>> Or something equivalent to the thing above, like using a pointer to an
>> array.
>
> What would be the benefit of that? A dss device can be connected only to
> one channel. Now we have the dividers and the channel defined, and
> omapdss can use this info to configure the dividers for that channel
> properly.
Okay, I guess channel wasn't the best example to explain my point, and I
guess its safe for dss device not to touch any other channels (currently
ignoring complex bridge chips which can merge data of 2 LCD channels
onto one panel).
But there are some parameters which might get common across dss devices.
Things like dispc clock source, dispc core clock divider will be shared
across the panels. We had discussed the possibility of declaring this
common info in omap_dss_board_info or as a separate common_clocks
structure. Each device could pick this filled up common_clocks struct,
or fill it up its own way (for the use cases which has only one panel on
at a time). I was wondering if it would be easy to move to this approach
with your patch. dispc itself would now have some common clock stuff and
per panel clock stuff. Is that a very clean approach?
Anyway, I think it would be good to have a channel struct, as there are
more things to put in dispc clocks, it should look something like:
struct clocks {
struct {
struct {
u16 lck_div;
u16 pck_div;
enum clock_source lcd_clk_src;
} channel;
...
...
u16 core_clk_div;
} dispc;
...
...
};
Archit
^ permalink raw reply
* [PATCH] unicore32 framebuffer fix: get videomemory by __get_free_pages() and make it floatable
From: Guan Xuetao @ 2011-04-01 8:29 UTC (permalink / raw)
To: 'Arnd Bergmann'; +Cc: 'Paul Mundt', linux-kernel, linux-fbdev
1. get videomemory by __get_free_pages() in fb-puv3.c
2. remove resource reservation for old fixed UNIGFX_MMAP & UVC_MMAP space
3. remove unused macros: PKUNTIY_UNIGFX_MMAP_BASE, PKUNITY_UNIGFX_MMAP_SIZE,
PKUNITY_UVC_MMAP_BASE, PKUNITY_UVC_MMAP_SIZE and KUSER_UNIGFX_BASE
4. remove unused header linux/vmalloc.h in fb-puv3.h
Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
---
arch/unicore32/include/mach/PKUnity.h | 10 ----------
arch/unicore32/include/mach/memory.h | 1 -
arch/unicore32/kernel/puv3-core.c | 5 -----
arch/unicore32/kernel/setup.c | 15 ++-------------
arch/unicore32/mm/mmu.c | 20 --------------------
drivers/video/fb-puv3.c | 28 +++++++++++++++++-----------
6 files changed, 19 insertions(+), 60 deletions(-)
diff --git a/arch/unicore32/include/mach/PKUnity.h b/arch/unicore32/include/mach/PKUnity.h
index a18bdc3..8040d57 100644
--- a/arch/unicore32/include/mach/PKUnity.h
+++ b/arch/unicore32/include/mach/PKUnity.h
@@ -24,16 +24,6 @@
#define PKUNITY_MMIO_BASE 0x80000000 /* 0x80000000 - 0xFFFFFFFF 2GB */
/*
- * PKUNITY Memory Map Addresses: 0x0D000000 - 0x0EFFFFFF (32MB)
- * 0x0D000000 - 0x0DFFFFFF 16MB: for UVC
- * 0x0E000000 - 0x0EFFFFFF 16MB: for UNIGFX
- */
-#define PKUNITY_UVC_MMAP_BASE 0x0D000000
-#define PKUNITY_UVC_MMAP_SIZE 0x01000000 /* 16MB */
-#define PKUNITY_UNIGFX_MMAP_BASE 0x0E000000
-#define PKUNITY_UNIGFX_MMAP_SIZE 0x01000000 /* 16MB */
-
-/*
* PKUNITY System Bus Addresses (PCI): 0x80000000 - 0xBFFFFFFF (1GB)
* 0x80000000 - 0x8000000B 12B PCI Configuration regs
* 0x80010000 - 0x80010250 592B PCI Bridge Base
diff --git a/arch/unicore32/include/mach/memory.h b/arch/unicore32/include/mach/memory.h
index 0bf21c9..4be72c2 100644
--- a/arch/unicore32/include/mach/memory.h
+++ b/arch/unicore32/include/mach/memory.h
@@ -50,7 +50,6 @@ void puv3_pci_adjust_zones(unsigned long *size, unsigned long *holes);
/* kuser area */
#define KUSER_VECPAGE_BASE (KUSER_BASE + UL(0x3fff0000))
-#define KUSER_UNIGFX_BASE (PAGE_OFFSET + PKUNITY_UNIGFX_MMAP_BASE)
/* kuser_vecpage (0xbfff0000) is ro, and vectors page (0xffff0000) is rw */
#define kuser_vecpage_to_vectors(x) ((x) - (KUSER_VECPAGE_BASE) \
+ (VECTORS_BASE))
diff --git a/arch/unicore32/kernel/puv3-core.c b/arch/unicore32/kernel/puv3-core.c
index 8b1b6be..1a505a7 100644
--- a/arch/unicore32/kernel/puv3-core.c
+++ b/arch/unicore32/kernel/puv3-core.c
@@ -99,11 +99,6 @@ static struct resource puv3_unigfx_resources[] = {
.end = io_v2p(PKUNITY_UNIGFX_BASE) + 0xfff,
.flags = IORESOURCE_MEM,
},
- [1] = {
- .start = PKUNITY_UNIGFX_MMAP_BASE,
- .end = PKUNITY_UNIGFX_MMAP_BASE + PKUNITY_UNIGFX_MMAP_SIZE,
- .flags = IORESOURCE_MEM,
- },
};
static struct resource puv3_rtc_resources[] = {
diff --git a/arch/unicore32/kernel/setup.c b/arch/unicore32/kernel/setup.c
index 1e175a8..471b6bc 100644
--- a/arch/unicore32/kernel/setup.c
+++ b/arch/unicore32/kernel/setup.c
@@ -64,12 +64,6 @@ static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
*/
static struct resource mem_res[] = {
{
- .name = "Video RAM",
- .start = 0,
- .end = 0,
- .flags = IORESOURCE_MEM
- },
- {
.name = "Kernel text",
.start = 0,
.end = 0,
@@ -83,9 +77,8 @@ static struct resource mem_res[] = {
}
};
-#define video_ram mem_res[0]
-#define kernel_code mem_res[1]
-#define kernel_data mem_res[2]
+#define kernel_code mem_res[0]
+#define kernel_data mem_res[1]
/*
* These functions re-use the assembly code in head.S, which
@@ -224,10 +217,6 @@ request_standard_resources(struct meminfo *mi)
kernel_data.end <= res->end)
request_resource(res, &kernel_data);
}
-
- video_ram.start = PKUNITY_UNIGFX_MMAP_BASE;
- video_ram.end = PKUNITY_UNIGFX_MMAP_BASE + PKUNITY_UNIGFX_MMAP_SIZE;
- request_resource(&iomem_resource, &video_ram);
}
static void (*init_machine)(void) __initdata;
diff --git a/arch/unicore32/mm/mmu.c b/arch/unicore32/mm/mmu.c
index 7bf3d58..db2d334 100644
--- a/arch/unicore32/mm/mmu.c
+++ b/arch/unicore32/mm/mmu.c
@@ -338,15 +338,6 @@ void __init uc32_mm_memblock_reserve(void)
* and can only be in node 0.
*/
memblock_reserve(__pa(swapper_pg_dir), PTRS_PER_PGD * sizeof(pgd_t));
-
-#ifdef CONFIG_PUV3_UNIGFX
- /*
- * These should likewise go elsewhere. They pre-reserve the
- * screen/video memory region at the 48M~64M of main system memory.
- */
- memblock_reserve(PKUNITY_UNIGFX_MMAP_BASE, PKUNITY_UNIGFX_MMAP_SIZE);
- memblock_reserve(PKUNITY_UVC_MMAP_BASE, PKUNITY_UVC_MMAP_SIZE);
-#endif
}
/*
@@ -371,17 +362,6 @@ static void __init devicemaps_init(void)
pmd_clear(pmd_off_k(addr));
/*
- * Create a mapping for UniGFX VRAM
- */
-#ifdef CONFIG_PUV3_UNIGFX
- map.pfn = __phys_to_pfn(PKUNITY_UNIGFX_MMAP_BASE);
- map.virtual = KUSER_UNIGFX_BASE;
- map.length = PKUNITY_UNIGFX_MMAP_SIZE;
- map.type = MT_KUSER;
- create_mapping(&map);
-#endif
-
- /*
* Create a mapping for the machine vectors at the high-vectors
* location (0xffff0000). If we aren't using high-vectors, also
* create a mapping at the low-vectors virtual address.
diff --git a/drivers/video/fb-puv3.c b/drivers/video/fb-puv3.c
index dbd2dc4..27f2c57 100644
--- a/drivers/video/fb-puv3.c
+++ b/drivers/video/fb-puv3.c
@@ -13,7 +13,6 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
-#include <linux/vmalloc.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
#include <linux/fb.h>
@@ -531,7 +530,7 @@ static int unifb_set_par(struct fb_info *info)
return -EINVAL;
}
- writel(PKUNITY_UNIGFX_MMAP_BASE, UDE_FSA);
+ writel(info->fix.smem_start, UDE_FSA);
writel(info->var.yres, UDE_LS);
writel(get_line_length(info->var.xres,
info->var.bits_per_pixel) >> 3, UDE_PS);
@@ -680,13 +679,27 @@ static int unifb_probe(struct platform_device *dev)
struct fb_info *info;
u32 unifb_regs[UNIFB_REGS_NUM];
int retval = -ENOMEM;
- struct resource *iomem, *mapmem;
+ struct resource *iomem;
+ void *videomemory;
+
+ videomemory = (void *)__get_free_pages(GFP_KERNEL | __GFP_COMP,
+ get_order(UNIFB_MEMSIZE));
+ if (!videomemory)
+ goto err;
+
+ memset(videomemory, 0, UNIFB_MEMSIZE);
+
+ unifb_fix.smem_start = virt_to_phys(videomemory);
+ unifb_fix.smem_len = UNIFB_MEMSIZE;
+
+ iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
+ unifb_fix.mmio_start = iomem->start;
info = framebuffer_alloc(sizeof(u32)*256, &dev->dev);
if (!info)
goto err;
- info->screen_base = (char __iomem *)KUSER_UNIGFX_BASE;
+ info->screen_base = (char __iomem *)videomemory;
info->fbops = &unifb_ops;
retval = fb_find_mode(&info->var, info, NULL,
@@ -695,13 +708,6 @@ static int unifb_probe(struct platform_device *dev)
if (!retval || (retval = 4))
info->var = unifb_default;
- iomem = platform_get_resource(dev, IORESOURCE_MEM, 0);
- unifb_fix.mmio_start = iomem->start;
-
- mapmem = platform_get_resource(dev, IORESOURCE_MEM, 1);
- unifb_fix.smem_start = mapmem->start;
- unifb_fix.smem_len = UNIFB_MEMSIZE;
-
info->fix = unifb_fix;
info->pseudo_palette = info->par;
info->par = NULL;
--
1.6.2.2
^ permalink raw reply related
* Re: [PATCH 1/9] OMAP: DSS2: move dss device clock configuration
From: Tomi Valkeinen @ 2011-04-01 7:50 UTC (permalink / raw)
To: Archit Taneja; +Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
In-Reply-To: <4D958407.1080505@ti.com>
On Fri, 2011-04-01 at 13:21 +0530, Archit Taneja wrote:
> On Friday 01 April 2011 12:37 PM, Valkeinen, Tomi wrote:
> > On Fri, 2011-04-01 at 12:35 +0530, Archit Taneja wrote:
> >> On Thursday 31 March 2011 03:40 PM, Valkeinen, Tomi wrote:
> >>> Clock configuration was defined inside dssdev.phy.dsi struct. The clock
> >>> config doesn't really belong there, and so it's moved to dssdev.clock
> >>> struct.
> >>>
> >>> Now the explicit clock configuration could also be used for other
> >>> interfaces than DSI, although there's no support for it currently.
> >>>
> >>> Signed-off-by: Tomi Valkeinen<tomi.valkeinen@ti.com>
> >>> ---
> >>> arch/arm/mach-omap2/board-4430sdp.c | 14 +++++++++-----
> >>> arch/arm/plat-omap/include/plat/display.h | 28 ++++++++++++++++------------
> >>> drivers/video/omap2/dss/dsi.c | 14 +++++++-------
> >>> 3 files changed, 32 insertions(+), 24 deletions(-)
> >>>
> >>> diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
> >>> index 05288c9..626b16b 100644
> >>> --- a/arch/arm/mach-omap2/board-4430sdp.c
> >>> +++ b/arch/arm/mach-omap2/board-4430sdp.c
> >
> > <snip>
> >
> >>> @@ -424,6 +412,22 @@ struct omap_dss_device {
> >>> } phy;
> >>>
> >>> struct {
> >>> + struct {
> >>> + u16 lck_div;
> >>> + u16 pck_div;
> >>
> >> Is it possible to wrap these members around a channel member? The board
> >> file can then fill up the lck_div and ppck_div based on what channel it
> >> is using.
> >
> > Hmm. What do you mean "wrap around"? The channel is defined a bit below
> > there.
> >
>
> I meant something like:
>
> ...
> struct {
> struct {
> struct {
> u16 lck_div;
> u16 pck_div;
> } channel[MAX_CHANNELS];
> } dispc;
>
> ...
>
> struct {
>
> } dsi;
>
> } clocks;
> ...
>
> Or something equivalent to the thing above, like using a pointer to an
> array.
What would be the benefit of that? A dss device can be connected only to
one channel. Now we have the dividers and the channel defined, and
omapdss can use this info to configure the dividers for that channel
properly.
Tomi
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox