From patchwork Fri Mar 1 00:43:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 15163 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id D37C423E1A for ; Fri, 1 Mar 2013 00:43:52 +0000 (UTC) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by fiordland.canonical.com (Postfix) with ESMTP id 7C2B1A1935F for ; Fri, 1 Mar 2013 00:43:52 +0000 (UTC) Received: by mail-vc0-f175.google.com with SMTP id p1so1070725vcq.34 for ; Thu, 28 Feb 2013 16:43:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=o9xpeGXd0s8Nue88//b8U/wdCVfGT6/gDt5wEYUX3Hc=; b=VSycH343bZYUtcP18SSTXAFYdtV+LxVt7ubU6TfvavpVA9n9d7OliAojJ/F7hNDNfN xnsFPtqna8ohvLPF37tw0Z6Gc4Asprx4ysnyu21jpoU+PshQSl/j4RU9xiZgydBu7Yjw 32vpd/2nxeSQ/cmGUc5LOzsr2bKPqRav4r59M+DF4YRmPUkqSdwGCr9/vmTbXZBtXeV2 ZVCxOjwQNu3ROVWgcTunZafpjXlntaCQj/ODd4p1j7AzgnAQsNHnf4Ly+pFHzBLymr1j 9ocbulLhUh00h75aD+E90e2A0Azh/l0aehZl/MNlVIY4Rj7jrQHBhUBZq2XayeYiEDOV Yk4g== X-Received: by 10.221.11.135 with SMTP id pe7mr3318374vcb.41.1362098632001; Thu, 28 Feb 2013 16:43:52 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp643veb; Thu, 28 Feb 2013 16:43:51 -0800 (PST) X-Received: by 10.68.170.34 with SMTP id aj2mr11597534pbc.208.1362098631203; Thu, 28 Feb 2013 16:43:51 -0800 (PST) Received: from mail-pb0-f53.google.com (mail-pb0-f53.google.com [209.85.160.53]) by mx.google.com with ESMTPS id tp2si4897585pbc.15.2013.02.28.16.43.50 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Feb 2013 16:43:51 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.53 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.53; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.53 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) smtp.mail=john.stultz@linaro.org Received: by mail-pb0-f53.google.com with SMTP id un1so1380221pbc.26 for ; Thu, 28 Feb 2013 16:43:50 -0800 (PST) X-Received: by 10.68.252.193 with SMTP id zu1mr11759873pbc.175.1362098630789; Thu, 28 Feb 2013 16:43:50 -0800 (PST) Received: from localhost.localdomain (c-24-21-54-107.hsd1.or.comcast.net. [24.21.54.107]) by mx.google.com with ESMTPS id dx17sm10914892pac.17.2013.02.28.16.43.49 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 28 Feb 2013 16:43:50 -0800 (PST) From: John Stultz To: lkml Cc: Erik Gilling , Maarten Lankhorst , Daniel Vetter , Rob Clark , Sumit Semwal , Greg KH , dri-devel@lists.freedesktop.org, Android Kernel Team , John Stultz Subject: [PATCH 07/30] staging: sw_sync: Add fill_driver_data support Date: Thu, 28 Feb 2013 16:43:03 -0800 Message-Id: <1362098606-26469-8-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1362098606-26469-1-git-send-email-john.stultz@linaro.org> References: <1362098606-26469-1-git-send-email-john.stultz@linaro.org> X-Gm-Message-State: ALoCoQlV/frONNeKFMB6gxe1LVKvNMB52Rs7LMJcPaV4YQk+GAhvm+JOMSAO3gRN2SoE7+V7laho From: Erik Gilling Add fill_driver_data support to export fence data to ioctl Cc: Maarten Lankhorst Cc: Erik Gilling Cc: Daniel Vetter Cc: Rob Clark Cc: Sumit Semwal Cc: Greg KH Cc: dri-devel@lists.freedesktop.org Cc: Android Kernel Team Signed-off-by: Erik Gilling [jstultz: Add commit message] Signed-off-by: John Stultz --- drivers/staging/android/sw_sync.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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, };