diff options
author | Erik Gilling <konkers@android.com> | 2013-03-01 00:43:03 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-04 09:40:08 (GMT) |
commit | b1489c2704b3db72ff37ecabe054926176e88e50 (patch) | |
tree | b4bd0340ca1a7858863684ebaa697876d33cf107 /drivers/staging/android/sw_sync.c | |
parent | 79ba1525a91e99cdd7a3b6a57c7537d13ac0ac19 (diff) | |
download | linux-b1489c2704b3db72ff37ecabe054926176e88e50.tar.xz |
staging: sw_sync: Add fill_driver_data support
Add fill_driver_data support to export fence data to ioctl
Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Erik Gilling <konkers@android.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Rob Clark <robclark@gmail.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: dri-devel@lists.freedesktop.org
Cc: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Erik Gilling <konkers@android.com>
[jstultz: Add commit message]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android/sw_sync.c')
-rw-r--r-- | drivers/staging/android/sw_sync.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c index 64c5ebb..081e4d1 100644 --- a/drivers/staging/android/sw_sync.c +++ b/drivers/staging/android/sw_sync.c @@ -87,6 +87,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, @@ -94,6 +107,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, }; |