Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* 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

* 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

* [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

* [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] 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 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: 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

* 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

* 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] 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: 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 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: Future desktop on dumb frame buffers?
From: Alan Cox @ 2011-04-04  9:40 UTC (permalink / raw)
  To: Matt Turner
  Cc: Fbdev development list, dri-devel, wayland-devel,
	Geert Uytterhoeven, Linux, timofonic timofonic
In-Reply-To: <AANLkTikAQ1ZLy6aoCPSQdJ8F9-D172uypff+-4+_WXPz@mail.gmail.com>

> It's nothing fantastic, but I've had a number of people tell me that
> it was useful for them.

It does document some stuff nicely - not alas the bits I need to figure
out at the moment but its definitely a nice reference to the basic setup.

(ponders Voodoo2 DRI)

^ permalink raw reply

* Re: [PATCH v3] s3fb: add DDC support
From: Ondrej Zary @ 2011-04-04 20:44 UTC (permalink / raw)
  To: Paul Mundt; +Cc: Ondrej Zajicek, linux-fbdev, Kernel development list
In-Reply-To: <20110404084200.GD28208@linux-sh.org>

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>

---
This is the CONFIG-less version.

--- 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-04 22:22:11.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,10 @@ struct s3fb_info {
 	struct mutex open_lock;
 	unsigned int ref_count;
 	u32 pseudo_palette[16];
+	u8 __iomem *mmio;
+	bool ddc_registered;
+	struct i2c_adapter ddc_adapter;
+	struct i2c_algo_bit_data ddc_algo;
 };
 
 
@@ -105,6 +113,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 +151,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 +180,116 @@ MODULE_PARM_DESC(fasttext, "Enable S3 fa
 
 /* ------------------------------------------------------------------------- */
 
+#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);
+}
+
+
+/* ------------------------------------------------------------------------- */
+
 /* Set font in S3 fast text mode */
 
 static void s3fb_settile_fast(struct fb_info *info, struct fb_tilemap *map)
@@ -994,6 +1115,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 +1239,63 @@ 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;
+
+	/* 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;
+					}
+				}
+			}
+		}
+
+	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 +1341,10 @@ err_reg_fb:
 	fb_dealloc_cmap(&info->cmap);
 err_alloc_cmap:
 err_find_mode:
+	if (par->ddc_registered)
+		i2c_del_adapter(&par->ddc_adapter);
+	if (par->mmio)
+		iounmap(par->mmio);
 	pci_iounmap(dev, info->screen_base);
 err_iomap:
 	pci_release_regions(dev);
@@ -1202,6 +1376,11 @@ static void __devexit s3_pci_remove(stru
 		unregister_framebuffer(info);
 		fb_dealloc_cmap(&info->cmap);
 
+		if (par->ddc_registered)
+			i2c_del_adapter(&par->ddc_adapter);
+		if (par->mmio)
+			iounmap(par->mmio);
+
 		pci_iounmap(dev, info->screen_base);
 		pci_release_regions(dev);
 /*		pci_disable_device(dev); */


-- 
Ondrej Zary

^ permalink raw reply

* [PATCH] fb: Reduce priority of resource conflict message
From: Matthew Garrett @ 2011-04-04 21:39 UTC (permalink / raw)
  To: linux-fbdev

