[MPlayer-cvslog] r37703 - in trunk/vidix: cyberblade_vid.c ivtv_vid.c mach64_vid.c mga_vid.c nvidia_vid.c pm2_vid.c pm3_vid.c radeon_vid.c s3_vid.c sh_veu_vid.c sis_vid.c unichrome_vid.c

reimar subversion at mplayerhq.hu
Sat Feb 13 17:37:16 CET 2016


Author: reimar
Date: Sat Feb 13 17:37:16 2016
New Revision: 37703

Log:
VIDIX: make capability templates const.

Modified:
   trunk/vidix/cyberblade_vid.c
   trunk/vidix/ivtv_vid.c
   trunk/vidix/mach64_vid.c
   trunk/vidix/mga_vid.c
   trunk/vidix/nvidia_vid.c
   trunk/vidix/pm2_vid.c
   trunk/vidix/pm3_vid.c
   trunk/vidix/radeon_vid.c
   trunk/vidix/s3_vid.c
   trunk/vidix/sh_veu_vid.c
   trunk/vidix/sis_vid.c
   trunk/vidix/unichrome_vid.c

Modified: trunk/vidix/cyberblade_vid.c
==============================================================================
--- trunk/vidix/cyberblade_vid.c	Sat Feb 13 17:22:51 2016	(r37702)
+++ trunk/vidix/cyberblade_vid.c	Sat Feb 13 17:37:16 2016	(r37703)
@@ -74,7 +74,7 @@ static void SROUTW(int reg,int val)
 	SROUTB(reg+1,(val>>8)&255);
 }
 
