Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9ae6d039 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'viafb-next' of git://github.com/schandinat/linux-2.6

* 'viafb-next' of git://github.com/schandinat/linux-2.6: (29 commits)
  viafb: add initial VX900 support
  viafb: fix hardware acceleration for suspend & resume
  viafb: make suspend and resume work (on all machines?)
  viafb: restore display on resume
  Minimal support for viafb suspend/resume
  viafb: use proper register for colour when doing fill ops
  viafb: add documentation for proc interface
  viafb: rename output devices
  viafb: add a mapping of supported output devices
  viafb: set sync polarity for all output devices
  viafb: add function to change sync polarity per device
  viafb: reduce I2C timeout and delay
  viafb: enable I2C for CRT
  viafb: fix i2c_transfer error handling
  viafb: vt1636 cleanup
  viafb: introduce per output device power management
  viafb: limit LCD code impact
  viafb: add interface for output device configuration
  viafb: merge the remaining output path with enable functions
  viafb: use new device routing
  ...
parents bdab2250 51f4332b
Loading
Loading
Loading
Loading
+48 −0
Original line number Diff line number Diff line
@@ -197,6 +197,54 @@ Notes:
       example,
           # fbset -depth 16


[Configure viafb via /proc]
---------------------------
    The following files exist in /proc/viafb

    supported_output_devices

        This read-only file contains a full ',' seperated list containing all
        output devices that could be available on your platform. It is likely
        that not all of those have a connector on your hardware but it should
        provide a good starting point to figure out which of those names match
        a real connector.
        Example:
        # cat /proc/viafb/supported_output_devices

    iga1/output_devices
    iga2/output_devices

        These two files are readable and writable. iga1 and iga2 are the two
        independent units that produce the screen image. Those images can be
        forwarded to one or more output devices. Reading those files is a way
        to query which output devices are currently used by an iga.
        Example:
        # cat /proc/viafb/iga1/output_devices
        If there are no output devices printed the output of this iga is lost.
        This can happen for example if only one (the other) iga is used.
        Writing to these files allows adjusting the output devices during
        runtime. One can add new devices, remove existing ones or switch
        between igas. Essentially you can write a ',' seperated list of device
        names (or a single one) in the same format as the output to those
        files. You can add a '+' or '-' as a prefix allowing simple addition
        and removal of devices. So a prefix '+' adds the devices from your list
        to the already existing ones, '-' removes the listed devices from the
        existing ones and if no prefix is given it replaces all existing ones
        with the listed ones. If you remove devices they are expected to turn
        off. If you add devices that are already part of the other iga they are
        removed there and added to the new one.
        Examples:
        Add CRT as output device to iga1
        # echo +CRT > /proc/viafb/iga1/output_devices

        Remove (turn off) DVP1 and LVDS1 as output devices of iga2
        # echo -DVP1,LVDS1 > /proc/viafb/iga2/output_devices

        Replace all iga1 output devices by CRT
        # echo CRT > /proc/viafb/iga1/output_devices


[Bootup with viafb]:
--------------------
    Add the following line to your grub.conf:
+1 −1
Original line number Diff line number Diff line
@@ -5,5 +5,5 @@
obj-$(CONFIG_FB_VIA) += viafb.o

viafb-y	:=viafbdev.o hw.o via_i2c.o dvi.o lcd.o ioctl.o accel.o \
	via_utility.o vt1636.o global.o tblDPASetting.o viamode.o tbl1636.o \
	via_utility.o vt1636.o global.o tblDPASetting.o viamode.o \
	via-core.o via-gpio.o via_modesetting.o
+33 −20
Original line number Diff line number Diff line
@@ -283,11 +283,12 @@ static int hw_bitblt_2(void __iomem *engine, u8 op, u32 width, u32 height,
		writel(tmp, engine + 0x1C);
	}

	if (op != VIA_BITBLT_COLOR)
	if (op == VIA_BITBLT_FILL) {
		writel(fg_color, engine + 0x58);
	} else if (op == VIA_BITBLT_MONO) {
		writel(fg_color, engine + 0x4C);

	if (op == VIA_BITBLT_MONO)
		writel(bg_color, engine + 0x50);
	}

	if (op == VIA_BITBLT_FILL)
		ge_cmd |= fill_rop << 24 | 0x00002000 | 0x00000001;
