omapfb.h

来自「Linux Kernel 2.6.9 for OMAP1710」· C头文件 代码 · 共 184 行

H
184
字号
/* * File: drivers/video/omap_new/omapfb.c * * Framebuffer driver for TI OMAP boards * * Copyright (C) 2004 Nokia Corporation * Author: Imre Deak <imre.deak@nokia.com> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. */#ifndef __OMAPFB_H#define __OMAPFB_H/* IOCTL commands. */#define OMAP_IOW(num, dtype)	_IOW('O', num, dtype)#define OMAP_IOR(num, dtype)	_IOR('O', num, dtype)#define OMAP_IOWR(num, dtype)	_IOWR('O', num, dtype)#define OMAP_IO(num)		_IO('O', num)#define OMAPFB_FILLRECT		OMAP_IOW(0, struct fb_fillrect)#define OMAPFB_COPYAREA		OMAP_IOW(1, struct fb_copyarea)#define OMAPFB_IMAGEBLIT	OMAP_IOW(2, struct fb_image)#define OMAPFB_TRANSPARENT_BLIT	OMAP_IOW(30, struct fb_image)#define OMAPFB_MIRROR		OMAP_IOW(31, int)#define OMAPFB_SCALE		OMAP_IOW(32, struct fb_scale)#define OMAPFB_SELECT_VIS_FRAME	OMAP_IOW(33, int)#define OMAPFB_SELECT_SRC_FRAME OMAP_IOW(34, int)#define OMAPFB_SELECT_DST_FRAME	OMAP_IOW(35, int)#define OMAPFB_GET_FRAME_OFFSET	OMAP_IOWR(36, struct fb_frame_offset)#define OMAPFB_SYNC_GFX		OMAP_IO(37)#define OMAPFB_VSYNC		OMAP_IO(38)#define OMAPFB_LATE_ACTIVATE	OMAP_IO(39)struct fb_scale {	unsigned int xscale, yscale;};struct fb_frame_offset {	unsigned int idx;	unsigned long offset;};#ifdef __KERNEL__#include <linux/completion.h>#include <linux/interrupt.h>#define OMAPFB_DEVICE "omapfb"#define OMAPFB_DRIVER "omapfb"#define PRNERR(fmt, args...)  printk(KERN_ERR OMAPFB_DRIVER ": " fmt, ## args)#define GFX_FIFO_SIZE		2#define LCD_PANEL_TFT 0x01struct lcd_panel {	const char *name;	int  config;	int  signals;	struct lcdc_video_mode *video_mode;	int  (*init)	(struct lcd_panel *panel);	void (*cleanup)	(struct lcd_panel *panel);	int  (*enable)	(struct lcd_panel *panel);	void (*disable)	(struct lcd_panel *panel);};struct omapfb_device;struct lcd_ctrl {	const char *name;	int  (*init)    (struct omapfb_device *fbdev);	void (*cleanup) (struct omapfb_device *fbdev);	void (*start)	(struct omapfb_device *fbdev);	void (*stop)    (struct omapfb_device *fbdev);	void (*suspend)	(struct omapfb_device *fbdev);	void (*resume)	(struct omapfb_device *fbdev);	void (*change_mode)(struct omapfb_device *fbdev);	void *data;};enum omapfb_state {	OMAPFB_DISABLED    = 0,	OMAPFB_DEACTIVATED = 98,	OMAPFB_MODE_CHANGE = 99,	OMAPFB_ACTIVE	   = 100};struct gfx_lchannel {	int			lch_num;	struct gfx_lchannel	*next, *prev;};struct gfx_dma {	spinlock_t		spinlock;	struct completion	sync_complete;		/* Signalled when the							   fifo gets empty */	volatile int		done;			/* Indicates the							   end of a DMA chain							   transfer */	struct gfx_lchannel	fifo[GFX_FIFO_SIZE];	struct gfx_lchannel	*f_head, *f_tail;	/* Process and insert							   points on the							   fifo */	struct gfx_lchannel	*f_chain_end;		/* Points to the new							   chain end */	struct semaphore	f_free;			/* # of free lch-s */	int			f_run;			/* # of active lch-s */	int			f_wait;			/* # of lch-s							   waiting */	struct tasklet_struct	dequeue_tasklet;	/* Processes new DMA							   chain  transfers on							   the fifo */};struct omapfb_device {	int			state;	int                     ext_lcdc;               /* Using external                                                           LCD controller */	void			*lcddma_base;		/* MPU virtual							   address */	dma_addr_t		lcddma_handle;		/* Bus physical							   address */	unsigned long		lcddma_mem_size;	unsigned long		palette_org;		/* Palette offset into							   lcddma_base/handle */	unsigned long		frame0_org, frame1_org;	/* Frame offsets for							   back and front							   frame buffers into							   lcddma_base/handle */	unsigned long		vis_frame_org;		/* Offset of visible							   frame buffer.							   = frame0/1_org */	unsigned long		src_frame_org;		/* Offset of source							   frame for drawing							   operations.							   = frame0/1_org */	unsigned long		dst_frame_org;		/* Offset of dest							   frame for drawing							   operations.							   = frame0/1_org */	unsigned long		view_org;		/* View offset into							   lcddma_base/handle+							   vis_frame_org.							   Used for panning */	unsigned long		palette_size;	int			xscale, yscale, mirror;	/* transformations.							   rotate is stored in							   fb_info->var */	u32			pseudo_palette[17];	struct completion	load_complete;	struct gfx_dma		gfx;			/* Accelerator */	struct lcd_panel	*panel;			/* LCD panel */	struct lcd_ctrl         *ctrl;			/* LCD controller */	struct fb_info		*fb_info;		/* Linux fbdev							   framework data */	struct device		*dev;};#endif /* __KERNEL__ */#endif /* __OMAPFB_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?