On 4/15/24 9:06 AM, Kevin Brodsky wrote:
On 12/04/2024 18:06, carsten.haitzler@foss.arm.com wrote:
From: Carsten Haitzler carsten.haitzler@arm.com
Vblank is a bit different because it produces events that then can copy pointers/capabilities back to userspace via a read on the DRM device as opposed to the ioctl. The compat handler called the normal native/purecap one and this happened to work for compat but not for purecap. Make the shared "native" purecap handling work for both and share that infra properly to avoid copy and paste.
Signed-off-by: Carsten Haitzler Carsten.Haitzler@arm.com
drivers/gpu/drm/drm_atomic_uapi.c | 3 ++- drivers/gpu/drm/drm_ioc32.c | 1 + drivers/gpu/drm/drm_vblank.c | 39 ++++++++++++++++++++++--------- include/drm/drm_vblank.h | 23 ++++++++++++++++++ include/uapi/drm/drm.h | 6 ++--- include/uapi/drm/drm_mode.h | 2 +- tools/include/uapi/drm/drm.h | 2 +- 7 files changed, 59 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c index 3e4668a20157..08474a1ea90e 100644 --- a/drivers/gpu/drm/drm_atomic_uapi.c +++ b/drivers/gpu/drm/drm_atomic_uapi.c @@ -940,7 +940,8 @@ int drm_atomic_get_property(struct drm_mode_object *obj, */ static struct drm_pending_vblank_event *create_vblank_event(
struct drm_crtc *crtc, uint64_t user_data)
struct drm_crtc *crtc,
{ struct drm_pending_vblank_event *e = NULL;__kernel_uintptr_t user_data)
diff --git a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c index 504c2fcd9c89..a081ee3f4dac 100644 --- a/drivers/gpu/drm/drm_ioc32.c +++ b/drivers/gpu/drm/drm_ioc32.c @@ -33,6 +33,7 @@ #include <drm/drm_file.h> #include <drm/drm_print.h> +#include <drm/drm_drv.h>
Looks like a leftover, this file is not otherwise touched anymore.
#include "drm_crtc_internal.h" #include "drm_internal.h"
[...]
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index 128d09138ceb..3a426e7ed775 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h @@ -1135,7 +1135,7 @@ struct drm_mode_atomic { __u64 props_ptr; __u64 prop_values_ptr; __u64 reserved;
- __u64 user_data;
- __kernel_uintptr_t user_data;
I think this change requires compat handling too (in drm_mode_atomic_ioctl()). In fact it looks a lot like the *_ptr members should also be changed like the other drm_mode_* structs in patch 3. Or maybe the intention is not to change it at all considering user_data is reverted to __u64 in patch 3? In which case it doesn't really make sense to change create_vblank_event() either.
Ahh never mind - I undid that in patch 2 - well did it in patch 1, undid in patch 2... but yeah - this needs doing. I seem to have only partly begun this but nothing used/tested it so didn't finish it (didn't notice it wasn't finished).
}; struct drm_format_modifier_blob { diff --git a/tools/include/uapi/drm/drm.h b/tools/include/uapi/drm/drm.h index de723566c5ae..82797c95efa6 100644 --- a/tools/include/uapi/drm/drm.h +++ b/tools/include/uapi/drm/drm.h @@ -1277,7 +1277,7 @@ struct drm_event { struct drm_event_vblank { struct drm_event base;
- __u64 user_data;
- uintptr_t user_data;
As discussed in v1, it doesn't look like this header ever gets used in practice, so I'd rather leave it alone.
Kevin
__u32 tv_sec; __u32 tv_usec; __u32 sequence;