56 u32 fg_color,
u32 bg_color,
u8 fill_rop)
93 ret = viafb_set_bpp(engine, dst_bpp);
99 || src_y & 0xFFFFF000) {
101 "x/y %d %d\n", src_x, src_y);
104 tmp = src_x | (src_y << 16);
108 if (dst_x & 0xFFFFF000 || dst_y & 0xFFFFF000) {
110 "%d %d\n", dst_x, dst_y);
113 tmp = dst_x | (dst_y << 16);
116 if ((width - 1) & 0xFFFFF000 || (height - 1) & 0xFFFFF000) {
118 "%d %d\n", width, height);
121 tmp = (width - 1) | ((height - 1) << 16);
125 writel(fg_color, engine + 0x18);
128 writel(bg_color, engine + 0x1C);
132 if (dst_addr & 0xE0000007) {
134 "address %X\n",
tmp);
141 if (dst_addr & 0xE0000007) {
143 "address %X\n", dst_addr);
153 if (
tmp & 0xFFFFC007 || dst_pitch & 0xFFFFC007) {
162 ge_cmd |= fill_rop << 24 | 0x00002000 | 0x00000001;
164 ge_cmd |= 0xCC000000;
166 ge_cmd |= 0x00000040;
168 ge_cmd |= 0x00000002 | 0x00000100 | 0x00020000;
170 ge_cmd |= 0x00000001;
180 for (i = 0; i <
tmp; i++)
186 static int hw_bitblt_2(
void __iomem *engine,
u8 op,
u32 width,
u32 height,
189 u32 fg_color,
u32 bg_color,
u8 fill_rop)
201 ge_cmd |= 0x00008000;
206 ge_cmd |= 0x00004000;
226 ret = viafb_set_bpp(engine, dst_bpp);
234 if (tmp & 0xFFFFC007 || dst_pitch & 0xFFFFC007) {
239 tmp = (tmp >> 3) | (dst_pitch << (16 - 3));
240 writel(tmp, engine + 0x08);
242 if ((width - 1) & 0xFFFFF000 || (height - 1) & 0xFFFFF000) {
244 "%d %d\n", width, height);
247 tmp = (width - 1) | ((height - 1) << 16);
248 writel(tmp, engine + 0x0C);
250 if (dst_x & 0xFFFFF000 || dst_y & 0xFFFFF000) {
252 "%d %d\n", dst_x, dst_y);
255 tmp = dst_x | (dst_y << 16);
256 writel(tmp, engine + 0x10);
258 if (dst_addr & 0xE0000007) {
260 "address %X\n", dst_addr);
264 writel(tmp, engine + 0x14);
268 || src_y & 0xFFFFF000) {
270 "x/y %d %d\n", src_x, src_y);
273 tmp = src_x | (src_y << 16);
274 writel(tmp, engine + 0x18);
277 if (dst_addr & 0xE0000007) {
279 "address %X\n", tmp);
283 writel(tmp, engine + 0x1C);
287 writel(fg_color, engine + 0x58);
289 writel(fg_color, engine + 0x4C);
290 writel(bg_color, engine + 0x50);
294 ge_cmd |= fill_rop << 24 | 0x00002000 | 0x00000001;
296 ge_cmd |= 0xCC000000;
298 ge_cmd |= 0x00000040;
300 ge_cmd |= 0x00000002 | 0x00000100 | 0x00020000;
302 ge_cmd |= 0x00000001;
312 for (i = 0; i <
tmp; i++)
322 u32 chip_name = viapar->
shared->chip_info.gfx_chip_name;
324 engine = viapar->
shared->vdev->engine_mmio;
327 "hardware acceleration disabled\n");
342 viapar->
shared->hw_bitblt = hw_bitblt_1;
347 viapar->
shared->hw_bitblt = hw_bitblt_2;
361 #if defined(CONFIG_VIDEO_VIA_CAMERA) || defined(CONFIG_VIDEO_VIA_CAMERA_MODULE)
385 u32 vq_start_addr, vq_end_addr, vq_start_low, vq_end_low, vq_high,
386 vq_len, chip_name = viapar->
shared->chip_info.gfx_chip_name;
389 switch (viapar->
shared->chip_info.twod_engine) {
397 for (i = 0; i <= highest_reg; i += 4)
429 vq_start_addr = viapar->
shared->vq_vram_addr;
432 vq_start_low = 0x50000000 | (vq_start_addr & 0xFFFFFF);
433 vq_end_low = 0x51000000 | (vq_end_addr & 0xFFFFFF);
434 vq_high = 0x52000000 | ((vq_start_addr & 0xFF000000) >> 24) |
435 ((vq_end_addr & 0xFF000000) >> 16);
436 vq_len = 0x53000000 | (
VQ_SIZE >> 3);
444 vq_start_low |= 0x20000000;
445 vq_end_low |= 0x20000000;
446 vq_high |= 0x20000000;
447 vq_len |= 0x20000000;
524 switch (viapar->
shared->chip_info.twod_engine) {