Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193559
b: refs/heads/master
c: 24b4d82
h: refs/heads/master
i:
  193557: 7ebd224
  193555: 236d4ca
  193551: 7c2daff
v: v3
  • Loading branch information
Jonathan Corbet committed May 7, 2010
1 parent 14734e4 commit 5d08daf
Show file tree
Hide file tree
Showing 13 changed files with 266 additions and 186 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: f045f77bc0bf238a871b10bea9e425329a8e4abc
refs/heads/master: 24b4d82e4715841848a499534ed5cb7db3d6bca3
14 changes: 7 additions & 7 deletions trunk/drivers/video/via/accel.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "via-core.h"
#include "global.h"

/*
Expand Down Expand Up @@ -321,8 +322,7 @@ int viafb_init_engine(struct fb_info *info)
u32 vq_start_addr, vq_end_addr, vq_start_low, vq_end_low, vq_high,
vq_len, chip_name = viapar->shared->chip_info.gfx_chip_name;

engine = ioremap_nocache(info->fix.mmio_start, info->fix.mmio_len);
viapar->shared->engine_mmio = engine;
engine = viapar->shared->vdev->engine_mmio;
if (!engine) {
printk(KERN_WARNING "viafb_init_accel: ioremap failed, "
"hardware acceleration disabled\n");
Expand Down Expand Up @@ -465,7 +465,7 @@ void viafb_show_hw_cursor(struct fb_info *info, int Status)
struct viafb_par *viapar = info->par;
u32 temp, iga_path = viapar->iga_path;

temp = readl(viapar->shared->engine_mmio + VIA_REG_CURSOR_MODE);
temp = readl(viapar->shared->vdev->engine_mmio + VIA_REG_CURSOR_MODE);
switch (Status) {
case HW_Cursor_ON:
temp |= 0x1;
Expand All @@ -482,14 +482,15 @@ void viafb_show_hw_cursor(struct fb_info *info, int Status)
default:
temp &= 0x7FFFFFFF;
}
writel(temp, viapar->shared->engine_mmio + VIA_REG_CURSOR_MODE);
writel(temp, viapar->shared->vdev->engine_mmio + VIA_REG_CURSOR_MODE);
}

void viafb_wait_engine_idle(struct fb_info *info)
{
struct viafb_par *viapar = info->par;
int loop = 0;
u32 mask;
void __iomem *engine = viapar->shared->vdev->engine_mmio;

switch (viapar->shared->chip_info.twod_engine) {
case VIA_2D_ENG_H5:
Expand All @@ -498,7 +499,7 @@ void viafb_wait_engine_idle(struct fb_info *info)
VIA_3D_ENG_BUSY_M1;
break;
default:
while (!(readl(viapar->shared->engine_mmio + VIA_REG_STATUS) &
while (!(readl(engine + VIA_REG_STATUS) &
VIA_VR_QUEUE_BUSY) && (loop < MAXLOOP)) {
loop++;
cpu_relax();
Expand All @@ -507,8 +508,7 @@ void viafb_wait_engine_idle(struct fb_info *info)
break;
}

while ((readl(viapar->shared->engine_mmio + VIA_REG_STATUS) & mask) &&
(loop < MAXLOOP)) {
while ((readl(engine + VIA_REG_STATUS) & mask) && (loop < MAXLOOP)) {
loop++;
cpu_relax();
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/video/via/dvi.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "via-core.h"
#include "via_i2c.h"
#include "global.h"

static void tmds_register_write(int index, u8 data);
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/video/via/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@

#include "debug.h"

#include "via-core.h"
#include "viafbdev.h"
#include "chip.h"
#include "accel.h"
#include "share.h"
#include "dvi.h"
#include "viamode.h"
#include "via_i2c.h"
#include "hw.h"

#include "lcd.h"
Expand Down
131 changes: 6 additions & 125 deletions trunk/drivers/video/via/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#include "via-core.h"
#include "global.h"

static struct pll_map pll_value[] = {
Expand Down Expand Up @@ -526,8 +526,7 @@ static void dvi_patch_skew_dvp_low(void);
static void set_dvi_output_path(int set_iga, int output_interface);
static void set_lcd_output_path(int set_iga, int output_interface);
static void load_fix_bit_crtc_reg(void);
static void init_gfx_chip_info(struct pci_dev *pdev,
const struct pci_device_id *pdi);
static void init_gfx_chip_info(int chip_type);
static void init_tmds_chip_info(void);
static void init_lvds_chip_info(void);
static void device_screen_off(void);
Expand Down Expand Up @@ -1911,10 +1910,9 @@ void viafb_fill_crtc_timing(struct crt_mode_table *crt_table,

}

void viafb_init_chip_info(struct pci_dev *pdev,
const struct pci_device_id *pdi)
void viafb_init_chip_info(int chip_type)
{
init_gfx_chip_info(pdev, pdi);
init_gfx_chip_info(chip_type);
init_tmds_chip_info();
init_lvds_chip_info();

Expand Down Expand Up @@ -1981,12 +1979,11 @@ void viafb_update_device_setting(int hres, int vres,
}
}

static void init_gfx_chip_info(struct pci_dev *pdev,
const struct pci_device_id *pdi)
static void init_gfx_chip_info(int chip_type)
{
u8 tmp;

viaparinfo->chip_info->gfx_chip_name = pdi->driver_data;
viaparinfo->chip_info->gfx_chip_name = chip_type;

/* Check revision of CLE266 Chip */
if (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266) {
Expand Down Expand Up @@ -2489,122 +2486,6 @@ static void disable_second_display_channel(void)
viafb_write_reg_mask(CR6A, VIACR, BIT6, BIT6);
}

