aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2011-03-02 17:26:35 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-03-07 16:23:26 -0500
commit817368f19af206d382be1347165f1bb2817a666a (patch)
tree044c39b7ef89f1639624b7d9a907b4a80a2e26bf
parent5d884b97c5143f0d4097cefefbf9f7f755fd54fa (diff)
staging: xgifb: remove private ioctls
Drop the badly defined and broken private ioctl interface. Since the driver is in staging, and some of the ioctls are clearly unsafe or not even working, it's unlikely that there are any users. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/xgifb/XGI_main.h9
-rw-r--r--drivers/staging/xgifb/XGI_main_26.c178
-rw-r--r--drivers/staging/xgifb/XGIfb.h72
3 files changed, 0 insertions, 259 deletions
diff --git a/drivers/staging/xgifb/XGI_main.h b/drivers/staging/xgifb/XGI_main.h
index eb0f79aeb38..37f77ee459c 100644
--- a/drivers/staging/xgifb/XGI_main.h
+++ b/drivers/staging/xgifb/XGI_main.h
@@ -794,9 +794,6 @@ static int XGIfb_blank(int blank,
794 struct vm_area_struct *vma); 794 struct vm_area_struct *vma);
795*/ 795*/
796 796
797static int XGIfb_ioctl(struct fb_info *info, unsigned int cmd,
798 unsigned long arg);
799
800/* 797/*
801extern int XGIfb_mode_rate_to_dclock(VB_DEVICE_INFO *XGI_Pr, 798extern int XGIfb_mode_rate_to_dclock(VB_DEVICE_INFO *XGI_Pr,
802 struct xgi_hw_device_info *HwDeviceExtension, 799 struct xgi_hw_device_info *HwDeviceExtension,
@@ -826,18 +823,12 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
826static void XGIfb_pre_setmode(void); 823static void XGIfb_pre_setmode(void);
827static void XGIfb_post_setmode(void); 824static void XGIfb_post_setmode(void);
828 825
829static unsigned char XGIfb_CheckVBRetrace(void);
830static unsigned char XGIfbcheckvretracecrt2(void);
831static unsigned char XGIfbcheckvretracecrt1(void);
832static unsigned char XGIfb_bridgeisslave(void);
833
834struct XGI_memreq { 826struct XGI_memreq {
835 unsigned long offset; 827 unsigned long offset;
836 unsigned long size; 828 unsigned long size;
837}; 829};
838 830
839/* XGI-specific Export functions */ 831/* XGI-specific Export functions */
840void XGI_dispinfo(struct ap_data *rec);
841void XGI_malloc(struct XGI_memreq *req); 832void XGI_malloc(struct XGI_memreq *req);
842void XGI_free(unsigned long base); 833void XGI_free(unsigned long base);
843 834
diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index c569d9744e8..faf7106b355 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -982,61 +982,6 @@ static void XGIfb_search_tvstd(const char *name)
982 } 982 }
983} 983}
984 984
985static unsigned char XGIfb_bridgeisslave(void)
986{
987 unsigned char usScratchP1_00;
988
989 if (xgi_video_info.hasVB == HASVB_NONE)
990 return 0;
991
992 inXGIIDXREG(XGIPART1, 0x00, usScratchP1_00);
993 if ((usScratchP1_00 & 0x50) == 0x10)
994 return 1;
995 else
996 return 0;
997}
998
999static unsigned char XGIfbcheckvretracecrt1(void)
1000{
1001 unsigned char temp;
1002
1003 inXGIIDXREG(XGICR, 0x17, temp);
1004 if (!(temp & 0x80))
1005 return 0;
1006
1007 inXGIIDXREG(XGISR, 0x1f, temp);
1008 if (temp & 0xc0)
1009 return 0;
1010
1011 if (inXGIREG(XGIINPSTAT) & 0x08)
1012 return 1;
1013 else
1014 return 0;
1015}
1016
1017static unsigned char XGIfbcheckvretracecrt2(void)
1018{
1019 unsigned char temp;
1020 if (xgi_video_info.hasVB == HASVB_NONE)
1021 return 0;
1022 inXGIIDXREG(XGIPART1, 0x30, temp);
1023 if (temp & 0x02)
1024 return 0;
1025 else
1026 return 1;
1027}
1028
1029static unsigned char XGIfb_CheckVBRetrace(void)
1030{
1031 if (xgi_video_info.disp_state & DISPTYPE_DISP2) {
1032 if (XGIfb_bridgeisslave())
1033 return XGIfbcheckvretracecrt1();
1034 else
1035 return XGIfbcheckvretracecrt2();
1036 }
1037 return XGIfbcheckvretracecrt1();
1038}
1039
1040/* ----------- FBDev related routines for all series ----------- */ 985/* ----------- FBDev related routines for all series ----------- */
1041 986
1042static void XGIfb_bpp_to_var(struct fb_var_screeninfo *var) 987static void XGIfb_bpp_to_var(struct fb_var_screeninfo *var)
@@ -1280,26 +1225,6 @@ static int XGIfb_pan_var(struct fb_var_screeninfo *var)
1280} 1225}
1281#endif 1226#endif
1282 1227
1283void XGI_dispinfo(struct ap_data *rec)
1284{
1285 rec->minfo.bpp = xgi_video_info.video_bpp;
1286 rec->minfo.xres = xgi_video_info.video_width;
1287 rec->minfo.yres = xgi_video_info.video_height;
1288 rec->minfo.v_xres = xgi_video_info.video_vwidth;
1289 rec->minfo.v_yres = xgi_video_info.video_vheight;
1290 rec->minfo.org_x = xgi_video_info.org_x;
1291 rec->minfo.org_y = xgi_video_info.org_y;
1292 rec->minfo.vrate = xgi_video_info.refresh_rate;
1293 rec->iobase = xgi_video_info.vga_base - 0x30;
1294 rec->mem_size = xgi_video_info.video_size;
1295 rec->disp_state = xgi_video_info.disp_state;
1296 rec->version = (VER_MAJOR << 24) | (VER_MINOR << 16) | VER_LEVEL;
1297 rec->hasVB = xgi_video_info.hasVB;
1298 rec->TV_type = xgi_video_info.TV_type;
1299 rec->TV_plug = xgi_video_info.TV_plug;
1300 rec->chip = xgi_video_info.chip;
1301}
1302
1303static int XGIfb_open(struct fb_info *info, int user) 1228static int XGIfb_open(struct fb_info *info, int user)
1304{ 1229{
1305 return 0; 1230 return 0;
@@ -1574,108 +1499,6 @@ static int XGIfb_blank(int blank, struct fb_info *info)
1574 return 0; 1499 return 0;
1575} 1500}
1576 1501
1577static int XGIfb_ioctl(struct fb_info *info, unsigned int cmd,
1578 unsigned long arg)
1579{
1580 DEBUGPRN("inside ioctl");
1581 switch (cmd) {
1582 case FBIO_ALLOC:
1583 if (!capable(CAP_SYS_RAWIO))
1584 return -EPERM;
1585 XGI_malloc((struct XGI_memreq *) arg);
1586 break;
1587 case FBIO_FREE:
1588 if (!capable(CAP_SYS_RAWIO))
1589 return -EPERM;
1590 XGI_free(*(unsigned long *) arg);
1591 break;
1592 case FBIOGET_HWCINFO: {
1593 unsigned long *hwc_offset = (unsigned long *) arg;
1594
1595 if (XGIfb_caps & HW_CURSOR_CAP)
1596 *hwc_offset
1597 = XGIfb_hwcursor_vbase
1598 - (unsigned long) xgi_video_info.video_vbase;
1599 else
1600 *hwc_offset = 0;
1601
1602 break;
1603 }
1604 case FBIOPUT_MODEINFO: {
1605 struct mode_info *x = (struct mode_info *) arg;
1606
1607 xgi_video_info.video_bpp = x->bpp;
1608 xgi_video_info.video_width = x->xres;
1609 xgi_video_info.video_height = x->yres;
1610 xgi_video_info.video_vwidth = x->v_xres;
1611 xgi_video_info.video_vheight = x->v_yres;
1612 xgi_video_info.org_x = x->org_x;
1613 xgi_video_info.org_y = x->org_y;
1614 xgi_video_info.refresh_rate = x->vrate;
1615 xgi_video_info.video_linelength = xgi_video_info.video_vwidth
1616 * (xgi_video_info.video_bpp >> 3);
1617 switch (xgi_video_info.video_bpp) {
1618 case 8:
1619 xgi_video_info.DstColor = 0x0000;
1620 xgi_video_info.XGI310_AccelDepth = 0x00000000;
1621 xgi_video_info.video_cmap_len = 256;
1622 break;
1623 case 16:
1624 xgi_video_info.DstColor = 0x8000;
1625 xgi_video_info.XGI310_AccelDepth = 0x00010000;
1626 xgi_video_info.video_cmap_len = 16;
1627 break;
1628 case 32:
1629 xgi_video_info.DstColor = 0xC000;
1630 xgi_video_info.XGI310_AccelDepth = 0x00020000;
1631 xgi_video_info.video_cmap_len = 16;
1632 break;
1633 default:
1634 xgi_video_info.video_cmap_len = 16;
1635 printk(KERN_ERR "XGIfb: Unsupported accel depth %d", xgi_video_info.video_bpp);
1636 break;
1637 }
1638
1639 break;
1640 }
1641 case FBIOGET_DISPINFO:
1642 XGI_dispinfo((struct ap_data *) arg);
1643 break;
1644 case XGIFB_GET_INFO: /* TW: New for communication with X driver */
1645 {
1646 struct XGIfb_info *x = (struct XGIfb_info *) arg;
1647
1648 /* x->XGIfb_id = XGIFB_ID; */
1649 x->XGIfb_version = VER_MAJOR;
1650 x->XGIfb_revision = VER_MINOR;
1651 x->XGIfb_patchlevel = VER_LEVEL;
1652 x->chip_id = xgi_video_info.chip_id;
1653 x->memory = xgi_video_info.video_size / 1024;
1654 x->heapstart = xgi_video_info.heapstart / 1024;
1655 x->fbvidmode = XGIfb_mode_no;
1656 x->XGIfb_caps = XGIfb_caps;
1657 x->XGIfb_tqlen = 512; /* yet unused */
1658 x->XGIfb_pcibus = xgi_video_info.pcibus;
1659 x->XGIfb_pcislot = xgi_video_info.pcislot;
1660 x->XGIfb_pcifunc = xgi_video_info.pcifunc;
1661 x->XGIfb_lcdpdc = XGIfb_detectedpdc;
1662 x->XGIfb_lcda = XGIfb_detectedlcda;
1663 break;
1664 }
1665 case XGIFB_GET_VBRSTATUS: {
1666 unsigned long *vbrstatus = (unsigned long *) arg;
1667 if (XGIfb_CheckVBRetrace())
1668 *vbrstatus = 1;
1669 else
1670 *vbrstatus = 0;
1671 }
1672 default:
1673 return -EINVAL;
1674 } DEBUGPRN("end of ioctl");
1675 return 0;
1676
1677}
1678
1679/* ----------- FBDev related routines for all series ---------- */ 1502/* ----------- FBDev related routines for all series ---------- */
1680 1503
1681static int XGIfb_get_fix(struct fb_fix_screeninfo *fix, int con, 1504static int XGIfb_get_fix(struct fb_fix_screeninfo *fix, int con,
@@ -1738,7 +1561,6 @@ static struct fb_ops XGIfb_ops = {
1738 .fb_fillrect = cfb_fillrect, 1561 .fb_fillrect = cfb_fillrect,
1739 .fb_copyarea = cfb_copyarea, 1562 .fb_copyarea = cfb_copyarea,
1740 .fb_imageblit = cfb_imageblit, 1563 .fb_imageblit = cfb_imageblit,
1741 .fb_ioctl = XGIfb_ioctl,
1742 /* .fb_mmap = XGIfb_mmap, */ 1564 /* .fb_mmap = XGIfb_mmap, */
1743}; 1565};
1744 1566
diff --git a/drivers/staging/xgifb/XGIfb.h b/drivers/staging/xgifb/XGIfb.h
index 8e59e15281b..d6c3139f72e 100644
--- a/drivers/staging/xgifb/XGIfb.h
+++ b/drivers/staging/xgifb/XGIfb.h
@@ -64,36 +64,6 @@ enum xgi_tvtype {
64 TVMODE_TOTAL 64 TVMODE_TOTAL
65}; 65};
66 66
67
68struct XGIfb_info {
69 unsigned long XGIfb_id;
70 int chip_id; /* PCI ID of detected chip */
71 int memory; /* video memory in KB which XGIfb manages */
72 int heapstart; /* heap start (= XGIfb "mem" argument) in KB */
73 unsigned char fbvidmode; /* current XGIfb mode */
74
75 unsigned char XGIfb_version;
76 unsigned char XGIfb_revision;
77 unsigned char XGIfb_patchlevel;
78
79 unsigned char XGIfb_caps; /* XGIfb capabilities */
80
81 int XGIfb_tqlen; /* turbo queue length (in KB) */
82
83 unsigned int XGIfb_pcibus; /* The card's PCI ID */
84 unsigned int XGIfb_pcislot;
85 unsigned int XGIfb_pcifunc;
86
87 unsigned char XGIfb_lcdpdc; /* PanelDelayCompensation */
88
89 unsigned char XGIfb_lcda; /* Detected status of LCDA for low res/text modes */
90
91 char reserved[235]; /* for future use */
92};
93
94
95
96
97enum xgi_tv_plug { /* vicki@030226 */ 67enum xgi_tv_plug { /* vicki@030226 */
98// TVPLUG_Legacy = 0, 68// TVPLUG_Legacy = 0,
99// TVPLUG_COMPOSITE, 69// TVPLUG_COMPOSITE,
@@ -112,48 +82,6 @@ enum xgi_tv_plug { /* vicki@030226 */
112 TVPLUG_TOTAL 82 TVPLUG_TOTAL
113}; 83};
114 84
115
116struct mode_info {
117 int bpp;
118 int xres;
119 int yres;
120 int v_xres;
121 int v_yres;
122 int org_x;
123 int org_y;
124 unsigned int vrate;
125};
126
127struct ap_data {
128 struct mode_info minfo;
129 unsigned long iobase;
130 unsigned int mem_size;
131 unsigned long disp_state;
132 enum XGI_CHIP_TYPE chip;
133 unsigned char hasVB;
134 enum xgi_tvtype TV_type;
135 enum xgi_tv_plug TV_plug;
136 unsigned long version;
137 char reserved[256];
138};
139
140
141
142/* If changing this, vgatypes.h must also be changed (for X driver) */
143
144
145/*
146 * NOTE! The ioctl types used to be "size_t" by mistake, but were
147 * really meant to be __u32. Changed to "__u32" even though that
148 * changes the value on 64-bit architectures, because the value
149 * (with a 4-byte size) is also hardwired in vgatypes.h for user
150 * space exports. So "__u32" is actually more compatible, duh!
151 */
152#define XGIFB_GET_INFO _IOR('n',0xF8,__u32)
153#define XGIFB_GET_VBRSTATUS _IOR('n',0xF9,__u32)
154
155
156
157struct video_info{ 85struct video_info{
158 int chip_id; 86 int chip_id;
159 unsigned int video_size; 87 unsigned int video_size;