Skip to contentSkip to conversation

New FBDev driver for Intel Vermilion Range

PATCH In review Alan Hourihane 6 participants 13 messages Apr 5, 2007 – Apr 20, 2007 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 New FBDev driver for Intel Vermilion Range

Attached is a patch against 2.6.21-rc5 which adds the Intel Vermilion Range support.

Intel funded Tungsten Graphics to do this work.

If there's any problems or updates needed to be done to get accepted, please let me know.

Thanks,

Alan.

Add Intel Vermilion Range support

Intel funded Tungsten Graphics for this work.

drivers/video/Kconfig +16 -0
index e4f0dd0..24d9bf2 100644
@@ -806,6 +806,22 @@ config FB_I810_I2C
 	select FB_DDC
 	help
 
+config FB_VERMILION
+	tristate "Vermilion support"
+	depends on FB && PCI && X86
+	select FB_MODE_HELPERS
+	select FB_CFB_FILLRECT
+	select FB_CFB_COPYAREA
+	select FB_CFB_IMAGEBLIT
+	help
+	  This driver supports the Vermilion Range chipset
+
+config FB_CARILLO_RANCH
+	tristate "Carillo Ranch (Vermilion) support"
+	depends on FB_VERMILION && FB && PCI && X86
+	help
+	  This driver supports the Carillo Ranch (Vermilion Range) chipset
+
 config FB_INTEL
 	tristate "Intel 830M/845G/852GM/855GM/865G/915G/945G support (EXPERIMENTAL)"
 	depends on FB && EXPERIMENTAL && PCI && X86
drivers/video/Makefile +1 -0
index 760305c..102ad27 100644
@@ -51,6 +51,7 @@ obj-$(CONFIG_FB_IMSTT)            += imsttfb.o
 obj-$(CONFIG_FB_FM2)              += fm2fb.o
 obj-$(CONFIG_FB_CYBLA)            += cyblafb.o
 obj-$(CONFIG_FB_TRIDENT)          += tridentfb.o
+obj-$(CONFIG_FB_VERMILION)        += vermilion/
 obj-$(CONFIG_FB_S3)               += s3fb.o vgastate.o
 obj-$(CONFIG_FB_STI)              += stifb.o
 obj-$(CONFIG_FB_FFB)              += ffb.o sbuslib.o
drivers/video/vermilion/Makefile new file +5 -0
new file mode 100644
index 0000000..6331357
@@ -0,0 +1,5 @@
+obj-$(CONFIG_FB_VERMILION) += vmlfb.o
+obj-$(CONFIG_FB_CARILLO_RANCH) += crvml.o
+
+vmlfb-objs := vermilion.o
+crvml-objs := carillo_ranch.o
drivers/video/vermilion/carillo_ranch.c new file +405 -0

405 lines not on this page · raw message

drivers/video/vermilion/vermilion.c new file +1495 -0

1,495 lines not on this page · raw message

drivers/video/vermilion/vermilion.h new file +293 -0

293 lines not on this page · raw message

drivers/video/vermilion/vermilion_kernel.h new file +81 -0

81 lines not on this page · raw message

#1 lore raw
Quoted 2 lines · Alan Hourihane

Attached is a patch against 2.6.21-rc5 which adds the Intel Vermilion Range support.

One non-technical question here...

drivers/video/Kconfig config FB_I810_I2C · line 817

Quoted 9 lines
drivers/video/Kconfig +9 -0
+config FB_VERMILION
+	tristate "Vermilion support"
+	depends on FB && PCI && X86
+	select FB_MODE_HELPERS
+	select FB_CFB_FILLRECT
+	select FB_CFB_COPYAREA
+	select FB_CFB_IMAGEBLIT
+	help
+	  This driver supports the Vermilion Range chipset

Is 'Vermillion' the project codename, or the name that end users will actually see when hardware ships? Most of the Intel graphics chopsets have been named things like i810, i925, and so on - if the user-visible name is known, that should probably be reflected in the 'tristate' string and help text (FB_VERMILLION in the code is fine by be though).