It's expected that efifb will conflict with a native driver, so the
handover message should be informational rather than an error.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
---
 drivers/video/fbmem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index e2bf953..e0c2284 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1507,7 +1507,7 @@ void remove_conflicting_framebuffers(struct apertures_struct *a,
 			(primary && gen_aper && gen_aper->count &&
 			 gen_aper->ranges[0].base = VGA_FB_PHYS)) {
 
-			printk(KERN_ERR "fb: conflicting fb hw usage "
+			printk(KERN_INFO "fb: conflicting fb hw usage "
 			       "%s vs %s - removing generic driver\n",
 			       name, registered_fb[i]->fix.id);
 			unregister_framebuffer(registered_fb[i]);
-- 
1.7.4.1


^ permalink raw reply related

* [PATCH] udlfb.c dlfb_ops_ioctl - missing copy_from_user's  - NEEDS
From: Dr. David Alan Gilbert @ 2011-04-05  0:02 UTC (permalink / raw)
  To: linux-fbdev

    Fix __user casting in dlfb_ops_ioctl and a missing copy_from_user, and a missing &

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---

NOTE! I don't have the hardware to test this; but Bernie suggested I put the
patch together anyway; build and Sparse tested only -**  don't **
merge without a test by a udl dev

Patch is against ecb78ab6f30106ab72a575a25b1cdfd1633b7ca2 on Linus's tree
a few days after 39-rc1

diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c
index 2c8364e..ef7801a 100644
--- a/drivers/video/udlfb.c
+++ b/drivers/video/udlfb.c
@@ -751,14 +751,13 @@ static int dlfb_ops_ioctl(struct fb_info *info, unsigned int cmd,
 {
 
 	struct dlfb_data *dev = info->par;
-	struct dloarea *area = NULL;
 
 	if (!atomic_read(&dev->usb_active))
 		return 0;
 
 	/* TODO: Update X server to get this from sysfs instead */
 	if (cmd = DLFB_IOCTL_RETURN_EDID) {
-		char *edid = (char *)arg;
+		void __user *edid = (void __user *)arg;
 		if (copy_to_user(edid, dev->edid, dev->edid_size))
 			return -EFAULT;
 		return 0;
@@ -766,6 +765,11 @@ static int dlfb_ops_ioctl(struct fb_info *info, unsigned int cmd,
 
 	/* TODO: Help propose a standard fb.h ioctl to report mmap damage */
 	if (cmd = DLFB_IOCTL_REPORT_DAMAGE) {
+		struct dloarea area;
+
+		if (copy_from_user(&area, (void __user *)arg,
+				   sizeof(struct dloarea)))
+			return -EFAULT;
 
 		/*
 		 * If we have a damage-aware client, turn fb_defio "off"
@@ -777,21 +781,19 @@ static int dlfb_ops_ioctl(struct fb_info *info, unsigned int cmd,
 		if (info->fbdefio)
 			info->fbdefio->delay = DL_DEFIO_WRITE_DISABLE;
 
-		area = (struct dloarea *)arg;
-
-		if (area->x < 0)
-			area->x = 0;
+		if (area.x < 0)
+			area.x = 0;
 
-		if (area->x > info->var.xres)
-			area->x = info->var.xres;
+		if (area.x > info->var.xres)
+			area.x = info->var.xres;
 
-		if (area->y < 0)
-			area->y = 0;
+		if (area.y < 0)
+			area.y = 0;
 
-		if (area->y > info->var.yres)
-			area->y = info->var.yres;
+		if (area.y > info->var.yres)
+			area.y = info->var.yres;
 
-		dlfb_handle_damage(dev, area->x, area->y, area->w, area->h,
+		dlfb_handle_damage(dev, area.x, area.y, area.w, area.h,
 			   info->screen_base);
 	}
 
@@ -839,7 +841,7 @@ static int dlfb_ops_open(struct fb_info *info, int user)
 	 * preventing other clients (X) from working properly. Usually
 	 * not what the user wants. Fail by default with option to enable.
 	 */
-	if ((user = 0) & (!console))
+	if ((user = 0) && (!console))
 		return -EBUSY;
 
 	/* If the USB device is gone, we don't accept new opens */
-- 
 -----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 related

* Re: [PATCH] fb: Reduce priority of resource conflict message
From: Dave Airlie @ 2011-04-06  0:50 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1301953194-6706-1-git-send-email-mjg@redhat.com>

On Tue, Apr 5, 2011 at 7:39 AM, Matthew Garrett <mjg@redhat.com> wrote:
> It's expected that efifb will conflict with a native driver, so the
> handover message should be informational rather than an error.
>
> Signed-off-by: Matthew Garrett <mjg@redhat.com>

Acked-by: Dave Airlie <airlied@redhat.com>

Dave.

> ---
>  drivers/video/fbmem.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
> index e2bf953..e0c2284 100644
> --- a/drivers/video/fbmem.c
> +++ b/drivers/video/fbmem.c
> @@ -1507,7 +1507,7 @@ void remove_conflicting_framebuffers(struct apertures_struct *a,
>                        (primary && gen_aper && gen_aper->count &&
>                         gen_aper->ranges[0].base = VGA_FB_PHYS)) {
>
> -                       printk(KERN_ERR "fb: conflicting fb hw usage "
> +                       printk(KERN_INFO "fb: conflicting fb hw usage "
>                               "%s vs %s - removing generic driver\n",
>                               name, registered_fb[i]->fix.id);
>                        unregister_framebuffer(registered_fb[i]);
> --
> 1.7.4.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply

* [PATCH] video: imx-fb: just depend on IMX_HAVE_PLATFORM_IMX_FB
From:  @ 2011-04-06 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

All machines having a imx-fb device now select IMX_HAVE_PLATFORM_IMX_FB,
so HAVE_FB_IMX can go away and there is no need anymore to explicitly
depend on ARCH_MX1 or ARCH_MX2.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

should this go via Sascha's or Paul's tree?

Best regards
Uwe

 arch/arm/plat-mxc/devices/Kconfig |    1 -
 drivers/video/Kconfig             |    5 +----
 2 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig
index b9ab1d5..e4dcf49 100644
--- a/arch/arm/plat-mxc/devices/Kconfig
+++ b/arch/arm/plat-mxc/devices/Kconfig
@@ -24,7 +24,6 @@ config IMX_HAVE_PLATFORM_IMXDI_RTC
 
 config IMX_HAVE_PLATFORM_IMX_FB
 	bool
-	select HAVE_FB_IMX
 
 config IMX_HAVE_PLATFORM_IMX_I2C
 	bool
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index e6a8d8c..62f337a 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -8,9 +8,6 @@ menu "Graphics support"
 config HAVE_FB_ATMEL
 	bool
 
-config HAVE_FB_IMX
-	bool
-
 config SH_MIPI_DSI
 	tristate
 	depends on (SUPERH || ARCH_SHMOBILE) && HAVE_CLK
@@ -359,7 +356,7 @@ config FB_SA1100
 
 config FB_IMX
 	tristate "Freescale i.MX LCD support"
-	depends on FB && (HAVE_FB_IMX || ARCH_MX1 || ARCH_MX2)
+	depends on FB && IMX_HAVE_PLATFORM_IMX_FB
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
 	select FB_CFB_IMAGEBLIT
-- 
1.7.2.3


^ permalink raw reply related

* Re: [PATCH] video: imx-fb: just depend on IMX_HAVE_PLATFORM_IMX_FB
From: Paul Mundt @ 2011-04-06 16:38 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1302100144-17176-1-git-send-email-u.kleine-koenig@pengutronix.de>

On Wed, Apr 06, 2011 at 04:29:04PM +0200, Uwe Kleine-K??nig wrote:
> All machines having a imx-fb device now select IMX_HAVE_PLATFORM_IMX_FB,
> so HAVE_FB_IMX can go away and there is no need anymore to explicitly
> depend on ARCH_MX1 or ARCH_MX2.
> 
> Signed-off-by: Uwe Kleine-K??nig <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
> 
> should this go via Sascha's or Paul's tree?
> 
There shouldn't be anything it conflicts with in my tree, so it can go
via either. Most of the imx changes have bypassed the fbdev tree, so I'm
unaware if there are outstanding patches in Sascha's tree at the moment
or not. I can of course take it though.

^ permalink raw reply

* Re: [PATCH 1/2] Support overriding fields FW tells us with the DMI data.
From: Paul Mundt @ 2011-04-06 16:42 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1301582030-10607-2-git-send-email-pjones@redhat.com>

On Thu, Mar 31, 2011 at 10:33:49AM -0400, Peter Jones wrote:
> Some machines apparently give us bogus linelength/stride/pitch data, so
> we need to support letting the DMI table override the supplied data.
> 
> I bet you can't guess whose machines I'm talking about.
> ---
>  drivers/video/efifb.c |  149 +++++++++++++++++++++++++++++--------------------
>  1 files changed, 88 insertions(+), 61 deletions(-)
> 
You're missing a signed-off-by here but have one on 2/2, was this
intended as an RFC?

^ permalink raw reply

* Re: [PATCH] video: s3c-fb: fix checkpatch errors and warning
From: Paul Mundt @ 2011-04-06 16:45 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1301642247-20926-1-git-send-email-jg1.han@samsung.com>

On Fri, Apr 01, 2011 at 04:17:27PM +0900, Jingoo Han wrote:
> This patch fixes the checkpatch errors listed below:
> 
> ERROR: space required before the open parenthesis '('
> ERROR: need consistent spacing around '+' (ctx:WxV)
> ERROR: space prohibited before that close parenthesis ')'
> 
> Also, following warning is fixed by adding 'platid' variable
> which can reduce number of lines exceeding 80 characters.
> 
> WARNING: line over 80 characters
> 
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH 6/6] drivers/video/bfin-lq035q1-fb.c: introduce missing kfree
From: Paul Mundt @ 2011-04-06 16:46 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: Julia Lawall, kernel-janitors, linux-fbdev, linux-kernel
In-Reply-To: <BANLkTinF-Z_1J8UiPJ0wnaDLxgHRv0MsPw@mail.gmail.com>

On Sat, Apr 02, 2011 at 01:05:57AM -0400, Mike Frysinger wrote:
> 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>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH 1/2] savagefb: Replace magic register address with define
From: Paul Mundt @ 2011-04-06 16:50 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1301835246-6520-1-git-send-email-lists.tormod@gmail.com>

On Sun, Apr 03, 2011 at 02:54:04PM +0200, Tormod Volden wrote:
> MM_SERIAL1 was already defined, but not used.
> 
> Signed-off-by: Tormod Volden <debian.tormod@gmail.com>

On Sun, Apr 03, 2011 at 02:54:05PM +0200, Tormod Volden wrote:
> 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>

On Sun, Apr 03, 2011 at 02:54:06PM +0200, Tormod Volden wrote:
> The else clause was not needed after the cleanup in commit
> b8901b091db260b0f0101d6395ce5c6016835a47
> 
> Signed-off-by: Tormod Volden <debian.tormod@gmail.com>

These all look fine. All applied, thanks.

^ permalink raw reply

* Re: [PATCH v3] s3fb: add DDC support
From: Paul Mundt @ 2011-04-06 17:01 UTC (permalink / raw)
  To: Ondrej Zary; +Cc: Ondrej Zajicek, linux-fbdev, Kernel development list
In-Reply-To: <201104041125.36404.linux@rainbow-software.org>

On Mon, Apr 04, 2011 at 11:25:36AM +0200, Ondrej Zary wrote:
> 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.
> 
Oh, that's right, i2c is one of those pain in the ass subsystems that
refuses to provide a stubbed implementation of the API for i2c disabled
systems. Lets just stick with the first version for now.

^ permalink raw reply

* Re: [PATCH] fb: Reduce priority of resource conflict message
From: Paul Mundt @ 2011-04-06 17:05 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <1301953194-6706-1-git-send-email-mjg@redhat.com>

On Wed, Apr 06, 2011 at 10:50:04AM +1000, Dave Airlie wrote:
> On Tue, Apr 5, 2011 at 7:39 AM, Matthew Garrett <mjg@redhat.com> wrote:
> > It's expected that efifb will conflict with a native driver, so the
> > handover message should be informational rather than an error.
> >
> > Signed-off-by: Matthew Garrett <mjg@redhat.com>
> 
> Acked-by: Dave Airlie <airlied@redhat.com>
> 
Applied, thanks.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox