diff vidix/savage_vid.c @ 22857:77def5093daf

switch to new internal vidix API, no more dlopen/dlsym, libvidix is now a fully static library with all drivers built-in
author ben
date Sun, 01 Apr 2007 11:06:06 +0000
parents 9a1e26fef45b
children 6c57087c5a2d
line wrap: on
line diff
--- a/vidix/savage_vid.c	Sun Apr 01 09:45:26 2007 +0000
+++ b/vidix/savage_vid.c	Sun Apr 01 11:06:06 2007 +0000
@@ -39,6 +39,7 @@
 #include <math.h>
 
 #include "vidix.h"
+#include "vidixlib.h"
 #include "fourcc.h"
 #include "../libdha/libdha.h"
 #include "../libdha/pci_ids.h"
@@ -768,8 +769,8 @@
  *
  * @return vidix version number.
  */
-unsigned int
-vixGetVersion (void)
+static unsigned int
+savage_get_version (void)
 {
   return (VIDIX_VERSION);
 }
@@ -803,7 +804,7 @@
  *          a negative error code otherwise.
  */
 
-int vixProbe(int verbose, int force){
+static int savage_probe(int verbose, int force){
     pciinfo_t lst[MAX_PCI_DEVICES];
     unsigned i,num_pci;
     int err;
@@ -849,8 +850,8 @@
  * @returns 0 if ok.
  *          a negative error code otherwise.
  */
-int
-vixInit (void)
+static int
+savage_init (void)
 {
 	int mtrr;
   unsigned char config1, m, n, n1, n2, sr8, cr3f, cr66 = 0, tmp;
@@ -1033,8 +1034,8 @@
 /**
  * @brief Destroys driver.
  */
-void
-vixDestroy (void)
+static void
+savage_destroy (void)
 {
 	unmap_phys_mem(info->video_base, info->chip.fbsize);
 	unmap_phys_mem(info->control_base, SAVAGE_NEWMMIO_REGSIZE);
@@ -1048,8 +1049,8 @@
  *
  * @returns 0.
  */
-int
-vixGetCapability (vidix_capability_t * to)
+static int
+savage_get_caps (vidix_capability_t * to)
 {
   memcpy (to, &savage_cap, sizeof (vidix_capability_t));
   return 0;
@@ -1091,8 +1092,8 @@
  * @returns 0 if ok.
  *          errno otherwise.
  */
-int
-vixQueryFourcc (vidix_fourcc_t * to)
+static int
+savage_query_fourcc (vidix_fourcc_t * to)
 {
   if (is_supported_fourcc (to->fourcc))
     {
@@ -1133,8 +1134,8 @@
  *
  * @return 0.
  */
-int
-vixSetGrKeys (const vidix_grkey_t * grkey)
+static int
+savage_set_gkeys (const vidix_grkey_t * grkey)
 {
   if (grkey->ckey.op == CKEY_FALSE)
   {
@@ -1156,7 +1157,7 @@
 /**
  * @brief Unichrome driver equalizer capabilities.
  */
-vidix_video_eq_t equal = {
+static vidix_video_eq_t equal = {
   VEQ_CAP_BRIGHTNESS | VEQ_CAP_SATURATION | VEQ_CAP_HUE,
   300, 100, 0, 0, 0, 0, 0, 0
 };
@@ -1169,8 +1170,8 @@
  *
  * @return 0.
  */
-int
-vixPlaybackGetEq (vidix_video_eq_t * eq)
+static int
+savage_get_eq (vidix_video_eq_t * eq)
 {
   memcpy (eq, &equal, sizeof (vidix_video_eq_t));
   return 0;
@@ -1183,8 +1184,8 @@
  *
  * @return 0.
  */
-int
-vixPlaybackSetEq (const vidix_video_eq_t * eq)
+static int
+savage_set_eq (const vidix_video_eq_t * eq)
 {
   return 0;
 }
@@ -1202,8 +1203,8 @@
  * @returns  0 in case of success.
  *          -1 otherwise.
  */
-int
-vixConfigPlayback (vidix_playback_t * vinfo)
+static int
+savage_config_playback (vidix_playback_t * vinfo)
 {
   int uv_size, swap_uv;
   unsigned int i;
@@ -1325,8 +1326,8 @@
  *
  * @return 0.
  */
-int
-vixPlaybackOn (void)
+static int
+savage_playback_on (void)
 {
  // FIXME: enable
   SavageDisplayVideoOld();
@@ -1339,8 +1340,8 @@
  *
  * @return 0.
  */
-int
-vixPlaybackOff (void)
+static int
+savage_playback_off (void)
 {
 	// otherwise we wont disable streams properly in new xorg
 	// FIXME: shouldnt this be enabled?
@@ -1365,8 +1366,8 @@
  *       and never used for single buffering playback.
  */
 #if 0
-int
-vixPlaybackFrameSelect (unsigned int frame)
+static int
+savage_frame_select (unsigned int frame)
 {
 ////FIXME ADD
 //    savage_overlay_start(info, frame);
@@ -1472,4 +1473,22 @@
     fprintf(stderr,":\t\t 0x%08X = %u\n",val,val);
 }
 
-
+VDXDriver savage_drv = {
+  "savage",
+  NULL,
+  .probe = savage_probe,
+  .get_version = savage_get_version,
+  .get_caps = savage_get_caps,
+  .query_fourcc = savage_query_fourcc,
+  .init = savage_init,
+  .destroy = savage_destroy,
+  .config_playback = savage_config_playback,
+  .playback_on = savage_playback_on,
+  .playback_off = savage_playback_off,
+#if 0
+  .frame_sel = savage_frame_select,
+#endif
+  .get_eq = savage_get_eq,
+  .set_eq = savage_set_eq,
+  .set_gkey = savage_set_gkeys,
+};