/*-*- linux-c -*- * linux/drivers/video/i810_accel.c -- Hardware Acceleration * * Copyright (C) 2001 Antonino Daplas<adaplas@pol.net> * All Rights Reserved * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive for * more details.
*/ #include <linux/kernel.h> #include <linux/string.h> #include <linux/fb.h>
/** * wait_for_space - check ring buffer free space * @space: amount of ringbuffer space needed in bytes * @par: pointer to i810fb_par structure * * DESCRIPTION: * The function waits until a free space from the ringbuffer * is available
*/ staticinlineint wait_for_space(struct fb_info *info, u32 space)
{ struct i810fb_par *par = info->par;
u32 head, count = WAIT_COUNT, tail;
u8 __iomem *mmio = par->mmio_start_virtual;
/** * wait_for_engine_idle - waits for all hardware engines to finish * @par: pointer to i810fb_par structure * * DESCRIPTION: * This waits for lring(0), iring(1), and batch(3), etc to finish and * waits until ringbuffer is empty.
*/ staticinlineint wait_for_engine_idle(struct fb_info *info)
{ struct i810fb_par *par = info->par;
u8 __iomem *mmio = par->mmio_start_virtual; int count = WAIT_COUNT;
if (wait_for_space(info, par->iring.size)) /* flush */ return 1;
/* begin_iring - prepares the ringbuffer * @space: length of sequence in dwords * @par: pointer to i810fb_par structure * * DESCRIPTION: * Checks/waits for sufficient space in ringbuffer of size * space. Returns the tail of the buffer
*/ staticinline u32 begin_iring(struct fb_info *info, u32 space)
{ struct i810fb_par *par = info->par;
if (par->dev_flags & ALWAYS_SYNC)
wait_for_engine_idle(info); return wait_for_space(info, space);
}
/** * end_iring - advances the buffer * @par: pointer to i810fb_par structure * * DESCRIPTION: * This advances the tail of the ringbuffer, effectively * beginning the execution of the graphics instruction sequence.
*/ staticinlinevoid end_iring(struct i810fb_par *par)
{
u8 __iomem *mmio = par->mmio_start_virtual;
i810_writel(IRING, mmio, par->cur_tail);
}
/** * source_copy_blit - BLIT transfer operation * @dwidth: width of rectangular graphics data * @dheight: height of rectangular graphics data * @dpitch: bytes per line of destination buffer * @xdir: direction of copy (left to right or right to left) * @src: address of first pixel to read from * @dest: address of first pixel to write to * @from: source address * @where: destination address * @rop: raster operation * @blit_bpp: pixel format which can be different from the * framebuffer's pixelformat * @par: pointer to i810fb_par structure * * DESCRIPTION: * This is a BLIT operation typically used when doing * a 'Copy and Paste'
*/ staticinlinevoid source_copy_blit(int dwidth, int dheight, int dpitch, int xdir, int src, int dest, int rop, int blit_bpp, struct fb_info *info)
{ struct i810fb_par *par = info->par;
/** * color_blit - solid color BLIT operation * @width: width of destination * @height: height of destination * @pitch: pixels per line of the buffer * @dest: address of first pixel to write to * @where: destination * @rop: raster operation * @what: color to transfer * @blit_bpp: pixel format which can be different from the * framebuffer's pixelformat * @par: pointer to i810fb_par structure * * DESCRIPTION: * A BLIT operation which can be used for color fill/rectangular fill
*/ staticinlinevoid color_blit(int width, int height, int pitch, int dest, int rop, int what, int blit_bpp, struct fb_info *info)
{ struct i810fb_par *par = info->par;
/** * mono_src_copy_imm_blit - color expand from system memory to framebuffer * @dwidth: width of destination * @dheight: height of destination * @dpitch: pixels per line of the buffer * @dsize: size of bitmap in double words * @dest: address of first byte of pixel; * @rop: raster operation * @blit_bpp: pixelformat to use which can be different from the * framebuffer's pixelformat * @src: address of image data * @bg: backgound color * @fg: forground color * @par: pointer to i810fb_par structure * * DESCRIPTION: * A color expand operation where the source data is placed in the * ringbuffer itself. Useful for drawing text. * * REQUIREMENT: * The end of a scanline must be padded to the next word.
*/ staticinlinevoid mono_src_copy_imm_blit(int dwidth, int dheight, int dpitch, int dsize, int blit_bpp, int rop, int dest, const u32 *src, int bg, int fg, struct fb_info *info)
{ struct i810fb_par *par = info->par;
if (begin_iring(info, 24 + (dsize << 2) + IRING_PAD)) return;
/** * i810fb_init_ringbuffer - initialize the ringbuffer * @par: pointer to i810fb_par structure * * DESCRIPTION: * Initializes the ringbuffer by telling the device the * size and location of the ringbuffer. It also sets * the head and tail pointers = 0
*/ void i810fb_init_ringbuffer(struct fb_info *info)
{ struct i810fb_par *par = info->par;
u32 tmp1, tmp2;
u8 __iomem *mmio = par->mmio_start_virtual;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.