dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org,
	"Daniel Stone" <daniels@collabora.com>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"Riley Andrews" <riandrews@android.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	"Arve Hjønnevåg" <arve@android.com>,
	"Gustavo Padovan" <gustavo.padovan@collabora.co.uk>,
	"John Harrison" <John.C.Harrison@Intel.com>
Subject: [PATCH 03/11] staging/android: remove .fill_driver_data() timeline ops
Date: Tue, 26 Jan 2016 16:30:18 -0200	[thread overview]
Message-ID: <1453833026-24637-4-git-send-email-gustavo@padovan.org> (raw)
In-Reply-To: <1453833026-24637-1-git-send-email-gustavo@padovan.org>

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

The .fill_driver_data() ops was just a useless abstraction for
fence_ops op of the same name.

Now that we use fence->seqno to store the value it is cleaner to
remove the abstraction and fill the data directly.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/staging/android/sw_sync.c | 14 --------------
 drivers/staging/android/sync.c    |  9 +++++----
 drivers/staging/android/sync.h    |  7 -------
 3 files changed, 5 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/android/sw_sync.c b/drivers/staging/android/sw_sync.c
index b9d53d3..428e22c 100644
--- a/drivers/staging/android/sw_sync.c
+++ b/drivers/staging/android/sw_sync.c
@@ -38,19 +38,6 @@ struct fence *sw_sync_pt_create(struct sw_sync_timeline *obj, u32 value)
 }
 EXPORT_SYMBOL(sw_sync_pt_create);
 
-static int sw_sync_fill_driver_data(struct fence *fence,
-				    void *data, int size)
-{
-	struct sw_sync_pt *pt = (struct sw_sync_pt *)fence;
-
-	if (size < sizeof(pt->value))
-		return -ENOMEM;
-
-	memcpy(data, &pt->value, sizeof(pt->value));
-
-	return sizeof(pt->value);
-}
-
 static void sw_sync_timeline_value_str(struct sync_timeline *sync_timeline,
 				       char *str, int size)
 {
@@ -68,7 +55,6 @@ static void sw_sync_fence_value_str(struct fence *fence, char *str, int size)
 
 static struct sync_timeline_ops sw_sync_timeline_ops = {
 	.driver_name = "sw_sync",
-	.fill_driver_data = sw_sync_fill_driver_data,
 	.timeline_value_str = sw_sync_timeline_value_str,
 	.fence_value_str = sw_sync_fence_value_str,
 };
diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index 4eea5c3..39af5fb 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -185,11 +185,12 @@ static bool android_fence_enable_signaling(struct fence *fence)
 static int android_fence_fill_driver_data(struct fence *fence,
 					  void *data, int size)
 {
-	struct sync_timeline *parent = fence_parent(fence);
+	if (size < sizeof(fence->seqno))
+		return -ENOMEM;
+
+	memcpy(data, &fence->seqno, sizeof(fence->seqno));
 
-	if (!parent->ops->fill_driver_data)
-		return 0;
-	return parent->ops->fill_driver_data(fence, data, size);
+	return sizeof(fence->seqno);
 }
 
 static void android_fence_value_str(struct fence *fence,
diff --git a/drivers/staging/android/sync.h b/drivers/staging/android/sync.h
index 4d3dfbf..500838b 100644
--- a/drivers/staging/android/sync.h
+++ b/drivers/staging/android/sync.h
@@ -27,10 +27,6 @@ struct sync_timeline;
 /**
  * struct sync_timeline_ops - sync object implementation ops
  * @driver_name:	name of the implementation
- * @fill_driver_data:	write implementation specific driver data to data.
- *			  should return an error if there is not enough room
- *			  as specified by size.  This information is returned
- *			  to userspace by SYNC_IOC_FENCE_INFO.
  * @timeline_value_str: fill str with the value of the sync_timeline's counter
  * @fence_value_str:	fill str with the value of the fence
  */
@@ -38,9 +34,6 @@ struct sync_timeline_ops {
 	const char *driver_name;
 
 	/* optional */
-	int (*fill_driver_data)(struct fence *fence, void *data, int size);
-
-	/* optional */
 	void (*timeline_value_str)(struct sync_timeline *timeline, char *str,
 				   int size);
 
-- 
2.5.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2016-01-26 18:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26 18:30 [PATCH 00/11] sync framework de-staging: part 2 - de-stage Gustavo Padovan
2016-01-26 18:30 ` [PATCH 01/11] dma-buf/sync_file: de-stage sync_file Gustavo Padovan
2016-01-26 18:30 ` [PATCH 02/11] staging/android: store last signaled value on sync timeline Gustavo Padovan
2016-01-26 18:30 ` Gustavo Padovan [this message]
2016-01-26 18:30 ` [PATCH 04/11] staging/android: remove .{fence, timeline}_value_str() from timeline_ops Gustavo Padovan
2016-01-26 18:30 ` [PATCH 05/11] staging/android: remove struct sync_timeline_ops Gustavo Padovan
2016-01-26 18:30 ` [PATCH 06/11] staging/android: remove sw_sync_timeline and sw_sync_pt Gustavo Padovan
2016-01-26 18:30 ` [PATCH 07/11] staging/android: remove sw_sync.[ch] files Gustavo Padovan
2016-01-26 18:30 ` [PATCH 08/11] staging/android: rename android_fence to timeline_fence Gustavo Padovan
2016-01-26 18:30 ` [PATCH 09/11] dma-buf/sync_timeline: de-stage sync_timeline Gustavo Padovan
2016-01-26 20:07   ` Gustavo Padovan
2016-01-26 18:30 ` [PATCH 10/11] dma-buf/sync_file: bring debug back to sync file Gustavo Padovan
2016-01-26 18:30 ` [PATCH 11/11] dma-buf/sync_file: bring sync_dump() back Gustavo Padovan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453833026-24637-4-git-send-email-gustavo@padovan.org \
    --to=gustavo@padovan.org \
    --cc=John.C.Harrison@Intel.com \
    --cc=arve@android.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniels@collabora.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riandrews@android.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).