[xiph-commits] r13786 - trunk/sushivision

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Wed Sep 12 02:21:44 PDT 2007


Author: xiphmont
Date: 2007-09-12 02:21:43 -0700 (Wed, 12 Sep 2007)
New Revision: 13786

Modified:
   trunk/sushivision/main.c
   trunk/sushivision/panel-2d.c
   trunk/sushivision/panel-2d.h
   trunk/sushivision/slider.c
   trunk/sushivision/sushivision.h
Log:
More plane locking work in progress



Modified: trunk/sushivision/main.c
===================================================================
--- trunk/sushivision/main.c	2007-09-12 08:02:16 UTC (rev 13785)
+++ trunk/sushivision/main.c	2007-09-12 09:21:43 UTC (rev 13786)
@@ -483,7 +483,7 @@
   if((ret=pthread_key_create(&_sv_obj_key,NULL)))
     return ret;
   
-  num_threads = num_proccies();
+  num_threads = ((num_proccies()*3)>>2);
 
   pthread_mutexattr_init(&gdk_ma);
   pthread_mutexattr_settype(&gdk_ma,PTHREAD_MUTEX_RECURSIVE);

Modified: trunk/sushivision/panel-2d.c
===================================================================
--- trunk/sushivision/panel-2d.c	2007-09-12 08:02:16 UTC (rev 13785)
+++ trunk/sushivision/panel-2d.c	2007-09-12 09:21:43 UTC (rev 13786)
@@ -32,11 +32,38 @@
 #include <cairo-ft.h>
 #include "internal.h"
 
-/* helper functions for performing progressive computation */
+/* helper functions for performing progressive computation and rendering */
 
+static void _sv_plane2d_set_recompute(_sv_plane2d_t *z){
+  pthread_mutex_lock(z->data_m);
+
+}
+
+static void _sv_plane2d_set_remap(){
+
+}
+
+static int _sv_plane2d_xscale_one(){
+
+}
+
+static int _sv_plane2d_yscale_one(){
+
+}
+
+static int _sv_plane2d_compute_one(){
+
+}
+
+static int _sv_plane2d_map_one(){
+
+}
+
+// work order: resize/fast scale -> compute -> plane_render -> composite
+
 // enter unlocked
 static void _sv_planez_compute_line(sv_panel_t *p, 
-				    _sv_planez_t *z,
+				    _sv_plane2d_t *z,
 
 				    int serialno,
 

Modified: trunk/sushivision/panel-2d.h
===================================================================
--- trunk/sushivision/panel-2d.h	2007-09-12 08:02:16 UTC (rev 13785)
+++ trunk/sushivision/panel-2d.h	2007-09-12 09:21:43 UTC (rev 13786)
@@ -23,41 +23,47 @@
 //
 //  gdk_m -> panel_m -> obj_m -> dim_m -> scale_m
 //  |
-//  -> z.status_m -> bg.status_m -> z.data_m -> z.image_m -> bg.image_m 
+//  -> z.data_m -> z.image_m -> bg.image_m 
+//  |
+//  -> z.status_m -> bg.status_m
 
 #define PLANE_Z 1
  
 typedef union  _sv_plane _sv_plane_t;
 typedef struct _sv_plane_proto _sv_plane_proto_t;
 typedef struct _sv_plane_bg _sv_plane_bg_t;
-typedef struct _sv_plane_z _sv_plane_z_t;
+typedef struct _sv_plane_2d _sv_plane_2d_t;
 
 struct _sv_plane_proto {
   // in common with all plane types
+  // common fields locked via panel
   int plane_type;
-  int working;
   sv_obj_t *o;
   _sv_plane_t *share_next;
   _sv_plane_t *share_prev;
-
+  _sv_panel2d_t   *panel;
 };
 
 // bg plane mutex policy: [mutexes from one other plane] -> image -> status -> [back to other plane]
 struct _sv_plane_bg {
   // in common with all plane types
-  int plane_type;
-  int working;
-  sv_obj_t *o;
-  _sv_plane_t *share_next;
-  _sv_plane_t *share_prev;
+  // common fields locked via panel
+  int             plane_type;
+  sv_obj_t       *o;
+  _sv_plane_t    *share_next;
+  _sv_plane_t    *share_prev;
+  _sv_panel2d_t  *panel;
 
+  // image data
    _sv_ucolor_t  *image; // panel size
   int             image_serialno;
+  int             image_waiting;
+  int             image_incomplete;
+  int             image_nextline;
   pthread_mutex_t image_m; 
 
   // concurrency tracking
   unsigned char  *line_status; // rendering flags
-  int             progress; // round-robin indicator
   pthread_mutex_t status_m;
 };
 
@@ -76,30 +82,39 @@
 };
 
 // z-plane mutex policy: data -> image plane -> [bg mutextes] -> status
