From patchwork Tue Jun 5 23:45:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Gilling X-Patchwork-Id: 9128 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 F3F8623E5A for ; Tue, 5 Jun 2012 23:46:23 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id AD80EA189E0 for ; Tue, 5 Jun 2012 23:46:23 +0000 (UTC) Received: by ggnf1 with SMTP id f1so5101674ggn.11 for ; Tue, 05 Jun 2012 16:46:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to :date:message-id:x-mailer:in-reply-to:references:subject:x-beenthere :x-mailman-version:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=6+VjsISyH80vuhD0VtFfuf68rF2EmtKWnbFrzxbe+3c=; b=bKcnkiI1UJ/JNVw1GyCMNeiFBb5PYfjZWbdyPbyviZUMxwmwjNIB1UP6bo4aTx7Qne QG/K3TSCNftbQk958Do/6lzhZOSUzgLHEeoV/zeu+kKVRLOd+pLb/CbzTUb1asTomi2P JFy1yXWydAmXkyLdel14twi7JLSnBuyGWr/fI4c++el6jd8E5Rk24WA36m/Lw1Soh7Gp J8elQTjw/j0GyoBSO2XAWlcfwi9fQgN34AD1zrqe2VG5tLl3h3xPL/UMUXQW3YJObu2E A+ZnV7Zf2NEzG6vOIBXNYbBKwJoAjcn9q822f3ylujDnZSUjhSvsk447VwpSCI49//kp DENQ== Received: by 10.50.40.193 with SMTP id z1mr4939412igk.0.1338939983066; Tue, 05 Jun 2012 16:46:23 -0700 (PDT) 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.231.24.148 with SMTP id v20csp52397ibb; Tue, 5 Jun 2012 16:46:22 -0700 (PDT) Received: by 10.216.225.15 with SMTP id y15mr14014661wep.138.1338939981624; Tue, 05 Jun 2012 16:46:21 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id c73si4973247wec.101.2012.06.05.16.46.20; Tue, 05 Jun 2012 16:46:21 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Sc3S5-0005l6-Ky; Tue, 05 Jun 2012 23:46:17 +0000 Received: from mail-bk0-f74.google.com ([209.85.214.74]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1Sc3Rx-0005hr-6g for linaro-mm-sig@lists.linaro.org; Tue, 05 Jun 2012 23:46:09 +0000 Received: by bkty5 with SMTP id y5so359280bkt.1 for ; Tue, 05 Jun 2012 16:46:08 -0700 (PDT) Received: by 10.14.29.66 with SMTP id h42mr5540536eea.13.1338939968891; Tue, 05 Jun 2012 16:46:08 -0700 (PDT) Received: by 10.14.29.66 with SMTP id h42mr5540532eea.13.1338939968795; Tue, 05 Jun 2012 16:46:08 -0700 (PDT) Received: from hpza9.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id v14si9539eef.2.2012.06.05.16.46.08 (version=TLSv1/SSLv3 cipher=AES128-SHA); Tue, 05 Jun 2012 16:46:08 -0700 (PDT) Received: from dirtysouth.mtv.corp.google.com (dirtysouth.mtv.corp.google.com [172.18.104.93]) by hpza9.eem.corp.google.com (Postfix) with ESMTP id 98A7B5C0050; Tue, 5 Jun 2012 16:46:08 -0700 (PDT) Received: by dirtysouth.mtv.corp.google.com (Postfix, from userid 94083) id 0808C40DB9; Tue, 5 Jun 2012 16:46:07 -0700 (PDT) From: Erik Gilling To: linaro-mm-sig@lists.linaro.org Date: Tue, 5 Jun 2012 16:45:52 -0700 Message-Id: <1338939956-17312-8-git-send-email-konkers@android.com> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1338939956-17312-1-git-send-email-konkers@android.com> References: <1338939956-17312-1-git-send-email-konkers@android.com> Subject: [Linaro-mm-sig] [RFC 07/11] sw_sync: add fill_driver_data support X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQn0lMEt8TdkDzyuAnHZvIUIkQfeGByoZAMqOATGs9Sob7CfvKXXtCalAiWILzkBCKG1UBnu Allows sw_sync private data to be available in get fence data ioctl. Signed-off-by: Erik Gilling --- drivers/base/sw_sync.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/drivers/base/sw_sync.c b/drivers/base/sw_sync.c index 41beb9e..21ddf4f 100644 --- a/drivers/base/sw_sync.c +++ b/drivers/base/sw_sync.c @@ -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, };