sw_sync: add fill_driver_data support
authorErik Gilling <konkers@android.com>
Fri, 16 Mar 2012 00:46:07 +0000 (17:46 -0700)
committerErik Gilling <konkers@android.com>
Wed, 18 Apr 2012 21:11:47 +0000 (14:11 -0700)
Change-Id: Ib3812d282db56362d82f5ccc9a12b7d2100ab93a
Signed-off-by: Erik Gilling <konkers@android.com>
drivers/base/sw_sync.c

index 41beb9eeeb38bb29cb30454e7edaa46ddba592ea..21ddf4ffd58944714d8a84b25ae19d4611163ce8 100644 (file)
@@ -86,6 +86,19 @@ static void sw_sync_print_pt(struct seq_file *s, struct sync_pt *sync_pt)
        seq_printf(s, "%d / %d", pt->value, obj->value);
 }
 
+static int sw_sync_fill_driver_data(struct sync_pt *sync_pt,
+                                   void *data, int size)
+{
+       struct sw_sync_pt *pt = (struct sw_sync_pt *)sync_pt;
+
+       if (size < sizeof(pt->value))
+               return -ENOMEM;
+
+       memcpy(data, &pt->value, sizeof(pt->value));
+
+       return sizeof(pt->value);
+}
+
 struct sync_timeline_ops sw_sync_timeline_ops = {
        .driver_name = "sw_sync",
        .dup = sw_sync_pt_dup,
@@ -93,6 +106,7 @@ struct sync_timeline_ops sw_sync_timeline_ops = {
        .compare = sw_sync_pt_compare,
        .print_obj = sw_sync_print_obj,
        .print_pt = sw_sync_print_pt,
+       .fill_driver_data = sw_sync_fill_driver_data,
 };