Commit ce31e58a authored by Petr Vandrovec's avatar Petr Vandrovec

Make secondary output support mandatory for Matrox G450/G550.

parent 48800d9e
...@@ -387,8 +387,7 @@ CONFIG_FB_MATROX ...@@ -387,8 +387,7 @@ CONFIG_FB_MATROX
Say Y here if you have a Matrox Millennium, Matrox Millennium II, Say Y here if you have a Matrox Millennium, Matrox Millennium II,
Matrox Mystique, Matrox Mystique 220, Matrox Productiva G100, Matrox Matrox Mystique, Matrox Mystique 220, Matrox Productiva G100, Matrox
Mystique G200, Matrox Millennium G200, Matrox Marvel G200 video, Mystique G200, Matrox Millennium G200, Matrox Marvel G200 video,
Matrox G400, G450 or G550 card in your box. At this time, support for Matrox G400, G450 or G550 card in your box.
the G-series digital output is almost non-existant.
This driver is also available as a module ( = code which can be This driver is also available as a module ( = code which can be
inserted and removed from the running kernel whenever you want). inserted and removed from the running kernel whenever you want).
...@@ -413,7 +412,7 @@ CONFIG_FB_MATROX_MYSTIQUE ...@@ -413,7 +412,7 @@ CONFIG_FB_MATROX_MYSTIQUE
packed pixel and 32 bpp packed pixel. You can also use font widths packed pixel and 32 bpp packed pixel. You can also use font widths
different from 8. different from 8.
CONFIG_FB_MATROX_G100 CONFIG_FB_MATROX_G450
Say Y here if you have a Matrox G100, G200, G400, G450 or G550 based Say Y here if you have a Matrox G100, G200, G400, G450 or G550 based
video card. If you select "Advanced lowlevel driver options", you video card. If you select "Advanced lowlevel driver options", you
should check 8 bpp packed pixel, 16 bpp packed pixel, 24 bpp packed should check 8 bpp packed pixel, 16 bpp packed pixel, 24 bpp packed
...@@ -423,11 +422,26 @@ CONFIG_FB_MATROX_G100 ...@@ -423,11 +422,26 @@ CONFIG_FB_MATROX_G100
If you need support for G400 secondary head, you must first say Y to If you need support for G400 secondary head, you must first say Y to
"I2C support" and "I2C bit-banging support" in the character devices "I2C support" and "I2C bit-banging support" in the character devices
section, and then to "Matrox I2C support" and "G400 second head section, and then to "Matrox I2C support" and "G400 second head
support" here in the framebuffer section. support" here in the framebuffer section. G450/G550 secondary head
and digital output are supported without additional modules.
Do not forget that second head supports only 16 and 32 bpp
packed pixels, so it is a good idea to compile them into the kernel
too. You can use only some font widths, as the driver uses generic
painting procedures (the secondary head does not use acceleration
engine).
If you have G550, you must also compile support for G450/G550 secondary CONFIG_FB_MATROX_G100A
head into kernel, otherwise picture will be shown only on output you Say Y here if you have a Matrox G100, G200 or G400 based
are probably not using... video card. If you select "Advanced lowlevel driver options", you
should check 8 bpp packed pixel, 16 bpp packed pixel, 24 bpp packed
pixel and 32 bpp packed pixel. You can also use font widths
different from 8.
If you need support for G400 secondary head, you must first say Y to
"I2C support" and "I2C bit-banging support" in the character devices
section, and then to "Matrox I2C support" and "G400 second head
support" here in the framebuffer section.
CONFIG_FB_MATROX_I2C CONFIG_FB_MATROX_I2C
This drivers creates I2C buses which are needed for accessing the This drivers creates I2C buses which are needed for accessing the
...@@ -470,27 +484,6 @@ CONFIG_FB_MATROX_MAVEN ...@@ -470,27 +484,6 @@ CONFIG_FB_MATROX_MAVEN
painting procedures (the secondary head does not use acceleration painting procedures (the secondary head does not use acceleration
engine). engine).
CONFIG_FB_MATROX_G450
Say Y or M here if you want to use a secondary head (meaning two
monitors in parallel) on G450, or if you are using analog output
of G550.
If you compile it as module, two modules are created,
matroxfb_crtc2.o and matroxfb_g450.o. Both modules are needed if you
want two independent display devices.
The driver starts in monitor mode and currently does not support
output in TV modes. You must use the matroxset tool (available
at <ftp://platan.vc.cvut.cz/pub/linux/matrox-latest/>) to swap
primary and secondary head outputs. Secondary head driver always
start in 640x480 resolution and you must use fbset to change it.
Also do not forget that second head supports only 16 and 32 bpp
packed pixels, so it is a good idea to compile them into the kernel
too. You can use only some font widths, as the driver uses generic
painting procedures (the secondary head does not use acceleration
engine).
CONFIG_FB_MATROX_MULTIHEAD CONFIG_FB_MATROX_MULTIHEAD
Say Y here if you have more than one (supported) Matrox device in Say Y here if you have more than one (supported) Matrox device in
your computer and you want to use all of them for different monitors your computer and you want to use all of them for different monitors
......
...@@ -130,14 +130,19 @@ if [ "$CONFIG_FB" = "y" ]; then ...@@ -130,14 +130,19 @@ if [ "$CONFIG_FB" = "y" ]; then
if [ "$CONFIG_FB_MATROX" != "n" ]; then if [ "$CONFIG_FB_MATROX" != "n" ]; then
bool ' Millennium I/II support' CONFIG_FB_MATROX_MILLENIUM bool ' Millennium I/II support' CONFIG_FB_MATROX_MILLENIUM
bool ' Mystique support' CONFIG_FB_MATROX_MYSTIQUE bool ' Mystique support' CONFIG_FB_MATROX_MYSTIQUE
bool ' G100/G200/G400/G450/G550 support' CONFIG_FB_MATROX_G100 bool ' G100/G200/G400/G450/G550 support' CONFIG_FB_MATROX_G450
if [ "$CONFIG_FB_MATROX_G450" = "n" ]; then
bool ' G100/G200/G400 support' CONFIG_FB_MATROX_G100A
fi
if [ "$CONFIG_FB_MATROX_G450" = "y" -o "$CONFIG_FB_MATROX_G100A" = "y" ]; then
define_bool CONFIG_FB_MATROX_G100 y
fi
if [ "$CONFIG_I2C" != "n" ]; then if [ "$CONFIG_I2C" != "n" ]; then
dep_tristate ' Matrox I2C support' CONFIG_FB_MATROX_I2C $CONFIG_FB_MATROX $CONFIG_I2C_ALGOBIT dep_tristate ' Matrox I2C support' CONFIG_FB_MATROX_I2C $CONFIG_FB_MATROX $CONFIG_I2C_ALGOBIT
if [ "$CONFIG_FB_MATROX_G100" = "y" ]; then if [ "$CONFIG_FB_MATROX_G100" = "y" ]; then
dep_tristate ' G400 second head support' CONFIG_FB_MATROX_MAVEN $CONFIG_FB_MATROX_I2C dep_tristate ' G400 second head support' CONFIG_FB_MATROX_MAVEN $CONFIG_FB_MATROX_I2C
fi fi
fi fi
dep_tristate ' G450/G550 second head support (mandatory for G550)' CONFIG_FB_MATROX_G450 $CONFIG_FB_MATROX_G100
bool ' Multihead support' CONFIG_FB_MATROX_MULTIHEAD bool ' Multihead support' CONFIG_FB_MATROX_MULTIHEAD
fi fi
tristate ' ATI Mach64 display support (EXPERIMENTAL)' CONFIG_FB_ATY tristate ' ATI Mach64 display support (EXPERIMENTAL)' CONFIG_FB_ATY
......
...@@ -5,16 +5,16 @@ ...@@ -5,16 +5,16 @@
# All of the (potential) objects that export symbols. # All of the (potential) objects that export symbols.
# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'. # This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
export-objs := matroxfb_base.o matroxfb_accel.o matroxfb_DAC1064.o matroxfb_Ti3026.o matroxfb_misc.o g450_pll.o export-objs := matroxfb_base.o matroxfb_accel.o matroxfb_DAC1064.o matroxfb_Ti3026.o matroxfb_misc.o g450_pll.o matroxfb_g450.o
# Each configuration option enables a list of files. # Each configuration option enables a list of files.
my-obj-$(CONFIG_FB_MATROX_G100) := g450_pll.o my-obj-$(CONFIG_FB_MATROX_G100) += g450_pll.o
my-obj-$(CONFIG_FB_MATROX_G450) += matroxfb_g450.o matroxfb_crtc2.o
obj-$(CONFIG_FB_MATROX) += matroxfb_base.o matroxfb_accel.o matroxfb_DAC1064.o matroxfb_Ti3026.o matroxfb_misc.o $(my-obj-y) obj-$(CONFIG_FB_MATROX) += matroxfb_base.o matroxfb_accel.o matroxfb_DAC1064.o matroxfb_Ti3026.o matroxfb_misc.o $(my-obj-y)
obj-$(CONFIG_FB_MATROX_I2C) += i2c-matroxfb.o obj-$(CONFIG_FB_MATROX_I2C) += i2c-matroxfb.o
obj-$(CONFIG_FB_MATROX_MAVEN) += matroxfb_maven.o matroxfb_crtc2.o obj-$(CONFIG_FB_MATROX_MAVEN) += matroxfb_maven.o matroxfb_crtc2.o
obj-$(CONFIG_FB_MATROX_G450) += matroxfb_g450.o matroxfb_crtc2.o
include $(TOPDIR)/Rules.make include $(TOPDIR)/Rules.make
......
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
#include "matroxfb_Ti3026.h" #include "matroxfb_Ti3026.h"
#include "matroxfb_maven.h" #include "matroxfb_maven.h"
#include "matroxfb_crtc2.h" #include "matroxfb_crtc2.h"
#include "matroxfb_g450.h"
#include <linux/matroxfb.h> #include <linux/matroxfb.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -212,6 +213,7 @@ static void matroxfb_remove(WPMINFO int dummy) { ...@@ -212,6 +213,7 @@ static void matroxfb_remove(WPMINFO int dummy) {
} }
matroxfb_unregister_device(MINFO); matroxfb_unregister_device(MINFO);
unregister_framebuffer(&ACCESS_FBINFO(fbcon)); unregister_framebuffer(&ACCESS_FBINFO(fbcon));
matroxfb_g450_shutdown(PMINFO2);
del_timer_sync(&ACCESS_FBINFO(cursor.timer)); del_timer_sync(&ACCESS_FBINFO(cursor.timer));
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
if (ACCESS_FBINFO(mtrr.vram_valid)) if (ACCESS_FBINFO(mtrr.vram_valid))
...@@ -1732,6 +1734,7 @@ static int initMatrox2(WPMINFO struct display* d, struct board* b){ ...@@ -1732,6 +1734,7 @@ static int initMatrox2(WPMINFO struct display* d, struct board* b){
if (!ACCESS_FBINFO(devflags.novga)) if (!ACCESS_FBINFO(devflags.novga))
request_region(0x3C0, 32, "matrox"); request_region(0x3C0, 32, "matrox");
matroxfb_g450_connect(PMINFO2);
ACCESS_FBINFO(hw_switch->reset(PMINFO2)); ACCESS_FBINFO(hw_switch->reset(PMINFO2));
ACCESS_FBINFO(fbcon.monspecs.hfmin) = 0; ACCESS_FBINFO(fbcon.monspecs.hfmin) = 0;
...@@ -1885,6 +1888,7 @@ static int initMatrox2(WPMINFO struct display* d, struct board* b){ ...@@ -1885,6 +1888,7 @@ static int initMatrox2(WPMINFO struct display* d, struct board* b){
} }
return 0; return 0;
failVideoIO:; failVideoIO:;
matroxfb_g450_shutdown(PMINFO2);
mga_iounmap(ACCESS_FBINFO(video.vbase)); mga_iounmap(ACCESS_FBINFO(video.vbase));
failCtrlIO:; failCtrlIO:;
mga_iounmap(ACCESS_FBINFO(mmio.vbase)); mga_iounmap(ACCESS_FBINFO(mmio.vbase));
......
...@@ -71,76 +71,41 @@ static struct matrox_altout matroxfb_g450_altout = { ...@@ -71,76 +71,41 @@ static struct matrox_altout matroxfb_g450_altout = {
matroxfb_g450_get_mode matroxfb_g450_get_mode
}; };
static int matroxfb_g450_connect(struct matroxfb_g450_info* m2info) { void matroxfb_g450_connect(WPMINFO2) {
MINFO_FROM(m2info->primary_dev); struct matroxfb_g450_info* m2info;
/* hardware is not G450... */
if (!ACCESS_FBINFO(devflags.g450dac))
return;
m2info = (struct matroxfb_g450_info*)kmalloc(sizeof(*m2info), GFP_KERNEL);
if (!m2info) {
printk(KERN_ERR "matroxfb_g450: Not enough memory for G450 DAC control structs\n");
return;
}
memset(m2info, 0, sizeof(*m2info));
down_write(&ACCESS_FBINFO(altout.lock)); down_write(&ACCESS_FBINFO(altout.lock));
m2info->primary_dev = MINFO;
ACCESS_FBINFO(altout.device) = m2info; ACCESS_FBINFO(altout.device) = m2info;
ACCESS_FBINFO(altout.output) = &matroxfb_g450_altout; ACCESS_FBINFO(altout.output) = &matroxfb_g450_altout;
up_write(&ACCESS_FBINFO(altout.lock)); up_write(&ACCESS_FBINFO(altout.lock));
ACCESS_FBINFO(output.all) |= MATROXFB_OUTPUT_CONN_SECONDARY; ACCESS_FBINFO(output.all) |= MATROXFB_OUTPUT_CONN_SECONDARY;
matroxfb_switch(ACCESS_FBINFO(fbcon.currcon), (struct fb_info*)MINFO); matroxfb_switch(ACCESS_FBINFO(fbcon.currcon), (struct fb_info*)MINFO);
return 0;
} }
static void matroxfb_g450_shutdown(struct matroxfb_g450_info* m2info) { void matroxfb_g450_shutdown(WPMINFO2) {
MINFO_FROM(m2info->primary_dev);
if (MINFO) {
ACCESS_FBINFO(output.all) &= ~MATROXFB_OUTPUT_CONN_SECONDARY; ACCESS_FBINFO(output.all) &= ~MATROXFB_OUTPUT_CONN_SECONDARY;
ACCESS_FBINFO(output.ph) &= ~MATROXFB_OUTPUT_CONN_SECONDARY; ACCESS_FBINFO(output.ph) &= ~MATROXFB_OUTPUT_CONN_SECONDARY;
ACCESS_FBINFO(output.sh) &= ~MATROXFB_OUTPUT_CONN_SECONDARY; ACCESS_FBINFO(output.sh) &= ~MATROXFB_OUTPUT_CONN_SECONDARY;
down_write(&ACCESS_FBINFO(altout.lock)); down_write(&ACCESS_FBINFO(altout.lock));
kfree(ACCESS_FBINFO(altout.device));
ACCESS_FBINFO(altout.device) = NULL; ACCESS_FBINFO(altout.device) = NULL;
ACCESS_FBINFO(altout.output) = NULL; ACCESS_FBINFO(altout.output) = NULL;
up_write(&ACCESS_FBINFO(altout.lock)); up_write(&ACCESS_FBINFO(altout.lock));
m2info->primary_dev = NULL;
}
}
/* we do not have __setup() yet */
static void* matroxfb_g450_probe(struct matrox_fb_info* minfo) {
struct matroxfb_g450_info* m2info;
/* hardware is not G450... */
if (!ACCESS_FBINFO(devflags.g450dac))
return NULL;
m2info = (struct matroxfb_g450_info*)kmalloc(sizeof(*m2info), GFP_KERNEL);
if (!m2info) {
printk(KERN_ERR "matroxfb_g450: Not enough memory for G450 DAC control structs\n");
return NULL;
}
memset(m2info, 0, sizeof(*m2info));
m2info->primary_dev = MINFO;
if (matroxfb_g450_connect(m2info)) {
kfree(m2info);
printk(KERN_ERR "matroxfb_g450: G450 DAC failed to initialize\n");
return NULL;
}
return m2info;
}
static void matroxfb_g450_remove(struct matrox_fb_info* minfo, void* g450) {
matroxfb_g450_shutdown(g450);
kfree(g450);
}
static struct matroxfb_driver g450 = {
.name = "Matrox G450 output #2",
.probe = matroxfb_g450_probe,
.remove = matroxfb_g450_remove };
static int matroxfb_g450_init(void) {
matroxfb_register_driver(&g450);
return 0;
} }
static void matroxfb_g450_exit(void) { EXPORT_SYMBOL(matroxfb_g450_connect);
matroxfb_unregister_driver(&g450); EXPORT_SYMBOL(matroxfb_g450_shutdown);
}
MODULE_AUTHOR("(c) 2000-2001 Petr Vandrovec <vandrove@vc.cvut.cz>"); MODULE_AUTHOR("(c) 2000-2001 Petr Vandrovec <vandrove@vc.cvut.cz>");
MODULE_DESCRIPTION("Matrox G450 secondary output driver"); MODULE_DESCRIPTION("Matrox G450 secondary output driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
module_init(matroxfb_g450_init);
module_exit(matroxfb_g450_exit);
#ifndef __MATROXFB_G450_H__ #ifndef __MATROXFB_G450_H__
#define __MATROXFB_G450_H__ #define __MATROXFB_G450_H__
#include <linux/ioctl.h>
#include "matroxfb_base.h" #include "matroxfb_base.h"
struct matroxfb_g450_info { struct matroxfb_g450_info {
...@@ -9,4 +8,12 @@ struct matroxfb_g450_info { ...@@ -9,4 +8,12 @@ struct matroxfb_g450_info {
unsigned int timmings; unsigned int timmings;
}; };
#endif /* __MATROXFB_MAVEN_H__ */ #ifdef CONFIG_FB_MATROX_G450
void matroxfb_g450_connect(WPMINFO2);
void matroxfb_g450_shutdown(WPMINFO2);
#else
static inline void matroxfb_g450_connect(WPMINFO2) { };
static inline void matroxfb_g450_shutdown(WPMINFO2) { };
#endif
#endif /* __MATROXFB_G450_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment