gatos-cvs Mailing List for GATOS (Page 5)
Status: Beta
Brought to you by:
volodya
You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(10) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(35) |
Feb
(67) |
Mar
(41) |
Apr
(4) |
May
(7) |
Jun
(9) |
Jul
(7) |
Aug
(2) |
Sep
(9) |
Oct
(3) |
Nov
(5) |
Dec
(30) |
| 2004 |
Jan
(11) |
Feb
|
Mar
|
Apr
|
May
(9) |
Jun
(6) |
Jul
(8) |
Aug
(3) |
Sep
(5) |
Oct
(15) |
Nov
(25) |
Dec
(14) |
| 2005 |
Jan
(11) |
Feb
(5) |
Mar
(8) |
Apr
(5) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
(3) |
Dec
|
| 2006 |
Jan
(2) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
(3) |
Nov
(1) |
Dec
(2) |
| 2007 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
|
From: <gat...@li...> - 2004-10-21 20:33:15
|
Update of /cvsroot/gatos/ati.4.4.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26692 Modified Files: Tag: r200_branch fi1236.c Log Message: Added FM216ME entry Index: fi1236.c =================================================================== RCS file: /cvsroot/gatos/ati.4.4.0/fi1236.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -d -r1.4 -r1.4.2.1 --- fi1236.c 7 Sep 2004 00:22:52 -0000 1.4 +++ fi1236.c 21 Oct 2004 20:33:06 -0000 1.4.2.1 @@ -3,7 +3,7 @@ #include "fi1236.h" #include "i2c_def.h" -#define NUM_TUNERS 7 +#define NUM_TUNERS 8 const FI1236_parameters tuner_parms[NUM_TUNERS] = { @@ -23,7 +23,9 @@ /* 5 - FI1256 */ { 623 ,16*49.75 ,16*863.25 ,16*170 ,16*450 ,0xA0 ,0x90, 0x30, 0x8e }, /* 6 - FI1236W */ - { 733 ,884 ,12820 ,2516 ,7220 ,0x1 ,0x2, 0x4, 0x8e } + { 733 ,884 ,12820 ,2516 ,7220 ,0x1 ,0x2, 0x4, 0x8e }, + /* 7 - FM1216ME */ + { 733 ,16*48.25 ,16*863.25 ,16*158.00 ,16*442.00 ,0x1 ,0x2, 0x4, 0x8e } }; @@ -330,8 +332,10 @@ { CARD8 out; CARD8 AFC; + I2C_WriteRead(&(f->d), NULL, 0, &out, 1); AFC=out & 0x7; +xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "AFC: FI1236_get_afc_hint: %i\n", AFC); if(AFC==2)return TUNER_TUNED; if(AFC==3)return TUNER_JUST_BELOW; if(AFC==1)return TUNER_JUST_ABOVE; @@ -456,6 +460,7 @@ void FI1236_tune(FI1236Ptr f, CARD32 frequency) { CARD16 divider; + CARD8 data; if(frequency < f->parm.min_freq) frequency = f->parm.min_freq; if(frequency > f->parm.max_freq) frequency = f->parm.max_freq; @@ -478,10 +483,15 @@ f->tuner_data.band = f->parm.band_high; } -#if 0 + xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "Setting tuner band to %d\n", f->tuner_data.band); + xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "Setting tuner frequency to %d\n", frequency); -#endif + I2C_WriteRead(&(f->d), (I2CByte *)&(f->tuner_data), 4, NULL, 0); + + I2C_WriteRead(&(f->d), NULL, 0, &data, 1); + + xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "Tuner status %x\n", data); } void TUNER_set_frequency(FI1236Ptr f, CARD32 frequency) @@ -528,7 +538,11 @@ return 1; /* call me again */ } else { f->last_afc_hint=FI1236_get_afc_hint(f); - if(f->last_afc_hint==TUNER_TUNED)return 0; + if(f->last_afc_hint==TUNER_TUNED) + { + xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "AFC: TUNER_TUNNED\n"); + return 0; + } if(f->afc_count>3)f->last_afc_hint=TUNER_OFF; if(f->last_afc_hint==TUNER_OFF){ f->afc_delta=0; |
|
From: <gat...@li...> - 2004-10-21 20:31:29
|
Update of /cvsroot/gatos/ati.4.4.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26232 Modified Files: Tag: r200_branch fi1236.h Log Message: Added FM216ME entry Index: fi1236.h =================================================================== RCS file: /cvsroot/gatos/ati.4.4.0/fi1236.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- fi1236.h 14 Jul 2004 05:38:24 -0000 1.2 +++ fi1236.h 21 Oct 2004 20:31:19 -0000 1.2.2.1 @@ -70,6 +70,7 @@ #define TUNER_TYPE_FI1246 4 #define TUNER_TYPE_FI1256 5 #define TUNER_TYPE_FI1236W 6 +#define TUNER_TYPE_FM1216ME 7 #define FI1236_ADDR(a) ((a)->d.SlaveAddr) |
|
From: <gat...@li...> - 2004-10-21 20:29:34
|
Update of /cvsroot/gatos/ati.4.4.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25814 Modified Files: Tag: r200_branch theatre_reg.h Log Message: Added new registers that appeared in RT200 Index: theatre_reg.h =================================================================== RCS file: /cvsroot/gatos/ati.4.4.0/theatre_reg.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -d -r1.1 -r1.1.2.1 --- theatre_reg.h 20 May 2004 01:37:59 -0000 1.1 +++ theatre_reg.h 21 Oct 2004 20:29:18 -0000 1.1.2.1 @@ -38,10 +38,60 @@ #define VIP_I2C_CNTL_1 0x0024 #define VIP_I2C_DATA 0x0028 #define VIP_INT_CNTL 0x002c +/* RT200 */ +#define VIP_INT_CNTL__FB_INT0 0x02000000 +#define VIP_INT_CNTL__FB_INT0_CLR 0x02000000 #define VIP_GPIO_INOUT 0x0030 #define VIP_GPIO_CNTL 0x0034 #define VIP_CLKOUT_GPIO_CNTL 0x0038 #define VIP_RIPINTF_PORT_CNTL 0x003c + +/* RT200 */ +#define VIP_HOSTINTF_PORT_CNTL 0x003c +#define VIP_HOSTINTF_PORT_CNTL__HAD_HCTL_SDA_SN 0x00000008 +#define VIP_HOSTINTF_PORT_CNTL__HAD_HCTL_SDA_SP 0x00000080 +#define VIP_HOSTINTF_PORT_CNTL__HAD_HCTL_SDA_SR 0x00000100 +#define VIP_HOSTINTF_PORT_CNTL__SUB_SYS_ID_EN 0x00010000 +#define VIP_HOSTINTF_PORT_CNTL__FIFO_RW_MODE 0x00300000 +#define VIP_HOSTINTF_PORT_CNTL__FIFOA_ENDIAN_SWAP 0x00c00000 +#define VIP_HOSTINTF_PORT_CNTL__FIFOB_ENDIAN_SWAP 0x03000000 +#define VIP_HOSTINTF_PORT_CNTL__FIFOC_ENDIAN_SWAP 0x0c000000 +#define VIP_HOSTINTF_PORT_CNTL__FIFOD_ENDIAN_SWAP 0x30000000 +#define VIP_HOSTINTF_PORT_CNTL__FIFOE_ENDIAN_SWAP 0xc0000000 + +/* RT200 */ +#define VIP_DSP_PLL_CNTL 0x0bc + +/* RT200 */ +#define VIP_TC_SOURCE 0x300 +#define VIP_TC_DESTINATION 0x304 +#define VIP_TC_COMMAND 0x308 + +/* RT200 */ +#define VIP_TC_STATUS 0x030c +#define VIP_TC_STATUS__TC_CHAN_BUSY 0x00007fff +#define VIP_TC_STATUS__TC_WRITE_PENDING 0x00008000 +#define VIP_TC_STATUS__TC_FIFO_4_EMPTY 0x00040000 +#define VIP_TC_STATUS__TC_FIFO_6_EMPTY 0x00080000 +#define VIP_TC_STATUS__TC_FIFO_8_EMPTY 0x00100000 +#define VIP_TC_STATUS__TC_FIFO_10_EMPTY 0x00200000 +#define VIP_TC_STATUS__TC_FIFO_4_FULL 0x04000000 +#define VIP_TC_STATUS__TC_FIFO_6_FULL 0x08080000 +#define VIP_TC_STATUS__TC_FIFO_8_FULL 0x10080000 +#define VIP_TC_STATUS__TC_FIFO_10_FULL 0x20080000 +#define VIP_TC_STATUS__DSP_ILLEGAL_OP 0x80080000 + +/* RT200 */ +#define VIP_TC_DOWNLOAD 0x0310 +#define VIP_TC_DOWNLOAD__TC_DONE_MASK 0x00003fff +#define VIP_TC_DOWNLOAD__TC_RESET_MODE 0x00060000 + +/* RT200 */ +#define VIP_FB_INT 0x0314 +#define VIP_FB_INT__INT_7 0x00000080 +#define VIP_FB_SCRATCH0 0x0318 +#define VIP_FB_SCRATCH1 0x031c + #define VIP_ADC_CNTL 0x0400 #define VIP_ADC_DEBUG 0x0404 #define VIP_STANDARD_SELECT 0x0408 @@ -224,13 +274,23 @@ #define VIP_IDLE 1 #define VIP_RESET 2 +#define VIPH_TIMEOUT_STAT__VIPH_FIFO0_STAT 0x00000001 +#define VIPH_TIMEOUT_STAT__VIPH_FIFO0_AK 0x00000001 +#define VIPH_TIMEOUT_STAT__VIPH_FIFO1_STAT 0x00000002 +#define VIPH_TIMEOUT_STAT__VIPH_FIFO1_AK 0x00000002 +#define VIPH_TIMEOUT_STAT__VIPH_FIFO2_STAT 0x00000004 +#define VIPH_TIMEOUT_STAT__VIPH_FIFO2_AK 0x00000004 +#define VIPH_TIMEOUT_STAT__VIPH_FIFO3_STAT 0x00000008 +#define VIPH_TIMEOUT_STAT__VIPH_FIFO3_AK 0x00000008 + #define VIPH_TIMEOUT_STAT__VIPH_REG_STAT 0x00000010 #define VIPH_TIMEOUT_STAT__VIPH_REG_AK 0x00000010 #define VIPH_TIMEOUT_STAT__VIPH_REGR_DIS 0x01000000 #define TEST_DEBUG_CNTL__TEST_DEBUG_OUT_EN 0x00000001 #define RT100_ATI_ID 0x4D541002 -#define RT200_ATI_ID 0x4f4a1002 +/* #define RT200_ATI_ID 0x4f4a1002 */ +#define RT200_ATI_ID 0x4d4a1002 /* Register/Field values: */ #define RT_COMP0 0x0 |
|
From: <gat...@li...> - 2004-10-21 20:27:31
|
Update of /cvsroot/gatos/ati.4.4.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25471 Modified Files: Tag: r200_branch theatre.c Log Message: Added support for RT200. On a second thought I think a module special for RT200 is a better approach Index: theatre.c =================================================================== RCS file: /cvsroot/gatos/ati.4.4.0/theatre.c,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -d -r1.1 -r1.1.2.1 --- theatre.c 20 May 2004 01:37:59 -0000 1.1 +++ theatre.c 21 Oct 2004 20:27:18 -0000 1.1.2.1 @@ -2,6 +2,7 @@ #include "generic_bus.h" #include "theatre.h" #include "theatre_reg.h" +#include "theatre200.h" #undef read #undef write @@ -42,7 +43,7 @@ t->VIP = b; t->theatre_num = -1; t->mode=MODE_UNINITIALIZED; - + b->read(b, VIP_VIP_VENDOR_DEVICE_ID, 4, (CARD8 *)&val); for(i=0;i<4;i++) { @@ -66,10 +67,12 @@ } if(t->theatre_num>=0)xf86DrvMsg(b->scrnIndex, X_INFO, "Detected Rage Theatre as device %d on VIP bus with id 0x%08x\n",t->theatre_num,t->theatre_id); +#if 0 if(t->theatre_id==RT200_ATI_ID){ xf86DrvMsg(b->scrnIndex, X_INFO, "Rage Theatre 200 is not supported yet\n"); t->theatre_num=-1; } +#endif if(t->theatre_num < 0) { @@ -1144,6 +1147,46 @@ xf86DrvMsg(t->VIP->scrnIndex,X_INFO,"Rage Theatre setting standard 0x%04x\n", wStandard); t->wStandard = wStandard; + + if (t->theatre_id == RT200_ATI_ID) + { +#if 0 + dsp_video_standard_detection(t); +#endif + dsp_set_video_standard(t, 7); + + /* Program the new standards: */ + switch (wStandard & 0x00FF) + { + CARD32 data; + case (DEC_NTSC): /*NTSC GROUP - 480 lines */ + dsp_set_video_standard(t, 1); + switch (wStandard & 0xFF00) + { + case (extPAL_M): + case (extNONE): + case (extNTSC): + dsp_set_video_standard(t, 3); + break; + case (extNTSC_J): + dsp_set_video_standard(t, 4); + break; + default: + break; + } + break; + case (DEC_PAL): /*PAL GROUP - 525 lines */ + dsp_set_video_standard(t, 5); + break; + case (DEC_SECAM): /*PAL GROUP*/ + dsp_set_video_standard(t, 14); + break; + default: + dsp_video_standard_detection(t); + break; + } + return; + } /* Get the constants for the given standard. */ GetStandardConstants (&dbLPeriod, &dbFPeriod, &dbFsamp, wStandard); @@ -1780,6 +1823,28 @@ t->wConnector = wConnector; + if (t->theatre_id == RT200_ATI_ID) + { + switch (wConnector) + { + case (DEC_TUNER): /* Tuner*/ + dsp_set_video_input_connector(t, t->wTunerConnector); + break; + case (DEC_COMPOSITE): /* Comp*/ + dsp_set_video_input_connector(t, t->wComp0Connector); + break; + case (DEC_SVIDEO): /* Svideo*/ + dsp_set_video_input_connector(t, t->wSVideo0Connector); + break; + default: + dsp_set_video_input_connector(t, t->wComp0Connector); + break; + } + + return; + } + + xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "Rage Theatre Checkpoint 1\n"); /* Get the contrast value - make sure we are viewing a visible line*/ counter=0; @@ -1861,65 +1926,176 @@ void InitTheatre(TheatrePtr t) { CARD32 data; + CARD32 M, N, P; - - /* 0 reset Rage Theatre */ - ShutdownTheatre(t); - usleep(100000); - - t->mode=MODE_INITIALIZATION_IN_PROGRESS; - /* 1. - Set the VIN_PLL to NTSC value */ - RT_SetVINClock(t, RT_NTSC); + switch(t->theatre_id) + { + case RT100_ATI_ID: + + /* 0 reset Rage Theatre */ + ShutdownTheatre(t); + usleep(100000); + + t->mode=MODE_INITIALIZATION_IN_PROGRESS; + /* 1. + Set the VIN_PLL to NTSC value */ + RT_SetVINClock(t, RT_NTSC); - /* Take VINRST and L54RST out of reset */ - RT_regr (VIP_PLL_CNTL1, &data); - RT_regw (VIP_PLL_CNTL1, data & ~((RT_VINRST_RESET << 1) | (RT_L54RST_RESET << 3))); - RT_regr (VIP_PLL_CNTL1, &data); + /* Take VINRST and L54RST out of reset */ + RT_regr (VIP_PLL_CNTL1, &data); + RT_regw (VIP_PLL_CNTL1, data & ~((RT_VINRST_RESET << 1) | (RT_L54RST_RESET << 3))); + RT_regr (VIP_PLL_CNTL1, &data); - /* Set VIN_CLK_SEL to PLL_VIN_CLK */ - RT_regr (VIP_CLOCK_SEL_CNTL, &data); - RT_regw (VIP_CLOCK_SEL_CNTL, data | (RT_PLL_VIN_CLK << 7)); - RT_regr (VIP_CLOCK_SEL_CNTL, &data); + /* Set VIN_CLK_SEL to PLL_VIN_CLK */ + RT_regr (VIP_CLOCK_SEL_CNTL, &data); + RT_regw (VIP_CLOCK_SEL_CNTL, data | (RT_PLL_VIN_CLK << 7)); + RT_regr (VIP_CLOCK_SEL_CNTL, &data); - /* 2. - Set HW_DEBUG to 0xF000 before setting the standards registers */ - RT_regw (VIP_HW_DEBUG, 0x0000F000); - - /* wait for things to settle */ - usleep(100000); - - RT_SetStandard(t, t->wStandard); + /* 2. + Set HW_DEBUG to 0xF000 before setting the standards registers */ + RT_regw (VIP_HW_DEBUG, 0x0000F000); + + /* wait for things to settle */ + usleep(100000); + + RT_SetStandard(t, t->wStandard); - /* 3. - Set DVS port to OUTPUT */ - RT_regr (VIP_DVS_PORT_CTRL, &data); - RT_regw (VIP_DVS_PORT_CTRL, data | RT_DVSDIR_OUT); - RT_regr (VIP_DVS_PORT_CTRL, &data); + /* 3. + Set DVS port to OUTPUT */ + RT_regr (VIP_DVS_PORT_CTRL, &data); + RT_regw (VIP_DVS_PORT_CTRL, data | RT_DVSDIR_OUT); + RT_regr (VIP_DVS_PORT_CTRL, &data); - /* 4. - Set default values for ADC_CNTL */ - RT_regw (VIP_ADC_CNTL, RT_ADC_CNTL_DEFAULT); + /* 4. + Set default values for ADC_CNTL */ + RT_regw (VIP_ADC_CNTL, RT_ADC_CNTL_DEFAULT); - /* 5. - Clear the VIN_ASYNC_RST bit */ - RT_regr (VIP_MASTER_CNTL, &data); - RT_regw (VIP_MASTER_CNTL, data & ~0x20); - RT_regr (VIP_MASTER_CNTL, &data); + /* 5. + Clear the VIN_ASYNC_RST bit */ + RT_regr (VIP_MASTER_CNTL, &data); + RT_regw (VIP_MASTER_CNTL, data & ~0x20); + RT_regr (VIP_MASTER_CNTL, &data); - /* Clear the DVS_ASYNC_RST bit */ - RT_regr (VIP_MASTER_CNTL, &data); - RT_regw (VIP_MASTER_CNTL, data & ~(RT_DVS_ASYNC_RST)); - RT_regr (VIP_MASTER_CNTL, &data); + /* Clear the DVS_ASYNC_RST bit */ + RT_regr (VIP_MASTER_CNTL, &data); + RT_regw (VIP_MASTER_CNTL, data & ~(RT_DVS_ASYNC_RST)); + RT_regr (VIP_MASTER_CNTL, &data); - /* Set the GENLOCK delay */ - RT_regw (VIP_HS_GENLOCKDELAY, 0x10); + /* Set the GENLOCK delay */ + RT_regw (VIP_HS_GENLOCKDELAY, 0x10); - RT_regr (fld_DVS_DIRECTION, &data); - RT_regw (fld_DVS_DIRECTION, data & RT_DVSDIR_OUT); -/* WriteRT_fld (fld_DVS_DIRECTION, RT_DVSDIR_IN); */ + RT_regr (fld_DVS_DIRECTION, &data); + RT_regw (fld_DVS_DIRECTION, data & RT_DVSDIR_OUT); + /* WriteRT_fld (fld_DVS_DIRECTION, RT_DVSDIR_IN); */ - t->mode=MODE_INITIALIZED_FOR_TV_IN; + t->mode=MODE_INITIALIZED_FOR_TV_IN; + + break; + + case RT200_ATI_ID: + + M = 28; + N = 224; + P = 1; + + ShutdownTheatre(t); + usleep(100000); + t->mode=MODE_INITIALIZATION_IN_PROGRESS; + + + data = M | (N << 11) | (P <<24); + RT_regw(VIP_DSP_PLL_CNTL, data); + + RT_regr(VIP_PLL_CNTL0, &data); + data |= 0x2000; + RT_regw(VIP_PLL_CNTL0, data); + + /* RT_regw(VIP_I2C_SLVCNTL, 0x249); */ + RT_regr(VIP_PLL_CNTL1, &data); + data |= 0x00030003; + RT_regw(VIP_PLL_CNTL1, data); + + RT_regr(VIP_PLL_CNTL0, &data); + data &= 0xfffffffc; + RT_regw(VIP_PLL_CNTL0, data); + usleep(15000); + + RT_regr(VIP_CLOCK_SEL_CNTL, &data); + data |= 0x1b; + RT_regw(VIP_CLOCK_SEL_CNTL, data); + + RT_regr(VIP_MASTER_CNTL, &data); + data &= 0xffffff07; + RT_regw(VIP_MASTER_CNTL, data); + data &= 0xffffff03; + RT_regw(VIP_MASTER_CNTL, data); + usleep(1000); + + if (DownloadMicrocode(t) < 0) + { + ShutdownTheatre(t); + return; + } + + dsp_set_lowpowerstate(t, 1); + dsp_set_videostreamformat(t, 1); + + t->mode=MODE_INITIALIZED_FOR_TV_IN; + + break; + + default: + xf86DrvMsg(t->VIP->scrnIndex, X_ERROR, "Theater: cannot load microcode\n"); + } + +} + +int DownloadMicrocode(TheatrePtr t) +{ + CARD32 data; + struct rt200_microc_data microc_data; + + if (microc_load("/usr/X11R6/lib/modules/rt2_pmem.hex", MICROC_FILE_TYPE_ASCII, µc_data, t->VIP->scrnIndex) < 0) + { + xf86DrvMsg(t->VIP->scrnIndex, X_ERROR, "Microcode: cannot load microcode\n"); + goto err_exit; + } + else + { + xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "Microcode: device_id: %x\n", microc_data.microc_head.device_id); + xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "Microcode: vendor_id: %x\n", microc_data.microc_head.vendor_id); + xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "Microcode: rev_id: %x\n", microc_data.microc_head.revision_id); + xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "Microcode: num_seg: %x\n", microc_data.microc_head.num_seg); + } + + if (dsp_init(t, µc_data) < 0) + { + xf86DrvMsg(t->VIP->scrnIndex, X_ERROR, "Microcode: dsp_init failed\n"); + goto err_exit; + } + else + { + xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "Microcode: dsp_init OK\n"); + } + + if (dsp_load(t, µc_data) < 0) + { + xf86DrvMsg(t->VIP->scrnIndex, X_ERROR, "Microcode: dsp_download failed\n"); + goto err_exit; + } + else + { + xf86DrvMsg(t->VIP->scrnIndex, X_INFO, "Microcode: dsp_download OK\n"); + } + + microc_clean(µc_data, t->VIP->scrnIndex); + return 0; + +err_exit: + + microc_clean(µc_data, t->VIP->scrnIndex); + return -1; + } |
|
From: <gat...@li...> - 2004-10-21 20:21:51
|
Update of /cvsroot/gatos/ati.4.4.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24347 Modified Files: Tag: r200_branch radeon_video.c Log Message: Added FIFO functions for RT200 support. The tunner part is not finished Index: radeon_video.c =================================================================== RCS file: /cvsroot/gatos/ati.4.4.0/radeon_video.c,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -d -r1.6 -r1.6.2.1 --- radeon_video.c 14 Jul 2004 05:38:24 -0000 1.6 +++ radeon_video.c 21 Oct 2004 20:21:41 -0000 1.6.2.1 @@ -1194,7 +1194,7 @@ {"FI1236W" , TUNER_TYPE_FI1236W}, {"Alps TSBH5" , -1}, {"Alps TSCxx" , -1}, - {"Alps TSCH5 FM" , -1}, + {"Philips FI1216ME (or compatible)" , TUNER_TYPE_FM1216ME}, {"UNKNOWN-19" , -1}, {"UNKNOWN-20" , -1}, {"UNKNOWN-21" , -1}, @@ -1252,6 +1252,7 @@ pPriv->i2c->BusName="Radeon multimedia bus"; pPriv->i2c->DriverPrivate.ptr=(pointer)pPriv; switch(info->ChipFamily){ + case CHIP_FAMILY_RV350: case CHIP_FAMILY_R300: case CHIP_FAMILY_R200: case CHIP_FAMILY_RV200: @@ -1362,6 +1363,29 @@ } } } + + if(pPriv->MM_TABLE_valid && (RADEON_tuners[pPriv->MM_TABLE.tuner_type & 0x1f].type==TUNER_TYPE_FM1216ME )){ + if(!xf86LoadSubModule(pScrn,"tda9885")) + { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unable to initialize tda9885 driver\n"); + } + else + { + xf86LoaderReqSymbols(TDA9885SymbolsList, NULL); + if(pPriv->tda9885 == NULL) + { + pPriv->tda9885 = xf86_Detect_tda9885(pPriv->i2c, TDA9885_ADDR_1); + } + if(pPriv->tda9885 == NULL) + { + pPriv->tda9885 = xf86_Detect_tda9885(pPriv->i2c, TDA9885_ADDR_2); + } + if(pPriv->tda9885 != NULL) + { + RADEON_TDA9885_Init(pPriv); + } + } + } if(!xf86LoadSubModule(pScrn,"msp3430")) { @@ -1473,6 +1497,28 @@ return (INREG(VIPH_CONTROL) & 0x2000) ? VIP_BUSY : VIP_IDLE ; } +static CARD32 RADEONVIP_fifo_idle(GENERIC_BUS_Ptr b, CARD8 channel) +{ + ScrnInfoPtr pScrn = xf86Screens[b->scrnIndex]; + RADEONInfoPtr info = RADEONPTR(pScrn); + unsigned char *RADEONMMIO = info->MMIO; + + CARD32 timeout; + + RADEONWaitForIdleMMIO(pScrn); + timeout = INREG(VIPH_TIMEOUT_STAT); + if((timeout & 0x0000000f) & channel) /* lockup ?? */ + { + xf86DrvMsg(b->scrnIndex, X_INFO, "RADEON_fifo_idle\n"); + RADEONWaitForFifo(pScrn, 2); + OUTREG(VIPH_TIMEOUT_STAT, (timeout & 0xfffffff0) | channel); + RADEONWaitForIdleMMIO(pScrn); + return (INREG(VIPH_CONTROL) & 0x2000) ? VIP_BUSY : VIP_RESET; + } + RADEONWaitForIdleMMIO(pScrn); + return (INREG(VIPH_CONTROL) & 0x2000) ? VIP_BUSY : VIP_IDLE ; +} + /* address format: ((device & 0x3)<<14) | (fifo << 12) | (addr) */ @@ -1495,16 +1541,18 @@ write_mem_barrier(); while(VIP_BUSY == (status = RADEONVIP_idle(b))); if(VIP_IDLE != status) return FALSE; - + /* disable VIPH_REGR_DIS to enable VIP cycle. The LSB of VIPH_TIMEOUT_STAT are set to 0 because 1 would have acknowledged various VIP interrupts unexpectedly */ + RADEONWaitForIdleMMIO(pScrn); OUTREG(VIPH_TIMEOUT_STAT, INREG(VIPH_TIMEOUT_STAT) & (0xffffff00 & ~VIPH_TIMEOUT_STAT__VIPH_REGR_DIS) ); write_mem_barrier(); + /* the value returned here is garbage. The read merely initiates a register cycle @@ -1514,6 +1562,7 @@ while(VIP_BUSY == (status = RADEONVIP_idle(b))); if(VIP_IDLE != status) return FALSE; + /* set VIPH_REGR_DIS so that the read won't take too long. */ @@ -1521,6 +1570,7 @@ tmp=INREG(VIPH_TIMEOUT_STAT); OUTREG(VIPH_TIMEOUT_STAT, (tmp & 0xffffff00) | VIPH_TIMEOUT_STAT__VIPH_REGR_DIS); write_mem_barrier(); + RADEONWaitForIdleMMIO(pScrn); switch(count){ case 1: @@ -1535,12 +1585,86 @@ } while(VIP_BUSY == (status = RADEONVIP_idle(b))); if(VIP_IDLE != status) return FALSE; + + /* + so that reading VIPH_REG_DATA would not trigger unnecessary vip cycles. +*/ + OUTREG(VIPH_TIMEOUT_STAT, (INREG(VIPH_TIMEOUT_STAT) & 0xffffff00) | VIPH_TIMEOUT_STAT__VIPH_REGR_DIS); + write_mem_barrier(); + return TRUE; +} + +static Bool RADEONVIP_fifo_read(GENERIC_BUS_Ptr b, CARD32 address, CARD32 count, CARD8 *buffer) +{ + ScrnInfoPtr pScrn = xf86Screens[b->scrnIndex]; + RADEONInfoPtr info = RADEONPTR(pScrn); + unsigned char *RADEONMMIO = info->MMIO; + CARD32 status,tmp; + + if(count!=1) + { + xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"Attempt to access VIP bus with non-stadard transaction length\n"); + return FALSE; + } + + RADEONWaitForFifo(pScrn, 2); + OUTREG(VIPH_REG_ADDR, address | 0x3000); + write_mem_barrier(); + while(VIP_BUSY == (status = RADEONVIP_fifo_idle(b, 0xff))); + if(VIP_IDLE != status) return FALSE; + +/* + disable VIPH_REGR_DIS to enable VIP cycle. + The LSB of VIPH_TIMEOUT_STAT are set to 0 + because 1 would have acknowledged various VIP + interrupts unexpectedly +*/ + + RADEONWaitForIdleMMIO(pScrn); + OUTREG(VIPH_TIMEOUT_STAT, INREG(VIPH_TIMEOUT_STAT) & (0xffffff00 & ~VIPH_TIMEOUT_STAT__VIPH_REGR_DIS) ); + write_mem_barrier(); + +/* + the value returned here is garbage. The read merely initiates + a register cycle +*/ + RADEONWaitForIdleMMIO(pScrn); + INREG(VIPH_REG_DATA); + + while(VIP_BUSY == (status = RADEONVIP_fifo_idle(b, 0xff))); + if(VIP_IDLE != status) return FALSE; + +/* + set VIPH_REGR_DIS so that the read won't take too long. +*/ + RADEONWaitForIdleMMIO(pScrn); + tmp=INREG(VIPH_TIMEOUT_STAT); + OUTREG(VIPH_TIMEOUT_STAT, (tmp & 0xffffff00) | VIPH_TIMEOUT_STAT__VIPH_REGR_DIS); + write_mem_barrier(); + + RADEONWaitForIdleMMIO(pScrn); + switch(count){ + case 1: + *buffer=(CARD8)(INREG(VIPH_REG_DATA) & 0xff); + break; + case 2: + *(CARD16 *)buffer=(CARD16) (INREG(VIPH_REG_DATA) & 0xffff); + break; + case 4: + *(CARD32 *)buffer=(CARD32) ( INREG(VIPH_REG_DATA) & 0xffffffff); + break; + } + while(VIP_BUSY == (status = RADEONVIP_fifo_idle(b, 0xff))); + if(VIP_IDLE != status) return FALSE; + /* so that reading VIPH_REG_DATA would not trigger unnecessary vip cycles. */ OUTREG(VIPH_TIMEOUT_STAT, (INREG(VIPH_TIMEOUT_STAT) & 0xffffff00) | VIPH_TIMEOUT_STAT__VIPH_REGR_DIS); write_mem_barrier(); return TRUE; + + } static Bool RADEONVIP_write(GENERIC_BUS_Ptr b, CARD32 address, CARD32 count, CARD8 *buffer) @@ -1561,8 +1685,11 @@ RADEONWaitForFifo(pScrn, 2); OUTREG(VIPH_REG_ADDR, address & (~0x2000)); while(VIP_BUSY == (status = RADEONVIP_idle(b))); - - if(VIP_IDLE != status) return FALSE; + + if(VIP_IDLE != status){ + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "cannot write %x to VIPH_REG_ADDR\n", (unsigned int)address); + return FALSE; + } RADEONWaitForFifo(pScrn, 2); switch(count){ @@ -1572,10 +1699,52 @@ } write_mem_barrier(); while(VIP_BUSY == (status = RADEONVIP_idle(b))); - if(VIP_IDLE != status) return FALSE; + if(VIP_IDLE != status) + { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "cannot write to VIPH_REG_DATA\n"); + return FALSE; + } + return TRUE; } +static Bool RADEONVIP_fifo_write(GENERIC_BUS_Ptr b, CARD32 address, CARD32 count, CARD8 *buffer) +{ + ScrnInfoPtr pScrn = xf86Screens[b->scrnIndex]; + RADEONInfoPtr info = RADEONPTR(pScrn); + unsigned char *RADEONMMIO = info->MMIO; + + CARD32 status; + CARD32 i; + + RADEONWaitForFifo(pScrn, 2); + OUTREG(VIPH_REG_ADDR, (address & (~0x2000)) | 0x1000); + while(VIP_BUSY == (status = RADEONVIP_fifo_idle(b, 0x0f))); + + + if(VIP_IDLE != status){ + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "cannot write %x to VIPH_REG_ADDR\n", (unsigned int)address); + return FALSE; + } + + RADEONWaitForFifo(pScrn, 2); + for (i = 0; i < count; i+=4) + { + OUTREG(VIPH_REG_DATA, *(CARD32*)(buffer + i)); + write_mem_barrier(); + while(VIP_BUSY == (status = RADEONVIP_fifo_idle(b, 0x0f))); + if(VIP_IDLE != status) + { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "cannot write to VIPH_REG_DATA\n"); + return FALSE; + } + + } + + return TRUE; + +} + void RADEONVIP_reset(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv) { RADEONInfoPtr info = RADEONPTR(pScrn); @@ -1585,6 +1754,7 @@ RADEONWaitForIdleMMIO(pScrn); switch(info->ChipFamily){ case CHIP_FAMILY_RV250: + case CHIP_FAMILY_RV350: OUTREG(VIPH_CONTROL, 0x003F0009); /* slowest, timeout in 16 phases */ OUTREG(VIPH_TIMEOUT_STAT, (INREG(VIPH_TIMEOUT_STAT) & 0xFFFFFF00) | VIPH_TIMEOUT_STAT__VIPH_REGR_DIS); OUTREG(VIPH_DV_LAT, 0x444400FF); /* set timeslice */ @@ -1608,7 +1778,9 @@ pPriv->VIP->ioctl=RADEONVIP_ioctl; pPriv->VIP->read=RADEONVIP_read; pPriv->VIP->write=RADEONVIP_write; - + pPriv->VIP->fifo_read=RADEONVIP_fifo_read; + pPriv->VIP->fifo_write=RADEONVIP_fifo_write; + RADEONVIP_reset(pScrn, pPriv); } @@ -1665,7 +1837,9 @@ CARD16 bios_header; if((info->VBIOS==NULL)||(info->VBIOS[0]!=0x55)||(info->VBIOS[1]!=0xaa)){ - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Cannot access BIOS or it is not valid.\n" + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "info->VBIOS: %p, info->VBIOS[0]: %i, \ + info->VBIOS[1]: %i\n", info->VBIOS, info->VBIOS[0], info->VBIOS[1]); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Cannot access BIOS or it is not valid.\n" "\t\tYou will need to specify options RageTheatreCrystal, RageTheatreTunerPort, \n" "\t\tRageTheatreSVideoPort and TunerType in /etc/XF86Config.\n" ); @@ -1957,6 +2131,7 @@ xf86DrvMsg(pScrn->scrnIndex,X_INFO,"Multimedia table is not valid and no forced settings have been specified\n"); xf86DrvMsg(pScrn->scrnIndex,X_INFO,"Skipping i2c and Rage Theatre initialization code.\n"); } else { + xf86DrvMsg(pScrn->scrnIndex,X_INFO,"Going to detect Theatre chip\n"); pPriv->theatre=xf86_DetectTheatre(pPriv->VIP); RADEONInitI2C(pScrn,pPriv); } @@ -1981,13 +2156,14 @@ if(pPriv->theatre != NULL) { - xf86_InitTheatre(pPriv->theatre); + xf86_InitTheatre(pPriv->theatre); xf86_ResetTheatreRegsForNoTVout(pPriv->theatre); xf86_RT_SetTint(pPriv->theatre, pPriv->dec_hue); xf86_RT_SetSaturation(pPriv->theatre, pPriv->dec_saturation); xf86_RT_SetSharpness(pPriv->theatre, RT_NORM_SHARPNESS); xf86_RT_SetContrast(pPriv->theatre, pPriv->dec_contrast); - xf86_RT_SetBrightness(pPriv->theatre, pPriv->dec_brightness); + xf86_RT_SetBrightness(pPriv->theatre, pPriv->dec_brightness); + RADEON_RT_SetEncoding(pScrn, pPriv); } @@ -2310,6 +2486,7 @@ if((pPriv->msp3430!=NULL)&& !pPriv->mute)xf86_MSP3430SetVolume(pPriv->msp3430, MSP3430_FAST_MUTE); if(pPriv->fi1236 != NULL) xf86_TUNER_set_frequency(pPriv->fi1236, value); /* if(pPriv->theatre != NULL) RADEON_RT_SetEncoding(pScrn, pPriv); */ + if(pPriv->tda9885 != NULL) RADEON_TDA9885_SetEncoding(pPriv); if((pPriv->msp3430 != NULL) && (pPriv->msp3430->recheck)) xf86_InitMSP3430(pPriv->msp3430); if((pPriv->msp3430 != NULL)&& !pPriv->mute) xf86_MSP3430SetVolume(pPriv->msp3430, MSP3430_VOLUME(pPriv->volume)); @@ -3361,6 +3538,7 @@ pPriv->v=0; return; } + xf86_RT_SetInterlace(pPriv->theatre, 1); width = InputVideoEncodings[pPriv->encoding].width; height = InputVideoEncodings[pPriv->encoding].height; @@ -3753,7 +3931,7 @@ OUTREG(RADEON_CAP0_TRIG_CNTL, 0x11); if(pPriv->theatre != NULL) { - RADEON_RT_SetEncoding(pScrn, pPriv); + RADEON_RT_SetEncoding(pScrn, pPriv); } if(pPriv->msp3430 != NULL) RADEON_MSP_SetEncoding(pPriv); if(pPriv->tda9885 != NULL) RADEON_TDA9885_SetEncoding(pPriv); |
|
From: <gat...@li...> - 2004-10-21 20:18:51
|
Update of /cvsroot/gatos/ati.4.4.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23773 Modified Files: Tag: r200_branch radeon_reg.h Log Message: Added RADEON DMA VIP registers Index: radeon_reg.h =================================================================== RCS file: /cvsroot/gatos/ati.4.4.0/radeon_reg.h,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -d -r1.2 -r1.2.2.1 --- radeon_reg.h 20 May 2004 01:37:59 -0000 1.2 +++ radeon_reg.h 21 Oct 2004 20:18:42 -0000 1.2.2.1 @@ -53,6 +53,23 @@ #ifndef _RADEON_REG_H_ #define _RADEON_REG_H_ +#define RADEON_DMA_VIPH0_COMMAND 0x0a00 +#define RADEON_DMA_VIPH1_COMMAND 0x0a04 +#define RADEON_DMA_VIPH2_COMMAND 0x0a08 +#define RADEON_DMA_VIPH3_COMMAND 0x0a0c +#define RADEON_DMA_VIPH_STATUS 0x0a10 +#define RADEON_DMA_VIPH_CHUNK_0 0x0a18 +#define RADEON_DMA_VIPH_CHUNK_1_VAL 0x0a1c +#define RADEON_DMA_VIP0_TABLE_ADDR 0x0a20 +#define RADEON_DMA_VIP1_TABLE_ADDR 0x0a30 +#define RADEON_DMA_VIP2_TABLE_ADDR 0x0a40 +#define RADEON_DMA_VIP3_TABLE_ADDR 0x0a50 +#define RADEON_DMA_VIPH0_ACTIVE 0x0a24 +#define RADEON_DMA_VIPH1_ACTIVE 0x0a34 +#define RADEON_DMA_VIPH2_ACTIVE 0x0a44 +#define RADEON_DMA_VIPH3_ACTIVE 0x0a54 +#define RADEON_DMA_VIPH_ABORT 0x0a88 + /* Registers for 2D/Video/Overlay */ #define RADEON_ADAPTER_ID 0x0f2c /* PCI */ #define RADEON_AGP_BASE 0x0170 |
|
From: <gat...@li...> - 2004-10-21 20:16:22
|
Update of /cvsroot/gatos/ati.4.4.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23288 Modified Files: Tag: r200_branch generic_bus.h Log Message: Added support for FIFO read and write Index: generic_bus.h =================================================================== RCS file: /cvsroot/gatos/ati.4.4.0/generic_bus.h,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -d -r1.1 -r1.1.2.1 --- generic_bus.h 20 May 2004 01:37:59 -0000 1.1 +++ generic_bus.h 21 Oct 2004 20:16:05 -0000 1.1.2.1 @@ -23,6 +23,9 @@ Bool (*ioctl)(GENERIC_BUS_Ptr, long, long, char *); Bool (*read)(GENERIC_BUS_Ptr, CARD32, CARD32, CARD8 *); Bool (*write)(GENERIC_BUS_Ptr, CARD32, CARD32, CARD8 *); + Bool (*fifo_read)(GENERIC_BUS_Ptr, CARD32, CARD32, CARD8 *); + Bool (*fifo_write)(GENERIC_BUS_Ptr, CARD32, CARD32, CARD8 *); + } GENERIC_BUS_Rec; |
|
From: <gat...@li...> - 2004-10-21 20:09:50
|
Update of /cvsroot/gatos/ati.4.4.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21873 Modified Files: generic_bus.h Log Message: Added support for FIFO read and write Index: generic_bus.h =================================================================== RCS file: /cvsroot/gatos/ati.4.4.0/generic_bus.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- generic_bus.h 20 May 2004 01:37:59 -0000 1.1 +++ generic_bus.h 21 Oct 2004 20:09:26 -0000 1.2 @@ -23,6 +23,9 @@ Bool (*ioctl)(GENERIC_BUS_Ptr, long, long, char *); Bool (*read)(GENERIC_BUS_Ptr, CARD32, CARD32, CARD8 *); Bool (*write)(GENERIC_BUS_Ptr, CARD32, CARD32, CARD8 *); + Bool (*fifo_read)(GENERIC_BUS_Ptr, CARD32, CARD32, CARD8 *); + Bool (*fifo_write)(GENERIC_BUS_Ptr, CARD32, CARD32, CARD8 *); + } GENERIC_BUS_Rec; |
|
From: <gat...@li...> - 2004-10-19 16:59:03
|
Update of /cvsroot/gatos/avview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27386 Modified Files: INSTALL README Log Message: Update documentation about LIRC support Index: README =================================================================== RCS file: /cvsroot/gatos/avview/README,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- README 3 Jan 2004 18:21:18 -0000 1.18 +++ README 19 Oct 2004 16:58:53 -0000 1.19 @@ -8,9 +8,11 @@ * Xv support - Requirements: TV input capable card with Xv support, Tcl/Tk 8.4.x or later. + Requirements: TV input capable card with Xv support + Tcl/Tk 8.4.x or later libzvbi from http://zapping.sf.net/ ffmpeg-0.4.6 from http://ffmpeg.sf.net/ + LIRC (optional) from http://www.lirc.org/ *** NOTES *** @@ -68,3 +70,30 @@ Right-click bring up popup menu MouseWheel adjust on-screen control +*** LIRC CONFIGURATION *** + + * LIRC (Linux Infrared Remote Control) commands are defined in + file ~/.lircrc, see + <http://www.lirc.org/html/configure.html#lircrc_format> for + description of the file format. Each entry in the file has + prog field telling which application should handle the button + press. For AVview this field is 'avview' (without the + apostrophes). The following commands are recogniced as config + field values: + + fullscreen toggle fullscreen mode + next_channel val switch between favourite channels. + val is the number of channels to + skip, can be negative + mute toggle mute + exit exit AVview + volume val change volume by amount val + next_control val switch on-screen control. val is the + number of controls to skip, can be + negative + change_control val change the value of on-screen control + by amount val + next_encoding change xv port encoding (PAL, NTSC, ...) + remote_power_off exit or toggle screensaver + channel val select channel val. val is channel + name (e.g. E5) Index: INSTALL =================================================================== RCS file: /cvsroot/gatos/avview/INSTALL,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- INSTALL 17 Dec 2003 21:07:59 -0000 1.11 +++ INSTALL 19 Oct 2004 16:58:53 -0000 1.12 @@ -7,6 +7,7 @@ FFmpeg 0.4.8 (optional, http://ffmpeg.sf.net/) autoconf 2.57 or later (if compiling from CVS) (http://www.gnu.org/) automake 1.7.8 (if compiling from CVS) (http://www.gnu.org) + LIRC 0.6.0 or later (optional, http://www.lirc.org/) To compile: |
|
From: <gat...@li...> - 2004-10-06 12:10:48
|
Update of /cvsroot/gatos/avview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3144 Modified Files: alsa.c Log Message: Fix to compile with newer versions with gcc. Index: alsa.c =================================================================== RCS file: /cvsroot/gatos/avview/alsa.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- alsa.c 3 Jan 2004 18:21:19 -0000 1.38 +++ alsa.c 6 Oct 2004 12:10:23 -0000 1.39 @@ -298,6 +298,7 @@ Tcl_ListObjAppendElement(interp,list,list2); break; default: + break; } Tcl_ListObjAppendElement(interp, ans, list); j++; |
|
From: <gat...@li...> - 2004-10-04 16:10:30
|
Update of /cvsroot/gatos/avview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27806 Modified Files: avview.scp ffmpeg.scp setup.scp Log Message: Minor UI fixes Index: avview.scp =================================================================== RCS file: /cvsroot/gatos/avview/avview.scp,v retrieving revision 1.152 retrieving revision 1.153 diff -u -d -r1.152 -r1.153 --- avview.scp 26 Aug 2004 00:24:33 -0000 1.152 +++ avview.scp 4 Oct 2004 16:10:18 -0000 1.153 @@ -943,6 +943,7 @@ set_default_settings read_settings rehash_themes + set_encoding_theme switch_to_pane "/Configuration/User interface settings" if { $display_setup_window_on_startup } { create_setup_window Index: ffmpeg.scp =================================================================== RCS file: /cvsroot/gatos/avview/ffmpeg.scp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ffmpeg.scp 2 Jan 2004 09:57:39 -0000 1.11 +++ ffmpeg.scp 4 Oct 2004 16:10:19 -0000 1.12 @@ -122,9 +122,6 @@ global ffmpeg_encoding_theme -trace variable ffmpeg_encoding_theme w { - skip_args3 } - set ffmpeg_encoding_theme [lindex $encoding_themes 1] proc get_encoding_theme { short_name } { @@ -324,8 +321,7 @@ } } -rehash_themes - +set encoding_themes_list {} add_parameter_pane "/Configuration/Encoding settings" "Encoding settings" \ "Pre-configured themes" heading "" \ "Encoding theme" choice [concat ffmpeg_encoding_theme $encoding_themes_list] \ @@ -334,6 +330,8 @@ "Name" entry custom_theme_name \ "Create new theme based on current one" command create_new_theme +rehash_themes + add_description_pane "/Configuration/Encoding settings/Custom themes" "Custom themes" \ { You can create new custom encoding themes by duplicating an existing one. The newly created theme Index: setup.scp =================================================================== RCS file: /cvsroot/gatos/avview/setup.scp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- setup.scp 2 Jan 2004 09:57:39 -0000 1.16 +++ setup.scp 4 Oct 2004 16:10:19 -0000 1.17 @@ -60,6 +60,11 @@ proc switch_to_pane { key } { global SETUP_MAIN + +if {$key == ""} { + return +} + set pane [get_pane_frame "$key"] Tree:setselection $SETUP_MAIN.tree "$key" foreach win [place slaves $SETUP_MAIN.f] { |
|
From: <gat...@li...> - 2004-10-03 09:49:47
|
Update of /cvsroot/gatos/avview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2873 Modified Files: ffmpeg.c Log Message: Fix potential race condition Index: ffmpeg.c =================================================================== RCS file: /cvsroot/gatos/avview/ffmpeg.c,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- ffmpeg.c 3 Jan 2004 18:21:19 -0000 1.85 +++ ffmpeg.c 3 Oct 2004 09:48:19 -0000 1.86 @@ -874,6 +874,18 @@ return TCL_OK; } +void finish_recording() +{ +pthread_mutex_lock(&(sdata->format_context_mutex)); +if(sdata->format_context.oformat!=NULL) + av_write_trailer(&(sdata->format_context)); +pthread_mutex_unlock(&(sdata->format_context_mutex)); +close(sdata->fd_out); +free(sdata); +sdata=NULL; +fprintf(stderr,"Recording finished\n"); +} + int ffmpeg_stop_encoding(ClientData client_data,Tcl_Interp* interp,int argc,const char *argv[]) { @@ -895,6 +907,17 @@ if(sdata->audio_s!=NULL)pthread_mutex_unlock(&(sdata->audio_s->ctr_mutex)); if(sdata->video_s!=NULL)pthread_mutex_unlock(&(sdata->video_s->ctr_mutex)); if(sdata->video_s!=NULL)v4l_detach_output_stream(sdata->v4l_device, sdata->video_s); +if(sdata->video_s!=NULL){ + pthread_join(sdata->video_s->consumer_thread_id, NULL); + free(sdata->video_s); + sdata->video_s=NULL; + } +if(sdata->audio_s!=NULL){ + pthread_join(sdata->audio_s->consumer_thread_id, NULL); + free(sdata->audio_s); + sdata->audio_s=NULL; + } +finish_recording(); return 0; } @@ -949,15 +972,7 @@ Tcl_SetObjResult(interp, Tcl_NewIntObj(total)); if((sdata!=NULL)&&(sdata->audio_s==NULL)&&(sdata->video_s==NULL)){ - pthread_mutex_lock(&(sdata->format_context_mutex)); - if(sdata->format_context.oformat!=NULL) - av_write_trailer(&(sdata->format_context)); - pthread_mutex_unlock(&(sdata->format_context_mutex)); - close(sdata->fd_out); - free(sdata); - sdata=NULL; - fprintf(stderr,"Recording finished\n"); - return TCL_OK; + finish_recording(); } if(sdata->video_s!=NULL){ pthread_mutex_unlock(&(sdata->video_s->ctr_mutex)); @@ -1069,17 +1084,8 @@ sdata->audio_sample_top_right=0; for(i=0;i<32;i++)sdata->luma_hist[i]=0; - if((sdata!=NULL)&&(sdata->audio_s==NULL)&&(sdata->video_s==NULL)){ - pthread_mutex_lock(&(sdata->format_context_mutex)); - if(sdata->format_context.oformat!=NULL) - av_write_trailer(&(sdata->format_context)); - close(sdata->fd_out); - pthread_mutex_unlock(&(sdata->format_context_mutex)); - free(sdata); - sdata=NULL; - fprintf(stderr,"Recording finished\n"); - return TCL_OK; + finish_recording(); } if(sdata->video_s!=NULL){ pthread_mutex_unlock(&(sdata->video_s->ctr_mutex)); |
|
From: <gat...@li...> - 2004-09-20 17:42:47
|
Update of /cvsroot/gatos/km In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23642 Modified Files: km_v4l.c km_v4l.h km_v4l_24.c Log Message: Use pointers to video device structs Index: km_v4l.h =================================================================== RCS file: /cvsroot/gatos/km/km_v4l.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- km_v4l.h 8 Feb 2003 16:19:52 -0000 1.3 +++ km_v4l.h 20 Sep 2004 17:42:32 -0000 1.4 @@ -9,7 +9,7 @@ #ifndef __KM_V4L_H__ #define __KM_V4L_H__ -void init_km_v4l(KM_STRUCT *kms); +int init_km_v4l(KM_STRUCT *kms); void cleanup_km_v4l(KM_STRUCT *kms); Index: km_v4l_24.c =================================================================== RCS file: /cvsroot/gatos/km/km_v4l_24.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- km_v4l_24.c 29 Jun 2004 04:32:34 -0000 1.1 +++ km_v4l_24.c 20 Sep 2004 17:42:32 -0000 1.2 @@ -132,7 +132,7 @@ case VIDIOCGCAP:{ struct video_capability b; struct video_window vwin; - strcpy(b.name,kms->vd.name); + strcpy(b.name,kms->vd->name); b.type = VID_TYPE_CAPTURE; if(kms->get_window_parameters==NULL)return -EINVAL; kms->get_window_parameters(kms, &(vwin)); @@ -191,7 +191,7 @@ return -EFAULT; if((vwin.width!=vwin1.width)||(vwin.height!=vwin1.height)){ printk("km: /dev/video%d uses frame format %dx%d\n", - kms->vd.minor, vwin1.width, vwin1.height); + kms->vd->minor, vwin1.width, vwin1.height); return -EINVAL; } return 0; @@ -355,7 +355,7 @@ struct video_capability b; memset(&b, 0, sizeof(b)); - strcpy(b.name,kms->vd.name); + strcpy(b.name,kms->vd->name); b.type = VID_TYPE_CAPTURE | VID_TYPE_TELETEXT; if(copy_to_user(arg,&b,sizeof(b))) @@ -476,23 +476,34 @@ minor: -1, }; -void init_km_v4l(KM_STRUCT *kms) +int init_km_v4l(KM_STRUCT *kms) { -memcpy(&(kms->vd), &km_v4l_template, sizeof(km_v4l_template)); -kms->vd.priv=kms; -memcpy(&(kms->vbi_vd), &km_v4l_vbi_template, sizeof(km_v4l_vbi_template)); -kms->vbi_vd.priv=kms; +kms->vd = rvmalloc(sizeof(km_v4l_template)); +if (NULL == kms->vd) return -1; +memcpy(kms->vd, &km_v4l_template, sizeof(km_v4l_template)); +kms->vd->priv=kms; + +kms->vbi_vd = rvmalloc(sizeof(km_v4l_vbi_template)); +if (NULL == kms->vbi_vd) { + rvfree(kms->vd, sizeof(km_v4l_template)); + return -1; +} +memcpy(kms->vbi_vd, &km_v4l_vbi_template, sizeof(km_v4l_vbi_template)); +kms->vbi_vd->priv=kms; if(kms->is_capture_active!=NULL) - video_register_device(&(kms->vd), VFL_TYPE_GRABBER, -1); + video_register_device(kms->vd, VFL_TYPE_GRABBER, -1); if(kms->is_vbi_active!=NULL) - video_register_device(&(kms->vbi_vd), VFL_TYPE_VBI, -1); + video_register_device(kms->vbi_vd, VFL_TYPE_VBI, -1); +return 0; } void cleanup_km_v4l(KM_STRUCT *kms) { if(kms->is_capture_active!=NULL) - video_unregister_device(&(kms->vd)); + video_unregister_device(kms->vd); if(kms->is_vbi_active!=NULL) - video_unregister_device(&(kms->vbi_vd)); + video_unregister_device(kms->vbi_vd); +rvfree(kms->vbi_vd, sizeof(km_v4l_vbi_template)); +rvfree(kms->vd, sizeof(km_v4l_template)); } Index: km_v4l.c =================================================================== RCS file: /cvsroot/gatos/km/km_v4l.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- km_v4l.c 29 Jun 2004 05:48:55 -0000 1.47 +++ km_v4l.c 20 Sep 2004 17:42:31 -0000 1.48 @@ -103,7 +103,7 @@ case VIDIOCGCAP:{ struct video_capability b; struct video_window vwin; - strcpy(b.name,kms->vd.name); + strcpy(b.name,kms->vd->name); b.type = VID_TYPE_CAPTURE; if(kms->get_window_parameters==NULL)return -EINVAL; kms->get_window_parameters(kms, &(vwin)); @@ -162,7 +162,7 @@ return -EFAULT; if((vwin.width!=vwin1.width)||(vwin.height!=vwin1.height)){ printk("km: /dev/video%d uses frame format %dx%d\n", - kms->vd.minor, vwin1.width, vwin1.height); + kms->vd->minor, vwin1.width, vwin1.height); return -EINVAL; } return 0; @@ -243,6 +243,7 @@ km_data_destroy_kdufpd(kms->vbi_kdufpd); kms->vbi_kdufpd=NULL; stop_vbi_capture(kms); + return 0; } static ssize_t km_vbi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) @@ -295,7 +296,7 @@ struct video_capability b; memset(&b, 0, sizeof(b)); - strcpy(b.name,kms->vd.name); + strcpy(b.name,kms->vd->name); b.type = VID_TYPE_CAPTURE | VID_TYPE_TELETEXT; if(copy_to_user(arg,&b,sizeof(b))) @@ -389,23 +390,34 @@ minor: -1, }; -void init_km_v4l(KM_STRUCT *kms) +int init_km_v4l(KM_STRUCT *kms) { - memcpy(&(kms->vd), &km_v4l_template, sizeof(km_v4l_template)); - kms->vd.priv=kms; - memcpy(&(kms->vbi_vd), &km_v4l_vbi_template, sizeof(km_v4l_vbi_template)); - kms->vbi_vd.priv=kms; + kms->vd = rvmalloc(sizeof(km_v4l_template)); + if (NULL == kms->vd) return -1; + memcpy(kms->vd, &km_v4l_template, sizeof(km_v4l_template)); + kms->vd->priv=kms; + + kms->vbi_vd = rvmalloc(sizeof(km_v4l_vbi_template)); + if (NULL == kms->vbi_vd) { + rvfree(kms->vd, sizeof(km_v4l_template)); + return -1; + } + memcpy(kms->vbi_vd, &km_v4l_vbi_template, sizeof(km_v4l_vbi_template)); + kms->vbi_vd->priv=kms; if(kms->is_capture_active!=NULL) - video_register_device(&(kms->vd), VFL_TYPE_GRABBER, -1); + video_register_device(kms->vd, VFL_TYPE_GRABBER, -1); if(kms->is_vbi_active!=NULL) - video_register_device(&(kms->vbi_vd), VFL_TYPE_VBI, -1); + video_register_device(kms->vbi_vd, VFL_TYPE_VBI, -1); + return 0; } void cleanup_km_v4l(KM_STRUCT *kms) { if(kms->is_capture_active!=NULL) - video_unregister_device(&(kms->vd)); + video_unregister_device(kms->vd); if(kms->is_vbi_active!=NULL) - video_unregister_device(&(kms->vbi_vd)); + video_unregister_device(kms->vbi_vd); + rvfree(kms->vbi_vd, sizeof(km_v4l_vbi_template)); + rvfree(kms->vd, sizeof(km_v4l_template)); } |
|
From: <gat...@li...> - 2004-09-15 00:50:15
|
Update of /cvsroot/r300/r300_demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7236 Modified Files: Makefile r300_demo.c r300_lib.h r300_regs.h Added Files: global.h r300_lib.c Log Message: Separate out some code into r300_lib.c - no need to put entire library in a header file. --- NEW FILE: r300_lib.c --- #include <stdio.h> #include <stdlib.h> #include <math.h> #include "radeon_reg.h" #include "r300_regs.h" #include "global.h" /* for now declare these explicitly */ extern int indirect_end; extern CARD32 *indirect; #include "r300_lib.h" /* emit random 32 bit number */ void erand32(void) { CARD32 w; [...1605 lines suppressed...] e32(RADEON_CP_PACKET2); e32(RADEON_CP_PACKET2); e32(RADEON_CP_PACKET2); e32(RADEON_CP_PACKET2); e32(RADEON_CP_PACKET2); e32(RADEON_CP_PACKET2); e32(RADEON_CP_PACKET2); e32(RADEON_CP_PACKET2); e32(RADEON_CP_PACKET2); e32(RADEON_CP_PACKET2); } --- NEW FILE: global.h --- #ifndef __GLOBAL_H__ #define __GLOBAL_H__ typedef unsigned int CARD32; #define CHECKPOINT { fprintf(stderr,"CHECKPOINT %s %d\n",__FUNCTION__,__LINE__); } #endif Index: r300_regs.h =================================================================== RCS file: /cvsroot/r300/r300_demo/r300_regs.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- r300_regs.h 14 Sep 2004 15:30:49 -0000 1.1 +++ r300_regs.h 15 Sep 2004 00:50:01 -0000 1.2 @@ -194,4 +194,7 @@ #define R300_VAP_VTX_NUM_ARRAYS 0x20C0 #define R300_SRC_CLUT_DATA 0x1784 +#define CP_PACKET0(reg, n) (RADEON_CP_PACKET0 | ((n)<<16) | ((reg)>>2)) + + #endif Index: r300_lib.h =================================================================== RCS file: /cvsroot/r300/r300_demo/r300_lib.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- r300_lib.h 14 Sep 2004 15:30:49 -0000 1.1 +++ r300_lib.h 15 Sep 2004 00:50:01 -0000 1.2 @@ -1,1303 +1,44 @@ #ifndef __R300_LIB_H__ #define __R300_LIB_H__ +#include "global.h" #include "registers.h" -/* Notes: - - Vertex shaders: - - According to [...1604 lines suppressed...] - -e32(RADEON_CP_PACKET2); - -e32(RADEON_CP_PACKET2); - -e32(RADEON_CP_PACKET2); - -e32(RADEON_CP_PACKET2); - -e32(RADEON_CP_PACKET2); - -e32(RADEON_CP_PACKET2); - -e32(RADEON_CP_PACKET2); -} +void init_flat_primitive(void); #define PRIM_TYPE_TRIANGLE 0x4 #define PRIM_TYPE_QUAD 0xd Index: r300_demo.c =================================================================== RCS file: /cvsroot/r300/r300_demo/r300_demo.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- r300_demo.c 14 Sep 2004 15:30:49 -0000 1.1 +++ r300_demo.c 15 Sep 2004 00:50:01 -0000 1.2 @@ -1,5 +1,6 @@ #include <stdio.h> #include <stdlib.h> +#include <unistd.h> #include <errno.h> #include <math.h> @@ -7,10 +8,9 @@ #include "radeon_common.h" #include "radeon_reg.h" #include "r300_regs.h" +#include "global.h" -typedef unsigned int CARD32; -#define CHECKPOINT { fprintf(stderr,"CHECKPOINT %s %d\n",__FUNCTION__,__LINE__); } #define RADEON_TIMEOUT 2000000 /* Fall out of wait loops after this count */ @@ -23,7 +23,6 @@ #define DMA_COUNT 3 #define DMA_SIZE 64000 -#define CP_PACKET0(reg, n) (RADEON_CP_PACKET0 | ((n)<<16) | ((reg)>>2)) int indices[DMA_COUNT]; int sizes[DMA_COUNT]; @@ -32,17 +31,18 @@ int indirect_start=0, indirect_end=0,indirect_idx=-1,indirect_size=0; CARD32 *indirect; +#include "r300_lib.h" + + /* DRM driver does not reprogram MC controller by default. Thus all these can start at 0. I put depth and zmask at offsets that are inside visible framebuffer so I can see what is happening */ -unsigned int display_base=0x0, depth_offset=1920*4*500, zmask_offset=1920*4*700; +unsigned int display_base=0x0, zmask_offset=1920*4*700; /* width of the framebuffer - I am using a laptop panel 1920x1200 */ int display_width=1920; -/* this function is autogenerated by pretty_print_command_stream.tcl */ - void xf86InstallSIGIOHandler(void) { @@ -93,41 +93,6 @@ indirect_size=sizes[INDIRECT]; } -/* Emit CARD32 */ -void e32(CARD32 dword) -{ -indirect[indirect_end>>2]=dword; -indirect_end+=4; -} - -void efloat(float f) -{ -indirect[indirect_end>>2]=*((CARD32*)&f); -indirect_end+=4; -} - -/* emit random 32 bit number */ -void erand32(void) -{ -CARD32 w; -CARD32 p; - -p=floor(0xffff*1.0*rand()/RAND_MAX); -w=p; -p=floor(0xffff*1.0*rand()/RAND_MAX); -w|=(p<<16); -e32(w); -} - -/* emit random float */ -void erandfloat(float maxvalue) -{ -float v; - -v=(maxvalue*rand())/RAND_MAX; -efloat(v); -} - void FlushIndirect(void) { drmRadeonIndirect indirect; @@ -210,6 +175,7 @@ /* play with color space argument here */ #define COLORSPACE (6<<5) /* ARGB */ + /* emit regs necessary for 3d packets */ void Emit3dRegs(void) { @@ -258,12 +224,12 @@ } +ADAPTOR adaptor; -#include "r300_lib.h" void test_3d(void) { -init_3d(); +init_3d(&adaptor); init_flat_primitive(); @@ -343,6 +309,28 @@ } fprintf(stderr,"\n"); } + +/* setup ADAPTOR structure */ + +adaptor.chip=CHIP_RV350; + +adaptor.color_offset[0]=display_base; +adaptor.color_offset[1]=0x0; +adaptor.color_offset[2]=0x0; +adaptor.color_offset[3]=0x0; + +adaptor.color_pitch[0]=(display_width | (0xc0<<16)); +adaptor.color_pitch[1]=0; +adaptor.color_pitch[2]=0; +adaptor.color_pitch[3]=0; + +adaptor.depth_offset=display_width*4*500; +adaptor.depth_pitch=display_width | (0x2 << 16); + +print_adaptor(&adaptor); +system("sync"); +sleep(1); /* Give people chance to hit Ctrl-C */ + /* play around with indirect buffer here */ Emit3dRegs(); Index: Makefile =================================================================== RCS file: /cvsroot/r300/r300_demo/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile 14 Sep 2004 15:30:49 -0000 1.1 +++ Makefile 15 Sep 2004 00:50:01 -0000 1.2 @@ -10,12 +10,15 @@ sync ./r300_demo -r300_demo: r300_demo.c r300_lib.h libdrm/libdrm.o - $(CC) $(LIBS) r300_demo.c -o r300_demo +r300_demo: r300_demo.c r300_lib.h r300_lib.c libdrm/libdrm.o + $(CC) $(LIBS) r300_demo.c r300_lib.c -o r300_demo libdrm/libdrm.o: (cd libdrm ; make) +clean: + + tarball: date > TARBALL_DATE (cd .. ; tar czvf r300_demo/r300_demo.tgz r300_demo/README \ |
|
From: <gat...@li...> - 2004-09-15 00:42:40
|
Update of /cvsroot/r300/r300_demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6066 Added Files: README Log Message: Turns out I forgot README.. --- NEW FILE: README --- This source code may damage your hardware. It is *UNTESTED* and *BROKEN* ! Or, at least, some of it is. R300_DEMO DRM/DRI exercise utility What it does: r300_demo exercises r300_lib.h and paints various graphics that we know how to do at the moment. The code as is should work on Radeon Mobility M10 chips (using a large enough mode, 1280x1024 will do) It will produce the intended picture as well as some screen corruption due to DEPTH buffer being allocated in visible area (for debugging and feedback). Requirements: * this package (obviously) * Radeon DRM driver - patched using one of the patches from http://volodya-project.sf.net/R300.php * Modified ati driver - so that Xserver initializes DRM driver properly. DO NOT RUN ANY GL 3D PROGRAMS (like glxgears) WITH THIS PATCH ! * modify drmtest/drmtest.c to specify correct display_width - I left it at 1920 which is correct for my hardware * You need to be root to run glxtest If you have R300/RV350 graphics card different from Radeon Mobility M10 this code might not work for you and may cause a hard lockup. |
|
From: <gat...@li...> - 2004-09-07 00:23:02
|
Update of /cvsroot/gatos/ati.4.4.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24173 Modified Files: fi1236.c Log Message: Fix missing comma. Update NUM_TUNERS count. Index: fi1236.c =================================================================== RCS file: /cvsroot/gatos/ati.4.4.0/fi1236.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- fi1236.c 27 Jul 2004 04:07:21 -0000 1.3 +++ fi1236.c 7 Sep 2004 00:22:52 -0000 1.4 @@ -3,7 +3,7 @@ #include "fi1236.h" #include "i2c_def.h" -#define NUM_TUNERS 6 +#define NUM_TUNERS 7 const FI1236_parameters tuner_parms[NUM_TUNERS] = { |
|
From: <gat...@li...> - 2004-09-07 00:22:27
|
Update of /cvsroot/gatos/ati.2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24055 Modified Files: fi1236.c Log Message: Fix missing comma. Update NUM_TUNERS count. Index: fi1236.c =================================================================== RCS file: /cvsroot/gatos/ati.2/fi1236.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- fi1236.c 14 Jul 2004 05:24:34 -0000 1.26 +++ fi1236.c 7 Sep 2004 00:22:18 -0000 1.27 @@ -3,7 +3,7 @@ #include "fi1236.h" #include "i2c_def.h" -#define NUM_TUNERS 6 +#define NUM_TUNERS 7 const FI1236_parameters tuner_parms[NUM_TUNERS] = { @@ -21,9 +21,9 @@ /* 4 - FI1246 */ { 623 ,16*45.75 ,16*855.25 ,16*170 ,16*450 ,0xA0 ,0x90, 0x30, 0x8e }, /* 5 - FI1256 */ - { 623 ,16*49.75 ,16*863.25 ,16*170 ,16*450 ,0xA0 ,0x90, 0x30, 0x8e } + { 623 ,16*49.75 ,16*863.25 ,16*170 ,16*450 ,0xA0 ,0x90, 0x30, 0x8e }, /* 6 - FI1236W */ - { 733 ,884 ,12820 ,2516 ,7220 ,0x1 ,0x2, 0x4, 0x8e }, + { 733 ,884 ,12820 ,2516 ,7220 ,0x1 ,0x2, 0x4, 0x8e } }; |
|
From: <gat...@li...> - 2004-08-26 00:26:15
|
Update of /cvsroot/gatos/avview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6373 Added Files: lirc.c lirc.h lirc.scp Log Message: Merge LIRC patch from Antti Ajanki. --- NEW FILE: lirc.scp --- #!avview_shell global lirc_bindings set lirc_bindings { "toggle_fullscreen" "fullscreen" "next_fav_channel" "next_channel" "toggle_mute" "mute" "exit_avview" "exit" "switch_to_control XV_VOLUME; change_control" "volume" "next_control" "next_control" "change_control" "change_control" "next_encoding 1" "next_encoding" "remote_power_off" "remote_power_off" "switch_to_channel" "channel" } proc handle_lirc_command { lircstring } { global lirc_bindings # There can be multiple lines in one lircstring. Split the string # and handle every line separately. foreach line [split $lircstring \n] { # Extract space-separated tokens from line. The first token is # commandname and will be compared against commandnames in # lirc_bindings list. Remaining tokens will be passed as # parameters to corresponding tcl-procedure. set tokens [split $line] foreach {action commandstring} $lirc_bindings { if {[lindex $tokens 0] == $commandstring} { set err [catch {eval $action [lrange $tokens 1 end]} errmsg] if {$err!=0} { puts stderr "Error in LIRC command: $errmsg" } break } } } } --- NEW FILE: lirc.h --- /* lirc support for avview (C) Antti Ajanki 2004 GNU Public License */ #ifndef __LIRC_H__ #define __LIRC_H__ #include <tcl.h> ClientData init_lirc(Tcl_Interp * interp); void deinit_lirc(ClientData data); #endif --- NEW FILE: lirc.c --- /* lirc support for avview (C) Antti Ajanki 2004 GNU Public License */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <stdio.h> #include <stdlib.h> #include <tcl.h> #include <tk.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef USE_LIRC #include <lirc/lirc_client.h> #include <fcntl.h> struct lircdata { struct lirc_config *config; Tcl_Interp *interp; }; void lirc_event_handler(ClientData clientData, int mask) { int ret; char *code; char *c; char *buffer; int len; struct lircdata *data=(struct lircdata *)clientData; // If we have no config file loaded, just read the strings from // socket but don't act upon them. if (data->config == NULL) { while(lirc_nextcode(&code)==0 && code!=NULL) { free(code); } return; } // There can be multiple string in the socket waiting to be read. while((ret=lirc_nextcode(&code))==0 && code!=NULL) { // Translate code to action string and pass the string to TCL // procedure. ret=lirc_code2char(data->config,code,&c); if(ret==0 && c!=NULL) { len=strlen(c)+23; buffer=malloc(len); strcpy(buffer, "handle_lirc_command \""); strcpy(buffer+21, c); strcpy(buffer+len-2, "\""); Tcl_EvalEx(data->interp, buffer, len-1, TCL_EVAL_GLOBAL); free(buffer); } free(code); if(ret == -1) break; } } char *lirc_conffiles_changed(ClientData clientData, Tcl_Interp *interp, char *name1, char *name2, int flags) { Tcl_Obj *configfilelist; Tcl_Obj **filenames; int num, i; char *filename; struct lircdata *data = (struct lircdata *)clientData; Tcl_DString *dstring; if (clientData == NULL ) return NULL; // The value of the variable is list of file names. configfilelist=Tcl_GetVar2Ex(interp, "lirc_config_files", NULL, TCL_GLOBAL_ONLY); if (configfilelist != NULL) { // First free old config data. lirc_freeconfig(data->config); data->config=NULL; // Try to load every file and print error message it loading // fails. if (Tcl_ListObjGetElements(interp, configfilelist, &num, &filenames) !=TCL_OK) { return NULL; } for(i=0; i<num; i++) { filename = Tcl_GetString(filenames[i]); printf("Loading LIRC config file %s.\n", filename); // Perform tilde substitution with Tcl_TranslateFileName. It // needs a Tcl_DString to return the name. dstring=(Tcl_DString *)Tcl_Alloc(sizeof(Tcl_DString)); if(Tcl_TranslateFileName(interp, filename, dstring) != NULL) { filename = Tcl_DStringValue(dstring); if(lirc_readconfig(filename,&(data->config),NULL)==-1) fprintf(stderr, "Error reading LIRC config file %s\n", filename); Tcl_DStringFree(dstring); } Tcl_Free((char *)dstring); } } return NULL; } ClientData init_lirc(Tcl_Interp *interp) { int flags; int lirc_socket; struct lirc_config *config; struct lircdata *data; printf("Initializing LIRC.\n"); lirc_socket=lirc_init("avview",1); if(lirc_socket == -1) { fprintf(stderr, "Can't initialize LIRC: error opening socket.\n"); return NULL; } if(lirc_readconfig(NULL,&config,NULL)==-1) { fprintf(stderr, "Can't read default LIRC config file ~/.lircrc.\n"); config=NULL; } // Make socket non-blocking. fcntl(lirc_socket,F_SETOWN,getpid()); flags=fcntl(lirc_socket,F_GETFL,0); if(flags == -1) { fprintf(stderr, "Can't initialize LIRC:" "error occured while setting-up the socket.\n"); lirc_deinit(); return NULL; } fcntl(lirc_socket,F_SETFL,flags|O_NONBLOCK); data=malloc(sizeof(struct lircdata)); data->interp=interp; data->config=config; // Trace this variable, so that we can load new config file when its // name is written to lirc_config_files Tcl_TraceVar(interp, "lirc_config_files", TCL_TRACE_WRITES, (Tcl_VarTraceProc *)lirc_conffiles_changed, data); // Register the event handler, which reads the socket and executes // the LIRC commands. Tcl_CreateFileHandler(lirc_socket, TCL_READABLE, lirc_event_handler, data); return data; } void deinit_lirc(ClientData clientData) { struct lircdata *data=clientData; // If data == NULL, the initialization failed and there is nothing // to deinitialize. if(data == NULL) return; lirc_freeconfig(data->config); lirc_deinit(); free(data); } #else /* USE_LIRC */ ClientData init_lirc(Tcl_Interp *interp) { return NULL; } void deinit_lirc(ClientData clientData) { } #endif /* USE_LIRC */ |
Update of /cvsroot/gatos/avview In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6040 Modified Files: Makefile.am aclocal.m4 avview.scp compile configure.in depcomp install-sh main.c missing Log Message: Merge patch from Antti Ajanki: LIRC support for AVview. Index: aclocal.m4 =================================================================== RCS file: /cvsroot/gatos/avview/aclocal.m4,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- aclocal.m4 14 Dec 2003 21:55:45 -0000 1.5 +++ aclocal.m4 26 Aug 2004 00:24:33 -0000 1.6 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.7.8 -*- Autoconf -*- +# generated automatically by aclocal 1.9.1 -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 # Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -11,132 +11,9 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. [...1166 lines suppressed...] + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar <conftest.tar]) + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR Index: depcomp =================================================================== RCS file: /cvsroot/gatos/avview/depcomp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- depcomp 3 Oct 2003 13:04:30 -0000 1.2 +++ depcomp 26 Aug 2004 00:24:33 -0000 1.3 @@ -1,7 +1,9 @@ #! /bin/sh - # depcomp - compile a program generating dependencies as side-effects -# Copyright 1999, 2000, 2003 Free Software Foundation, Inc. + +scriptversion=2004-04-25.13 + +# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. # 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 @@ -25,6 +27,36 @@ # Originally written by Alexandre Oliva <ol...@dc...>. +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to <bug...@gn...>. +EOF + exit 0 + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit 0 + ;; +esac + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -262,26 +294,32 @@ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then + # Dependencies are output in .lo.d with libtool 1.4. + # They are output in .o.d with libtool 1.5. tmpdepfile1="$dir.libs/$base.lo.d" - tmpdepfile2="$dir.libs/$base.d" + tmpdepfile2="$dir.libs/$base.o.d" + tmpdepfile3="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" + tmpdepfile3="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else - rm -f "$tmpdepfile1" "$tmpdepfile2" + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" - else + elif test -f "$tmpdepfile2"; then tmpdepfile="$tmpdepfile2" + else + tmpdepfile="$tmpdepfile3" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" @@ -477,3 +515,12 @@ esac exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: Index: Makefile.am =================================================================== RCS file: /cvsroot/gatos/avview/Makefile.am,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- Makefile.am 20 Dec 2003 18:34:59 -0000 1.20 +++ Makefile.am 26 Aug 2004 00:24:33 -0000 1.21 @@ -10,7 +10,7 @@ avview_shell_SOURCES = xv.c frequencies.c xmisc.c string_cache.c v4l.c formats.c ffmpeg.c \ alsa.c packet_stream.c linux.c main.c alsa.h config.h ffmpeg.h formats.h \ frequencies.h global.h linux.h packet_stream.h string_cache.h v4l.h \ - xmisc.h xv.h vbi.c vbi.h + xmisc.h xv.h vbi.c vbi.h lirc.c lirc.h avview_shell_LDFLAGS = @TCL_LIB_SPEC@ @TK_LIB_SPEC@ @TK_XLIBSW@ scpdir = @datadir@/AVview @@ -20,10 +20,10 @@ nodist_scp_DATA = start_avview.desktop dist_scp_DATA = alsa.scp bindings.scp ffmpeg.scp themes.scp video_device.scp \ - alsa_mixer.scp channel_scan.scp km.scp tree.scp xv.scp vbi.scp \ - avview.scp diag.scp setup.scp v4l.scp xmisc.scp avview.modmap \ - avview-16x16.ppm avview-control-16x16.ppm avview-48x48.png start_avview.desktop.in \ - README INSTALL + alsa_mixer.scp channel_scan.scp km.scp tree.scp xv.scp vbi.scp \ + avview.scp diag.scp setup.scp v4l.scp xmisc.scp lirc.scp \ + avview.modmap avview-16x16.ppm avview-control-16x16.ppm \ + avview-48x48.png start_avview.desktop.in README INSTALL # # Whoever said that the suffix is .c ? Index: main.c =================================================================== RCS file: /cvsroot/gatos/avview/main.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- main.c 3 Jan 2004 18:21:19 -0000 1.18 +++ main.c 26 Aug 2004 00:24:33 -0000 1.19 @@ -27,6 +27,7 @@ #include "linux.h" #include "alsa.h" #include "vbi.h" +#include "lirc.h" #include <pthread.h> pthread_mutex_t memory_mutex; @@ -79,6 +80,7 @@ int Tcl_AppInit(Tcl_Interp * interp) { int status=TCL_OK; +ClientData data; status=Tcl_Init(interp); if(status!=TCL_OK)return TCL_ERROR; @@ -93,6 +95,8 @@ init_alsa(interp); init_linux(interp); init_vbi(interp); +data=init_lirc(interp); +Tcl_CreateExitHandler(deinit_lirc, data); return TCL_OK; } Index: configure.in =================================================================== RCS file: /cvsroot/gatos/avview/configure.in,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- configure.in 5 Jan 2004 21:03:47 -0000 1.59 +++ configure.in 26 Aug 2004 00:24:33 -0000 1.60 @@ -4,7 +4,7 @@ # Note to self: always bump version number when there are changes # in setup window or avview_shell # -AC_INIT([AVview], [0.80.3], [gat...@li...]) +AC_INIT([AVview], [0.80.5], [gat...@li...]) # # For now I'll be happier without NEWS and Changelog files. # @@ -38,6 +38,7 @@ AC_ARG_WITH(ffmpeg, [ --with-ffmpeg=path Path to compiled ffmpeg source tree]) AC_ARG_ENABLE(alsa, [ --disable-alsa Do not use ALSA sound library]) +AC_ARG_ENABLE(lirc, [ --disable-lirc Disable LIRC support]) AC_CHECK_LIB([dl], [dlopen]) AC_CHECK_LIB([z], [uncompress]) @@ -45,6 +46,7 @@ AC_CHECK_LIB([pthread], [pthread_create]) AC_CHECK_LIB([zvbi], [vbi_capture_v4l_new]) AC_CHECK_LIB([asound], [snd_card_get_name]) +AC_CHECK_LIB([lirc_client], [lirc_init]) echo "The libraries mp3lame, ogg, vorbis and vorbisenc might be required by ffmpeg" AC_CHECK_LIB([mp3lame], [lame_encode_buffer]) @@ -87,6 +89,21 @@ fi +LIRC_PRESENT=no + +if ! test "$enable_lirc" = "no" ; then + + if test "$ac_cv_lib_lirc_client_lirc_init" = "yes" ; then + AC_DEFINE(USE_LIRC, 1, [use lirc libraries]) + LIRC_PRESENT=yes + fi + +else + + LIRC_PRESENT=disabled + +fi + AC_CHECK_HEADER(linux/videodev.h, ,echo "Avview requires video4linux support. You may want to upgrade to Linux 2.4.x."; exit) AC_CHECK_HEADER(libzvbi.h, , echo "Avview requires libzvbi 0.2.3 or later" ; exit ) Index: avview.scp =================================================================== RCS file: /cvsroot/gatos/avview/avview.scp,v retrieving revision 1.151 retrieving revision 1.152 diff -u -d -r1.151 -r1.152 --- avview.scp 14 Jan 2004 00:05:59 -0000 1.151 +++ avview.scp 26 Aug 2004 00:24:33 -0000 1.152 @@ -22,8 +22,8 @@ display --screen-size=WxH start TV window with size WxH --geometry=geometry specify TV window geometry, using - usual X11 notation - + usual X11 notation + --lircconf=files LIRC config file name } } @@ -87,6 +87,16 @@ regexp -- {--geometry=(.+)} $option {} geometry append startup_script "wm geometry . \"$geometry\"\n" } + "--lircconf=*" { + global lirc_config_files + regexp -- {--lircconf=(.+)} $option {} files + set lirc_config_files [split $files ,] + } + "--lircconf=*" { + global lirc_config_files + regexp -- {--lircconf=(.+)} $option {} files + set lirc_config_files [split $files ,] + } } } @@ -106,12 +116,12 @@ foreach file {xmisc.scp tree.scp setup.scp themes.scp alsa.scp v4l.scp xv.scp channel_scan.scp ffmpeg.scp - video_device.scp diag.scp bindings.scp vbi.scp km.scp} { + video_device.scp diag.scp bindings.scp vbi.scp km.scp + lirc.scp} { source $avview_directory/$file } - global VIDEO_WINDOW set VIDEO_WINDOW .video @@ -130,6 +140,7 @@ bind . <Unmap> unmap_video_window bind . <Map> map_video_window + proc place_video_window {} { global aspect_ratio use_physical_screen_size set h [winfo height .] Index: missing =================================================================== RCS file: /cvsroot/gatos/avview/missing,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- missing 3 Oct 2003 13:04:30 -0000 1.2 +++ missing 26 Aug 2004 00:24:33 -0000 1.3 @@ -1,6 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. + +scriptversion=2003-09-02.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 +# Free Software Foundation, Inc. # Originally by Fran,cois Pinard <pi...@ir...>, 1996. # This program is free software; you can redistribute it and/or modify @@ -38,12 +42,23 @@ configure_ac=configure.in fi +msg="missing on your system" + case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi ;; esac @@ -74,11 +89,13 @@ lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags - yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to <bug...@gn...>." ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing 0.4 - GNU automake" + echo "missing $scriptversion (GNU Automake)" ;; -*) @@ -94,7 +111,7 @@ fi echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." @@ -108,7 +125,7 @@ fi echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." @@ -122,7 +139,7 @@ fi echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." @@ -146,7 +163,7 @@ fi echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." @@ -162,8 +179,8 @@ fi echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." @@ -185,7 +202,7 @@ bison|yacc) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." @@ -215,7 +232,7 @@ lex|flex) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." @@ -243,7 +260,7 @@ fi echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." @@ -268,7 +285,7 @@ fi echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, @@ -323,8 +340,8 @@ *) echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case @@ -334,3 +351,10 @@ esac exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: Index: compile =================================================================== RCS file: /cvsroot/gatos/avview/compile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- compile 25 Aug 2002 21:18:41 -0000 1.1 +++ compile 26 Aug 2004 00:24:33 -0000 1.2 @@ -1,8 +1,9 @@ #! /bin/sh - # Wrapper for compilers which do not understand `-c -o'. -# Copyright 1999, 2000 Free Software Foundation, Inc. +scriptversion=2003-11-09.00 + +# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. # Written by Tom Tromey <tr...@cy...>. # # This program is free software; you can redistribute it and/or modify @@ -24,9 +25,36 @@ # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Usage: -# compile PROGRAM [ARGS]... -# `-o FOO.o' is removed from the args passed to the actual compile. +# This file is maintained in Automake, please report +# bugs to <bug...@gn...> or send patches to +# <aut...@gn...>. + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to <bug...@gn...>. +EOF + exit 0 + ;; + -v | --v*) + echo "compile $scriptversion" + exit 0 + ;; +esac + prog=$1 shift @@ -35,39 +63,39 @@ cfile= args= while test $# -gt 0; do - case "$1" in + case "$1" in -o) - # configure might choose to run compile as `compile cc -o foo foo.c'. - # So we do something ugly here. - ofile=$2 - shift - case "$ofile" in + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we do something ugly here. + ofile=$2 + shift + case "$ofile" in *.o | *.obj) - ;; + ;; *) - args="$args -o $ofile" - ofile= - ;; - esac + args="$args -o $ofile" + ofile= + ;; + esac ;; *.c) - cfile=$1 - args="$args $1" - ;; + cfile=$1 + args="$args $1" + ;; *) - args="$args $1" - ;; - esac - shift + args="$args $1" + ;; + esac + shift done if test -z "$ofile" || test -z "$cfile"; then - # If no `-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # `.c' file was seen then we are probably linking. That is also - # ok. - exec "$prog" $args + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$prog" $args fi # Name of file we expect compiler to create. @@ -79,10 +107,10 @@ # object file name, since that is what matters with a parallel build. lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d while true; do - if mkdir $lockdir > /dev/null 2>&1; then - break - fi - sleep 1 + if mkdir $lockdir > /dev/null 2>&1; then + break + fi + sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir $lockdir; exit 1" 1 2 15 @@ -92,8 +120,17 @@ status=$? if test -f "$cofile"; then - mv "$cofile" "$ofile" + mv "$cofile" "$ofile" fi rmdir $lockdir exit $status + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: Index: install-sh =================================================================== RCS file: /cvsroot/gatos/avview/install-sh,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- install-sh 3 Oct 2003 13:04:30 -0000 1.2 +++ install-sh 26 Aug 2004 00:24:33 -0000 1.3 @@ -1,7 +1,8 @@ #!/bin/sh -# # install - install a program, script, or datafile -# + +scriptversion=2004-04-01.17 + # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. @@ -41,13 +42,11 @@ # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. - # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" - # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" @@ -59,236 +58,268 @@ rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" -transformbasename="" -transform_arg="" +transformbasename= +transform_arg= instcmd="$mvprog" chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" +chowncmd= +chgrpcmd= +stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd=$cpprog - shift - continue;; +src= +dst= +dir_arg= - -d) dir_arg=true - shift - continue;; +usage="Usage: $0 [OPTION]... SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 -d DIRECTORIES... - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; +In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default. +In the second, create the directory path DIR. - -o) chowncmd="$chownprog $2" - shift - shift - continue;; +Options: +-b=TRANSFORMBASENAME +-c copy source (using $cpprog) instead of moving (using $mvprog). +-d create directories instead of installing files. +-g GROUP $chgrp installed files to GROUP. +-m MODE $chmod installed files to MODE. +-o USER $chown installed files to USER. +-s strip installed files (using $stripprog). +-t=TRANSFORM +--help display this help and exit. +--version display version info and exit. - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" - -s) stripcmd=$stripprog - shift - continue;; +while test -n "$1"; do + case $1 in + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; + -c) instcmd=$cpprog + shift + continue;; - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; + -d) dir_arg=true + shift + continue;; - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; -if [ x"$src" = x ] -then - echo "$0: no input file specified" >&2 - exit 1 -else - : -fi + --help) echo "$usage"; exit 0;; -if [ x"$dir_arg" != x ]; then - dst=$src - src="" + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; - if [ -d "$dst" ]; then - instcmd=: - chmodcmd="" - else - instcmd=$mkdirprog - fi -else + -o) chowncmd="$chownprog $2" + shift + shift + continue;; -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. + -s) stripcmd=$stripprog + shift + continue;; - if [ -f "$src" ] || [ -d "$src" ] - then - : - else - echo "$0: $src does not exist" >&2 - exit 1 - fi + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; - if [ x"$dst" = x ] - then - echo "$0: no destination specified" >&2 - exit 1 - else - : - fi + --version) echo "$0 $scriptversion"; exit 0;; -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic + *) # When -d is used, all remaining arguments are directories to create. + test -n "$dir_arg" && break + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done + break;; + esac +done - if [ -d "$dst" ] - then - dst=$dst/`basename "$src"` - else - : - fi +if test -z "$1"; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 fi -## this sed command emulates the dirname command -dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' - ' -IFS="${IFS-$defaultIFS}" - -oIFS=$IFS -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS=$oIFS - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp=$pathcomp$1 - shift - - if [ ! -d "$pathcomp" ] ; - then - $mkdirprog "$pathcomp" - else - : - fi +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac - pathcomp=$pathcomp/ -done -fi + if test -n "$dir_arg"; then + dst=$src + src= -if [ x"$dir_arg" != x ] -then - $doit $instcmd "$dst" && + if test -d "$dst"; then + instcmd=: + chmodcmd= + else + instcmd=$mkdirprog + fi + else + # Waiting for this to be detected by the "$instcmd $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi - if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi -else + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi -# If we're going to rename the final executable, determine the name now. + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac - if [ x"$transformarg" = x ] - then - dstfile=`basename "$dst"` - else - dstfile=`basename "$dst" $transformbasename | - sed $transformarg`$transformbasename - fi + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + dst=$dst/`basename "$src"` + fi + fi -# don't allow the sed command to completely eliminate the filename + # This sed command emulates the dirname command. + dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - if [ x"$dstfile" = x ] - then - dstfile=`basename "$dst"` - else - : - fi + # Make sure that the destination directory exists. -# Make a couple of temp file names in the proper directory. + # Skip lots of stat calls in the usual case. + if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + IFS=$oIFS -# Trap to clean up temp files at exit. + pathcomp= - trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 - trap '(exit $?); exit' 1 2 13 15 + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" || lasterr=$? + # mkdir can fail with a `File exist' error in case several + # install-sh are creating the directory concurrently. This + # is OK. + test ! -d "$pathcomp" && { (exit ${lasterr-1}); exit; } + fi + pathcomp=$pathcomp/ + done + fi -# Move or copy the file name to the temp name + if test -n "$dir_arg"; then + $doit $instcmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } - $doit $instcmd "$src" "$dsttmp" && + else + # If we're going to rename the final executable, determine the name now. + if test -z "$transformarg"; then + dstfile=`basename "$dst"` + else + dstfile=`basename "$dst" $transformbasename \ + | sed $transformarg`$transformbasename + fi -# and set any options; do chmod last to preserve setuid bits + # don't allow the sed command to completely eliminate the filename. + test -z "$dstfile" && dstfile=`basename "$dst"` -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ - if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && + # Trap to clean up those temp files at exit. + trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 + trap '(exit $?); exit' 1 2 13 15 -# Now remove or move aside any old file at destination location. We try this -# two ways since rm can't unlink itself on some systems and the destination -# file might be busy for other reasons. In this case, the final cleanup -# might fail but the new file should still install successfully. + # Move or copy the file name to the temp name + $doit $instcmd "$src" "$dsttmp" && -{ - if [ -f "$dstdir/$dstfile" ] - then - $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || - $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || - { - echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 - (exit 1); exit - } - else - : - fi -} && + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $instcmd $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && -# Now rename the file to the real destination. + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. - $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + || { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit + } + else + : + fi + } && -fi && + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + } + } + fi || { (exit 1); exit; } +done # The final little trick to "correctly" pass the exit status to the exit trap. - { - (exit 0); exit + (exit 0); exit } + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: |
|
From: <gat...@li...> - 2004-08-26 00:03:29
|
Update of /cvsroot/gatos/ati.4.4.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1104 Modified Files: r128_accel.c r128_driver.c r128_video.c Log Message: Commit patch from Stanislav Brabec - restore Rage128 TV-in functionality. Index: r128_video.c =================================================================== RCS file: /cvsroot/gatos/ati.4.4.0/r128_video.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- r128_video.c 20 May 2004 01:37:59 -0000 1.2 +++ r128_video.c 26 Aug 2004 00:03:08 -0000 1.3 @@ -2830,18 +2830,14 @@ | R128_CAP0_CONFIG_HORZ_DECIMATOR \ | R128_CAP0_CONFIG_VIDEO_IN_VYUY422) -#if 0 /* XXX */ static int -R128PutImage( - ScrnInfoPtr pScrn, - short src_x, short src_y, - short drw_x, short drw_y, - short src_w, short src_h, - short drw_w, short drw_h, - int id, unsigned char* buf, - short width, short height, - Bool Sync, - RegionPtr clipBoxes, pointer data +R128PutVideo( + ScrnInfoPtr pScrn, + short src_x, short src_y, + short drw_x, short drw_y, + short src_w, short src_h, + short drw_w, short drw_h, + RegionPtr clipBoxes, pointer data ){ R128InfoPtr info = R128PTR(pScrn); R128PortPrivPtr pPriv = (R128PortPrivPtr)data; @@ -3002,7 +2998,7 @@ } /* update cliplist */ if(!RegionsEqual(&pPriv->clip, clipBoxes)) { - REGION_COPY(pScreen, &pPriv->clip, clipBoxes); + REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes); /* draw these */ if(pPriv->autopaint_colorkey)(*info->accel->FillSolidRects)(pScrn, pPriv->colorKey, GXcopy, ~0, REGION_NUM_RECTS(clipBoxes), @@ -3034,7 +3030,6 @@ return Success; } -#endif static void R128VideoTimerCallback(ScrnInfoPtr pScrn, Time now) Index: r128_accel.c =================================================================== RCS file: /cvsroot/gatos/ati.4.4.0/r128_accel.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- r128_accel.c 8 Jul 2004 16:30:06 -0000 1.3 +++ r128_accel.c 26 Aug 2004 00:03:08 -0000 1.4 @@ -248,7 +248,10 @@ "%s: CCE idle %d\n", __FUNCTION__, ret); } - if (ret == 0) return; + if (ret == 0){ + R128WaitForIdle(pScrn); + return; + } xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Idle timed out, resetting engine...\n"); @@ -1085,6 +1088,22 @@ #ifdef XF86DRI +static void R128CCEBubblePacket(ScrnInfoPtr pScrn, + int order) +{ + R128InfoPtr info = R128PTR(pScrn); + int i; + RING_LOCALS; + + BEGIN_RING(order); + + for(i=2;i<=order;i++) + OUT_RING(CCE_PACKET3(R128_CCE_PACKET3_NOP, order-i)); + OUT_RING(0); + + ADVANCE_RING(); +} + /* Setup for XAA SolidFill. */ static void R128CCESetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, Index: r128_driver.c =================================================================== RCS file: /cvsroot/gatos/ati.4.4.0/r128_driver.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- r128_driver.c 20 May 2004 01:37:59 -0000 1.2 +++ r128_driver.c 26 Aug 2004 00:03:08 -0000 1.3 @@ -70,7 +70,20 @@ #include "r128_sarea.h" #endif +#define USE_FB /* not until overlays */ +#ifdef USE_FB #include "fb.h" +#else + + /* CFB support */ +#define PSZ 8 +#include "cfb.h" +#undef PSZ +#include "cfb16.h" +#include "cfb24.h" +#include "cfb32.h" +#include "cfb24_32.h" +#endif /* colormap initialization */ #include "micmap.h" @@ -244,11 +257,22 @@ NULL }; +#ifdef USE_FB static const char *fbSymbols[] = { "fbPictureInit", "fbScreenInit", NULL }; +#else +static const char *cfbSymbols[] = { + "cfbScreenInit", + "cfb16ScreenInit", + "cfb24ScreenInit", + "cfb32ScreenInit", + "cfb24_32ScreenInit", + NULL +}; +#endif static const char *xaaSymbols[] = { "XAACreateInfoRec", @@ -343,7 +367,11 @@ * refer to. */ xf86LoaderRefSymLists(vgahwSymbols, +#ifdef USE_FB fbSymbols, +#else + cfbSymbols, +#endif xaaSymbols, ramdacSymbols, #ifdef XF86DRI @@ -745,7 +773,7 @@ { R128InfoPtr info = R128PTR(pScrn); - if (!xf86SetDepthBpp(pScrn, 0, 0, 0, (Support24bppFb + if (!xf86SetDepthBpp(pScrn, 8, 8, 8, (Support24bppFb | Support32bppFb | SupportConvert32to24 ))) @@ -1586,6 +1614,10 @@ R128InfoPtr info = R128PTR(pScrn); ClockRangePtr clockRanges; int modesFound; + char *mod = NULL; +#ifndef USE_FB + const char *Sym = NULL; +#endif if(info->isDFP) { R128MapMem(pScrn); @@ -1676,8 +1708,28 @@ xf86SetDpi(pScrn, 0, 0); /* Get ScreenInit function */ - if (!xf86LoadSubModule(pScrn, "fb")) return FALSE; +#ifdef USE_FB + mod = "fb"; +#else + switch (pScrn->bitsPerPixel) { + case 8: mod = "cfb"; Sym = "cfbScreenInit"; break; + case 16: mod = "cfb16"; Sym = "cfb16ScreenInit"; break; + case 24: + if (info->pix24bpp == 24) { + mod = "cfb24"; Sym = "cfb24ScreenInit"; + } else { + mod = "xf24_32bpp"; Sym = "cfb24_32ScreenInit"; + } + break; + case 32: mod = "cfb32"; Sym = "cfb32ScreenInit"; break; + } +#endif + if (mod && !xf86LoadSubModule(pScrn, mod)) return FALSE; +#ifdef USE_FB xf86LoaderReqSymLists(fbSymbols, NULL); +#else + xf86LoaderReqSymbols(Sym, NULL); +#endif info->CurrentLayout.displayWidth = pScrn->displayWidth; info->CurrentLayout.mode = pScrn->currentMode; @@ -2033,11 +2085,11 @@ if (!R128PreInitDRI(pScrn)) goto fail; #endif - /* Free the video bios (if applicable) */ - if (info->VBIOS) { + /* we will need it later */ /* Free the video bios (if applicable) */ +/* if (info->VBIOS) { xfree(info->VBIOS); info->VBIOS = NULL; - } + } */ /* Free int10 info */ if (pInt10) @@ -2214,12 +2266,53 @@ } #endif +#ifdef USE_FB if (!fbScreenInit (pScreen, info->FB, pScrn->virtualX, pScrn->virtualY, pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth, pScrn->bitsPerPixel)) return FALSE; - +#else + switch (pScrn->bitsPerPixel) { + case 8: + if (!cfbScreenInit(pScreen, info->FB, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth)) + return FALSE; + break; + case 16: + if (!cfb16ScreenInit(pScreen, info->FB, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth)) + return FALSE; + break; + case 24: + if (info->pix24bpp == 24) { + if (!cfb24ScreenInit(pScreen, info->FB, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth)) + return FALSE; + } else { + if (!cfb24_32ScreenInit(pScreen, info->FB, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, + pScrn->displayWidth)) + return FALSE; + } + break; + case 32: + if (!cfb32ScreenInit(pScreen, info->FB, + pScrn->virtualX, pScrn->virtualY, + pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth)) + return FALSE; + break; + default: + xf86DrvMsg(scrnIndex, X_ERROR, + "Invalid bpp (%d)\n", pScrn->bitsPerPixel); + return FALSE; + } +#endif xf86SetBlackWhitePixels(pScreen); if (pScrn->bitsPerPixel > 8) { @@ -2238,9 +2331,10 @@ } } +#ifdef USE_FB /* must be after RGB order fixed */ fbPictureInit (pScreen, 0, 0); - +#endif /* Memory manager setup */ #ifdef XF86DRI if (info->directRenderingEnabled) { @@ -2961,6 +3055,7 @@ int hsync_wid; int hsync_fudge; int vsync_wid; + int bytpp; int hsync_fudge_default[] = { 0x00, 0x12, 0x09, 0x09, 0x06, 0x05 }; int hsync_fudge_fp[] = { 0x12, 0x11, 0x09, 0x09, 0x05, 0x05 }; int hsync_fudge_fp_crt[] = { 0x12, 0x10, 0x08, 0x08, 0x04, 0x04 }; @@ -3644,11 +3739,14 @@ if (info->DGAModes) xfree(info->DGAModes); info->DGAModes = NULL; +#if 0 if (info->adaptor) { + R128ShutdownVideo(pScrn, info->adaptor->pPortPrivates[0].ptr); xfree(info->adaptor->pPortPrivates[0].ptr); xf86XVFreeVideoAdaptorRec(info->adaptor); info->adaptor = NULL; } +#endif pScrn->vtSema = FALSE; |
|
From: <gat...@li...> - 2004-07-27 04:07:29
|
Update of /cvsroot/gatos/ati.4.4.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2651 Modified Files: fi1236.c Log Message: Fix editing error. Index: fi1236.c =================================================================== RCS file: /cvsroot/gatos/ati.4.4.0/fi1236.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- fi1236.c 14 Jul 2004 05:38:24 -0000 1.2 +++ fi1236.c 27 Jul 2004 04:07:21 -0000 1.3 @@ -21,9 +21,9 @@ /* 4 - FI1246 */ { 623 ,16*45.75 ,16*855.25 ,16*170 ,16*450 ,0xA0 ,0x90, 0x30, 0x8e }, /* 5 - FI1256 */ - { 623 ,16*49.75 ,16*863.25 ,16*170 ,16*450 ,0xA0 ,0x90, 0x30, 0x8e } + { 623 ,16*49.75 ,16*863.25 ,16*170 ,16*450 ,0xA0 ,0x90, 0x30, 0x8e }, /* 6 - FI1236W */ - { 733 ,884 ,12820 ,2516 ,7220 ,0x1 ,0x2, 0x4, 0x8e }, + { 733 ,884 ,12820 ,2516 ,7220 ,0x1 ,0x2, 0x4, 0x8e } }; |
|
From: <gat...@li...> - 2004-07-21 01:08:10
|
Update of /cvsroot/gatos/km In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14913 Modified Files: km.h Log Message: Proper sysfs support: The video device has to be included as a pointer so that its destruction can be delayed until after all references have been released Index: km.h =================================================================== RCS file: /cvsroot/gatos/km/km.h,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- km.h 29 Feb 2004 01:13:34 -0000 1.52 +++ km.h 21 Jul 2004 01:07:53 -0000 1.53 @@ -15,7 +15,7 @@ #include "km_api.h" #include "km_api_data.h" -#define KM_VERSION "alpha-3.0" +#define KM_VERSION "alpha-4.0" /* already in >= 2.4.22 */ #ifndef LINUX_2_6 @@ -88,8 +88,8 @@ } KM_TRANSFER_QUEUE; typedef struct S_KM_STRUCT { - struct video_device vd; - struct video_device vbi_vd; + struct video_device *vd; + struct video_device *vbi_vd; struct video_window vwin; spinlock_t kms_lock; long irq; |
|
From: <gat...@li...> - 2004-07-21 01:05:59
|
Update of /cvsroot/gatos/km In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14485 Modified Files: km.c Log Message: Proper sysfs support Cleaner compilation Index: km.c =================================================================== RCS file: /cvsroot/gatos/km/km.c,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- km.c 29 Jun 2004 03:37:14 -0000 1.95 +++ km.c 21 Jul 2004 01:05:35 -0000 1.96 @@ -55,6 +55,8 @@ MODULE_PARM_DESC(km_debug_overruns, "kmultimedia debug overruns"); MODULE_PARM_DESC(km_buffers, "how many buffers to use for video capture per each device"); +#define POINTER_TO_INT( x ) ((unsigned long)(x)) + int km_debug=0; int km_debug_overruns=0; int km_buffers=5; @@ -67,7 +69,7 @@ while(kmsbi[next].flag & KM_STREAM_BUF_PINNED)next=kmsbi[next].next; stream->next_buf=kmsbi[next].next; if((next>stream->num_buffers) || (next<0)){ - printk("km: Invalid next buffer %d, forcing to 0\n", next); + printk(KERN_DEBUG "km: Invalid next buffer %d, forcing to 0\n", next); next=0; } return next; @@ -77,7 +79,7 @@ { int i,k; if(size>(4096*4096/sizeof(bm_list_descriptor))){ - printk("Too large buffer allocation requested: %ld bytes\n", size); + printk(KERN_ERR "km.c: Too large buffer allocation requested: %ld bytes\n", size); return -1; } spin_lock_init(&(stream->lock)); @@ -125,13 +127,13 @@ stream->dvb.kmsbi[k].prev=k-1; stream->dvb.kmsbi[k].age=-1; stream->dma_table[k]=rvmalloc(4096); - stream->dma_table_physical[k]=kvirt_to_bus(stream->dma_table[k]); + stream->dma_table_physical[k]=kvirt_to_bus(POINTER_TO_INT(stream->dma_table[k])); stream->free[k]=size; memset(stream->dma_table[k], 0, 4096); - KM_DEBUG("dma_table[%d]=0x%08x\n", k, stream->dma_table[k]); + KM_DEBUG("dma_table[%d]=%p\n", k, stream->dma_table[k]); /* create DMA table */ for(i=0;i<(stream->dvb.size/PAGE_SIZE);i++){ - stream->dma_table[k][i].to_addr=kvirt_to_bus(stream->buffer[k]+i*PAGE_SIZE); + stream->dma_table[k][i].to_addr=kvirt_to_bus(POINTER_TO_INT(stream->buffer[k]+i*PAGE_SIZE)); KM_DEBUG("dma_table[%d][%d].to_addr=0x%08x\n", k, i,stream->dma_table[k][i].to_addr); } } @@ -146,7 +148,7 @@ int i,k; #define VERIFY_PAGE(addr) ((kms->verify_page==NULL)||kms->verify_page(kms, (addr))) for(k=0;k<stream->num_buffers;k++){ - if(!VERIFY_PAGE(kvirt_to_bus(stream->dma_table[k])))return 0; + if(!VERIFY_PAGE(POINTER_TO_INT(kvirt_to_bus(POINTER_TO_INT(stream->dma_table[k]))))) return 0; for(i=0;i<(stream->dvb.size/PAGE_SIZE);i++){ if(!VERIFY_PAGE(stream->dma_table[k][i].to_addr))return 0; } @@ -180,7 +182,7 @@ KM_TRANSFER_QUEUE *kmtq; kmtq=kmalloc(sizeof(KM_TRANSFER_QUEUE)+size*sizeof(KM_TRANSFER_REQUEST), GFP_KERNEL); if(kmtq==NULL)return NULL; - kmtq->request=((u8 *)kmtq)+sizeof(KM_TRANSFER_QUEUE); + kmtq->request=(KM_TRANSFER_REQUEST *)((u8 *)kmtq)+sizeof(KM_TRANSFER_QUEUE); kmtq->size=size; kmtq->first=0; kmtq->last=0; @@ -310,7 +312,7 @@ goto fail; } if(!kms->is_capture_active(kms)){ - printk("km: no data is available until AVview or xawtv is started\n"); + printk(KERN_ERR "km: no data is available until AVview or xawtv is started\n"); result=-ENODATA; goto fail; } @@ -544,31 +546,38 @@ int video_stream_on(KM_STRUCT *kms) { printk("Video stream on\n"); + return 0; } int video_stream_off(KM_STRUCT *kms) { printk("Video stream off\n"); + return 0; } int vbi_stream_on(KM_STRUCT *kms) { printk("VBI stream on\n"); + return 0; } int vbi_stream_off(KM_STRUCT *kms) { printk("VBI stream off\n"); + return 0; } static int __devinit km_probe(struct pci_dev *dev, const struct pci_device_id *pci_id) { KM_STRUCT *kms; - int result; + char *tag; -/* too many */ + + /* too many */ if(num_devices>=MAX_DEVICES)return -1; + printk(KERN_INFO "km: probing %s\n",dev->pretty_name); + switch(pci_id->driver_data){ case HARDWARE_RADEON: tag="km_ati (Radeon)"; @@ -582,7 +591,7 @@ default: tag="km_ati (unknown)"; } - + kms=&(km_devices[num_devices]); memset(kms, 0, sizeof(KM_STRUCT)); kms->dev=dev; @@ -604,10 +613,10 @@ kms->vbi.du=-1; kms->vbi.info_du=-1; spin_lock_init(&(kms->kms_lock)); - printk("km: using irq %ld\n", kms->irq); + printk(KERN_DEBUG "km: using irq %ld\n", kms->irq); if (pci_enable_device(dev)) return -EIO; - printk("Register aperture is 0x%08lx 0x%08lx\n", pci_resource_start(dev, 2), pci_resource_len(dev, 2)); + printk(KERN_DEBUG "Register aperture is 0x%08lx 0x%08lx\n", pci_resource_start(dev, 2), pci_resource_len(dev, 2)); /* if (!request_mem_region(pci_resource_start(dev,2), pci_resource_len(dev,2), @@ -616,7 +625,7 @@ } */ kms->reg_aperture=ioremap(pci_resource_start(dev, 2), pci_resource_len(dev, 2)); - printk("kms variables: reg_aperture=0x%p\n", + printk(KERN_DEBUG "kms variables: reg_aperture=0x%p\n", kms->reg_aperture); switch(pci_id->driver_data){ #ifndef OMIT_RADEON_DRIVER @@ -679,7 +688,14 @@ return -EIO; } } - init_km_v4l(kms); + if (init_km_v4l(kms)){ + free_irq(kms->irq, kms); + iounmap(kms->reg_aperture); + release_mem_region(pci_resource_start(dev,2), + pci_resource_len(dev,2)); + pci_set_drvdata(dev, NULL); + return -EIO; + } printk("sizeof(kmfl_template)=%d sizeof(KM_FIELD)=%d\n", sizeof(kmfl_template), sizeof(KM_FIELD)); kms->kmfl=kmalloc(sizeof(kmfl_template), GFP_KERNEL); @@ -705,13 +721,13 @@ FIELD("INSTANCE_ID").data.c.string=kmalloc(20, GFP_KERNEL); sprintf(FIELD("INSTANCE_ID").data.c.string, "KM_DEVICE:%d", num_devices); - FIELD("VSYNC_COUNT").data.i.field=&(kms->vsync_count); + FIELD("VSYNC_COUNT").data.i.field=(u32 *)&(kms->vsync_count); - FIELD("VBLANK_COUNT").data.i.field=&(kms->vblank_count); + FIELD("VBLANK_COUNT").data.i.field=(u32 *)&(kms->vblank_count); - FIELD("VLINE_COUNT").data.i.field=&(kms->vline_count); + FIELD("VLINE_COUNT").data.i.field=(u32 *)&(kms->vline_count); - FIELD("V4L_DEVICE").data.i.field=&(kms->vd.minor); + FIELD("V4L_DEVICE").data.i.field=(u32 *)&(kms->vd->minor); FIELD("VIDEO_STREAM_ACTIVE").data.t.zero2one=start_video_capture; FIELD("VIDEO_STREAM_ACTIVE").data.t.one2zero=stop_video_capture; @@ -721,7 +737,7 @@ FIELD("VIDEO_STREAM_INFO_DATA_UNIT").data.i.field=&(kms->capture.info_du); - FIELD("VBI_DEVICE").data.i.field=&(kms->vbi_vd.minor); + FIELD("VBI_DEVICE").data.i.field=&(kms->vbi_vd->minor); FIELD("VBI_STREAM_DATA_UNIT").data.i.field=&(kms->vbi.du); @@ -735,26 +751,32 @@ #ifdef LINUX_2_6 #ifdef CONFIG_PCI_NAMES printk("Device %s %s (0x%04x:0x%04x) corresponds to /dev/video%d\n", - dev->pretty_name, dev->slot_name, dev->vendor, dev->device, kms->vd.minor); + dev->pretty_name, dev->slot_name, dev->vendor, dev->device, kms->vd->minor); #else printk("Device %s (0x%04x:0x%04x) corresponds to /dev/video%d\n", - dev->slot_name, dev->vendor, dev->device, kms->vd.minor); + dev->slot_name, dev->vendor, dev->device, kms->vd->minor); #endif #else printk("Device %s %s (0x%04x:0x%04x) corresponds to /dev/video%d\n", - dev->name, dev->slot_name, dev->vendor, dev->device, kms->vd.minor); + dev->name, dev->slot_name, dev->vendor, dev->device, kms->vd->minor); #endif pci_set_master(dev); - printk("kms variables: reg_aperture=0x%08x\n", - kms->reg_aperture); + printk("kms variables: reg_aperture=%p\n",kms->reg_aperture); num_devices++; return 0; } - -static void __devexit km_remove(struct pci_dev *pci_dev, KM_STRUCT *kms) +static void __devexit km_remove(struct pci_dev *pci_dev) { - printk("Removing Kmultimedia supported device /dev/video%d. Interrupt_count=%ld\n", kms->vd.minor, kms->interrupt_count); + KM_STRUCT *kms = 0; + int i; + for (i=0;i<num_devices;++i) + if (km_devices[i].dev==pci_dev) kms = &(km_devices[i]); + if (!kms){ + printk(KERN_ERR "km_remove: couldn't find km_device corresponding to pci_dev at %p\n",pci_dev); + return; + } + printk("Removing Kmultimedia supported device /dev/video%d. Interrupt_count=%ld\n", kms->vd->minor, kms->interrupt_count); if(kms->uninit_hardware!=NULL)kms->uninit_hardware(kms); remove_km_device(kms->kmd); cleanup_km_v4l(kms); @@ -828,7 +850,10 @@ #define PCI_DEVICE_ID_ATI_RADEON_RD 0x5147 #endif -static struct pci_device_id km_pci_tbl[] __devinitdata = { + +/*-------------------------------------------------------------------------*/ + +static struct pci_device_id km_pci_tbl [] = { /* mach64 cards */ {PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_215GB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, HARDWARE_MACH64}, @@ -1010,59 +1035,43 @@ PCI_ANY_ID, PCI_ANY_ID, 0, 0, HARDWARE_RADEON}, {PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RADEON_QL, PCI_ANY_ID, PCI_ANY_ID, 0, 0, HARDWARE_RADEON}, - {0,} + {PCI_DEVICE( 0x0000, 0x0000 )} }; MODULE_DEVICE_TABLE(pci, km_pci_tbl); -/* - static struct pci_driver radeon_km_pci_driver = { - name: "km", - id_table: km_pci_tbl, - probe: km_probe, - remove: km_remove, - }; -*/ + +static struct pci_driver km_pci_driver = { + .name = "Km", + .id_table = km_pci_tbl, + .probe = km_probe, + .remove = __devexit_p(km_remove) +}; + #ifdef MODULE static int km_init_module(void) { - int result; - struct pci_dev *pdev=0; - const struct pci_device_id *pdid; -/* this does not do anything useful at the moment */ + /* this does not do anything useful at the moment */ request_module("km_api_drv"); request_module("videodev"); - printk("Kmultimedia module version %s loaded\n", KM_VERSION); - printk("Page size is %ld sizeof(bm_list_descriptor)=%d sizeof(KM_STRUCT)=%d\n", PAGE_SIZE, sizeof(bm_list_descriptor), sizeof(KM_STRUCT)); + printk(KERN_INFO "Kmultimedia module version %s loaded\n", KM_VERSION); + printk(KERN_DEBUG "Page size is %ld sizeof(bm_list_descriptor)=%d sizeof(KM_STRUCT)=%d\n", PAGE_SIZE, sizeof(bm_list_descriptor), sizeof(KM_STRUCT)); num_devices=0; - result=-1; -#ifdef LINUX_2_6 - while( (pdev = pci_get_device(PCI_VENDOR_ID_ATI, PCI_ANY_ID, pdev))!=NULL ){ -#else - pci_for_each_dev(pdev){ -#endif - if((pdid=pci_match_device(km_pci_tbl, pdev))!=NULL){ - if(km_probe(pdev, pdid)>=0)result=0; - } - } - if(result<0)printk("km: **** no supported devices found ****\n"); - - return result; - } + pci_module_init( &km_pci_driver ); - void km_cleanup_module(void) - { - int i; - for(i=0;i<num_devices;i++) - km_remove(km_devices[i].dev, &(km_devices[i])); - return; - } + return 0; +} - module_init(km_init_module); - module_exit(km_cleanup_module); +void km_cleanup_module(void) +{ + pci_unregister_driver( &km_pci_driver ); + return; +} +module_init(km_init_module); +module_exit(km_cleanup_module); #endif |
|
From: <gat...@li...> - 2004-07-20 04:17:53
|
Update of /cvsroot/gatos/km In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23306 Modified Files: km_api.c Log Message: formatting changes, whitespace only Index: km_api.c =================================================================== RCS file: /cvsroot/gatos/km/km_api.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- km_api.c 11 Jan 2004 21:10:23 -0000 1.39 +++ km_api.c 20 Jul 2004 04:17:44 -0000 1.40 @@ -1,8 +1,8 @@ /* km preliminary version - (C) Vladimir Dergachev 2001-2003 +(C) Vladimir Dergachev 2001-2003 - GNU Public License +GNU Public License */ @@ -62,41 +62,41 @@ unsigned km_command_hash(const char *s, int length) { -int i; -unsigned r; -r=0; -for(i=0;(i<length)&& s[i] && (s[i]!=' ') && (s[i]!='\n') && (s[i]!='=');i++){ - r=(r*KM_MULTIPLE+s[i]) % KM_MODULUS; + int i; + unsigned r; + r=0; + for(i=0;(i<length)&& s[i] && (s[i]!=' ') && (s[i]!='\n') && (s[i]!='=');i++){ + r=(r*KM_MULTIPLE+s[i]) % KM_MODULUS; } -if((i>=length)&& s[i]){ - printk("%s function %s: length limit reached for string %s\n",__FILE__, __FUNCTION__, s); + if((i>=length)&& s[i]){ + printk("%s function %s: length limit reached for string %s\n",__FILE__, __FUNCTION__, s); } -return r; + return r; } static void expand_buffer(KM_FILE_PRIVATE_DATA *kmfpd, long increment) { -char *b; -kmfpd->br_size+=kmfpd->br_size+increment; -b=kmalloc(kmfpd->br_size, GFP_KERNEL); -if(kmfpd->br_free>0)memcpy(b, kmfpd->buffer_read, kmfpd->br_free); -kfree(kmfpd->buffer_read); -kmfpd->buffer_read=b; + char *b; + kmfpd->br_size+=kmfpd->br_size+increment; + b=kmalloc(kmfpd->br_size, GFP_KERNEL); + if(kmfpd->br_free>0)memcpy(b, kmfpd->buffer_read, kmfpd->br_free); + kfree(kmfpd->buffer_read); + kmfpd->buffer_read=b; } static void perform_status_cmd(KM_DEVICE *kmd, KM_FILE_PRIVATE_DATA *kmfpd) { -long field_length; -KM_FIELD *f; -int i; + long field_length; + KM_FIELD *f; + int i; -if(kmfpd->br_free+10>=kmfpd->br_size)expand_buffer(kmfpd, 10); -kmfpd->br_free+=sprintf(kmfpd->buffer_read+kmfpd->br_free, "+STATUS\n"); + if(kmfpd->br_free+10>=kmfpd->br_size)expand_buffer(kmfpd, 10); + kmfpd->br_free+=sprintf(kmfpd->buffer_read+kmfpd->br_free, "+STATUS\n"); -for(i=0;kmd->fields[i].type!=KM_FIELD_TYPE_EOL;i++){ - f=&(kmd->fields[i]); - switch(f->type){ + for(i=0;kmd->fields[i].type!=KM_FIELD_TYPE_EOL;i++){ + f=&(kmd->fields[i]); + switch(f->type){ case KM_FIELD_TYPE_STATIC: field_length=strlen(f->name)+strlen(f->data.c.string)+2; if(kmfpd->br_free+field_length+10>=kmfpd->br_size)expand_buffer(kmfpd, field_length+10); @@ -122,24 +122,24 @@ break; } } -if(kmfpd->br_free+10>=kmfpd->br_size)expand_buffer(kmfpd, 14); -kmfpd->br_free+=sprintf(kmfpd->buffer_read+kmfpd->br_free, "+END_STATUS\n"); -kmfpd->request_flags &= ~KM_STATUS_REQUESTED; -kmd_signal_state_change(kmd->number); + if(kmfpd->br_free+10>=kmfpd->br_size)expand_buffer(kmfpd, 14); + kmfpd->br_free+=sprintf(kmfpd->buffer_read+kmfpd->br_free, "+END_STATUS\n"); + kmfpd->request_flags &= ~KM_STATUS_REQUESTED; + kmd_signal_state_change(kmd->number); } static void dump_changed_fields(KM_DEVICE *kmd, KM_FILE_PRIVATE_DATA *kmfpd) { -int i; -long field_length; -u32 a; -char *b; -KM_FIELD *f; -for(i=0;kmd->fields[i].type!=KM_FIELD_TYPE_EOL;i++){ - if(!(kmfpd->field_flags[i] & KM_FIELD_UPDATE_REQUESTED))continue; - f=&(kmd->fields[i]); -/* if(!(f->changed))continue; */ - switch(f->type){ + int i; + long field_length; + u32 a; + char *b; + KM_FIELD *f; + for(i=0;kmd->fields[i].type!=KM_FIELD_TYPE_EOL;i++){ + if(!(kmfpd->field_flags[i] & KM_FIELD_UPDATE_REQUESTED))continue; + f=&(kmd->fields[i]); + /* if(!(f->changed))continue; */ + switch(f->type){ case KM_FIELD_TYPE_DYNAMIC_INT: a=*(f->data.i.field); if(a==kmfpd->kfd[i].i.old_value)continue; @@ -176,284 +176,284 @@ int num_km_devices(void) { -return devices_free; + return devices_free; } KM_FILE_PRIVATE_DATA *open_km_device(int number) { -KM_FILE_PRIVATE_DATA *kmfpd=NULL; -KM_DEVICE *kmd=NULL; -int i; + KM_FILE_PRIVATE_DATA *kmfpd=NULL; + KM_DEVICE *kmd=NULL; + int i; -if(number<0)return NULL; -if(number>=devices_free)return NULL; -kmd=(devices[number]); -if((kmd==NULL)||(kmd->fields==NULL))return NULL; + if(number<0)return NULL; + if(number>=devices_free)return NULL; + kmd=(devices[number]); + if((kmd==NULL)||(kmd->fields==NULL))return NULL; #ifndef LINUX_2_6 -MOD_INC_USE_COUNT; + MOD_INC_USE_COUNT; #endif -spin_lock(&(kmd->lock)); -kmfpd=kmalloc(sizeof(KM_FILE_PRIVATE_DATA), GFP_KERNEL); -memset(kmfpd, 0, sizeof(KM_FILE_PRIVATE_DATA)); + spin_lock(&(kmd->lock)); + kmfpd=kmalloc(sizeof(KM_FILE_PRIVATE_DATA), GFP_KERNEL); + memset(kmfpd, 0, sizeof(KM_FILE_PRIVATE_DATA)); -kmfpd->br_size=PAGE_SIZE; -kmfpd->br_free=0; -kmfpd->br_read=0; -kmfpd->buffer_read=kmalloc(kmfpd->br_size, GFP_KERNEL); + kmfpd->br_size=PAGE_SIZE; + kmfpd->br_free=0; + kmfpd->br_read=0; + kmfpd->buffer_read=kmalloc(kmfpd->br_size, GFP_KERNEL); -kmfpd->kmd=kmd; -kmfpd->field_flags=kmalloc(sizeof(*(kmfpd->field_flags))*kmd->num_fields, GFP_KERNEL); -memset(kmfpd->field_flags, 0, sizeof(*(kmfpd->field_flags))*kmd->num_fields); + kmfpd->kmd=kmd; + kmfpd->field_flags=kmalloc(sizeof(*(kmfpd->field_flags))*kmd->num_fields, GFP_KERNEL); + memset(kmfpd->field_flags, 0, sizeof(*(kmfpd->field_flags))*kmd->num_fields); -kmfpd->kfd=kmalloc(sizeof(*(kmfpd->kfd))*kmd->num_fields, GFP_KERNEL); -memset(kmfpd->kfd, 0, sizeof(*(kmfpd->kfd))*kmd->num_fields); + kmfpd->kfd=kmalloc(sizeof(*(kmfpd->kfd))*kmd->num_fields, GFP_KERNEL); + memset(kmfpd->kfd, 0, sizeof(*(kmfpd->kfd))*kmd->num_fields); -/* initialize field values */ -for(i=0;i<kmd->num_fields;i++) - switch(kmd->fields[i].type){ + /* initialize field values */ + for(i=0;i<kmd->num_fields;i++) + switch(kmd->fields[i].type){ case KM_FIELD_TYPE_LEVEL_TRIGGER: kmfpd->kfd[i].t.requested=0; kmfpd->kfd[i].t.old_count=0; break; } -spin_lock_init(&(kmfpd->lock)); + spin_lock_init(&(kmfpd->lock)); -kmd->use_count++; -spin_unlock(&(kmd->lock)); -return kmfpd; + kmd->use_count++; + spin_unlock(&(kmd->lock)); + return kmfpd; } static int km_fo_control_open(struct inode * inode, struct file * file) { -char *filename; -KM_FILE_PRIVATE_DATA *kmfpd=NULL; -int i; -filename=file->f_dentry->d_iname; -if(strncmp(filename, "control", 7)){ - return -EINVAL; + char *filename; + KM_FILE_PRIVATE_DATA *kmfpd=NULL; + int i; + filename=file->f_dentry->d_iname; + if(strncmp(filename, "control", 7)){ + return -EINVAL; } -i=simple_strtol(filename+7, NULL, 10); -kmfpd=open_km_device(i); -if(kmfpd==NULL)return -EINVAL; -file->private_data=kmfpd; -return 0; + i=simple_strtol(filename+7, NULL, 10); + kmfpd=open_km_device(i); + if(kmfpd==NULL)return -EINVAL; + file->private_data=kmfpd; + return 0; } void close_km_device(KM_FILE_PRIVATE_DATA *kmfpd) { -char temp[32]; -KM_DEVICE *kmd=kmfpd->kmd; -int i; + char temp[32]; + KM_DEVICE *kmd=kmfpd->kmd; + int i; -spin_lock(&(kmd->lock)); -/* cleanup first, as some fields need to relinquish their state */ -for(i=0;i<kmd->num_fields;i++){ - switch(kmd->fields[i].type){ + spin_lock(&(kmd->lock)); + /* cleanup first, as some fields need to relinquish their state */ + for(i=0;i<kmd->num_fields;i++){ + switch(kmd->fields[i].type){ case KM_FIELD_TYPE_LEVEL_TRIGGER: if(kmfpd->kfd[i].t.requested){ kmd->fields[i].data.t.count--; if(!kmd->fields[i].data.t.count)kmd->fields[i].data.t.one2zero(kmd->fields[i].data.t.priv); - } + } break; } } -kfree(kmfpd->field_flags); -kmfpd->field_flags=NULL; -kfree(kmfpd->kfd); -kmfpd->kfd=NULL; -kfree(kmfpd->buffer_read); -kmfpd->buffer_read=NULL; -kfree(kmfpd); -kmfpd=NULL; -kmd->use_count--; -if(kmd->use_count<=0){ - devices[kmd->number]=NULL; - sprintf(temp, "control%ld", kmd->number); - remove_proc_entry(temp, km_root); - kmd->control=NULL; - kfree(kmd); + kfree(kmfpd->field_flags); + kmfpd->field_flags=NULL; + kfree(kmfpd->kfd); + kmfpd->kfd=NULL; + kfree(kmfpd->buffer_read); + kmfpd->buffer_read=NULL; + kfree(kmfpd); + kmfpd=NULL; + kmd->use_count--; + if(kmd->use_count<=0){ + devices[kmd->number]=NULL; + sprintf(temp, "control%ld", kmd->number); + remove_proc_entry(temp, km_root); + kmd->control=NULL; + kfree(kmd); } -spin_unlock(&(kmd->lock)); + spin_unlock(&(kmd->lock)); #ifndef LINUX_2_6 -MOD_DEC_USE_COUNT; + MOD_DEC_USE_COUNT; #endif } static int km_fo_control_release(struct inode * inode, struct file * file) { -KM_FILE_PRIVATE_DATA *kmfpd=file->private_data; + KM_FILE_PRIVATE_DATA *kmfpd=file->private_data; -close_km_device(kmfpd); -file->private_data=NULL; -return 0; + close_km_device(kmfpd); + file->private_data=NULL; + return 0; } ssize_t km_fo_control_read(struct file *file, char *buf, size_t count, loff_t *ppos) { -int retval=0; -KM_FILE_PRIVATE_DATA *kmfpd=file->private_data; -KM_DEVICE *kmd=kmfpd->kmd; -DECLARE_WAITQUEUE(wait, current); -spin_lock(&(kmfpd->lock)); -if(kmfpd->br_free==0){ - dump_changed_fields(kmd, kmfpd); + int retval=0; + KM_FILE_PRIVATE_DATA *kmfpd=file->private_data; + KM_DEVICE *kmd=kmfpd->kmd; + DECLARE_WAITQUEUE(wait, current); + spin_lock(&(kmfpd->lock)); + if(kmfpd->br_free==0){ + dump_changed_fields(kmd, kmfpd); } -spin_unlock(&(kmfpd->lock)); -add_wait_queue(&(kmd->wait), &wait); -current->state=TASK_INTERRUPTIBLE; -while((kmfpd->br_free==0)){ - if(file->f_flags & O_NONBLOCK){ - retval=-EAGAIN; - break; + spin_unlock(&(kmfpd->lock)); + add_wait_queue(&(kmd->wait), &wait); + current->state=TASK_INTERRUPTIBLE; + while((kmfpd->br_free==0)){ + if(file->f_flags & O_NONBLOCK){ + retval=-EAGAIN; + break; } - if(signal_pending(current)){ - retval=-ERESTARTSYS; - break; + if(signal_pending(current)){ + retval=-ERESTARTSYS; + break; } - if(!kmfpd->request_flags) - schedule(); - /* check that the devices has not been removed from under us */ - if(kmd->fields!=NULL){ - spin_lock(&(kmfpd->lock)); - if(kmfpd->request_flags & KM_STATUS_REQUESTED)perform_status_cmd(kmd, kmfpd); - dump_changed_fields(kmd, kmfpd); - spin_unlock(&(kmfpd->lock)); + if(!kmfpd->request_flags) + schedule(); + /* check that the devices has not been removed from under us */ + if(kmd->fields!=NULL){ + spin_lock(&(kmfpd->lock)); + if(kmfpd->request_flags & KM_STATUS_REQUESTED)perform_status_cmd(kmd, kmfpd); + dump_changed_fields(kmd, kmfpd); + spin_unlock(&(kmfpd->lock)); } } -current->state=TASK_RUNNING; -remove_wait_queue(&(kmd->wait), &wait); -if(retval<0)return retval; -if(count>(kmfpd->br_free-kmfpd->br_read))count=kmfpd->br_free-kmfpd->br_read; -if(count>0)memcpy(buf, kmfpd->buffer_read+kmfpd->br_read, count); -kmfpd->br_read+=count; -if(kmfpd->br_read==kmfpd->br_free){ - kmfpd->br_free=0; - kmfpd->br_read=0; + current->state=TASK_RUNNING; + remove_wait_queue(&(kmd->wait), &wait); + if(retval<0)return retval; + if(count>(kmfpd->br_free-kmfpd->br_read))count=kmfpd->br_free-kmfpd->br_read; + if(count>0)memcpy(buf, kmfpd->buffer_read+kmfpd->br_read, count); + kmfpd->br_read+=count; + if(kmfpd->br_read==kmfpd->br_free){ + kmfpd->br_free=0; + kmfpd->br_read=0; } -return count; + return count; } static unsigned int km_fo_control_poll(struct file *file, poll_table *wait) { -KM_FILE_PRIVATE_DATA *kmfpd=file->private_data; -KM_DEVICE *kmd=kmfpd->kmd; -poll_wait(file, &(kmd->wait), wait); -if (kmfpd->br_free<kmfpd->br_read) - return POLLIN | POLLRDNORM; -return 0; + KM_FILE_PRIVATE_DATA *kmfpd=file->private_data; + KM_DEVICE *kmd=kmfpd->kmd; + poll_wait(file, &(kmd->wait), wait); + if (kmfpd->br_free<kmfpd->br_read) + return POLLIN | POLLRDNORM; + return 0; } /* for now only process one command per string */ int km_fo_control_perform_command(KM_FILE_PRIVATE_DATA *kmfpd, const char *command, size_t count) { -KM_DEVICE *kmd=kmfpd->kmd; -int i,j; -int field_length; -unsigned hash; -char *value; -KM_FIELD *kf; -KM_FIELD_DATA *kfd; -u32 int_value; -int result=0; + KM_DEVICE *kmd=kmfpd->kmd; + int i,j; + int field_length; + unsigned hash; + char *value; + KM_FIELD *kf; + KM_FIELD_DATA *kfd; + u32 int_value; + int result=0; -spin_lock(&(kmd->lock)); -hash=km_command_hash(command, count); -if((hash==kmd->status_hash) && !strncmp("STATUS\n", command, count)){ - spin_lock(&(kmfpd->lock)); - kmfpd->request_flags|=KM_STATUS_REQUESTED; - spin_unlock(&(kmfpd->lock)); - kmd_signal_state_change(kmd->number); + spin_lock(&(kmd->lock)); + hash=km_command_hash(command, count); + if((hash==kmd->status_hash) && !strncmp("STATUS\n", command, count)){ + spin_lock(&(kmfpd->lock)); + kmfpd->request_flags|=KM_STATUS_REQUESTED; + spin_unlock(&(kmfpd->lock)); + kmd_signal_state_change(kmd->number); } else -if((hash==kmd->report_hash)&& (count>8) && !strncmp("REPORT ", command, 7)){ - field_length=count-8; /* exclude trailing \n */ - if(field_length<=0)goto exit; /* bogus command */ - for(i=0;i<kmd->num_fields;i++){ - if(!strncmp(command+7, kmd->fields[i].name, field_length)&& - !kmd->fields[i].name[field_length]){ - spin_lock(&(kmfpd->lock)); - kmfpd->field_flags[i]|=KM_FIELD_UPDATE_REQUESTED; - spin_unlock(&(kmfpd->lock)); - kmd_signal_state_change(kmd->number); - printk("Reporting field %d = %s\n", i, kmd->fields[i].name); - goto exit; + if((hash==kmd->report_hash)&& (count>8) && !strncmp("REPORT ", command, 7)){ + field_length=count-8; /* exclude trailing \n */ + if(field_length<=0)goto exit; /* bogus command */ + for(i=0;i<kmd->num_fields;i++){ + if(!strncmp(command+7, kmd->fields[i].name, field_length)&& + !kmd->fields[i].name[field_length]){ + spin_lock(&(kmfpd->lock)); + kmfpd->field_flags[i]|=KM_FIELD_UPDATE_REQUESTED; + spin_unlock(&(kmfpd->lock)); + kmd_signal_state_change(kmd->number); + printk("Reporting field %d = %s\n", i, kmd->fields[i].name); + goto exit; + } } - } - } else { - i=kmd->command_hash[hash]; - while((i>=0) && (count>=kmd->fields[i].length) && strncmp(kmd->fields[i].name, command, kmd->fields[i].length))i=kmd->fields[i].next_command; - if(i<0)goto exit; /* nothing matched */ + } else { + i=kmd->command_hash[hash]; + while((i>=0) && (count>=kmd->fields[i].length) && strncmp(kmd->fields[i].name, command, kmd->fields[i].length))i=kmd->fields[i].next_command; + if(i<0)goto exit; /* nothing matched */ - kf=&(kmd->fields[i]); - kfd=&(kmfpd->kfd[i]); + kf=&(kmd->fields[i]); + kfd=&(kmfpd->kfd[i]); - value=&(command[kf->length]); - j=count-kf->length; - while((*value=='=')||(*value==' ')||(*value=='\t')){ - j--; - value++; - if(!j){ - break; + value=&(command[kf->length]); + j=count-kf->length; + while((*value=='=')||(*value==' ')||(*value=='\t')){ + j--; + value++; + if(!j){ + break; + } } - } - int_value=simple_strtol(value,NULL,j); - printk("Processing \"%s\"=\"%s\" int_value=%d\n", kf->name, value, int_value); - switch(kf->type){ - case KM_FIELD_TYPE_PROGRAMMABLE: - printk("Performing KM_FIELD_PROGRAMMABLE action \"%s\" is not implemented [yet]\n", kmd->fields[i].name); - break; - case KM_FIELD_TYPE_LEVEL_TRIGGER: - if(!j || (int_value==0)){ - /* trigger lowered */ - if(!kfd->t.requested){ goto exit; /* redundant */ } - kfd->t.requested=0; - kf->data.t.count--; - if(!kf->data.t.count)kf->data.t.one2zero(kf->data.t.priv); + int_value=simple_strtol(value,NULL,j); + printk("Processing \"%s\"=\"%s\" int_value=%d\n", kf->name, value, int_value); + switch(kf->type){ + case KM_FIELD_TYPE_PROGRAMMABLE: + printk("Performing KM_FIELD_PROGRAMMABLE action \"%s\" is not implemented [yet]\n", kmd->fields[i].name); + break; + case KM_FIELD_TYPE_LEVEL_TRIGGER: + if(!j || (int_value==0)){ + /* trigger lowered */ + if(!kfd->t.requested){ goto exit; /* redundant */ } + kfd->t.requested=0; + kf->data.t.count--; + if(!kf->data.t.count)kf->data.t.one2zero(kf->data.t.priv); } else { - /* trigger raised */ - if(kfd->t.requested){ goto exit; /* redundant */ } - /* the zero2one transition checks for success before - increasing count first */ - if(!kf->data.t.count && (result=kf->data.t.zero2one(kf->data.t.priv))){ - goto exit; + /* trigger raised */ + if(kfd->t.requested){ goto exit; /* redundant */ } + /* the zero2one transition checks for success before + increasing count first */ + if(!kf->data.t.count && (result=kf->data.t.zero2one(kf->data.t.priv))){ + goto exit; } - kfd->t.requested=1; - kf->data.t.count++; + kfd->t.requested=1; + kf->data.t.count++; } - break; + break; + } } - } -exit: -spin_unlock(&(kmd->lock)); -return result; + exit: + spin_unlock(&(kmd->lock)); + return result; } static ssize_t km_fo_control_write(struct file * file, const char * buffer, size_t count, loff_t *ppos) { -KM_FILE_PRIVATE_DATA *kmfpd=file->private_data; -km_fo_control_perform_command(kmfpd, buffer, count); -return count; + KM_FILE_PRIVATE_DATA *kmfpd=file->private_data; + km_fo_control_perform_command(kmfpd, buffer, count); + return count; } static void expand_devices(void) { -KM_DEVICE **d; -devices_size+=devices_size+10; -d=kmalloc(devices_size*sizeof(*devices), GFP_KERNEL); -if(d==NULL){ - devices_size=(devices_size-10)/2; - return; + KM_DEVICE **d; + devices_size+=devices_size+10; + d=kmalloc(devices_size*sizeof(*devices), GFP_KERNEL); + if(d==NULL){ + devices_size=(devices_size-10)/2; + return; } -if(devices_free>0)memcpy(d, devices, devices_free*sizeof(*devices)); -kfree(devices); -devices=d; + if(devices_free>0)memcpy(d, devices, devices_free*sizeof(*devices)); + kfree(devices); + devices=d; } struct file_operations km_control_file_operations={ @@ -463,116 +463,116 @@ release: km_fo_control_release, write: km_fo_control_write, poll: km_fo_control_poll - } ; +} ; int add_km_device(KM_FIELD *kmfl, void *priv) { -long i,h,num; -char temp[32]; -KM_DEVICE * kmd=NULL; -KM_FIELD *kf=NULL; -num=-1; + long i,h,num; + char temp[32]; + KM_DEVICE * kmd=NULL; + KM_FIELD *kf=NULL; + num=-1; #ifndef LINUX_2_6 -MOD_INC_USE_COUNT; + MOD_INC_USE_COUNT; #endif -for(i=0;(num<0)&&(i<devices_free);i++){ - if(devices[i]==NULL)num=i; + for(i=0;(num<0)&&(i<devices_free);i++){ + if(devices[i]==NULL)num=i; } -if(num<0){ - if(devices_free>=devices_size)expand_devices(); - if(devices_free>=devices_size){ + if(num<0){ + if(devices_free>=devices_size)expand_devices(); + if(devices_free>=devices_size){ #ifndef LINUX_2_6 - MOD_DEC_USE_COUNT; + MOD_DEC_USE_COUNT; #endif - return -ENOMEM; + return -ENOMEM; } - num=devices_free; - devices_free++; + num=devices_free; + devices_free++; } -kmd=kmalloc(sizeof(KM_DEVICE), GFP_KERNEL); -if(kmd==NULL){ + kmd=kmalloc(sizeof(KM_DEVICE), GFP_KERNEL); + if(kmd==NULL){ #ifndef LINUX_2_6 - MOD_DEC_USE_COUNT; + MOD_DEC_USE_COUNT; #endif - return -ENOMEM; + return -ENOMEM; } -devices[num]=kmd; -memset(kmd, 0, sizeof(KM_DEVICE)); -kmd->number=num; -kmd->fields=kmfl; -kmd->num_fields=0; -kmd->status_hash=km_command_hash("STATUS", 6); -kmd->report_hash=km_command_hash("REPORT", 6); -kmd->command_hash=kmalloc(sizeof(*(kmd->command_hash))*KM_MODULUS, GFP_KERNEL); -for(i=0;i<KM_MODULUS;i++)kmd->command_hash[i]=-1; -while((kf=&(kmd->fields[kmd->num_fields]))->type!=KM_FIELD_TYPE_EOL){ - kf->next_command=-1; - kf->length=strlen(kf->name); - switch(kf->type){ + devices[num]=kmd; + memset(kmd, 0, sizeof(KM_DEVICE)); + kmd->number=num; + kmd->fields=kmfl; + kmd->num_fields=0; + kmd->status_hash=km_command_hash("STATUS", 6); + kmd->report_hash=km_command_hash("REPORT", 6); + kmd->command_hash=kmalloc(sizeof(*(kmd->command_hash))*KM_MODULUS, GFP_KERNEL); + for(i=0;i<KM_MODULUS;i++)kmd->command_hash[i]=-1; + while((kf=&(kmd->fields[kmd->num_fields]))->type!=KM_FIELD_TYPE_EOL){ + kf->next_command=-1; + kf->length=strlen(kf->name); + switch(kf->type){ case KM_FIELD_TYPE_PROGRAMMABLE: case KM_FIELD_TYPE_LEVEL_TRIGGER: h=km_command_hash(kf->name, kf->length); i=kmd->command_hash[h]; if(i<0)kmd->command_hash[h]=kmd->num_fields; - else { + else { while(kmd->fields[i].next_command>=0)i=kmd->fields[i].next_command; kmd->fields[i].next_command=kmd->num_fields; - } + } break; } - kmd->num_fields++; + kmd->num_fields++; } -kmd->priv=priv; -spin_lock_init(&(kmd->lock)); -init_waitqueue_head(&(kmd->wait)); + kmd->priv=priv; + spin_lock_init(&(kmd->lock)); + init_waitqueue_head(&(kmd->wait)); -sprintf(temp, "control%ld", num); -/*kmd->control=create_proc_entry(temp, S_IFREG | S_IRUGO | S_IWUSR, km_root); */ -kmd->control=create_proc_entry(temp, S_IFREG | S_IRUGO | S_IWUGO, km_root); + sprintf(temp, "control%ld", num); + /*kmd->control=create_proc_entry(temp, S_IFREG | S_IRUGO | S_IWUSR, km_root); */ + kmd->control=create_proc_entry(temp, S_IFREG | S_IRUGO | S_IWUGO, km_root); #if 0 -sprintf(temp, "data%ld", num); -kmd->data=create_proc_entry(temp, S_IFREG | S_IRUGO | S_IWUSR, km_root); + sprintf(temp, "data%ld", num); + kmd->data=create_proc_entry(temp, S_IFREG | S_IRUGO | S_IWUSR, km_root); #endif -kmd->control->data=kmd; -kmd->control->proc_fops=&km_control_file_operations; + kmd->control->data=kmd; + kmd->control->proc_fops=&km_control_file_operations; -kmd->use_count=1; -return num; + kmd->use_count=1; + return num; } void kmd_signal_state_change(int num) { -if(num<0)return; -if(num>=devices_free)return; -if(devices[num]!=NULL)wake_up_interruptible(&(devices[num]->wait)); + if(num<0)return; + if(num>=devices_free)return; + if(devices[num]!=NULL)wake_up_interruptible(&(devices[num]->wait)); } int remove_km_device(int num) { -char temp[32]; -KM_DEVICE *kmd; -if(num<0)return -EINVAL; -if(num>devices_free)return -EINVAL; -kmd=devices[num]; -if(kmd==NULL)return -EINVAL; -spin_lock(&(kmd->lock)); -kfree(kmd->command_hash); -kmd->command_hash=NULL; -kmd->fields=NULL; -kmd->priv=NULL; -kmd->use_count--; -if(kmd->use_count<=0){ - devices[num]=NULL; - sprintf(temp, "control%d", num); - remove_proc_entry(temp, km_root); - kmd->control=NULL; - kfree(kmd); + char temp[32]; + KM_DEVICE *kmd; + if(num<0)return -EINVAL; + if(num>devices_free)return -EINVAL; + kmd=devices[num]; + if(kmd==NULL)return -EINVAL; + spin_lock(&(kmd->lock)); + kfree(kmd->command_hash); + kmd->command_hash=NULL; + kmd->fields=NULL; + kmd->priv=NULL; + kmd->use_count--; + if(kmd->use_count<=0){ + devices[num]=NULL; + sprintf(temp, "control%d", num); + remove_proc_entry(temp, km_root); + kmd->control=NULL; + kfree(kmd); } -spin_unlock(&(kmd->lock)); + spin_unlock(&(kmd->lock)); #ifndef LINUX_2_6 -MOD_DEC_USE_COUNT; + MOD_DEC_USE_COUNT; #endif -return 0; + return 0; } @@ -582,39 +582,39 @@ static int __init init_module(void) { -int result; -long i; + int result; + long i; -km_root=create_proc_entry("km", S_IFDIR, &proc_root); -if(km_root==NULL){ - printk(KERN_ERR "km_api: unable to initialize /proc/km\n"); - return -EACCES; + km_root=create_proc_entry("km", S_IFDIR, &proc_root); + if(km_root==NULL){ + printk(KERN_ERR "km_api: unable to initialize /proc/km\n"); + return -EACCES; } -memcpy(&km_file_operations, km_root->proc_fops, sizeof(struct file_operations)); -if((result=init_km_data_units())<0){ - cleanup_module(); - return result; + memcpy(&km_file_operations, km_root->proc_fops, sizeof(struct file_operations)); + if((result=init_km_data_units())<0){ + cleanup_module(); + return result; } -devices_size=10; -devices_free=0; -devices=kmalloc(devices_size*sizeof(KM_DEVICE), GFP_KERNEL); -if(devices==NULL){ - printk(KERN_ERR "Could not allocate memory for devices array\n"); - cleanup_module(); - return -ENOMEM; + devices_size=10; + devices_free=0; + devices=kmalloc(devices_size*sizeof(KM_DEVICE), GFP_KERNEL); + if(devices==NULL){ + printk(KERN_ERR "Could not allocate memory for devices array\n"); + cleanup_module(); + return -ENOMEM; } -printk("Kmultimedia API module version %s loaded\n", KM_API_VERSION); + printk("Kmultimedia API module version %s loaded\n", KM_API_VERSION); -return 0; + return 0; } void cleanup_module(void) { -if(devices!=NULL)kfree(devices); -if(km_root!=NULL)remove_proc_entry("km", &proc_root); -cleanup_km_data_units(); -return; + if(devices!=NULL)kfree(devices); + if(km_root!=NULL)remove_proc_entry("km", &proc_root); + cleanup_km_data_units(); + return; } |
|
From: <gat...@li...> - 2004-07-14 05:38:32
|
Update of /cvsroot/gatos/ati.4.4.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11223 Modified Files: fi1236.c fi1236.h radeon_video.c Log Message: Start support for FI1236/W Index: fi1236.c =================================================================== RCS file: /cvsroot/gatos/ati.4.4.0/fi1236.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- fi1236.c 20 May 2004 01:37:59 -0000 1.1 +++ fi1236.c 14 Jul 2004 05:38:24 -0000 1.2 @@ -22,6 +22,8 @@ { 623 ,16*45.75 ,16*855.25 ,16*170 ,16*450 ,0xA0 ,0x90, 0x30, 0x8e }, /* 5 - FI1256 */ { 623 ,16*49.75 ,16*863.25 ,16*170 ,16*450 ,0xA0 ,0x90, 0x30, 0x8e } + /* 6 - FI1236W */ + { 733 ,884 ,12820 ,2516 ,7220 ,0x1 ,0x2, 0x4, 0x8e }, }; Index: radeon_video.c =================================================================== RCS file: /cvsroot/gatos/ati.4.4.0/radeon_video.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- radeon_video.c 20 May 2004 15:33:12 -0000 1.5 +++ radeon_video.c 14 Jul 2004 05:38:24 -0000 1.6 @@ -1191,7 +1191,7 @@ {"Philips FI1236 (or compatible)" , TUNER_TYPE_FI1236}, {"TEMIC-FN5AL" , TUNER_TYPE_TEMIC_FN5AL}, {"FQ1216ME/P" , TUNER_TYPE_FI1216}, - {"FI1236W" , TUNER_TYPE_FI1236}, + {"FI1236W" , TUNER_TYPE_FI1236W}, {"Alps TSBH5" , -1}, {"Alps TSCxx" , -1}, {"Alps TSCH5 FM" , -1}, Index: fi1236.h =================================================================== RCS file: /cvsroot/gatos/ati.4.4.0/fi1236.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- fi1236.h 20 May 2004 01:37:59 -0000 1.1 +++ fi1236.h 14 Jul 2004 05:38:24 -0000 1.2 @@ -69,6 +69,7 @@ #define TUNER_TYPE_MT2032 3 #define TUNER_TYPE_FI1246 4 #define TUNER_TYPE_FI1256 5 +#define TUNER_TYPE_FI1236W 6 #define FI1236_ADDR(a) ((a)->d.SlaveAddr) |