@@ -314,13 +315,11 @@ static int hw_bitblt_2(void __iomem *engine, u8 op, u32 width, u32 height,
	return 0;
}

int viafb_init_engine(struct fb_info *info)
int viafb_setup_engine(struct fb_info *info)
{
	struct viafb_par *viapar = info->par;
	void __iomem *engine;
	int highest_reg, i;
	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;
	u32 chip_name = viapar->shared->chip_info.gfx_chip_name;

	engine = viapar->shared->vdev->engine_mmio;
	if (!engine) {
@@ -329,18 +328,6 @@ int viafb_init_engine(struct fb_info *info)
		return -ENOMEM;
	}

	/* Initialize registers to reset the 2D engine */
	switch (viapar->shared->chip_info.twod_engine) {
	case VIA_2D_ENG_M1:
		highest_reg = 0x5c;
		break;
	default:
		highest_reg = 0x40;
		break;
	}
	for (i = 0; i <= highest_reg; i += 4)
		writel(0x0, engine + i);

	switch (chip_name) {
	case UNICHROME_CLE266:
	case UNICHROME_K400:
@@ -356,6 +343,7 @@ int viafb_init_engine(struct fb_info *info)
		break;
	case UNICHROME_VX800:
	case UNICHROME_VX855:
	case UNICHROME_VX900:
		viapar->shared->hw_bitblt = hw_bitblt_2;
		break;
	default:
@@ -386,12 +374,36 @@ int viafb_init_engine(struct fb_info *info)
	viapar->shared->vdev->camera_fbmem_offset = viapar->fbmem_free;
#endif

	viafb_reset_engine(viapar);
	return 0;
}

void viafb_reset_engine(struct viafb_par *viapar)
{
	void __iomem *engine = viapar->shared->vdev->engine_mmio;
	int highest_reg, i;
	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;

	/* Initialize registers to reset the 2D engine */
	switch (viapar->shared->chip_info.twod_engine) {
	case VIA_2D_ENG_M1:
		highest_reg = 0x5c;
		break;
	default:
		highest_reg = 0x40;
		break;
	}
	for (i = 0; i <= highest_reg; i += 4)
		writel(0x0, engine + i);

	/* Init AGP and VQ regs */
	switch (chip_name) {
	case UNICHROME_K8M890:
	case UNICHROME_P4M900:
	case UNICHROME_VX800:
	case UNICHROME_VX855:
	case UNICHROME_VX900:
		writel(0x00100000, engine + VIA_REG_CR_TRANSET);
		writel(0x680A0000, engine + VIA_REG_CR_TRANSPACE);
		writel(0x02000000, engine + VIA_REG_CR_TRANSPACE);
@@ -428,6 +440,7 @@ int viafb_init_engine(struct fb_info *info)
	case UNICHROME_P4M900:
	case UNICHROME_VX800:
	case UNICHROME_VX855:
	case UNICHROME_VX900:
		vq_start_low |= 0x20000000;
		vq_end_low |= 0x20000000;
		vq_high |= 0x20000000;
@@ -473,7 +486,7 @@ int viafb_init_engine(struct fb_info *info)
	writel(0x0, engine + VIA_REG_CURSOR_ORG);
	writel(0x0, engine + VIA_REG_CURSOR_BG);
	writel(0x0, engine + VIA_REG_CURSOR_FG);
	return 0;
	return;
}

void viafb_show_hw_cursor(struct fb_info *info, int Status)
+2 −1
Original line number Diff line number Diff line
@@ -203,7 +203,8 @@
#define VIA_BITBLT_MONO		2
#define VIA_BITBLT_FILL		3

int viafb_init_engine(struct fb_info *info);
int viafb_setup_engine(struct fb_info *info);
void viafb_reset_engine(struct viafb_par *viapar);
void viafb_show_hw_cursor(struct fb_info *info, int Status);
void viafb_wait_engine_idle(struct fb_info *info);

+3 −0
Original line number Diff line number Diff line
@@ -71,6 +71,9 @@
#define     UNICHROME_VX855         12
#define     UNICHROME_VX855_DID     0x5122

#define     UNICHROME_VX900         13
#define     UNICHROME_VX900_DID     0x7122

/**************************************************/
/* Definition TMDS Trasmitter Information         */
/**************************************************/
Loading