| From 82d90af9075b81eee524b3f04d4163f36f3062c9 Mon Sep 17 00:00:00 2001 |
| From: Lukasz Spintzyk <lukasz.spintzyk@displaylink.com> |
| Date: Wed, 10 Feb 2016 12:55:44 +0100 |
| Subject: [PATCH libdrm 5/7] CHROMIUM: drm/evdi: Add Evdi module userspace api |
| file. |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| Old-BUG=chromium:579926 |
| Old-TEST=Build succeds, evdi_drm.h is installed. |
| |
| Adding evdi module user space api header file. |
| Header file is necessary by libevdi library. |
| (review: https://chromium-review.googlesource.com/#/c/326670/) |
| |
| Signed-off-by: Lukasz Spintzyk <lukasz.spintzyk@displaylink.com> |
| Reviewed-on: https://chromium-review.googlesource.com/327051 |
| Commit-Ready: Bernie Thompson <bhthompson@chromium.org> |
| Tested-by: Łukasz Spintzyk <lukasz.spintzyk@displaylink.com> |
| Reviewed-by: Haixia Shi <hshi@chromium.org> |
| (rebased from chromeos-2.4.89) |
| |
| BUG=b:112720782 |
| Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org> |
| |
| Change-Id: I355eb33d9953b1157888e4699ceb749865d8bb19 |
| --- |
| Makefile.sources | 1 + |
| include/drm/evdi_drm.h | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 2 files changed, 86 insertions(+) |
| create mode 100644 include/drm/evdi_drm.h |
| |
| diff --git a/Makefile.sources b/Makefile.sources |
| index 19b62619..bd00db46 100644 |
| --- a/Makefile.sources |
| +++ b/Makefile.sources |
| @@ -22,6 +22,7 @@ LIBDRM_INCLUDE_H_FILES := \ |
| include/drm/drm_fourcc.h \ |
| include/drm/drm_mode.h \ |
| include/drm/drm_sarea.h \ |
| + include/drm/evdi_drm.h \ |
| include/drm/i915_drm.h \ |
| include/drm/mach64_drm.h \ |
| include/drm/mediatek_drm.h \ |
| diff --git a/include/drm/evdi_drm.h b/include/drm/evdi_drm.h |
| new file mode 100644 |
| index 00000000..3a00c7fc |
| --- /dev/null |
| +++ b/include/drm/evdi_drm.h |
| @@ -0,0 +1,85 @@ |
| +/* |
| + * Copyright (c) 2015 - 2016 DisplayLink (UK) Ltd. |
| + * |
| + * This file is subject to the terms and conditions of the GNU General Public |
| + * License v2. See the file COPYING in the main directory of this archive for |
| + * more details. |
| + */ |
| + |
| +#ifndef __UAPI_EVDI_DRM_H__ |
| +#define __UAPI_EVDI_DRM_H__ |
| + |
| +/* Output events sent from driver to evdi lib */ |
| +#define DRM_EVDI_EVENT_UPDATE_READY 0x80000000 |
| +#define DRM_EVDI_EVENT_DPMS 0x80000001 |
| +#define DRM_EVDI_EVENT_MODE_CHANGED 0x80000002 |
| +#define DRM_EVDI_EVENT_CRTC_STATE 0x80000003 |
| + |
| +struct drm_evdi_event_update_ready { |
| + struct drm_event base; |
| +}; |
| + |
| +struct drm_evdi_event_dpms { |
| + struct drm_event base; |
| + int32_t mode; |
| +}; |
| + |
| +struct drm_evdi_event_mode_changed { |
| + struct drm_event base; |
| + int32_t hdisplay; |
| + int32_t vdisplay; |
| + int32_t vrefresh; |
| + int32_t bits_per_pixel; |
| + uint32_t pixel_format; |
| +}; |
| + |
| +struct drm_evdi_event_crtc_state { |
| + struct drm_event base; |
| + int32_t state; |
| +}; |
| + |
| +struct drm_evdi_connect { |
| + int32_t connected; |
| + int32_t dev_index; |
| + const unsigned char * __user edid; |
| + unsigned int edid_length; |
| +}; |
| + |
| +struct drm_evdi_mapfifo { |
| + int32_t reserved; |
| +}; |
| + |
| +struct drm_evdi_request_update { |
| + int32_t reserved; |
| +}; |
| + |
| +enum drm_evdi_grabpix_mode { |
| + EVDI_GRABPIX_MODE_RECTS = 0, |
| + EVDI_GRABPIX_MODE_DIRTY = 1, |
| +}; |
| + |
| +struct drm_evdi_grabpix { |
| + enum drm_evdi_grabpix_mode mode; |
| + int32_t buf_width; |
| + int32_t buf_height; |
| + int32_t buf_byte_stride; |
| + unsigned char __user *buffer; |
| + int32_t num_rects; |
| + struct drm_clip_rect __user *rects; |
| +}; |
| + |
| +/* Input ioctls from evdi lib to driver */ |
| +#define DRM_EVDI_CONNECT 0x00 |
| +#define DRM_EVDI_REQUEST_UPDATE 0x01 |
| +#define DRM_EVDI_GRABPIX 0x02 |
| +/* LAST_IOCTL 0x5F -- 96 driver specific ioctls to use */ |
| + |
| +#define DRM_IOCTL_EVDI_CONNECT DRM_IOWR(DRM_COMMAND_BASE + \ |
| + DRM_EVDI_CONNECT, struct drm_evdi_connect) |
| +#define DRM_IOCTL_EVDI_REQUEST_UPDATE DRM_IOWR(DRM_COMMAND_BASE + \ |
| + DRM_EVDI_REQUEST_UPDATE, struct drm_evdi_request_update) |
| +#define DRM_IOCTL_EVDI_GRABPIX DRM_IOWR(DRM_COMMAND_BASE + \ |
| + DRM_EVDI_GRABPIX, struct drm_evdi_grabpix) |
| + |
| +#endif /* __EVDI_UAPI_DRM_H__ */ |
| + |
| -- |
| 2.16.4 |
| |