#2 lore raw
Quoted 18 lines

One non-technical question here...

drivers/video/Kconfig config FB_I810_I2C · line 817

Quoted 9 lines
drivers/video/Kconfig +9 -0
+config FB_VERMILION
+	tristate "Vermilion support"
+	depends on FB && PCI && X86
+	select FB_MODE_HELPERS
+	select FB_CFB_FILLRECT
+	select FB_CFB_COPYAREA
+	select FB_CFB_IMAGEBLIT
+	help
+	  This driver supports the Vermilion Range chipset

Is 'Vermillion' the project codename, or the name that end users will actually see when hardware ships? Most of the Intel graphics chopsets have been named things like i810, i925, and so on - if the user-visible name is known, that should probably be reflected in the 'tristate' string and help text (FB_VERMILLION in the code is fine by be though).

I have to agree. I went looking for info on this card and I can't find anything. Please name it what the end user will expect.

#3 lore raw
In reply to [email protected]
Quoted 7 lines · On Thu, 2007-04-05 at 13:38 -0400, [email protected] wrote:
Quoted 2 lines · Alan Hourihane

Attached is a patch against 2.6.21-rc5 which adds the Intel Vermilion Range support.

One non-technical question here...

Quoted 15 lines

drivers/video/Kconfig config FB_I810_I2C · line 817

Quoted 9 lines
drivers/video/Kconfig +9 -0
+config FB_VERMILION
+	tristate "Vermilion support"
+	depends on FB && PCI && X86
+	select FB_MODE_HELPERS
+	select FB_CFB_FILLRECT
+	select FB_CFB_COPYAREA
+	select FB_CFB_IMAGEBLIT
+	help
+	  This driver supports the Vermilion Range chipset

Is 'Vermillion' the project codename, or the name that end users will actually see when hardware ships? Most of the Intel graphics chopsets have been named things like i810, i925, and so on - if the user-visible name is known, that should probably be reflected in the 'tristate' string and help text (FB_VERMILLION in the code is fine by be though).

I've asked the question and the part number would be...

LE80578

So, if that desperately needs changing let me know and I'll submit another patch, or maybe someone can make the tweak for me.

Thanks,

Alan.

#5 lore raw
In reply to a message not in the archive
Quoted 9 lines · Arnd Bergmann

drivers/video/vermilion/carillo_ranch.c line 4

Quoted 5 lines · Alan Hourihane
drivers/video/vermilion/carillo_ranch.c new file +4 -0
@@ -0,0 +1,405 @@
+/*  
+ * Copyright (c) Intel Corp. 2007.
+ * All Rights Reserved.
+ *

Saying 'All Rights Reserved' is usually considered the opposite of licensing your code as GPL. I suppose you need to remove that.

Arnd,

Thanks for your comments, and I'll review and make appropriate changes as you've suggested.

As for the above, I've noticed that drivers/video/epson1355fb.c also has this wording and is under the GPL.

Alan.

#6 lore raw
Quoted 2 lines · Alan Hourihane

As for the above, I've noticed that drivers/video/epson1355fb.c also has this wording and is under the GPL.

Yes, many files have it, but that doesn't make it right ;-)

	Arnd <><
#7 lore raw
In reply to Alan Hourihane
Quoted 11 lines · Alan Hourihane
Quoted 9 lines · Arnd Bergmann

drivers/video/vermilion/carillo_ranch.c line 4

Quoted 5 lines · Alan Hourihane
drivers/video/vermilion/carillo_ranch.c new file +4 -0
@@ -0,0 +1,405 @@
+/*  
+ * Copyright (c) Intel Corp. 2007.
+ * All Rights Reserved.
+ *

Saying 'All Rights Reserved' is usually considered the opposite of licensing your code as GPL. I suppose you need to remove that.

Quoted 8 lines

Arnd,

Thanks for your comments, and I'll review and make appropriate changes as you've suggested.

As for the above, I've noticed that drivers/video/epson1355fb.c also has this wording and is under the GPL.

"All Rights Reserved" is written notice, a part of copyright law formality. Nowadays, your works are protected (under the copyright law) even without that written notice, so the phrase can be excluded.

I don't think the phrase is incompatible with GPL.

Tony

#8 lore raw
In reply to Alan Hourihane
Quoted 8 lines · Alan Hourihane

Attached is a patch against 2.6.21-rc5 which adds the Intel Vermilion Range support.

Intel funded Tungsten Graphics to do this work.

If there's any problems or updates needed to be done to get accepted, please let me know.

Preferably, add sparse annotations and compile with make C=1. I've included possible sparse annotations (the only ones I can see) below.

drivers/video/vermilion/carillo_ranch.c line 66

Quoted 8 lines
drivers/video/vermilion/carillo_ranch.c new file +7 -0
+
+struct cr_sys {
+	struct vml_sys sys;
+	struct pci_dev *mch_dev;
+	struct pci_dev *lpc_dev;
+	__u32 mch_bar;
+	__u8 *mch_regs_base;

void __iomem *mch_regs_base; (sparse)

Quoted 64 lines
drivers/video/vermilion/carillo_ranch.c new file +62 -0
+	__u32 gpio_bar;
+	__u32 saved_panel_state;
+	__u32 saved_clock;
+};
+
 
+static void crvml_panel_on(const struct vml_sys *sys)
+{
+	const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys);
+	__u32 addr = crsys->gpio_bar + CRVML_PANEL_PORT;
+	__u32 cur = inl(addr);
+
+	if (!(cur & CRVML_PANEL_ON)) {
+		/* Make sure LVDS controller is down. */
+		if (cur & 0x00000001) {
+			cur &= ~CRVML_LVDS_ON;
+			outl(cur, addr);
+		}
+		/* Power up Panel */
+		schedule_timeout(HZ / 10);
+		cur |= CRVML_PANEL_ON;
+		outl(cur, addr);
+	}
+
+	/* Power up LVDS controller */
+
+	if (!(cur & CRVML_LVDS_ON)) {
+		schedule_timeout(HZ / 10);
+		outl(cur | CRVML_LVDS_ON, addr);
+	}
+}
+
+static void crvml_panel_off(const struct vml_sys *sys)
+{
+	const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys);
+
+	__u32 addr = crsys->gpio_bar + CRVML_PANEL_PORT;
+	__u32 cur = inl(addr);
+
+	/* Power down LVDS controller first to avoid high currents */
+	if (cur & CRVML_LVDS_ON) {
+		cur &= ~CRVML_LVDS_ON;
+		outl(cur, addr);
+	}
+	if (cur & CRVML_PANEL_ON) {
+		schedule_timeout(HZ / 10);
+		outl(cur & ~CRVML_PANEL_ON, addr);
+	}
+}
+
+static void crvml_backlight_on(const struct vml_sys *sys)
+{
+	const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys);
+	__u32 addr = crsys->gpio_bar + CRVML_PANEL_PORT;
+	__u32 cur = inl(addr);
+
+	if (cur & CRVML_BACKLIGHT_OFF) {
+		cur &= ~CRVML_BACKLIGHT_OFF;
+		outl(cur, addr);
+	}
+}
+
+static void crvml_backlight_off(const struct vml_sys *sys)

drivers/video/vermilion/carillo_ranch.c line 250

Quoted 10 lines
drivers/video/vermilion/carillo_ranch.c new file +10 -0
+{
+	const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys);
+	__u32 addr = crsys->gpio_bar + CRVML_PANEL_PORT;
+	__u32 cur = inl(addr);
+
+	if (!(cur & CRVML_BACKLIGHT_OFF)) {
+		cur |= CRVML_BACKLIGHT_OFF;
+		outl(cur, addr);
+	}
+}

