* [PATCH v8 00/16] dma-fence: Deadline awareness
@ 2023-02-28 22:58 Rob Clark
2023-02-28 22:58 ` [PATCH v8 01/16] dma-buf/dma-fence: Add deadline awareness Rob Clark
2023-02-28 22:58 ` [PATCH v8 05/16] dma-buf/sync_file: Surface sync-file uABI Rob Clark
0 siblings, 2 replies; 6+ messages in thread
From: Rob Clark @ 2023-02-28 22:58 UTC (permalink / raw)
To: dri-devel
Cc: freedreno, Daniel Vetter, Christian König,
Michel Dänzer, Tvrtko Ursulin, Rodrigo Vivi, Alex Deucher,
Pekka Paalanen, Simon Ser, Luben Tuikov, Rob Clark, Abhinav Kumar,
Dmitry Baryshkov, Douglas Anderson, Gustavo Padovan, intel-gfx,
moderated list:DMA BUFFER SHARING FRAMEWORK,
open list:DRM DRIVER FOR MSM ADRENO GPU, open list:DOCUMENTATION,
open list, open list:DMA BUFFER SHARING FRAMEWORK, Liu Shixin,
Sean Paul, Stephen Boyd, Vinod Koul, Vinod Polimera
From: Rob Clark <robdclark@chromium.org>
This series adds a deadline hint to fences, so realtime deadlines
such as vblank can be communicated to the fence signaller for power/
frequency management decisions.
This is partially inspired by a trick i915 does, but implemented
via dma-fence for a couple of reasons:
1) To continue to be able to use the atomic helpers
2) To support cases where display and gpu are different drivers
This iteration adds a dma-fence ioctl to set a deadline (both to
support igt-tests, and compositors which delay decisions about which
client buffer to display), and a sw_sync ioctl to read back the
deadline. IGT tests utilizing these can be found at:
https://gitlab.freedesktop.org/robclark/igt-gpu-tools/-/commits/fence-deadline
v1: https://patchwork.freedesktop.org/series/93035/
v2: Move filtering out of later deadlines to fence implementation
to avoid increasing the size of dma_fence
v3: Add support in fence-array and fence-chain; Add some uabi to
support igt tests and userspace compositors.
v4: Rebase, address various comments, and add syncobj deadline
support, and sync_file EPOLLPRI based on experience with perf/
freq issues with clvk compute workloads on i915 (anv)
v5: Clarify that this is a hint as opposed to a more hard deadline
guarantee, switch to using u64 ns values in UABI (still absolute
CLOCK_MONOTONIC values), drop syncobj related cap and driver
feature flag in favor of allowing count_handles==0 for probing
kernel support.
v6: Re-work vblank helper to calculate time of _start_ of vblank,
and work correctly if the last vblank event was more than a
frame ago. Add (mostly unrelated) drm/msm patch which also
uses the vblank helper. Use dma_fence_chain_contained(). More
verbose syncobj UABI comments. Drop DMA_FENCE_FLAG_HAS_DEADLINE_BIT.
v7: Fix kbuild complaints about vblank helper. Add more docs.
v8: Add patch to surface sync_file UAPI, and more docs updates.
Rob Clark (16):
dma-buf/dma-fence: Add deadline awareness
dma-buf/fence-array: Add fence deadline support
dma-buf/fence-chain: Add fence deadline support
dma-buf/dma-resv: Add a way to set fence deadline
dma-buf/sync_file: Surface sync-file uABI
dma-buf/sync_file: Add SET_DEADLINE ioctl
dma-buf/sync_file: Support (E)POLLPRI
dma-buf/sw_sync: Add fence deadline support
drm/scheduler: Add fence deadline support
drm/syncobj: Add deadline support for syncobj waits
drm/vblank: Add helper to get next vblank time
drm/atomic-helper: Set fence deadline for vblank
drm/msm: Add deadline based boost support
drm/msm: Add wait-boost support
drm/msm/atomic: Switch to vblank_start helper
drm/i915: Add deadline based boost support
Documentation/driver-api/dma-buf.rst | 16 ++++-
drivers/dma-buf/dma-fence-array.c | 11 ++++
drivers/dma-buf/dma-fence-chain.c | 12 ++++
drivers/dma-buf/dma-fence.c | 60 ++++++++++++++++++
drivers/dma-buf/dma-resv.c | 22 +++++++
drivers/dma-buf/sw_sync.c | 81 +++++++++++++++++++++++++
drivers/dma-buf/sync_debug.h | 2 +
drivers/dma-buf/sync_file.c | 27 +++++++++
drivers/gpu/drm/drm_atomic_helper.c | 36 +++++++++++
drivers/gpu/drm/drm_syncobj.c | 64 +++++++++++++++----
drivers/gpu/drm/drm_vblank.c | 53 +++++++++++++---
drivers/gpu/drm/i915/i915_request.c | 20 ++++++
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 15 -----
drivers/gpu/drm/msm/msm_atomic.c | 8 ++-
drivers/gpu/drm/msm/msm_drv.c | 12 ++--
drivers/gpu/drm/msm/msm_fence.c | 74 ++++++++++++++++++++++
drivers/gpu/drm/msm/msm_fence.h | 20 ++++++
drivers/gpu/drm/msm/msm_gem.c | 5 ++
drivers/gpu/drm/msm/msm_kms.h | 8 ---
drivers/gpu/drm/scheduler/sched_fence.c | 46 ++++++++++++++
drivers/gpu/drm/scheduler/sched_main.c | 2 +-
include/drm/drm_vblank.h | 1 +
include/drm/gpu_scheduler.h | 17 ++++++
include/linux/dma-fence.h | 22 +++++++
include/linux/dma-resv.h | 2 +
include/uapi/drm/drm.h | 17 ++++++
include/uapi/drm/msm_drm.h | 14 ++++-
include/uapi/linux/sync_file.h | 57 ++++++++++-------
28 files changed, 646 insertions(+), 78 deletions(-)
--
2.39.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v8 01/16] dma-buf/dma-fence: Add deadline awareness
2023-02-28 22:58 [PATCH v8 00/16] dma-fence: Deadline awareness Rob Clark
@ 2023-02-28 22:58 ` Rob Clark
2023-03-01 8:28 ` Bagas Sanjaya
2023-02-28 22:58 ` [PATCH v8 05/16] dma-buf/sync_file: Surface sync-file uABI Rob Clark
1 sibling, 1 reply; 6+ messages in thread
From: Rob Clark @ 2023-02-28 22:58 UTC (permalink / raw)
To: dri-devel
Cc: freedreno, Daniel Vetter, Christian König,
Michel Dänzer, Tvrtko Ursulin, Rodrigo Vivi, Alex Deucher,
Pekka Paalanen, Simon Ser, Luben Tuikov, Rob Clark,
Christian König, Pekka Paalanen, Sumit Semwal,
Jonathan Corbet, Gustavo Padovan,
open list:DMA BUFFER SHARING FRAMEWORK,
moderated list:DMA BUFFER SHARING FRAMEWORK,
open list:DOCUMENTATION, open list
From: Rob Clark <robdclark@chromium.org>
Add a way to hint to the fence signaler of an upcoming deadline, such as
vblank, which the fence waiter would prefer not to miss. This is to aid
the fence signaler in making power management decisions, like boosting
frequency as the deadline approaches and awareness of missing deadlines
so that can be factored in to the frequency scaling.
v2: Drop dma_fence::deadline and related logic to filter duplicate
deadlines, to avoid increasing dma_fence size. The fence-context
implementation will need similar logic to track deadlines of all
the fences on the same timeline. [ckoenig]
v3: Clarify locking wrt. set_deadline callback
v4: Clarify in docs comment that this is a hint
v5: Drop DMA_FENCE_FLAG_HAS_DEADLINE_BIT.
v6: More docs
v7: Fix typo, clarify past deadlines
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
---
Documentation/driver-api/dma-buf.rst | 6 +++
drivers/dma-buf/dma-fence.c | 59 ++++++++++++++++++++++++++++
include/linux/dma-fence.h | 22 +++++++++++
3 files changed, 87 insertions(+)
diff --git a/Documentation/driver-api/dma-buf.rst b/Documentation/driver-api/dma-buf.rst
index 622b8156d212..183e480d8cea 100644
--- a/Documentation/driver-api/dma-buf.rst
+++ b/Documentation/driver-api/dma-buf.rst
@@ -164,6 +164,12 @@ DMA Fence Signalling Annotations
.. kernel-doc:: drivers/dma-buf/dma-fence.c
:doc: fence signalling annotation
+DMA Fence Deadline Hints
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. kernel-doc:: drivers/dma-buf/dma-fence.c
+ :doc: deadline hints
+
DMA Fences Functions Reference
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 0de0482cd36e..f177c56269bb 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -912,6 +912,65 @@ dma_fence_wait_any_timeout(struct dma_fence **fences, uint32_t count,
}
EXPORT_SYMBOL(dma_fence_wait_any_timeout);
+/**
+ * DOC: deadline hints
+ *
+ * In an ideal world, it would be possible to pipeline a workload sufficiently
+ * that a utilization based device frequency governor could arrive at a minimum
+ * frequency that meets the requirements of the use-case, in order to minimize
+ * power consumption. But in the real world there are many workloads which
+ * defy this ideal. For example, but not limited to:
+ *
+ * * Workloads that ping-pong between device and CPU, with alternating periods
+ * of CPU waiting for device, and device waiting on CPU. This can result in
+ * devfreq and cpufreq seeing idle time in their respective domains and in
+ * result reduce frequency.
+ *
+ * * Workloads that interact with a periodic time based deadline, such as double
+ * buffered GPU rendering vs vblank sync'd page flipping. In this scenario,
+ * missing a vblank deadline results in an *increase* in idle time on the GPU
+ * (since it has to wait an additional vblank period), sending a signal to
+ * the GPU's devfreq to reduce frequency, when in fact the opposite is what is
+ * needed.
+ *
+ * To this end, deadline hint(s) can be set on a &dma_fence via &dma_fence_set_deadline.
+ * The deadline hint provides a way for the waiting driver, or userspace, to
+ * convey an appropriate sense of urgency to the signaling driver.
+ *
+ * A deadline hint is given in absolute ktime (CLOCK_MONOTONIC for userspace
+ * facing APIs). The time could either be some point in the future (such as
+ * the vblank based deadline for page-flipping, or the start of a compositor's
+ * composition cycle), or the current time to indicate an immediate deadline
+ * hint (Ie. forward progress cannot be made until this fence is signaled).
+ *
+ * Multiple deadlines may be set on a given fence, even in parallel. See the
+ * documentation for &dma_fence_ops.set_deadline.
+ *
+ * The deadline hint is just that, a hint. The driver that created the fence
+ * may react by increasing frequency, making different scheduling choices, etc.
+ * Or doing nothing at all.
+ */
+
+/**
+ * dma_fence_set_deadline - set desired fence-wait deadline hint
+ * @fence: the fence that is to be waited on
+ * @deadline: the time by which the waiter hopes for the fence to be
+ * signaled
+ *
+ * Give the fence signaler a hint about an upcoming deadline, such as
+ * vblank, by which point the waiter would prefer the fence to be
+ * signaled by. This is intended to give feedback to the fence signaler
+ * to aid in power management decisions, such as boosting GPU frequency
+ * if a periodic vblank deadline is approaching but the fence is not
+ * yet signaled..
+ */
+void dma_fence_set_deadline(struct dma_fence *fence, ktime_t deadline)
+{
+ if (fence->ops->set_deadline && !dma_fence_is_signaled(fence))
+ fence->ops->set_deadline(fence, deadline);
+}
+EXPORT_SYMBOL(dma_fence_set_deadline);
+
/**
* dma_fence_describe - Dump fence describtion into seq_file
* @fence: the 6fence to describe
diff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h
index 775cdc0b4f24..d54b595a0fe0 100644
--- a/include/linux/dma-fence.h
+++ b/include/linux/dma-fence.h
@@ -257,6 +257,26 @@ struct dma_fence_ops {
*/
void (*timeline_value_str)(struct dma_fence *fence,
char *str, int size);
+
+ /**
+ * @set_deadline:
+ *
+ * Callback to allow a fence waiter to inform the fence signaler of
+ * an upcoming deadline, such as vblank, by which point the waiter
+ * would prefer the fence to be signaled by. This is intended to
+ * give feedback to the fence signaler to aid in power management
+ * decisions, such as boosting GPU frequency.
+ *
+ * This is called without &dma_fence.lock held, it can be called
+ * multiple times and from any context. Locking is up to the callee
+ * if it has some state to manage. If multiple deadlines are set,
+ * the expectation is to track the soonest one. If the deadline is
+ * before the current time, it should be interpreted as an immediate
+ * deadline.
+ *
+ * This callback is optional.
+ */
+ void (*set_deadline)(struct dma_fence *fence, ktime_t deadline);
};
void dma_fence_init(struct dma_fence *fence, const struct dma_fence_ops *ops,
@@ -583,6 +603,8 @@ static inline signed long dma_fence_wait(struct dma_fence *fence, bool intr)
return ret < 0 ? ret : 0;
}
+void dma_fence_set_deadline(struct dma_fence *fence, ktime_t deadline);
+
struct dma_fence *dma_fence_get_stub(void);
struct dma_fence *dma_fence_allocate_private_stub(void);
u64 dma_fence_context_alloc(unsigned num);
--
2.39.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v8 05/16] dma-buf/sync_file: Surface sync-file uABI
2023-02-28 22:58 [PATCH v8 00/16] dma-fence: Deadline awareness Rob Clark
2023-02-28 22:58 ` [PATCH v8 01/16] dma-buf/dma-fence: Add deadline awareness Rob Clark
@ 2023-02-28 22:58 ` Rob Clark
2023-03-01 8:52 ` Pekka Paalanen
2023-03-02 3:50 ` kernel test robot
1 sibling, 2 replies; 6+ messages in thread
From: Rob Clark @ 2023-02-28 22:58 UTC (permalink / raw)
To: dri-devel
Cc: freedreno, Daniel Vetter, Christian König,
Michel Dänzer, Tvrtko Ursulin, Rodrigo Vivi, Alex Deucher,
Pekka Paalanen, Simon Ser, Luben Tuikov, Rob Clark, Sumit Semwal,
Christian König, Jonathan Corbet, Gustavo Padovan,
open list:DMA BUFFER SHARING FRAMEWORK,
moderated list:DMA BUFFER SHARING FRAMEWORK,
open list:DOCUMENTATION, open list
From: Rob Clark <robdclark@chromium.org>
We had all of the internal driver APIs, but not the all important
userspace uABI, in the dma-buf doc. Fix that. And re-arrange the
comments slightly as otherwise the comments for the ioctl nr defines
would not show up.
Signed-off-by: Rob Clark <robdclark@chromium.org>
---
Documentation/driver-api/dma-buf.rst | 10 ++++++--
include/uapi/linux/sync_file.h | 35 +++++++++++-----------------
2 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/Documentation/driver-api/dma-buf.rst b/Documentation/driver-api/dma-buf.rst
index 183e480d8cea..ff3f8da296af 100644
--- a/Documentation/driver-api/dma-buf.rst
+++ b/Documentation/driver-api/dma-buf.rst
@@ -203,8 +203,8 @@ DMA Fence unwrap
.. kernel-doc:: include/linux/dma-fence-unwrap.h
:internal:
-DMA Fence uABI/Sync File
-~~~~~~~~~~~~~~~~~~~~~~~~
+DMA Fence Sync File
+~~~~~~~~~~~~~~~~~~~
.. kernel-doc:: drivers/dma-buf/sync_file.c
:export:
@@ -212,6 +212,12 @@ DMA Fence uABI/Sync File
.. kernel-doc:: include/linux/sync_file.h
:internal:
+DMA Fence Sync File uABI
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. kernel-doc:: include/uapi/linux/sync_file.h
+ :internal:
+
Indefinite DMA Fences
~~~~~~~~~~~~~~~~~~~~~
diff --git a/include/uapi/linux/sync_file.h b/include/uapi/linux/sync_file.h
index ee2dcfb3d660..eced40c204d7 100644
--- a/include/uapi/linux/sync_file.h
+++ b/include/uapi/linux/sync_file.h
@@ -16,12 +16,16 @@
#include <linux/types.h>
/**
- * struct sync_merge_data - data passed to merge ioctl
+ * struct sync_merge_data - SYNC_IOC_MERGE: merge two fences
* @name: name of new fence
* @fd2: file descriptor of second fence
* @fence: returns the fd of the new fence to userspace
* @flags: merge_data flags
* @pad: padding for 64-bit alignment, should always be zero
+ *
+ * Creates a new fence containing copies of the sync_pts in both
+ * the calling fd and sync_merge_data.fd2. Returns the new fence's
+ * fd in sync_merge_data.fence
*/
struct sync_merge_data {
char name[32];
@@ -34,8 +38,8 @@ struct sync_merge_data {
/**
* struct sync_fence_info - detailed fence information
* @obj_name: name of parent sync_timeline
-* @driver_name: name of driver implementing the parent
-* @status: status of the fence 0:active 1:signaled <0:error
+ * @driver_name: name of driver implementing the parent
+ * @status: status of the fence 0:active 1:signaled <0:error
* @flags: fence_info flags
* @timestamp_ns: timestamp of status change in nanoseconds
*/
@@ -48,14 +52,19 @@ struct sync_fence_info {
};
/**
- * struct sync_file_info - data returned from fence info ioctl
+ * struct sync_file_info - SYNC_IOC_FILE_INFO: get detailed information on a sync_file
* @name: name of fence
* @status: status of fence. 1: signaled 0:active <0:error
* @flags: sync_file_info flags
* @num_fences number of fences in the sync_file
* @pad: padding for 64-bit alignment, should always be zero
- * @sync_fence_info: pointer to array of structs sync_fence_info with all
+ * @sync_fence_info: pointer to array of struct &sync_fence_info with all
* fences in the sync_file
+ *
+ * Takes a struct sync_file_info. If num_fences is 0, the field is updated
+ * with the actual number of fences. If num_fences is > 0, the system will
+ * use the pointer provided on sync_fence_info to return up to num_fences of
+ * struct sync_fence_info, with detailed fence information.
*/
struct sync_file_info {
char name[32];
@@ -76,23 +85,7 @@ struct sync_file_info {
* no upstream users available.
*/
-/**
- * DOC: SYNC_IOC_MERGE - merge two fences
- *
- * Takes a struct sync_merge_data. Creates a new fence containing copies of
- * the sync_pts in both the calling fd and sync_merge_data.fd2. Returns the
- * new fence's fd in sync_merge_data.fence
- */
#define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 3, struct sync_merge_data)
-
-/**
- * DOC: SYNC_IOC_FILE_INFO - get detailed information on a sync_file
- *
- * Takes a struct sync_file_info. If num_fences is 0, the field is updated
- * with the actual number of fences. If num_fences is > 0, the system will
- * use the pointer provided on sync_fence_info to return up to num_fences of
- * struct sync_fence_info, with detailed fence information.
- */
#define SYNC_IOC_FILE_INFO _IOWR(SYNC_IOC_MAGIC, 4, struct sync_file_info)
#endif /* _UAPI_LINUX_SYNC_H */
--
2.39.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v8 01/16] dma-buf/dma-fence: Add deadline awareness
2023-02-28 22:58 ` [PATCH v8 01/16] dma-buf/dma-fence: Add deadline awareness Rob Clark
@ 2023-03-01 8:28 ` Bagas Sanjaya
0 siblings, 0 replies; 6+ messages in thread
From: Bagas Sanjaya @ 2023-03-01 8:28 UTC (permalink / raw)
To: Rob Clark, dri-devel
Cc: freedreno, Daniel Vetter, Christian König,
Michel Dänzer, Tvrtko Ursulin, Rodrigo Vivi, Alex Deucher,
Pekka Paalanen, Simon Ser, Luben Tuikov, Rob Clark,
Christian König, Pekka Paalanen, Sumit Semwal,
Jonathan Corbet, Gustavo Padovan,
open list:DMA BUFFER SHARING FRAMEWORK,
moderated list:DMA BUFFER SHARING FRAMEWORK,
open list:DOCUMENTATION, open list
On 3/1/23 05:58, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
>
> Add a way to hint to the fence signaler of an upcoming deadline, such as
> vblank, which the fence waiter would prefer not to miss. This is to aid
> the fence signaler in making power management decisions, like boosting
> frequency as the deadline approaches and awareness of missing deadlines
> so that can be factored in to the frequency scaling.
>
> v2: Drop dma_fence::deadline and related logic to filter duplicate
> deadlines, to avoid increasing dma_fence size. The fence-context
> implementation will need similar logic to track deadlines of all
> the fences on the same timeline. [ckoenig]
> v3: Clarify locking wrt. set_deadline callback
> v4: Clarify in docs comment that this is a hint
> v5: Drop DMA_FENCE_FLAG_HAS_DEADLINE_BIT.
> v6: More docs
> v7: Fix typo, clarify past deadlines
>
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> Reviewed-by: Christian König <christian.koenig@amd.com>
> Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
I have given my Reviewed-by from v7 [1], but it didn't get picked up,
thus giving it again:
Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
Thanks.
[1]: https://lore.kernel.org/linux-doc/Y%2F7LfLxhIjDpD4D3@debian.me/
--
An old man doll... just what I always wanted! - Clara
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v8 05/16] dma-buf/sync_file: Surface sync-file uABI
2023-02-28 22:58 ` [PATCH v8 05/16] dma-buf/sync_file: Surface sync-file uABI Rob Clark
@ 2023-03-01 8:52 ` Pekka Paalanen
2023-03-02 3:50 ` kernel test robot
1 sibling, 0 replies; 6+ messages in thread
From: Pekka Paalanen @ 2023-03-01 8:52 UTC (permalink / raw)
To: Rob Clark
Cc: dri-devel, freedreno, Daniel Vetter, Christian König,
Michel Dänzer, Tvrtko Ursulin, Rodrigo Vivi, Alex Deucher,
Simon Ser, Luben Tuikov, Rob Clark, Sumit Semwal,
Christian König, Jonathan Corbet, Gustavo Padovan,
open list:DMA BUFFER SHARING FRAMEWORK,
moderated list:DMA BUFFER SHARING FRAMEWORK,
open list:DOCUMENTATION, open list
[-- Attachment #1: Type: text/plain, Size: 4918 bytes --]
On Tue, 28 Feb 2023 14:58:09 -0800
Rob Clark <robdclark@gmail.com> wrote:
> From: Rob Clark <robdclark@chromium.org>
>
> We had all of the internal driver APIs, but not the all important
> userspace uABI, in the dma-buf doc. Fix that. And re-arrange the
> comments slightly as otherwise the comments for the ioctl nr defines
> would not show up.
>
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
> Documentation/driver-api/dma-buf.rst | 10 ++++++--
> include/uapi/linux/sync_file.h | 35 +++++++++++-----------------
> 2 files changed, 22 insertions(+), 23 deletions(-)
>
Sounds good.
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Thanks,
pq
> diff --git a/Documentation/driver-api/dma-buf.rst b/Documentation/driver-api/dma-buf.rst
> index 183e480d8cea..ff3f8da296af 100644
> --- a/Documentation/driver-api/dma-buf.rst
> +++ b/Documentation/driver-api/dma-buf.rst
> @@ -203,8 +203,8 @@ DMA Fence unwrap
> .. kernel-doc:: include/linux/dma-fence-unwrap.h
> :internal:
>
> -DMA Fence uABI/Sync File
> -~~~~~~~~~~~~~~~~~~~~~~~~
> +DMA Fence Sync File
> +~~~~~~~~~~~~~~~~~~~
>
> .. kernel-doc:: drivers/dma-buf/sync_file.c
> :export:
> @@ -212,6 +212,12 @@ DMA Fence uABI/Sync File
> .. kernel-doc:: include/linux/sync_file.h
> :internal:
>
> +DMA Fence Sync File uABI
> +~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +.. kernel-doc:: include/uapi/linux/sync_file.h
> + :internal:
> +
> Indefinite DMA Fences
> ~~~~~~~~~~~~~~~~~~~~~
>
> diff --git a/include/uapi/linux/sync_file.h b/include/uapi/linux/sync_file.h
> index ee2dcfb3d660..eced40c204d7 100644
> --- a/include/uapi/linux/sync_file.h
> +++ b/include/uapi/linux/sync_file.h
> @@ -16,12 +16,16 @@
> #include <linux/types.h>
>
> /**
> - * struct sync_merge_data - data passed to merge ioctl
> + * struct sync_merge_data - SYNC_IOC_MERGE: merge two fences
> * @name: name of new fence
> * @fd2: file descriptor of second fence
> * @fence: returns the fd of the new fence to userspace
> * @flags: merge_data flags
> * @pad: padding for 64-bit alignment, should always be zero
> + *
> + * Creates a new fence containing copies of the sync_pts in both
> + * the calling fd and sync_merge_data.fd2. Returns the new fence's
> + * fd in sync_merge_data.fence
> */
> struct sync_merge_data {
> char name[32];
> @@ -34,8 +38,8 @@ struct sync_merge_data {
> /**
> * struct sync_fence_info - detailed fence information
> * @obj_name: name of parent sync_timeline
> -* @driver_name: name of driver implementing the parent
> -* @status: status of the fence 0:active 1:signaled <0:error
> + * @driver_name: name of driver implementing the parent
> + * @status: status of the fence 0:active 1:signaled <0:error
> * @flags: fence_info flags
> * @timestamp_ns: timestamp of status change in nanoseconds
> */
> @@ -48,14 +52,19 @@ struct sync_fence_info {
> };
>
> /**
> - * struct sync_file_info - data returned from fence info ioctl
> + * struct sync_file_info - SYNC_IOC_FILE_INFO: get detailed information on a sync_file
> * @name: name of fence
> * @status: status of fence. 1: signaled 0:active <0:error
> * @flags: sync_file_info flags
> * @num_fences number of fences in the sync_file
> * @pad: padding for 64-bit alignment, should always be zero
> - * @sync_fence_info: pointer to array of structs sync_fence_info with all
> + * @sync_fence_info: pointer to array of struct &sync_fence_info with all
> * fences in the sync_file
> + *
> + * Takes a struct sync_file_info. If num_fences is 0, the field is updated
> + * with the actual number of fences. If num_fences is > 0, the system will
> + * use the pointer provided on sync_fence_info to return up to num_fences of
> + * struct sync_fence_info, with detailed fence information.
> */
> struct sync_file_info {
> char name[32];
> @@ -76,23 +85,7 @@ struct sync_file_info {
> * no upstream users available.
> */
>
> -/**
> - * DOC: SYNC_IOC_MERGE - merge two fences
> - *
> - * Takes a struct sync_merge_data. Creates a new fence containing copies of
> - * the sync_pts in both the calling fd and sync_merge_data.fd2. Returns the
> - * new fence's fd in sync_merge_data.fence
> - */
> #define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 3, struct sync_merge_data)
> -
> -/**
> - * DOC: SYNC_IOC_FILE_INFO - get detailed information on a sync_file
> - *
> - * Takes a struct sync_file_info. If num_fences is 0, the field is updated
> - * with the actual number of fences. If num_fences is > 0, the system will
> - * use the pointer provided on sync_fence_info to return up to num_fences of
> - * struct sync_fence_info, with detailed fence information.
> - */
> #define SYNC_IOC_FILE_INFO _IOWR(SYNC_IOC_MAGIC, 4, struct sync_file_info)
>
> #endif /* _UAPI_LINUX_SYNC_H */
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v8 05/16] dma-buf/sync_file: Surface sync-file uABI
2023-02-28 22:58 ` [PATCH v8 05/16] dma-buf/sync_file: Surface sync-file uABI Rob Clark
2023-03-01 8:52 ` Pekka Paalanen
@ 2023-03-02 3:50 ` kernel test robot
1 sibling, 0 replies; 6+ messages in thread
From: kernel test robot @ 2023-03-02 3:50 UTC (permalink / raw)
To: Rob Clark, dri-devel; +Cc: linux-doc, linux-kernel
Hi Rob,
I love your patch! Perhaps something to improve:
[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on drm-intel/for-linux-next-fixes drm/drm-next linus/master v6.2 next-20230301]
[cannot apply to drm-misc/drm-misc-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Rob-Clark/dma-buf-dma-fence-Add-deadline-awareness/20230301-070358
base: git://anongit.freedesktop.org/drm-intel for-linux-next
patch link: https://lore.kernel.org/r/20230228225833.2920879-6-robdclark%40gmail.com
patch subject: [PATCH v8 05/16] dma-buf/sync_file: Surface sync-file uABI
reproduce:
# https://github.com/intel-lab-lkp/linux/commit/b13821931cc3898065e4264fad78bad23c7d2208
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Rob-Clark/dma-buf-dma-fence-Add-deadline-awareness/20230301-070358
git checkout b13821931cc3898065e4264fad78bad23c7d2208
make menuconfig
# enable CONFIG_COMPILE_TEST, CONFIG_WARN_MISSING_DOCUMENTS, CONFIG_WARN_ABI_ERRORS
make htmldocs
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303021119.RAl7HvmC-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> ./include/uapi/linux/sync_file.h:82: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
vim +82 ./include/uapi/linux/sync_file.h
64907b94dab947 drivers/staging/android/uapi/sync.h Colin Cross 2014-02-17 80
2d75c88fefb228 drivers/staging/android/uapi/sync.h Gustavo Padovan 2016-04-26 81 /**
2d75c88fefb228 drivers/staging/android/uapi/sync.h Gustavo Padovan 2016-04-26 @82 * Opcodes 0, 1 and 2 were burned during a API change to avoid users of the
2d75c88fefb228 drivers/staging/android/uapi/sync.h Gustavo Padovan 2016-04-26 83 * old API to get weird errors when trying to handling sync_files. The API
2d75c88fefb228 drivers/staging/android/uapi/sync.h Gustavo Padovan 2016-04-26 84 * change happened during the de-stage of the Sync Framework when there was
2d75c88fefb228 drivers/staging/android/uapi/sync.h Gustavo Padovan 2016-04-26 85 * no upstream users available.
2d75c88fefb228 drivers/staging/android/uapi/sync.h Gustavo Padovan 2016-04-26 86 */
2d75c88fefb228 drivers/staging/android/uapi/sync.h Gustavo Padovan 2016-04-26 87
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-03-02 3:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-28 22:58 [PATCH v8 00/16] dma-fence: Deadline awareness Rob Clark
2023-02-28 22:58 ` [PATCH v8 01/16] dma-buf/dma-fence: Add deadline awareness Rob Clark
2023-03-01 8:28 ` Bagas Sanjaya
2023-02-28 22:58 ` [PATCH v8 05/16] dma-buf/sync_file: Surface sync-file uABI Rob Clark
2023-03-01 8:52 ` Pekka Paalanen
2023-03-02 3:50 ` kernel test robot
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).