^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * linux/drivers/video/kyro/kryo.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (C) 2002 STMicroelectronics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2004 Paul Mundt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * This file is subject to the terms and conditions of the GNU General Public
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * License. See the file COPYING in the main directory of this archive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #ifndef _KYRO_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #define _KYRO_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) struct kyrofb_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) void __iomem *regbase;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) u32 palette[16];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) u32 HTot; /* Hor Total Time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) u32 HFP; /* Hor Front Porch */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) u32 HST; /* Hor Sync Time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) u32 HBP; /* Hor Back Porch */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) s32 HSP; /* Hor Sync Polarity */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) u32 VTot; /* Ver Total Time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) u32 VFP; /* Ver Front Porch */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) u32 VST; /* Ver Sync Time */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) u32 VBP; /* Ver Back Porch */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) s32 VSP; /* Ver Sync Polarity */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) u32 XRES; /* X Resolution */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) u32 YRES; /* Y Resolution */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) u32 VFREQ; /* Ver Frequency */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) u32 PIXCLK; /* Pixel Clock */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) u32 HCLK; /* Hor Clock */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) /* Useful to hold depth here for Linux */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) u8 PIXDEPTH;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) int wc_cookie;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) extern int kyro_dev_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) extern void kyro_dev_reset(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) extern unsigned char *kyro_dev_physical_fb_ptr(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) extern unsigned char *kyro_dev_virtual_fb_ptr(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) extern void *kyro_dev_physical_regs_ptr(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) extern void *kyro_dev_virtual_regs_ptr(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) extern unsigned int kyro_dev_fb_size(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) extern unsigned int kyro_dev_regs_size(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) extern u32 kyro_dev_overlay_offset(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) * benedict.gaster@superh.com
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) * Added the follow IOCTLS for the creation of overlay services...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #define KYRO_IOC_MAGIC 'k'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #define KYRO_IOCTL_OVERLAY_CREATE _IO(KYRO_IOC_MAGIC, 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #define KYRO_IOCTL_OVERLAY_VIEWPORT_SET _IO(KYRO_IOC_MAGIC, 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #define KYRO_IOCTL_SET_VIDEO_MODE _IO(KYRO_IOC_MAGIC, 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #define KYRO_IOCTL_UVSTRIDE _IO(KYRO_IOC_MAGIC, 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) #define KYRO_IOCTL_OVERLAY_OFFSET _IO(KYRO_IOC_MAGIC, 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #define KYRO_IOCTL_STRIDE _IO(KYRO_IOC_MAGIC, 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) * The follow 3 structures are used to pass data from user space into the kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) * for the creation of overlay surfaces and setting the video mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) typedef struct _OVERLAY_CREATE {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) u32 ulWidth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) u32 ulHeight;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) int bLinear;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) } overlay_create;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) typedef struct _OVERLAY_VIEWPORT_SET {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) u32 xOrgin;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) u32 yOrgin;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) u32 xSize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) u32 ySize;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) } overlay_viewport_set;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) typedef struct _SET_VIDEO_MODE {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) u32 ulWidth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) u32 ulHeight;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) u32 ulScan;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) u8 displayDepth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) int bLinear;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) } set_video_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) #endif /* _KYRO_H */