Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 94188
b: refs/heads/master
c: 3553a2f
h: refs/heads/master
v: v3
  • Loading branch information
Andres Salomon authored and Linus Torvalds committed Apr 28, 2008
1 parent 5173231 commit 07ed881
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fd96795630428ceca775bd1effc5bf41a9fe5272
refs/heads/master: 3553a2fa8cbfc9f85f1809366be5884054f52c6d
37 changes: 35 additions & 2 deletions trunk/drivers/video/geode/gxfb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static int vram;
static int vt_switch;

/* Modes relevant to the GX (taken from modedb.c) */
static const struct fb_videomode gx_modedb[] __initdata = {
static struct fb_videomode gx_modedb[] __initdata = {
/* 640x480-60 VESA */
{ NULL, 60, 640, 480, 39682, 48, 16, 33, 10, 96, 2,
0, FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
Expand Down Expand Up @@ -108,6 +108,35 @@ static const struct fb_videomode gx_modedb[] __initdata = {
FB_VMODE_NONINTERLACED, FB_MODE_IS_VESA },
};

#ifdef CONFIG_OLPC
#include <asm/olpc.h>

static struct fb_videomode gx_dcon_modedb[] __initdata = {
/* The only mode the DCON has is 1200x900 */
{ NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
FB_VMODE_NONINTERLACED, 0 }
};

static void __init get_modedb(struct fb_videomode **modedb, unsigned int *size)
{
if (olpc_has_dcon()) {
*modedb = (struct fb_videomode *) gx_dcon_modedb;
*size = ARRAY_SIZE(gx_dcon_modedb);
} else {
*modedb = (struct fb_videomode *) gx_modedb;
*size = ARRAY_SIZE(gx_modedb);
}
}

#else
static void __init get_modedb(struct fb_videomode **modedb, unsigned int *size)
{
*modedb = (struct fb_videomode *) gx_modedb;
*size = ARRAY_SIZE(gx_modedb);
}
#endif

static int gxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{
if (var->xres > 1600 || var->yres > 1200)
Expand Down Expand Up @@ -350,6 +379,9 @@ static int __init gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *i
int ret;
unsigned long val;

struct fb_videomode *modedb_ptr;
unsigned int modedb_size;

info = gxfb_init_fbinfo(&pdev->dev);
if (!info)
return -ENOMEM;
Expand All @@ -369,8 +401,9 @@ static int __init gxfb_probe(struct pci_dev *pdev, const struct pci_device_id *i
else
par->enable_crt = 1;

get_modedb(&modedb_ptr, &modedb_size);
ret = fb_find_mode(&info->var, info, mode_option,
gx_modedb, ARRAY_SIZE(gx_modedb), NULL, 16);
modedb_ptr, modedb_size, NULL, 16);
if (ret == 0 || ret == 4) {
dev_err(&pdev->dev, "could not find valid video mode\n");
ret = -EINVAL;
Expand Down
37 changes: 32 additions & 5 deletions trunk/drivers/video/geode/lxfb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static int vt_switch;
* we try to make it something sane - 640x480-60 is sane
*/

static const struct fb_videomode geode_modedb[] __initdata = {
static struct fb_videomode geode_modedb[] __initdata = {
/* 640x480-60 */
{ NULL, 60, 640, 480, 39682, 48, 8, 25, 2, 88, 2,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
Expand Down Expand Up @@ -217,6 +217,35 @@ static const struct fb_videomode geode_modedb[] __initdata = {
0, FB_VMODE_NONINTERLACED, 0 },
};

#ifdef CONFIG_OLPC
#include <asm/olpc.h>

static struct fb_videomode olpc_dcon_modedb[] __initdata = {
/* The only mode the DCON has is 1200x900 */
{ NULL, 50, 1200, 900, 17460, 24, 8, 4, 5, 8, 3,
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
FB_VMODE_NONINTERLACED, 0 }
};

static void __init get_modedb(struct fb_videomode **modedb, unsigned int *size)
{
if (olpc_has_dcon()) {
*modedb = (struct fb_videomode *) olpc_dcon_modedb;
*size = ARRAY_SIZE(olpc_dcon_modedb);
} else {
*modedb = (struct fb_videomode *) geode_modedb;
*size = ARRAY_SIZE(geode_modedb);
}
}

#else
static void __init get_modedb(struct fb_videomode **modedb, unsigned int *size)
{
*modedb = (struct fb_videomode *) geode_modedb;
*size = ARRAY_SIZE(geode_modedb);
}
#endif

static int lxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{
if (var->xres > 1920 || var->yres > 1440)
Expand Down Expand Up @@ -477,7 +506,7 @@ static int __init lxfb_probe(struct pci_dev *pdev,
int ret;

struct fb_videomode *modedb_ptr;
int modedb_size;
unsigned int modedb_size;

info = lxfb_init_fbinfo(&pdev->dev);

Expand All @@ -502,9 +531,7 @@ static int __init lxfb_probe(struct pci_dev *pdev,

/* Set up the mode database */

modedb_ptr = (struct fb_videomode *) geode_modedb;
modedb_size = ARRAY_SIZE(geode_modedb);

get_modedb(&modedb_ptr, &modedb_size);
ret = fb_find_mode(&info->var, info, mode_option,
modedb_ptr, modedb_size, NULL, 16);

Expand Down

0 comments on commit 07ed881

Please sign in to comment.