Perhaps backling_on/off and panel_on/off can be moved to the backlight subsystem?

drivers/video/vermilion/carillo_ranch.c line 255

Quoted 6 lines
drivers/video/vermilion/carillo_ranch.c new file +5 -0
+
 
+static int crvml_sys_restore(struct vml_sys *sys)
+{
+	struct cr_sys *crsys = container_of(sys, struct cr_sys, sys);
+	__u32 *clock_reg = (__u32 *) (crsys->mch_regs_base + CRVML_REG_CLOCK);

__u32 __iomem *clock_reg = crsys->mch_regs_base + CRVML_REG_CLOCK; (sparse)

Quoted 18 lines
drivers/video/vermilion/carillo_ranch.c new file +18 -0
+	__u32 cur = crsys->saved_panel_state;
+
+	if (cur & CRVML_BACKLIGHT_OFF) {
+		crvml_backlight_off(sys);
+	} else {
+		crvml_backlight_on(sys);
+	}
+
+	if (cur & CRVML_PANEL_ON) {
+		crvml_panel_on(sys);
+	} else {
+		crvml_panel_off(sys);
+		if (cur & CRVML_LVDS_ON) {
+			;
+			/* Will not power up LVDS controller while panel is off */
+		}
+	}
+	iowrite32(crsys->saved_clock, clock_reg);

drivers/video/vermilion/carillo_ranch.c line 283

Quoted 10 lines
drivers/video/vermilion/carillo_ranch.c new file +10 -0
+	ioread32(clock_reg);
+
+	return 0;
+}
+
+static int crvml_sys_save(struct vml_sys *sys)
+{
+	struct cr_sys *crsys = container_of(sys, struct cr_sys, sys);
+	__u32 *clock_reg = (__u32 *) (crsys->mch_regs_base + CRVML_REG_CLOCK);
+

__u32 __iomem *clock_reg = crsys->mch_regs_base + CRVML_REG_CLOCK; (sparse)

Quoted 28 lines
drivers/video/vermilion/carillo_ranch.c new file +27 -0
+	crsys->saved_panel_state = inl(crsys->gpio_bar + CRVML_PANEL_PORT);
+	crsys->saved_clock = ioread32(clock_reg);
+
+	return 0;
+}
+
+static int crvml_nearest_index(const struct vml_sys *sys, int clock)
+{
+
+	int i;
+	int cur_index;
+	int cur_diff;
+	int diff;
+
+	cur_index = 0;
+	cur_diff = clock - crvml_clocks[0];
+	cur_diff = (cur_diff < 0) ? -cur_diff : cur_diff;
+	for (i = 1; i < crvml_num_clocks; ++i) {
+		diff = clock - crvml_clocks[i];
+		diff = (diff < 0) ? -diff : diff;
+		if (diff < cur_diff) {
+			cur_index = i;
+			cur_diff = diff;
+		}
+	}
+	return cur_index;
+}

drivers/video/vermilion/carillo_ranch.c line 320

Quoted 10 lines
drivers/video/vermilion/carillo_ranch.c new file +10 -0
+
+static int crvml_nearest_clock(const struct vml_sys *sys, int clock)
+{
+	return crvml_clocks[crvml_nearest_index(sys, clock)];
+}
+
+static int crvml_set_clock(struct vml_sys *sys, int clock)
+{
+	struct cr_sys *crsys = container_of(sys, struct cr_sys, sys);
+	__u32 *clock_reg = (__u32 *) (crsys->mch_regs_base + CRVML_REG_CLOCK);

__u32 __iomem *clock_reg = crsys->mch_regs_base + CRVML_REG_CLOCK; (sparse)

Quoted 33 lines
drivers/video/vermilion/carillo_ranch.c new file +32 -0
+	int index;
+	__u32 clock_val;
+
+	index = crvml_nearest_index(sys, clock);
+
+	if (crvml_clocks[index] != clock)
+		return -EINVAL;
+
+	clock_val = ioread32(clock_reg) & ~CRVML_CLOCK_MASK;
+	clock_val = crvml_clock_bits[index] << CRVML_CLOCK_SHIFT;
+	iowrite32(clock_val, clock_reg);
+	ioread32(clock_reg);
+
+	return 0;
+}
+
 
