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: 2201491 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 6C7A8DF24C for ; Fri, 1 Mar 2013 12:38:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 64FF8E63BF for ; Fri, 1 Mar 2013 04:38:44 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by gabe.freedesktop.org (Postfix) with ESMTP id E282CE5F01 for ; Thu, 28 Feb 2013 16:43:50 -0800 (PST) Received: by mail-pa0-f50.google.com with SMTP id fa11so1455449pad.37 for ; Thu, 28 Feb 2013 16:43:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=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=pXs94N0DqwaWwzDxY0u/Y2rIH5CrEjLiPT7K/5pqTRuePL7McopW2lGO/q9QaoJwdz V6Xgp+6mrhtNrErMDm/aDuISG6EbDMa+t7w1XTAjTFrCeSptQUlTnYUwuAVFPc3PLTu7 hXp2k6Mmgmw4jjMOGjjqU+xiY3fefrzphpfCbdgzQgsBeBgII7FRA6OPVyUkO/vGWCnt EadCtkL/X7BoWA+uzEE85YkPhyW+a1XgY2B7QlpFrYkp20nxP1PbEyqwPqSLq8PIIlDZ 7SvVQC/yK5RQSg01SuhJUdOcl2WXU9K+MyDrIwC0AF1e2UDnPkRemMb1dPb/MEOT781h Ac5A== 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 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: ALoCoQktm8AGGOqGOdyM71AiHvXeuph1Tr/pG78rFLhnCLXQHJc5O7eYo4tswg/MsEiEIbSZtQRo X-Mailman-Approved-At: Fri, 01 Mar 2013 04:21:18 -0800 Cc: Daniel Vetter , dri-devel@lists.freedesktop.org, Rob Clark , John Stultz , Greg KH , Android Kernel Team X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org 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, };