Skip to content

Commit 1233d1d

Browse files
committed
tools headers UAPI: Update tools's copy of drm.h headers to pick DRM_IOCTL_MODE_CLOSEFB
Picking the changes from: 8570c27 ("drm/syncobj: Add deadline support for syncobj waits") 9724ed6 ("drm: Introduce DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT") e4d983a ("drm: introduce DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP") d208d87 ("drm: introduce CLOSEFB IOCTL") afa5cf3 ("drm/i915/uapi: fix typos/spellos and punctuation") Addressing these perf build warnings: Warning: Kernel ABI header differences: Now 'perf trace' and other code that might use the tools/perf/trace/beauty autogenerated tables will be able to translate this new ioctl command into a string: $ tools/perf/trace/beauty/drm_ioctl.sh > before $ cp include/uapi/drm/drm.h tools/include/uapi/drm/drm.h $ tools/perf/trace/beauty/drm_ioctl.sh > after $ diff -u before after --- before 2024-01-26 10:54:23.486381862 -0300 +++ after 2024-01-26 10:54:35.767902442 -0300 @@ -109,6 +109,7 @@ [0xCD] = "SYNCOBJ_TIMELINE_SIGNAL", [0xCE] = "MODE_GETFB2", [0xCF] = "SYNCOBJ_EVENTFD", + [0xD0] = "MODE_CLOSEFB", [DRM_COMMAND_BASE + 0x00] = "I915_INIT", [DRM_COMMAND_BASE + 0x01] = "I915_FLUSH", [DRM_COMMAND_BASE + 0x02] = "I915_FLIP", $ Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Cc: Ian Rogers <irogers@google.com> Cc: Javier Martinez Canillas <javierm@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Rob Clark <robdclark@chromium.org> Cc: Simon Ser <contact@emersion.fr> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Zack Rusin <zack.rusin@broadcom.com> Link: https://lore.kernel.org/lkml/ZbPIN9Dcc5AM0uxo@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 9a8dd2f commit 1233d1d

File tree

2 files changed

+77
-7
lines changed

2 files changed

+77
-7
lines changed

tools/include/uapi/drm/drm.h

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,8 @@ struct drm_gem_open {
713713
/**
714714
* DRM_CAP_ASYNC_PAGE_FLIP
715715
*
716-
* If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC.
716+
* If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC for legacy
717+
* page-flips.
717718
*/
718719
#define DRM_CAP_ASYNC_PAGE_FLIP 0x7
719720
/**
@@ -773,6 +774,13 @@ struct drm_gem_open {
773774
* :ref:`drm_sync_objects`.
774775
*/
775776
#define DRM_CAP_SYNCOBJ_TIMELINE 0x14
777+
/**
778+
* DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP
779+
*
780+
* If set to 1, the driver supports &DRM_MODE_PAGE_FLIP_ASYNC for atomic
781+
* commits.
782+
*/
783+
#define DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP 0x15
776784

777785
/* DRM_IOCTL_GET_CAP ioctl argument type */
778786
struct drm_get_cap {
@@ -842,6 +850,31 @@ struct drm_get_cap {
842850
*/
843851
#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5
844852

853+
/**
854+
* DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT
855+
*
856+
* Drivers for para-virtualized hardware (e.g. vmwgfx, qxl, virtio and
857+
* virtualbox) have additional restrictions for cursor planes (thus
858+
* making cursor planes on those drivers not truly universal,) e.g.
859+
* they need cursor planes to act like one would expect from a mouse
860+
* cursor and have correctly set hotspot properties.
861+
* If this client cap is not set the DRM core will hide cursor plane on
862+
* those virtualized drivers because not setting it implies that the
863+
* client is not capable of dealing with those extra restictions.
864+
* Clients which do set cursor hotspot and treat the cursor plane
865+
* like a mouse cursor should set this property.
866+
* The client must enable &DRM_CLIENT_CAP_ATOMIC first.
867+
*
868+
* Setting this property on drivers which do not special case
869+
* cursor planes (i.e. non-virtualized drivers) will return
870+
* EOPNOTSUPP, which can be used by userspace to gauge
871+
* requirements of the hardware/drivers they're running on.
872+
*
873+
* This capability is always supported for atomic-capable virtualized
874+
* drivers starting from kernel version 6.6.
875+
*/
876+
#define DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT 6
877+
845878
/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
846879
struct drm_set_client_cap {
847880
__u64 capability;
@@ -893,6 +926,7 @@ struct drm_syncobj_transfer {
893926
#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_ALL (1 << 0)
894927
#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT (1 << 1)
895928
#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE (1 << 2) /* wait for time point to become available */
929+
#define DRM_SYNCOBJ_WAIT_FLAGS_WAIT_DEADLINE (1 << 3) /* set fence deadline to deadline_nsec */
896930
struct drm_syncobj_wait {
897931
__u64 handles;
898932
/* absolute timeout */
@@ -901,6 +935,14 @@ struct drm_syncobj_wait {
901935
__u32 flags;
902936
__u32 first_signaled; /* only valid when not waiting all */
903937
__u32 pad;
938+
/**
939+
* @deadline_nsec - fence deadline hint
940+
*
941+
* Deadline hint, in absolute CLOCK_MONOTONIC, to set on backing
942+
* fence(s) if the DRM_SYNCOBJ_WAIT_FLAGS_WAIT_DEADLINE flag is
943+
* set.
944+
*/
945+
__u64 deadline_nsec;
904946
};
905947

906948
struct drm_syncobj_timeline_wait {
@@ -913,6 +955,14 @@ struct drm_syncobj_timeline_wait {
913955
__u32 flags;
914956
__u32 first_signaled; /* only valid when not waiting all */
915957
__u32 pad;
958+
/**
959+
* @deadline_nsec - fence deadline hint
960+
*
961+
* Deadline hint, in absolute CLOCK_MONOTONIC, to set on backing
962+
* fence(s) if the DRM_SYNCOBJ_WAIT_FLAGS_WAIT_DEADLINE flag is
963+
* set.
964+
*/
965+
__u64 deadline_nsec;
916966
};
917967

918968
/**
@@ -1218,6 +1268,26 @@ extern "C" {
12181268

12191269
#define DRM_IOCTL_SYNCOBJ_EVENTFD DRM_IOWR(0xCF, struct drm_syncobj_eventfd)
12201270

1271+
/**
1272+
* DRM_IOCTL_MODE_CLOSEFB - Close a framebuffer.
1273+
*
1274+
* This closes a framebuffer previously added via ADDFB/ADDFB2. The IOCTL
1275+
* argument is a framebuffer object ID.
1276+
*
1277+
* This IOCTL is similar to &DRM_IOCTL_MODE_RMFB, except it doesn't disable
1278+
* planes and CRTCs. As long as the framebuffer is used by a plane, it's kept
1279+
* alive. When the plane no longer uses the framebuffer (because the
1280+
* framebuffer is replaced with another one, or the plane is disabled), the
1281+
* framebuffer is cleaned up.
1282+
*
1283+
* This is useful to implement flicker-free transitions between two processes.
1284+
*
1285+
* Depending on the threat model, user-space may want to ensure that the
1286+
* framebuffer doesn't expose any sensitive user information: closed
1287+
* framebuffers attached to a plane can be read back by the next DRM master.
1288+
*/
1289+
#define DRM_IOCTL_MODE_CLOSEFB DRM_IOWR(0xD0, struct drm_mode_closefb)
1290+
12211291
/*
12221292
* Device specific ioctls should only be in their respective headers
12231293
* The device specific ioctl range is from 0x40 to 0x9f.

tools/include/uapi/drm/i915_drm.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ typedef struct drm_i915_irq_wait {
693693
#define I915_PARAM_HAS_EXEC_FENCE 44
694694

695695
/* Query whether DRM_I915_GEM_EXECBUFFER2 supports the ability to capture
696-
* user specified bufffers for post-mortem debugging of GPU hangs. See
696+
* user-specified buffers for post-mortem debugging of GPU hangs. See
697697
* EXEC_OBJECT_CAPTURE.
698698
*/
699699
#define I915_PARAM_HAS_EXEC_CAPTURE 45
@@ -1606,7 +1606,7 @@ struct drm_i915_gem_busy {
16061606
* is accurate.
16071607
*
16081608
* The returned dword is split into two fields to indicate both
1609-
* the engine classess on which the object is being read, and the
1609+
* the engine classes on which the object is being read, and the
16101610
* engine class on which it is currently being written (if any).
16111611
*
16121612
* The low word (bits 0:15) indicate if the object is being written
@@ -1815,7 +1815,7 @@ struct drm_i915_gem_madvise {
18151815
__u32 handle;
18161816

18171817
/* Advice: either the buffer will be needed again in the near future,
1818-
* or wont be and could be discarded under memory pressure.
1818+
* or won't be and could be discarded under memory pressure.
18191819
*/
18201820
__u32 madv;
18211821

@@ -3246,7 +3246,7 @@ struct drm_i915_query_topology_info {
32463246
* // enough to hold our array of engines. The kernel will fill out the
32473247
* // item.length for us, which is the number of bytes we need.
32483248
* //
3249-
* // Alternatively a large buffer can be allocated straight away enabling
3249+
* // Alternatively a large buffer can be allocated straightaway enabling
32503250
* // querying in one pass, in which case item.length should contain the
32513251
* // length of the provided buffer.
32523252
* err = ioctl(fd, DRM_IOCTL_I915_QUERY, &query);
@@ -3256,7 +3256,7 @@ struct drm_i915_query_topology_info {
32563256
* // Now that we allocated the required number of bytes, we call the ioctl
32573257
* // again, this time with the data_ptr pointing to our newly allocated
32583258
* // blob, which the kernel can then populate with info on all engines.
3259-
* item.data_ptr = (uintptr_t)&info,
3259+
* item.data_ptr = (uintptr_t)&info;
32603260
*
32613261
* err = ioctl(fd, DRM_IOCTL_I915_QUERY, &query);
32623262
* if (err) ...
@@ -3286,7 +3286,7 @@ struct drm_i915_query_topology_info {
32863286
/**
32873287
* struct drm_i915_engine_info
32883288
*
3289-
* Describes one engine and it's capabilities as known to the driver.
3289+
* Describes one engine and its capabilities as known to the driver.
32903290
*/
32913291
struct drm_i915_engine_info {
32923292
/** @engine: Engine class and instance. */

0 commit comments

Comments
 (0)