+
+static int __init crvml_init(void)
+{
+	int err = 0;
+	struct vml_sys *sys;
+	struct cr_sys *crsys;
+
+	crsys = (struct cr_sys *)kmalloc(sizeof(*crsys), GFP_KERNEL);
+
+	if (!crsys)
+		return -ENOMEM;
+
+	sys = &crsys->sys;
+	err = crvml_sysinit(crsys);
+	if (err) {
+		kfree(crsys);

drivers/video/vermilion/carillo_ranch.c line 376

Quoted 10 lines
drivers/video/vermilion/carillo_ranch.c new file +10 -0
+		return err;
+	}
+
+	sys->destroy = crvml_sys_destroy;
+	sys->subsys = crvml_subsys;
+	sys->save = crvml_sys_save;
+	sys->restore = crvml_sys_restore;
+	sys->prog_clock = crvml_false;
+	sys->set_clock = crvml_set_clock;
+	sys->has_panel = crvml_true;

Hmm...

Quoted 6 lines
drivers/video/vermilion/vermilion.c new file +6 -0
+
+#ifndef FB_BLANK_UNBLANK
+#define FB_BLANK_UNBLANK	VESA_NO_BLANKING
+#endif
+#ifndef FB_BLANK_NORMAL
+#define FB_BLANK_NORMAL		VESA_NO_BLANKING + 1

drivers/video/vermilion/vermilion.c line 92

Quoted 10 lines
drivers/video/vermilion/vermilion.c new file +10 -0
+#endif
+#ifndef FB_BLANK_VSYNC_SUSPEND
+#define FB_BLANK_VSYNC_SUSPEND	VESA_VSYNC_SUSPEND + 1
+#endif
+#ifndef FB_BLANK_HSYNC_SUSPEND
+#define FB_BLANK_HSYNC_SUSPEND	VESA_HSYNC_SUSPEND + 1
+#endif
+#ifndef FB_BLANK_POWERDOWN
+#define FB_BLANK_POWERDOWN	VESA_POWERDOWN + 1
+#endif

Since this driver going to be part of the kernel, the above is redundant, you don't need it.

Quoted 4 lines
drivers/video/vermilion/vermilion.c new file +3 -0
+static int __devinit vml_pci_probe(struct pci_dev *dev,
+				   const struct pci_device_id *id)
+{

drivers/video/vermilion/vermilion.c line 684

Quoted 10 lines
drivers/video/vermilion/vermilion.c new file +10 -0
+	struct vml_info *vinfo;
+	struct fb_info *info;
+	struct vml_par *par;
+	int err = 0;
+
+	par = kmalloc(sizeof(*par), GFP_KERNEL);
+	if (par == NULL)
+		return -ENOMEM;
+
+	vinfo = kmalloc(sizeof(*vinfo), GFP_KERNEL);

You can use kzalloc instead of kmalloc.

drivers/video/vermilion/vermilion.c line 692

Quoted 8 lines
drivers/video/vermilion/vermilion.c new file +8 -0
+	if (vinfo == NULL) {
+		err = -ENOMEM;
+		goto out_err_0;
+	}
+
+	memset(vinfo, 0, sizeof(*vinfo));
+	memset(par, 0, sizeof(*par));
+

You can also use framebuffer_alloc()/framebuffer_release() for struct fb_info and for par. But if it is not possible, set info->device = dev->dev so your driver can show up in sysfs.

Quoted 14 lines
drivers/video/vermilion/vermilion.c new file +14 -0
+	vinfo->par = par;
+	vinfo->pipe = 0;
+	par->mutex = &global_mutex;
+	INIT_LIST_HEAD(&par->gpu.head);
+	par->gpu_list = &global_gpu_list;
+	par->vdc = dev;
+	atomic_set(&par->refcount, 1);
+
+	switch (id->device) {
+	case VML_DEVICE_VDC:
+		if ((err = vmlfb_get_gpu(par)))
+			goto out_err_1;
+		if ((err = pci_enable_device(dev)))
+			goto out_err_1;

drivers/video/vermilion/vermilion.c line 716

Quoted 10 lines
drivers/video/vermilion/vermilion.c new file +10 -0
+		pci_set_drvdata(dev, &vinfo->info);
+		break;
+	default:
+		err = -ENODEV;
+		goto out_err_1;
+		break;
+	}
+
+	info = &vinfo->info;
+	info->flags = FBINFO_PARTIAL_PAN_OK;

Since your driver is tristate, do

info->flags = FBINFO_DEFAULT | FBINFO_PARTIAL_PAN_OK;

I will probably use this flag later to differentiate driver modules to fix a bug in the logo drawing code.

You may also wish to add FBINFO_HW_ACCEL_YPAN for faster text scrolling.

drivers/video/vermilion/vermilion.c line 935

Quoted 6 lines
drivers/video/vermilion/vermilion.c new file +4 -0
+
+static void vml_wait_vblank(struct vml_info *vinfo)
+{
+	schedule_timeout(HZ / 40);

This is not really wait for vblank, is it?

drivers/video/vermilion/vermilion.c line 1261

Quoted 9 lines
drivers/video/vermilion/vermilion.c new file +8 -0
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
+static int vmlfb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
+		       unsigned long arg, struct fb_info *info)
+#else
+static int vmlfb_ioctl(struct fb_info *info, unsigned int cmd,
+		       unsigned long arg)
+#endif

Similarly, you can remove the above version checks.

Tony

#9 lore raw
Quoted 4 lines · Antonino A. Daplas
Quoted 3 lines · Alan Hourihane

Attached is a patch against 2.6.21-rc5 which adds the Intel Vermilion Range support.

Quoted 8 lines
Quoted 5 lines

Intel funded Tungsten Graphics to do this work.

If there's any problems or updates needed to be done to get accepted, please let me know.

Preferably, add sparse annotations and compile with make C=1. I've included possible sparse annotations (the only ones I can see) below.

Great. Thanks for this information.

Quoted 2 lines

Perhaps backling_on/off and panel_on/off can be moved to the backlight subsystem?

Another good pointer.

Thanks. I'll revisit things and get back to the list.

Alan.

#10 lore raw
In reply to Alan Hourihane

Hi!

drivers/video/vermilion/carillo_ranch.c line 69

Quoted 9 lines
drivers/video/vermilion/carillo_ranch.c new file +9 -0
+struct cr_sys {
+	struct vml_sys sys;
+	struct pci_dev *mch_dev;
+	struct pci_dev *lpc_dev;
+	__u32 mch_bar;
+	__u8 *mch_regs_base;
+	__u32 gpio_bar;
+	__u32 saved_panel_state;
+	__u32 saved_clock;

u32/u8 is right type to use here.

Quoted 1 line

+static struct vml_sys *my_sys = NULL;

No need for zero initing.

drivers/video/vermilion/carillo_ranch.c line 106

Quoted 4 lines
drivers/video/vermilion/carillo_ranch.c new file +4 -0
+static int crvml_sysinit(struct cr_sys *crsys)
+{
+	__u32 dev_en;
+	__u8 dev_en8;

u8/u32, please.

drivers/video/vermilion/carillo_ranch.c line 188

Quoted 5 lines
drivers/video/vermilion/carillo_ranch.c new file +5 -0
+static void crvml_panel_on(const struct vml_sys *sys)
+{
+	const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys);
+	__u32 addr = crsys->gpio_bar + CRVML_PANEL_PORT;
+	__u32 cur = inl(addr);

here too, and everywhere outside headers.

Quoted 13 lines
drivers/video/vermilion/carillo_ranch.c new file +13 -0
+static void crvml_backlight_on(const struct vml_sys *sys)
+{
+	const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys);
+	__u32 addr = crsys->gpio_bar + CRVML_PANEL_PORT;
+	__u32 cur = inl(addr);
+
+	if (cur & CRVML_BACKLIGHT_OFF) {
+		cur &= ~CRVML_BACKLIGHT_OFF;
+		outl(cur, addr);
+	}
+}
+
+static void crvml_backlight_off(const struct vml_sys *sys)

drivers/video/vermilion/carillo_ranch.c line 250

Quoted 10 lines
drivers/video/vermilion/carillo_ranch.c new file +10 -0
+{
+	const struct cr_sys *crsys = container_of(sys, struct cr_sys, sys);
+	__u32 addr = crsys->gpio_bar + CRVML_PANEL_PORT;
+	__u32 cur = inl(addr);
+
+	if (!(cur & CRVML_BACKLIGHT_OFF)) {
+		cur |= CRVML_BACKLIGHT_OFF;
+		outl(cur, addr);
+	}
+}

Should this go to driv*/video/backlight?

drivers/video/vermilion/carillo_ranch.c line 350

Quoted 9 lines
drivers/video/vermilion/carillo_ranch.c new file +9 -0
+static int crvml_false(const struct vml_sys *sys)
+{
+	return 0;
+}
+
+static int crvml_true(const struct vml_sys *sys)
+{
+	return 1;
+}

Ugly but useful... should be done once for all fbdevs?

drivers/video/vermilion/vermilion.c line 63

Quoted 12 lines
drivers/video/vermilion/vermilion.c new file +12 -0
+#if (defined(CONFIG_X86) && defined(X86_FEATURE_PAT) && defined(X86_FEATURE_MSR))
+
+/*
+ * Use the i386 Page Attribute Table for write-combining.
+ * We can't include this code in the kernel submission, since some of it
+ * belongs at kernel startup.
+ */
+
+#define USE_PAT_WC
+#else
+#undef USE_PAT_WC
+#endif

Eh? Did you want to remove this?

Quoted 19 lines

+/**************************************************************************
+ *
+ * Copyright (c) Intel Corp. 2007.
+ * All Rights Reserved.
+ *
+ * Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
+ * develop this driver.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.

Quoted 8 lines

+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.

Can you just use GPL here?

drivers/video/vermilion/vermilion_kernel.h line 41

Quoted 3 lines
drivers/video/vermilion/vermilion_kernel.h new file +3 -0
+#ifdef __KERNEL__
+#include<linux/ioctl.h>
+#include<linux/types.h>

Missingspaces.

Quoted 1 line

+#define __u64 uint64_t

No.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#11 lore raw
In reply to Alan Hourihane

I've updated the Vermilion Range (LE80578) patch against linus' tree.

Hopefully this rectifies all of the issues noted previously.

Let me know again if there's more updates needed.

Thanks to all who responded with the feedback, it was appreciated.

Alan.

drivers/video/Kconfig +16 -0
index e4f0dd0..eedd4c5 100644
@@ -806,6 +806,22 @@ config FB_I810_I2C
 	select FB_DDC
 	help
 
+config FB_LE80578
+	tristate "Intel LE80578 (Vermilion) support"
+	depends on FB && PCI && X86
+	select FB_MODE_HELPERS
+	select FB_CFB_FILLRECT
+	select FB_CFB_COPYAREA
+	select FB_CFB_IMAGEBLIT
+	help
+	  This driver supports the LE80578 (Vermilion Range) chipset
+
+config FB_CARILLO_RANCH
+	tristate "Intel Carillo Ranch support"
+	depends on FB_LE80578 && FB && PCI && X86
+	help
+	  This driver supports the LE80578 (Carillo Ranch) board
+
 config FB_INTEL
 	tristate "Intel 830M/845G/852GM/855GM/865G/915G/945G support (EXPERIMENTAL)"
 	depends on FB && EXPERIMENTAL && PCI && X86
drivers/video/Makefile +1 -0
index 760305c..8bc405b 100644
@@ -51,6 +51,7 @@ obj-$(CONFIG_FB_IMSTT)            += imsttfb.o
 obj-$(CONFIG_FB_FM2)              += fm2fb.o
 obj-$(CONFIG_FB_CYBLA)            += cyblafb.o
 obj-$(CONFIG_FB_TRIDENT)          += tridentfb.o
+obj-$(CONFIG_FB_LE80578)          += vermilion/
 obj-$(CONFIG_FB_S3)               += s3fb.o vgastate.o
 obj-$(CONFIG_FB_STI)              += stifb.o
 obj-$(CONFIG_FB_FFB)              += ffb.o sbuslib.o
drivers/video/backlight/Kconfig +8 -0
index 47d15b5..fbef663 100644
@@ -63,3 +63,11 @@ config BACKLIGHT_PROGEAR
 	help
 	  If you have a Frontpath ProGear say Y to enable the
 	  backlight driver.
+
+config BACKLIGHT_CARILLO_RANCH
+	tristate "Intel Carillo Ranch Backlight Driver"
+	depends on BACKLIGHT_CLASS_DEVICE && LCD_CLASS_DEVICE && PCI && X86 && FB_LE80578
+	default n
+	help
+	  If you have a Intel LE80578 (Carillo Ranch) say Y to enable the
+	  backlight driver.
drivers/video/backlight/Makefile +1 -0
index 0c3ce46..c6e2266 100644
@@ -6,3 +6,4 @@ obj-$(CONFIG_BACKLIGHT_CORGI)	+= corgi_bl.o
 obj-$(CONFIG_BACKLIGHT_HP680)	+= hp680_bl.o
 obj-$(CONFIG_BACKLIGHT_LOCOMO)	+= locomolcd.o
 obj-$(CONFIG_BACKLIGHT_PROGEAR) += progear_bl.o
+obj-$(CONFIG_BACKLIGHT_CARILLO_RANCH) += cr_bllcd.o
drivers/video/backlight/cr_bllcd.c new file +287 -0

287 lines not on this page · raw message

drivers/video/vermilion/Makefile new file +5 -0
new file mode 100644
index 0000000..cc21a65
@@ -0,0 +1,5 @@
+obj-$(CONFIG_FB_LE80578) += vmlfb.o
+obj-$(CONFIG_FB_CARILLO_RANCH) += crvml.o
+
+vmlfb-objs := vermilion.o
+crvml-objs := cr_pll.o
drivers/video/vermilion/cr_pll.c new file +208 -0

208 lines not on this page · raw message

drivers/video/vermilion/vermilion.c new file +1195 -0

1,195 lines not on this page · raw message

drivers/video/vermilion/vermilion.h new file +260 -0

260 lines not on this page · raw message

#12 lore raw
Quoted 8 lines · Alan Hourihane

I've updated the Vermilion Range (LE80578) patch against linus' tree.

Hopefully this rectifies all of the issues noted previously.

Let me know again if there's more updates needed.

Thanks to all who responded with the feedback, it was appreciated.

This (at least the framebuffer part) looks good to me (except for the excessive curly braces, but that can be fixed easily). Okay if I add a

Tony

#13 lore raw
Quoted 7 lines · Antonino A. Daplas
Quoted 6 lines · Alan Hourihane

I've updated the Vermilion Range (LE80578) patch against linus' tree.

Hopefully this rectifies all of the issues noted previously.

Let me know again if there's more updates needed.

Quoted 7 lines
Quoted 2 lines

Thanks to all who responded with the feedback, it was appreciated.

This (at least the framebuffer part) looks good to me (except for the excessive curly braces, but that can be fixed easily). Okay if I add a

would be better.

Thanks Antonino !

Alan.