-struct _sv_plane_z {
+struct _sv_plane_2d {
   // in common with all plane types
-  int plane_type;
-  int working;
-  sv_obj_t *o;
-  _sv_plane_t *share_next;
-  _sv_plane_t *share_prev;
-  pthread_mutex_t planem;
+  // common fields locked via panel
+  int             plane_type; // == Z
+  sv_obj_t       *o;
+  _sv_plane_t    *share_next;
+  _sv_plane_t    *share_prev;
+  _sv_panel2d_t  *panel;
 
   // subtype 
   // objective data
-  float          *data;   // data size
-  int             data_serialno; 
+  float          *data;              // data size
+  int             data_serialno;     
+  int             xscale_waiting; 
+  int             xscale_incomplete; 
+  int             yscale_waiting;   
+  int             yscale_incomplete;   
+  int             compute_waiting;
+  int             compute_incomplete;
+  int             data_nextline;
   pthread_mutex_t data_m;
 
   // image plane
   _sv_ucolor_t   *image; // panel size;
   int             image_serialno;
   struct sv_zmap  image_map;
+  int             image_waiting;
+  int             image_incomplete;
+  int             image_nextline;
   pthread_mutex_t image_m;
 
   // concurrency tracking
-  unsigned char  *line_status; // rendering flags
-  int             progress; // round-robin indicator
+  unsigned char  *lineflags; // rendering flags
   pthread_mutex_t status_m;
 
   // ui elements; use gdk lock
@@ -114,7 +129,7 @@
   _sv_plane_proto_t proto;
   _sv_plane_bg_t bg;
 
-  _sv_plane_z_t z;
+  _sv_plane_2d_t p2d;
 } _sv_plane;
 
 typedef struct {
@@ -122,7 +137,7 @@
   GtkWidget *obj_table;
   GtkWidget *dim_table;
 
-  _sv_plane_t *bg;
+  _sv_plane_bg_t *bg;
 
   int planes;
   _sv_plane_t **plane_list;

Modified: trunk/sushivision/slider.c
===================================================================
--- trunk/sushivision/slider.c	2007-09-12 08:02:16 UTC (rev 13785)
+++ trunk/sushivision/slider.c	2007-09-12 09:21:43 UTC (rev 13786)
@@ -154,7 +154,14 @@
     // this happens 'under' cairo
     u_int32_t *pixel=s->backdata+ty*s->w;
     
-    for(i=tx;i<tx+tw;i++)
+    for(i=tx;i<tx+tw;i++){
+      _sv_lcolor_t outc = {0,0,0,0};
+  
+      s->mapfunc(rint(val*65536.f),255,&outc);
+
+  return m->mixfunc( (_sv_ucolor_t)(u_int32_t)((outc.a<<24) + (outc.r<<16) + (outc.g<<8) + outc.b),
+		     (_sv_ucolor_t)mix).u | 0xff000000;
+
       pixel[i]=_sv_mapping_calc(s->gradient,_sv_slider_pixel_to_mapdel(s,i), pixel[i]);
     
     for(i=ty+1;i<ty+th;i++){

Modified: trunk/sushivision/sushivision.h
===================================================================
--- trunk/sushivision/sushivision.h	2007-09-12 08:02:16 UTC (rev 13785)
+++ trunk/sushivision/sushivision.h	2007-09-12 09:21:43 UTC (rev 13786)
@@ -106,7 +106,6 @@
 				 void *callback_data);
 
 /* objectives ****************************************************/
-
 int                  sv_obj_new (char *decl,
 				 void (*function)(double *,double *),
 				 char *input_map,



More information about the commits mailing list