static u_int16_t via_function3[] = {
CLE266_FUNCTION3, KM400_FUNCTION3, CN400_FUNCTION3, CN700_FUNCTION3,
CX700_FUNCTION3, KM800_FUNCTION3, KM890_FUNCTION3, P4M890_FUNCTION3,
P4M900_FUNCTION3, VX800_FUNCTION3, VX855_FUNCTION3,
};

/* Get the BIOS-configured framebuffer size from PCI configuration space
* of function 3 in the respective chipset */
int viafb_get_fb_size_from_pci(void)
{
int i;
u_int8_t offset = 0;
u_int32_t FBSize;
u_int32_t VideoMemSize;

/* search for the "FUNCTION3" device in this chipset */
for (i = 0; i < ARRAY_SIZE(via_function3); i++) {
struct pci_dev *pdev;

pdev = pci_get_device(PCI_VENDOR_ID_VIA, via_function3[i],
NULL);
if (!pdev)
continue;

DEBUG_MSG(KERN_INFO "Device ID = %x\n", pdev->device);

switch (pdev->device) {
case CLE266_FUNCTION3:
case KM400_FUNCTION3:
offset = 0xE0;
break;
case CN400_FUNCTION3:
case CN700_FUNCTION3:
case CX700_FUNCTION3:
case KM800_FUNCTION3:
case KM890_FUNCTION3:
case P4M890_FUNCTION3:
case P4M900_FUNCTION3:
case VX800_FUNCTION3:
case VX855_FUNCTION3:
/*case CN750_FUNCTION3: */
offset = 0xA0;
break;
}

if (!offset)
break;

pci_read_config_dword(pdev, offset, &FBSize);
pci_dev_put(pdev);
}

if (!offset) {
printk(KERN_ERR "cannot determine framebuffer size\n");
return -EIO;
}

FBSize = FBSize & 0x00007000;
DEBUG_MSG(KERN_INFO "FB Size = %x\n", FBSize);

if (viaparinfo->chip_info->gfx_chip_name < UNICHROME_CX700) {
switch (FBSize) {
case 0x00004000:
VideoMemSize = (16 << 20); /*16M */
break;

case 0x00005000:
VideoMemSize = (32 << 20); /*32M */
break;

case 0x00006000:
VideoMemSize = (64 << 20); /*64M */
break;

default:
VideoMemSize = (32 << 20); /*32M */
break;
}
} else {
switch (FBSize) {
case 0x00001000:
VideoMemSize = (8 << 20); /*8M */
break;

case 0x00002000:
VideoMemSize = (16 << 20); /*16M */
break;

case 0x00003000:
VideoMemSize = (32 << 20); /*32M */
break;

case 0x00004000:
VideoMemSize = (64 << 20); /*64M */
break;

case 0x00005000:
VideoMemSize = (128 << 20); /*128M */
break;

case 0x00006000:
VideoMemSize = (256 << 20); /*256M */
break;

case 0x00007000: /* Only on VX855/875 */
VideoMemSize = (512 << 20); /*512M */
break;

default:
VideoMemSize = (32 << 20); /*32M */
break;
}
}

return VideoMemSize;
}

void viafb_set_dpa_gfx(int output_interface, struct GFX_DPA_SETTING\
*p_gfx_dpa_setting)
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/video/via/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -900,15 +900,13 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
struct VideoModeTable *vmode_tbl1, int video_bpp1);
void viafb_fill_var_timing_info(struct fb_var_screeninfo *var, int refresh,
struct VideoModeTable *vmode_tbl);
void viafb_init_chip_info(struct pci_dev *pdev,
const struct pci_device_id *pdi);
void viafb_init_chip_info(int chip_type);
void viafb_init_dac(int set_iga);
int viafb_get_pixclock(int hres, int vres, int vmode_refresh);
int viafb_get_refresh(int hres, int vres, u32 float_refresh);
void viafb_update_device_setting(int hres, int vres, int bpp,
int vmode_refresh, int flag);

int viafb_get_fb_size_from_pci(void);
void viafb_set_iga_path(void);
void viafb_set_primary_address(u32 addr);
void viafb_set_secondary_address(u32 addr);
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/video/via/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
* Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#include "via-core.h"
#include "via_i2c.h"
#include "global.h"
#include "lcdtbl.h"

Expand Down
Loading

0 comments on commit 5d08daf

Please sign in to comment.