[igt-dev] [PATCH i-g-t 1/3] include/drm-uapi/i915_drm: Add local defs for mmap_offset
Petri Latvala
petri.latvala at intel.com
Mon Nov 25 12:43:37 UTC 2019
On Mon, Nov 25, 2019 at 11:09:55AM +0100, Zbigniew Kempczyński wrote:
> Contains local definitions and structures for GEM_MMAP_OFFSET.
> To be removed on upstream merge.
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> ---
> include/drm-uapi/i915_drm.h | 33 +++++++++++++++++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
> diff --git a/include/drm-uapi/i915_drm.h b/include/drm-uapi/i915_drm.h
> index ab899abb..154e07ce 100644
> --- a/include/drm-uapi/i915_drm.h
> +++ b/include/drm-uapi/i915_drm.h
> @@ -2245,6 +2245,39 @@ struct drm_i915_query_perf_config {
> __u8 data[];
> };
>
> +/*
> + * Local structures and definitions to be removed on upstream merge
> + */
> +struct local_i915_gem_mmap_offset {
> + /** Handle for the object being mapped. */
> + __u32 handle;
> + __u32 pad;
> + /**
> + * Fake offset to use for subsequent mmap call
> + *
> + * This is a fixed-size type for 32/64 compatibility.
> + */
> + __u64 offset;
> + /**
> + * Flags for extended behaviour.
> + *
> + * It is mandatory that either one of the _WC/_WB flags
> + * should be passed here.
> + */
> + __u64 flags;
> +
> +#define LOCAL_I915_MMAP_OFFSET_GTT 0
> +#define LOCAL_I915_MMAP_OFFSET_WC 1
> +#define LOCAL_I915_MMAP_OFFSET_WB 2
> +#define LOCAL_I915_MMAP_OFFSET_UC 3
> +
> + __u64 extensions;
> +};
> +
> +#define LOCAL_I915_GEM_MMAP_OFFSET DRM_I915_GEM_MMAP_GTT
> +#define LOCAL_IOCTL_I915_GEM_MMAP_OFFSET DRM_IOWR(DRM_COMMAND_BASE + \
> + LOCAL_I915_GEM_MMAP_OFFSET, struct local_i915_gem_mmap_offset)
> +
Please don't use local_* / LOCAL_* names, use real names. And please
don't hand-edit the drm-uapi files. Copy the files from the
in-development kernel series (and note in the commit message that it
has been done as such and the patch is not to be merged), to reduce
the required churn in the test code. When the kernel side has been
merged, the uapi files can get the actual copies.
I'm sure someone has commented on this before but I didn't spot it...
--
Petri Latvala
More information about the igt-dev
mailing list