iface.c, iface.h: support getting video memory from backdoor.
ioctl.c, ioctl.h: support user mode application with additional information
Signed-off-by: Joseph Chan <redacted>
diff -Nur a/drivers/video/via/iface.c b/drivers/video/via/iface.c
+/* Get frame buffer size from VGA BIOS */++unsigned int get_memsize(void)
Not a good name for a globally visible function!
+unsigned long get_videobuf_addr(void)
+{
Ditto
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
+struct device_t {+ unsigned short crt:1;+ unsigned short dvi:1;+ unsigned short lcd:1;+ unsigned short samm:1;+ unsigned short primary_dev;++ unsigned short lcd_dsp_cent:1;+ unsigned char lcd_panel_id;+ unsigned char lcd_mode:1;++ unsigned short xres, yres;+ unsigned short xres1, yres1;+ unsigned short refresh;+ unsigned short bpp;+ unsigned short refresh1;+ unsigned short bpp1;+ unsigned short sequence;++ unsigned short epia_dvi:1;+ unsigned short lcd_dual_edge:1;+ unsigned short bus_width;+ unsigned short lcd2:1;+};
Bitfields suck (and generate ugly code).
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
Alan,
Thanks to remind.
Is it good to add viafb_ , ex: viafb_get_memsize(void)?
It would be great to have your comment. Thanks again.
BRs,
Joseph Chan
-----Original Message-----
From: Alan Cox [mailto:alan@lxorguk.ukuu.org.uk]
Sent: Monday, June 30, 2008 5:40 PM
To: Joseph Chan
Cc: Joseph Chan; linux-fbdev-devel@lists.sourceforge.net; linux-kernel@vger.kernel.org; akpm@linux-foundation.org; geert@linux-m68k.org
Subject: Re: [PATCH 7/13] viafb: iface.c, iface.h, ioctl.c, ioctl.h
quoted hunk
+/* Get frame buffer size from VGA BIOS */++unsigned int get_memsize(void)
Not a good name for a globally visible function!
+unsigned long get_videobuf_addr(void) {
Ditto
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
On Tue, 1 Jul 2008 09:20:31 +0800
[off-list ref] wrote:
Alan,
Thanks to remind.
Is it good to add viafb_ , ex: viafb_get_memsize(void)?
It would be great to have your comment. Thanks again.
It is yes - that way global symbols don't clash between modules
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
iface.c, iface.h: support getting video memory from backdoor.
ioctl.c, ioctl.h: support user mode application with additional information
Signed-off-by: Joseph Chan <redacted>
diff -Nurp a/drivers/video/via/iface.c b/drivers/video/via/iface.c
@@ -0,0 +1,210 @@+/*+*Copyright1998-2008VIATechnologies,Inc.AllRightsReserved.+*Copyright2001-2008S3Graphics,Inc.AllRightsReserved.++*Thisprogramisfreesoftware;youcanredistributeitand/or+*modifyitunderthetermsoftheGNUGeneralPublic+*LicenseaspublishedbytheFreeSoftwareFoundation;+*eitherversion2,or(atyouroption)anylaterversion.++*Thisprogramisdistributedinthehopethatitwillbeuseful,+*butWITHOUTANYWARRANTIESORREPRESENTATIONS;withouteven+*theimpliedwarrantyofMERCHANTABILITYorFITNESSFOR+*APARTICULARPURPOSE.SeetheGNUGeneralPublicLicense+*formoredetails.++*YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense+*alongwiththisprogram;ifnot,writetotheFreeSoftware+*Foundation,Inc.,+*59TemplePlace-Suite330,Boston,MA02111-1307,USA.+*/++#ifndef __IOCTL_H__+#define __IOCTL_H__++#ifndef __user+#define __user+#endif++/* VIAFB IOCTL definition */+#define VIAFB_GET_INFO_SIZE 0x56494101 /* 'VIA\01' */+#define VIAFB_GET_INFO 0x56494102 /* 'VIA\02' */+#define VIAFB_HOTPLUG 0x56494103 /* 'VIA\03' */+#define VIAFB_SET_HOTPLUG_FLAG 0x56494104 /* 'VIA\04' */+#define VIAFB_GET_RESOLUTION 0x56494105 /* 'VIA\05' */+#define VIAFB_GET_SAMM_INFO 0x56494107 /* 'VIA\07' */+#define VIAFB_TURN_ON_OUTPUT_DEVICE 0x56494108 /* 'VIA\08' */+#define VIAFB_TURN_OFF_OUTPUT_DEVICE 0x56494109 /* 'VIA\09' */+#define VIAFB_SET_DEVICE 0x5649410A+#define VIAFB_GET_DEVICE 0x5649410B+#define VIAFB_GET_DRIVER_VERSION 0x56494112 /* 'VIA\12' */+#define VIAFB_GET_CHIP_INFO 0x56494113 /* 'VIA\13' */+#define VIAFB_SET_DEVICE_INFO 0x56494114+#define VIAFB_GET_DEVICE_INFO 0x56494115++#define VIAFB_GET_DEVICE_SUPPORT 0x56494118+#define VIAFB_GET_DEVICE_CONNECT 0x56494119+#define VIAFB_GET_PANEL_SUPPORT_EXPAND 0x5649411A+#define VIAFB_GET_DRIVER_NAME 0x56494122+#define VIAFB_GET_DEVICE_SUPPORT_STATE 0x56494123+#define VIAFB_GET_GAMMA_LUT 0x56494124+#define VIAFB_SET_GAMMA_LUT 0x56494125+#define VIAFB_GET_GAMMA_SUPPORT_STATE 0x56494126+#define VIAFB_SET_VIDEO_DEVICE 0x56494127+#define VIAFB_GET_VIDEO_DEVICE 0x56494128+#define VIAFB_SET_SECOND_MODE 0x56494129+#define VIAFB_SYNC_SURFACE 0x56494130+#define VIAFB_GET_DRIVER_CAPS 0x56494131+#define VIAFB_GET_IGA_SCALING_INFO 0x56494132+#define VIAFB_GET_PANEL_MAX_SIZE 0x56494133+#define VIAFB_GET_PANEL_MAX_POSITION 0x56494134+#define VIAFB_SET_PANEL_SIZE 0x56494135+#define VIAFB_SET_PANEL_POSITION 0x56494136+#define VIAFB_GET_PANEL_POSITION 0x56494137+#define VIAFB_GET_PANEL_SIZE 0x56494138++#define None_Device 0x00+#define CRT_Device 0x01+#define LCD_Device 0x02+#define DVI_Device 0x08+#define CRT2_Device 0x10+#define LCD2_Device 0x40++#define OP_LCD_CENTERING 0x01+#define OP_LCD_PANEL_ID 0x02+#define OP_LCD_MODE 0x03++/*SAMM operation flag*/+#define OP_SAMM 0x80++#define LCD_PANEL_ID_MAXIMUM 22++#define STATE_ON 0x1+#define STATE_OFF 0x0+#define STATE_DEFAULT 0xFFFF++#define MAX_ACTIVE_DEV_NUM 2++structdevice_t{+unsignedshortcrt:1;+unsignedshortdvi:1;+unsignedshortlcd:1;+unsignedshortsamm:1;+unsignedshortlcd_dsp_cent:1;+unsignedcharlcd_mode:1;+unsignedshortepia_dvi:1;+unsignedshortlcd_dual_edge:1;+unsignedshortlcd2:1;++unsignedshortprimary_dev;+unsignedcharlcd_panel_id;+unsignedshortxres,yres;+unsignedshortxres1,yres1;+unsignedshortrefresh;+unsignedshortbpp;+unsignedshortrefresh1;+unsignedshortbpp1;+unsignedshortsequence;+unsignedshortbus_width;+};++structviafb_ioctl_info{+u32viafb_id;/* for identifying viafb */+#define VIAID 0x56494146 /* Identify myself with 'VIAF' */+u16vendor_id;+u16device_id;+u8version;+u8revision;+u8reserved[246];/* for future use */+};++structviafb_ioctl_mode{+u32xres;+u32yres;+u32refresh;+u32bpp;+u32xres_sec;+u32yres_sec;+u32virtual_xres_sec;+u32virtual_yres_sec;+u32refresh_sec;+u32bpp_sec;+};+structviafb_ioctl_samm{+u32samm_status;+u32size_prim;+u32size_sec;+u32mem_base;+u32offset_sec;+};++structviafb_driver_version{+intiMajorNum;+intiKernelNum;+intiOSNum;+intiMinorNum;+};++structviafb_ioctl_lcd_attribute{+unsignedintpanel_id;+unsignedintdisplay_center;+unsignedintlcd_mode;+};++structviafb_ioctl_setting{+/* Enable or disable active devices */+unsignedshortdevice_flag;+/* Indicate which device should be turn on or turn off. */+unsignedshortdevice_status;+unsignedintreserved;+/* Indicate which LCD's attribute can be changed. */+unsignedshortlcd_operation_flag;+/* 1: SAMM ON 0: SAMM OFF */+unsignedshortsamm_status;+/* horizontal resolution of first device */+unsignedshortfirst_dev_hor_res;+/* vertical resolution of first device */+unsignedshortfirst_dev_ver_res;+/* horizontal resolution of second device */+unsignedshortsecond_dev_hor_res;+/* vertical resolution of second device */+unsignedshortsecond_dev_ver_res;+/* refresh rate of first device */+unsignedshortfirst_dev_refresh;+/* bpp of first device */+unsignedshortfirst_dev_bpp;+/* refresh rate of second device */+unsignedshortsecond_dev_refresh;+/* bpp of second device */+unsignedshortsecond_dev_bpp;+/* Indicate which device are primary display device. */+unsignedintprimary_device;+/* Indicate which device will show video. only valid in duoview mode */+unsignedintvideo_device_status;+unsignedintstruct_reserved[34];+structviafb_ioctl_lcd_attributelcd_attributes;+};++struct_UTFunctionCaps{+unsignedintdw3DScalingState;+unsignedintreserved[31];+};++struct_POSITIONVALUE{+unsignedintdwX;+unsignedintdwY;+};++struct_panel_size_pos_info{+unsignedintdevice_type;+intx;+inty;+};++externintviafb_LCD_ON;+externintviafb_DVI_ON;++intviafb_ioctl_get_viafb_info(u_longarg);+intviafb_ioctl_hotplug(inthres,intvres,intbpp);++#endif /* __IOCTL_H__ */-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/