-static vidix_capability_t cyberblade_cap =
+static const vidix_capability_t cyberblade_cap =
 {
 	"Trident CyberBlade i1 driver",
 	"Alastair M. Robinson <blackfive at fakenhamweb.co.uk>",
@@ -145,7 +145,6 @@ static int cyberblade_probe(int verbose,
 					continue;
 				}
 #endif
-				cyberblade_cap.device_id = lst[i].device;
 				err = 0;
 				memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
 				break;
@@ -199,6 +198,7 @@ static void cyberblade_destroy(void)
 static int cyberblade_get_caps(vidix_capability_t *to)
 {
 	memcpy(to, &cyberblade_cap, sizeof(vidix_capability_t));
+	to->device_id = pci_info.device;
 	return 0;
 }
 

Modified: trunk/vidix/ivtv_vid.c
==============================================================================
--- trunk/vidix/ivtv_vid.c	Sat Feb 13 17:22:51 2016	(r37702)
+++ trunk/vidix/ivtv_vid.c	Sat Feb 13 17:37:16 2016	(r37703)
@@ -73,7 +73,7 @@ int alpha_disable = 0;
 
 /* VIDIX exports */
 
-static vidix_capability_t ivtv_cap =
+static const vidix_capability_t ivtv_cap =
 {
 	"Hauppauge PVR 350 YUV Video",
 	"Lutz Koschorreck",

Modified: trunk/vidix/mach64_vid.c
==============================================================================
--- trunk/vidix/mach64_vid.c	Sat Feb 13 17:22:51 2016	(r37702)
+++ trunk/vidix/mach64_vid.c	Sat Feb 13 17:37:16 2016	(r37703)
@@ -221,7 +221,7 @@ static void mach64_wait_vsync( void )
 
 }
 
-static vidix_capability_t mach64_cap =
+static const vidix_capability_t mach64_cap =
 {
     "BES driver for Mach64/3DRage cards",
     "Nick Kurshev and Michael Niedermayer",
@@ -445,7 +445,6 @@ static int mach64_probe(int verbose,int
 	    if(idx == -1)
 		mp_msg(MSGT_VO, MSGL_STATUS, "[mach64] Assuming it as Mach64\n");
 	}
-	mach64_cap.device_id = lst[i].device;
 	err = 0;
 	memcpy(&pci_info,&lst[i],sizeof(pciinfo_t));
 	probed=1;
@@ -512,10 +511,10 @@ static int mach64_init(void)
   if(supports_planar)	mp_msg(MSGT_VO, MSGL_STATUS, "[mach64] Planar YUV formats are supported :)\n");
   else			mp_msg(MSGT_VO, MSGL_STATUS, "[mach64] Planar YUV formats are not supported :(\n");
 
-  if(   mach64_cap.device_id==DEVICE_ATI_RAGE_MOBILITY_P_M
-     || mach64_cap.device_id==DEVICE_ATI_RAGE_MOBILITY_P_M2
-     || mach64_cap.device_id==DEVICE_ATI_RAGE_MOBILITY_L
-     || mach64_cap.device_id==DEVICE_ATI_RAGE_MOBILITY_L2)
+  if(   pci_info.device==DEVICE_ATI_RAGE_MOBILITY_P_M
+     || pci_info.device==DEVICE_ATI_RAGE_MOBILITY_P_M2
+     || pci_info.device==DEVICE_ATI_RAGE_MOBILITY_L
+     || pci_info.device==DEVICE_ATI_RAGE_MOBILITY_L2)
          supports_lcd_v_stretch=1;
   else
          supports_lcd_v_stretch=0;
@@ -540,6 +539,7 @@ static void mach64_destroy(void)
 static int mach64_get_caps(vidix_capability_t *to)
 {
     memcpy(to, &mach64_cap, sizeof(vidix_capability_t));
+    to->device_id = pci_info.device;
     return 0;
 }
 

Modified: trunk/vidix/mga_vid.c
==============================================================================
--- trunk/vidix/mga_vid.c	Sat Feb 13 17:22:51 2016	(r37702)
+++ trunk/vidix/mga_vid.c	Sat Feb 13 17:37:16 2016	(r37703)
@@ -109,7 +109,7 @@ static int mga_irq = -1;
 
 static int mga_next_frame = 0;
 
-static vidix_capability_t mga_cap =
+static const vidix_capability_t mga_cap =
 {
     "Matrox MGA G200/G4x0/G5x0 YUV Video",
     "Aaron Holtzman, Arpad Gereoffy, Alex Beregszaszi, Nick Kurshev",
@@ -1149,8 +1149,6 @@ card_found:
 	probed = 1;
 	memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
 
-	mga_cap.device_id = pci_info.device; /* set device id in capabilities */
-
 	return 0;
 }
 
@@ -1316,6 +1314,7 @@ static int mga_query_fourcc(vidix_fourcc
 static int mga_get_caps(vidix_capability_t *to)
 {
     memcpy(to, &mga_cap, sizeof(vidix_capability_t));
+    to->device_id = pci_info.device; /* set device id in capabilities */
     return 0;
 }
 

Modified: trunk/vidix/nvidia_vid.c
==============================================================================
--- trunk/vidix/nvidia_vid.c	Sat Feb 13 17:22:51 2016	(r37702)
+++ trunk/vidix/nvidia_vid.c	Sat Feb 13 17:37:16 2016	(r37703)
@@ -49,7 +49,7 @@ static pciinfo_t pci_info;
 #define NV04_BES_SIZE 1024*2000*4
 
 
-static vidix_capability_t nvidia_cap = {
+static const vidix_capability_t nvidia_cap = {
     "NVIDIA RIVA OVERLAY DRIVER",
     "Sascha Sommer <saschasommer at freenet.de>",
     TYPE_OUTPUT,
@@ -355,7 +355,6 @@ static int nv_probe(int verbose, int for
 			mp_msg(MSGT_VO, MSGL_STATUS, "[nvidia_vid] Device is disabled, ignoring\n");
 			continue;
 		}
-		nvidia_cap.device_id = lst[i].device;
 		err = 0;
 		memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
 		break;
@@ -980,6 +979,7 @@ static void nv_destroy(void){
 
 static int nv_get_caps(vidix_capability_t *to){
     memcpy(to, &nvidia_cap, sizeof(vidix_capability_t));
+    to->device_id = pci_info.device;
     return 0;
 }
 

Modified: trunk/vidix/pm2_vid.c
==============================================================================
--- trunk/vidix/pm2_vid.c	Sat Feb 13 17:22:51 2016	(r37702)
+++ trunk/vidix/pm2_vid.c	Sat Feb 13 17:37:16 2016	(r37703)
@@ -60,7 +60,7 @@ static void *pm2_mem;
 
 static int pm2_vidmem = PM2_VIDMEM;
 
-static vidix_capability_t pm2_cap =
+static const vidix_capability_t pm2_cap =
 {
     "3DLabs Permedia2 driver",
     "Måns Rullgård <mru at users.sf.net>",
@@ -118,7 +118,6 @@ static int pm2_probe(int verbose, int fo
 	    dname = pci_device_name(lst[i].vendor, lst[i].device);
 	    dname = dname ? dname : "Unknown chip";
 	    mp_msg(MSGT_VO, MSGL_STATUS, "[pm2] Found chip: %s\n", dname);
-	    pm2_cap.device_id = lst[i].device;
 	    err = 0;
 	    memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
 	    break;
@@ -154,6 +153,7 @@ static void pm2_destroy(void)
 static int pm2_get_caps(vidix_capability_t *to)
 {
     memcpy(to, &pm2_cap, sizeof(vidix_capability_t));
+    to->device_id = pci_info.device;
     return 0;
 }
 

Modified: trunk/vidix/pm3_vid.c
==============================================================================
--- trunk/vidix/pm3_vid.c	Sat Feb 13 17:22:51 2016	(r37702)
+++ trunk/vidix/pm3_vid.c	Sat Feb 13 17:37:16 2016	(r37703)
@@ -49,7 +49,7 @@ static pciinfo_t pci_info;
 void *pm3_reg_base;
 static void *pm3_mem;
 
-static vidix_capability_t pm3_cap =
+static const vidix_capability_t pm3_cap =
 {
     "3DLabs GLINT R3/Permedia3 driver",
     "Måns Rullgård <mru at users.sf.net>",
@@ -115,7 +115,6 @@ static int pm3_probe(int verbose, int fo
 			continue;
 		}
 #endif
-		pm3_cap.device_id = lst[i].device;
 		err = 0;
 		memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
 		break;
@@ -148,6 +147,7 @@ static void pm3_destroy(void)
 static int pm3_get_caps(vidix_capability_t *to)
 {
     memcpy(to, &pm3_cap, sizeof(vidix_capability_t));
+    to->device_id = pci_info.device;
     return 0;
 }
 

Modified: trunk/vidix/radeon_vid.c
==============================================================================
--- trunk/vidix/radeon_vid.c	Sat Feb 13 17:22:51 2016	(r37702)
+++ trunk/vidix/radeon_vid.c	Sat Feb 13 17:37:16 2016	(r37703)
@@ -1151,7 +1151,7 @@ static int find_chip(unsigned chip_id)
 static pciinfo_t pci_info;
 static int probed=0;
 
-static vidix_capability_t def_cap =
+static const vidix_capability_t def_cap =
 {
 #ifdef RAGE128
     "BES driver for Rage128 cards",
@@ -1251,7 +1251,6 @@ static int radeon_probe(int verbose, int
         probe_fireGL_driver();
 #endif
 	if(idx != -1) besr.chip_flags=ati_card_ids[idx].flags;
-	def_cap.device_id = lst[i].device;
 	err = 0;
 	memcpy(&pci_info,&lst[i],sizeof(pciinfo_t));
 	probed=1;
@@ -1345,14 +1344,14 @@ static int radeon_init(void)
 #ifdef RADEON
   /* according to XFree86 4.2.0, some production M6's return 0 for 8MB */
   if (radeon_ram_size == 0 &&
-      (def_cap.device_id == DEVICE_ATI_RADEON_MOBILITY_M6 ||
-       def_cap.device_id == DEVICE_ATI_RADEON_MOBILITY_M62))
+      (pci_info.device == DEVICE_ATI_RADEON_MOBILITY_M6 ||
+       pci_info.device == DEVICE_ATI_RADEON_MOBILITY_M62))
   {
       mp_msg(MSGT_VO, MSGL_STATUS, RADEON_MSG" Working around buggy Radeon Mobility M6 (0 vs. 8MB ram)\n");
       radeon_ram_size = 8192*1024;
   }
   else if (radeon_ram_size == 0 &&
-           (def_cap.device_id == DEVICE_ATI_RS482_RADEON_XPRESS))
+           (pci_info.device == DEVICE_ATI_RS482_RADEON_XPRESS))
   {
       mp_msg(MSGT_VO, MSGL_STATUS, RADEON_MSG" Working around buggy RS482 Radeon Xpress 200 Memory Detection\n");
       radeon_ram_size = (INREG(CONFIG_MEMSIZE) + 0x100000) << 2;
@@ -1361,8 +1360,8 @@ static int radeon_init(void)
 #else
   /* Rage Mobility (rage128) also has memsize bug */
   if (radeon_ram_size == 0 &&
-      (def_cap.device_id == DEVICE_ATI_RAGE_MOBILITY_M3 ||
-       def_cap.device_id == DEVICE_ATI_RAGE_MOBILITY_M32))
+      (pci_info.device == DEVICE_ATI_RAGE_MOBILITY_M3 ||
+       pci_info.device == DEVICE_ATI_RAGE_MOBILITY_M32))
   {
       mp_msg(MSGT_VO, MSGL_STATUS, RADEON_MSG" Working around Rage Mobility M3 (0 vs. 8MB ram)\n");
       radeon_ram_size = 8192*1024;
@@ -1402,6 +1401,7 @@ static void radeon_destroy(void)
 static int radeon_get_caps(vidix_capability_t *to)
 {
   memcpy(to,&def_cap,sizeof(vidix_capability_t));
+  to->device_id = pci_info.device;
   return 0;
 }
 

Modified: trunk/vidix/s3_vid.c
==============================================================================
--- trunk/vidix/s3_vid.c	Sat Feb 13 17:22:51 2016	(r37702)
+++ trunk/vidix/s3_vid.c	Sat Feb 13 17:37:16 2016	(r37703)
@@ -100,7 +100,7 @@ typedef struct s3_info s3_info;
 
 static s3_info *info;
 
-static vidix_capability_t s3_cap = {
+static const vidix_capability_t s3_cap = {
   "S3 BES",
   "Reza Jelveh, Michael Kostylev",
   TYPE_OUTPUT,
@@ -581,7 +581,6 @@ static int s3_probe (int verbose, int fo
           mp_msg(MSGT_VO, MSGL_STATUS, "[s3_vid] Device is disabled, ignoring\n");
           continue;
         }
-        s3_cap.device_id = lst[i].device;
         err = 0;
         memcpy (&pci_info, &lst[i], sizeof (pciinfo_t));
         break;
@@ -720,6 +719,7 @@ static void s3_destroy (void)
 static int s3_get_caps (vidix_capability_t * to)
 {
   memcpy (to, &s3_cap, sizeof (vidix_capability_t));
+  to->device_id = pci_info.device;
   return 0;
 }
 

Modified: trunk/vidix/sh_veu_vid.c
==============================================================================
--- trunk/vidix/sh_veu_vid.c	Sat Feb 13 17:22:51 2016	(r37702)
+++ trunk/vidix/sh_veu_vid.c	Sat Feb 13 17:37:16 2016	(r37703)
@@ -240,7 +240,7 @@ static void write_reg(struct uio_map *um
     reg[reg_offs / 4] = value;
 }
 
-static vidix_capability_t sh_veu_cap = {
+static const vidix_capability_t sh_veu_cap = {
     "SuperH VEU driver",
     "Magnus Damm",
     TYPE_OUTPUT,

Modified: trunk/vidix/sis_vid.c
==============================================================================
--- trunk/vidix/sis_vid.c	Sat Feb 13 17:22:51 2016	(r37702)
+++ trunk/vidix/sis_vid.c	Sat Feb 13 17:37:16 2016	(r37703)
@@ -134,7 +134,7 @@ static int sis_frames[VID_PLAY_MAXFRAMES
 
 static vidix_grkey_t sis_grkey;
 
-static vidix_capability_t sis_cap = {
+static const vidix_capability_t sis_cap = {
     "SiS 300/310/325 Video Driver",
     "Jake Page",
     TYPE_OUTPUT,
@@ -268,12 +268,12 @@ static int sis_probe(int verbose, int fo
 		if (sis_verbose > 0)
 		    mp_msg(MSGT_VO, MSGL_STATUS, "[SiS] Found chip: %s (0x%X)\n",
 			   dname, lst[i].device);
-		sis_device_id = sis_cap.device_id = lst[i].device;
+		sis_device_id = lst[i].device;
 		err = 0;
 		memcpy(&pci_info, &lst[i], sizeof(pciinfo_t));
 
 		sis_has_two_overlays = 0;
-		switch (sis_cap.device_id) {
+		switch (sis_device_id) {
 		case DEVICE_SIS_300:
 		case DEVICE_SIS_630_VGA:
 		    sis_has_two_overlays = 1;
@@ -409,6 +409,7 @@ static void sis_destroy(void)
 static int sis_get_caps(vidix_capability_t * to)
 {
     memcpy(to, &sis_cap, sizeof(vidix_capability_t));
+    to->device_id = sis_device_id;
     return 0;
 }
 

Modified: trunk/vidix/unichrome_vid.c
==============================================================================
--- trunk/vidix/unichrome_vid.c	Sat Feb 13 17:22:51 2016	(r37702)
+++ trunk/vidix/unichrome_vid.c	Sat Feb 13 17:37:16 2016	(r37703)
@@ -84,7 +84,7 @@ static FILE *logfile = 0;
 /**
  * @brief Unichrome driver vidix capabilities.
  */
-static vidix_capability_t uc_cap = {
+static const vidix_capability_t uc_cap = {
   "VIA CLE266 Unichrome driver",
   "Timothy Lee <timothy at siriushk.com>",
   TYPE_OUTPUT,
@@ -489,7 +489,6 @@ unichrome_probe (int verbose, int force)
 		  mp_msg(MSGT_VO, MSGL_STATUS, "[unichrome] Device is disabled, ignoring\n");
 		  continue;
 		}
-	      uc_cap.device_id = lst[i].device;
 	      err = 0;
 	      memcpy (&pci_info, &lst[i], sizeof (pciinfo_t));
 	      break;
@@ -588,6 +587,7 @@ static int
 unichrome_get_caps (vidix_capability_t * to)
 {
   memcpy (to, &uc_cap, sizeof (vidix_capability_t));
+  to->device_id = pci_info.device;
   return 0;
 }
 


More information about the MPlayer-cvslog mailing list