diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-06-01 04:49:16 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-06-01 04:52:54 -0400 |
commit | e269f90f3d3f7c70cf661c660bf445597261f54a (patch) | |
tree | f09685517e9efa7d675dad8fd13694157ce50521 /include/drm | |
parent | 112abd291db7d47974f166e742104d761bc76977 (diff) | |
parent | 63bc620b45af8c743ac291c8725933278c712692 (diff) |
Merge remote-tracking branch 'airlied/drm-prime-vmap' into drm-intel-next-queued
We need the latest dma-buf code from Dave Airlie so that we can pimp
the backing storage handling code in drm/i915 with Chris Wilson's
unbound tracking and stolen mem backed gem object code.
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drmP.h | 14 | ||||
-rw-r--r-- | include/drm/drm_crtc.h | 34 | ||||
-rw-r--r-- | include/drm/drm_crtc_helper.h | 21 | ||||
-rw-r--r-- | include/drm/drm_dp_helper.h | 8 | ||||
-rw-r--r-- | include/drm/drm_mode.h | 1 | ||||
-rw-r--r-- | include/drm/exynos_drm.h | 99 | ||||
-rw-r--r-- | include/drm/ttm/ttm_bo_api.h | 9 | ||||
-rw-r--r-- | include/drm/ttm/ttm_bo_driver.h | 2 |
8 files changed, 158 insertions, 30 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index efd124903761..31ad880ca2ef 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -755,11 +755,11 @@ struct drm_driver { | |||
755 | * @dev: DRM device | 755 | * @dev: DRM device |
756 | * @crtc: counter to fetch | 756 | * @crtc: counter to fetch |
757 | * | 757 | * |
758 | * Driver callback for fetching a raw hardware vblank counter | 758 | * Driver callback for fetching a raw hardware vblank counter for @crtc. |
759 | * for @crtc. If a device doesn't have a hardware counter, the | 759 | * If a device doesn't have a hardware counter, the driver can simply |
760 | * driver can simply return the value of drm_vblank_count and | 760 | * return the value of drm_vblank_count. The DRM core will account for |
761 | * make the enable_vblank() and disable_vblank() hooks into no-ops, | 761 | * missed vblank events while interrupts where disabled based on system |
762 | * leaving interrupts enabled at all times. | 762 | * timestamps. |
763 | * | 763 | * |
764 | * Wraparound handling and loss of events due to modesetting is dealt | 764 | * Wraparound handling and loss of events due to modesetting is dealt |
765 | * with in the DRM core code. | 765 | * with in the DRM core code. |
@@ -941,7 +941,7 @@ struct drm_driver { | |||
941 | uint32_t handle); | 941 | uint32_t handle); |
942 | 942 | ||
943 | /* Driver private ops for this object */ | 943 | /* Driver private ops for this object */ |
944 | struct vm_operations_struct *gem_vm_ops; | 944 | const struct vm_operations_struct *gem_vm_ops; |
945 | 945 | ||
946 | int major; | 946 | int major; |
947 | int minor; | 947 | int minor; |
@@ -1558,6 +1558,8 @@ extern int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data, | |||
1558 | extern int drm_prime_fd_to_handle_ioctl(struct drm_device *dev, void *data, | 1558 | extern int drm_prime_fd_to_handle_ioctl(struct drm_device *dev, void *data, |
1559 | struct drm_file *file_priv); | 1559 | struct drm_file *file_priv); |
1560 | 1560 | ||
1561 | extern int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **pages, | ||
1562 | dma_addr_t *addrs, int max_pages); | ||
1561 | extern struct sg_table *drm_prime_pages_to_sg(struct page **pages, int nr_pages); | 1563 | extern struct sg_table *drm_prime_pages_to_sg(struct page **pages, int nr_pages); |
1562 | extern void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg); | 1564 | extern void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg); |
1563 | 1565 | ||
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index d59bb7d93657..73e45600f95d 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -294,20 +294,16 @@ struct drm_plane; | |||
294 | 294 | ||
295 | /** | 295 | /** |
296 | * drm_crtc_funcs - control CRTCs for a given device | 296 | * drm_crtc_funcs - control CRTCs for a given device |
297 | * @reset: reset CRTC after state has been invalidate (e.g. resume) | ||
298 | * @dpms: control display power levels | ||
299 | * @save: save CRTC state | 297 | * @save: save CRTC state |
300 | * @resore: restore CRTC state | 298 | * @restore: restore CRTC state |
301 | * @lock: lock the CRTC | 299 | * @reset: reset CRTC after state has been invalidate (e.g. resume) |
302 | * @unlock: unlock the CRTC | 300 | * @cursor_set: setup the cursor |
303 | * @shadow_allocate: allocate shadow pixmap | 301 | * @cursor_move: move the cursor |
304 | * @shadow_create: create shadow pixmap for rotation support | ||
305 | * @shadow_destroy: free shadow pixmap | ||
306 | * @mode_fixup: fixup proposed mode | ||
307 | * @mode_set: set the desired mode on the CRTC | ||
308 | * @gamma_set: specify color ramp for CRTC | 302 | * @gamma_set: specify color ramp for CRTC |
309 | * @destroy: deinit and free object | 303 | * @destroy: deinit and free object |
310 | * @set_property: called when a property is changed | 304 | * @set_property: called when a property is changed |
305 | * @set_config: apply a new CRTC configuration | ||
306 | * @page_flip: initiate a page flip | ||
311 | * | 307 | * |
312 | * The drm_crtc_funcs structure is the central CRTC management structure | 308 | * The drm_crtc_funcs structure is the central CRTC management structure |
313 | * in the DRM. Each CRTC controls one or more connectors (note that the name | 309 | * in the DRM. Each CRTC controls one or more connectors (note that the name |
@@ -420,11 +416,8 @@ struct drm_crtc { | |||
420 | * @save: save connector state | 416 | * @save: save connector state |
421 | * @restore: restore connector state | 417 | * @restore: restore connector state |
422 | * @reset: reset connector after state has been invalidate (e.g. resume) | 418 | * @reset: reset connector after state has been invalidate (e.g. resume) |
423 | * @mode_valid: is this mode valid on the given connector? | ||
424 | * @mode_fixup: try to fixup proposed mode for this connector | ||
425 | * @mode_set: set this mode | ||
426 | * @detect: is this connector active? | 419 | * @detect: is this connector active? |
427 | * @get_modes: get mode list for this connector | 420 | * @fill_modes: fill mode list for this connector |
428 | * @set_property: property for this connector may need update | 421 | * @set_property: property for this connector may need update |
429 | * @destroy: make object go away | 422 | * @destroy: make object go away |
430 | * @force: notify the driver the connector is forced on | 423 | * @force: notify the driver the connector is forced on |
@@ -608,6 +601,7 @@ struct drm_connector { | |||
608 | * @update_plane: update the plane configuration | 601 | * @update_plane: update the plane configuration |
609 | * @disable_plane: shut down the plane | 602 | * @disable_plane: shut down the plane |
610 | * @destroy: clean up plane resources | 603 | * @destroy: clean up plane resources |
604 | * @set_property: called when a property is changed | ||
611 | */ | 605 | */ |
612 | struct drm_plane_funcs { | 606 | struct drm_plane_funcs { |
613 | int (*update_plane)(struct drm_plane *plane, | 607 | int (*update_plane)(struct drm_plane *plane, |
@@ -618,6 +612,9 @@ struct drm_plane_funcs { | |||
618 | uint32_t src_w, uint32_t src_h); | 612 | uint32_t src_w, uint32_t src_h); |
619 | int (*disable_plane)(struct drm_plane *plane); | 613 | int (*disable_plane)(struct drm_plane *plane); |
620 | void (*destroy)(struct drm_plane *plane); | 614 | void (*destroy)(struct drm_plane *plane); |
615 | |||
616 | int (*set_property)(struct drm_plane *plane, | ||
617 | struct drm_property *property, uint64_t val); | ||
621 | }; | 618 | }; |
622 | 619 | ||
623 | /** | 620 | /** |
@@ -635,6 +632,7 @@ struct drm_plane_funcs { | |||
635 | * @enabled: enabled flag | 632 | * @enabled: enabled flag |
636 | * @funcs: helper functions | 633 | * @funcs: helper functions |
637 | * @helper_private: storage for drver layer | 634 | * @helper_private: storage for drver layer |
635 | * @properties: property tracking for this plane | ||
638 | */ | 636 | */ |
639 | struct drm_plane { | 637 | struct drm_plane { |
640 | struct drm_device *dev; | 638 | struct drm_device *dev; |
@@ -657,6 +655,8 @@ struct drm_plane { | |||
657 | 655 | ||
658 | const struct drm_plane_funcs *funcs; | 656 | const struct drm_plane_funcs *funcs; |
659 | void *helper_private; | 657 | void *helper_private; |
658 | |||
659 | struct drm_object_properties properties; | ||
660 | }; | 660 | }; |
661 | 661 | ||
662 | /** | 662 | /** |
@@ -774,7 +774,7 @@ struct drm_mode_config { | |||
774 | 774 | ||
775 | int min_width, min_height; | 775 | int min_width, min_height; |
776 | int max_width, max_height; | 776 | int max_width, max_height; |
777 | struct drm_mode_config_funcs *funcs; | 777 | const struct drm_mode_config_funcs *funcs; |
778 | resource_size_t fb_base; | 778 | resource_size_t fb_base; |
779 | 779 | ||
780 | /* output poll support */ | 780 | /* output poll support */ |
@@ -940,6 +940,10 @@ extern struct drm_property *drm_property_create_enum(struct drm_device *dev, int | |||
940 | const char *name, | 940 | const char *name, |
941 | const struct drm_prop_enum_list *props, | 941 | const struct drm_prop_enum_list *props, |
942 | int num_values); | 942 | int num_values); |
943 | struct drm_property *drm_property_create_bitmask(struct drm_device *dev, | ||
944 | int flags, const char *name, | ||
945 | const struct drm_prop_enum_list *props, | ||
946 | int num_values); | ||
943 | struct drm_property *drm_property_create_range(struct drm_device *dev, int flags, | 947 | struct drm_property *drm_property_create_range(struct drm_device *dev, int flags, |
944 | const char *name, | 948 | const char *name, |
945 | uint64_t min, uint64_t max); | 949 | uint64_t min, uint64_t max); |
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h index 3add00e03388..7988e55c98d0 100644 --- a/include/drm/drm_crtc_helper.h +++ b/include/drm/drm_crtc_helper.h | |||
@@ -44,6 +44,13 @@ enum mode_set_atomic { | |||
44 | ENTER_ATOMIC_MODE_SET, | 44 | ENTER_ATOMIC_MODE_SET, |
45 | }; | 45 | }; |
46 | 46 | ||
47 | /** | ||
48 | * drm_crtc_helper_funcs - helper operations for CRTCs | ||
49 | * @mode_fixup: try to fixup proposed mode for this connector | ||
50 | * @mode_set: set this mode | ||
51 | * | ||
52 | * The helper operations are called by the mid-layer CRTC helper. | ||
53 | */ | ||
47 | struct drm_crtc_helper_funcs { | 54 | struct drm_crtc_helper_funcs { |
48 | /* | 55 | /* |
49 | * Control power levels on the CRTC. If the mode passed in is | 56 | * Control power levels on the CRTC. If the mode passed in is |
@@ -76,6 +83,13 @@ struct drm_crtc_helper_funcs { | |||
76 | void (*disable)(struct drm_crtc *crtc); | 83 | void (*disable)(struct drm_crtc *crtc); |
77 | }; | 84 | }; |
78 | 85 | ||
86 | /** | ||
87 | * drm_encoder_helper_funcs - helper operations for encoders | ||
88 | * @mode_fixup: try to fixup proposed mode for this connector | ||
89 | * @mode_set: set this mode | ||
90 | * | ||
91 | * The helper operations are called by the mid-layer CRTC helper. | ||
92 | */ | ||
79 | struct drm_encoder_helper_funcs { | 93 | struct drm_encoder_helper_funcs { |
80 | void (*dpms)(struct drm_encoder *encoder, int mode); | 94 | void (*dpms)(struct drm_encoder *encoder, int mode); |
81 | void (*save)(struct drm_encoder *encoder); | 95 | void (*save)(struct drm_encoder *encoder); |
@@ -97,6 +111,13 @@ struct drm_encoder_helper_funcs { | |||
97 | void (*disable)(struct drm_encoder *encoder); | 111 | void (*disable)(struct drm_encoder *encoder); |
98 | }; | 112 | }; |
99 | 113 | ||
114 | /** | ||
115 | * drm_connector_helper_funcs - helper operations for connectors | ||
116 | * @get_modes: get mode list for this connector | ||
117 | * @mode_valid: is this mode valid on the given connector? | ||
118 | * | ||
119 | * The helper operations are called by the mid-layer CRTC helper. | ||
120 | */ | ||
100 | struct drm_connector_helper_funcs { | 121 | struct drm_connector_helper_funcs { |
101 | int (*get_modes)(struct drm_connector *connector); | 122 | int (*get_modes)(struct drm_connector *connector); |
102 | int (*mode_valid)(struct drm_connector *connector, | 123 | int (*mode_valid)(struct drm_connector *connector, |
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index 93df2d72750b..1744b18c06b3 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h | |||
@@ -72,6 +72,10 @@ | |||
72 | 72 | ||
73 | #define DP_MAIN_LINK_CHANNEL_CODING 0x006 | 73 | #define DP_MAIN_LINK_CHANNEL_CODING 0x006 |
74 | 74 | ||
75 | #define DP_DOWN_STREAM_PORT_COUNT 0x007 | ||
76 | #define DP_PORT_COUNT_MASK 0x0f | ||
77 | #define DP_OUI_SUPPORT (1 << 7) | ||
78 | |||
75 | #define DP_EDP_CONFIGURATION_CAP 0x00d | 79 | #define DP_EDP_CONFIGURATION_CAP 0x00d |
76 | #define DP_TRAINING_AUX_RD_INTERVAL 0x00e | 80 | #define DP_TRAINING_AUX_RD_INTERVAL 0x00e |
77 | 81 | ||
@@ -213,6 +217,10 @@ | |||
213 | # define DP_TEST_NAK (1 << 1) | 217 | # define DP_TEST_NAK (1 << 1) |
214 | # define DP_TEST_EDID_CHECKSUM_WRITE (1 << 2) | 218 | # define DP_TEST_EDID_CHECKSUM_WRITE (1 << 2) |
215 | 219 | ||
220 | #define DP_SOURCE_OUI 0x300 | ||
221 | #define DP_SINK_OUI 0x400 | ||
222 | #define DP_BRANCH_OUI 0x500 | ||
223 | |||
216 | #define DP_SET_POWER 0x600 | 224 | #define DP_SET_POWER 0x600 |
217 | # define DP_SET_POWER_D0 0x1 | 225 | # define DP_SET_POWER_D0 0x1 |
218 | # define DP_SET_POWER_D3 0x2 | 226 | # define DP_SET_POWER_D3 0x2 |
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h index 326f2be0d497..5581980b14f6 100644 --- a/include/drm/drm_mode.h +++ b/include/drm/drm_mode.h | |||
@@ -230,6 +230,7 @@ struct drm_mode_get_connector { | |||
230 | #define DRM_MODE_PROP_IMMUTABLE (1<<2) | 230 | #define DRM_MODE_PROP_IMMUTABLE (1<<2) |
231 | #define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */ | 231 | #define DRM_MODE_PROP_ENUM (1<<3) /* enumerated type with text strings */ |
232 | #define DRM_MODE_PROP_BLOB (1<<4) | 232 | #define DRM_MODE_PROP_BLOB (1<<4) |
233 | #define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */ | ||
233 | 234 | ||
234 | struct drm_mode_property_enum { | 235 | struct drm_mode_property_enum { |
235 | __u64 value; | 236 | __u64 value; |
diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h index e478de4e5d56..b6d7ce92eadd 100644 --- a/include/drm/exynos_drm.h +++ b/include/drm/exynos_drm.h | |||
@@ -29,6 +29,8 @@ | |||
29 | #ifndef _EXYNOS_DRM_H_ | 29 | #ifndef _EXYNOS_DRM_H_ |
30 | #define _EXYNOS_DRM_H_ | 30 | #define _EXYNOS_DRM_H_ |
31 | 31 | ||
32 | #include "drm.h" | ||
33 | |||
32 | /** | 34 | /** |
33 | * User-desired buffer creation information structure. | 35 | * User-desired buffer creation information structure. |
34 | * | 36 | * |
@@ -75,6 +77,21 @@ struct drm_exynos_gem_mmap { | |||
75 | }; | 77 | }; |
76 | 78 | ||
77 | /** | 79 | /** |
80 | * A structure to gem information. | ||
81 | * | ||
82 | * @handle: a handle to gem object created. | ||
83 | * @flags: flag value including memory type and cache attribute and | ||
84 | * this value would be set by driver. | ||
85 | * @size: size to memory region allocated by gem and this size would | ||
86 | * be set by driver. | ||
87 | */ | ||
88 | struct drm_exynos_gem_info { | ||
89 | unsigned int handle; | ||
90 | unsigned int flags; | ||
91 | uint64_t size; | ||
92 | }; | ||
93 | |||
94 | /** | ||
78 | * A structure for user connection request of virtual display. | 95 | * A structure for user connection request of virtual display. |
79 | * | 96 | * |
80 | * @connection: indicate whether doing connetion or not by user. | 97 | * @connection: indicate whether doing connetion or not by user. |
@@ -95,18 +112,64 @@ struct drm_exynos_plane_set_zpos { | |||
95 | 112 | ||
96 | /* memory type definitions. */ | 113 | /* memory type definitions. */ |
97 | enum e_drm_exynos_gem_mem_type { | 114 | enum e_drm_exynos_gem_mem_type { |
115 | /* Physically Continuous memory and used as default. */ | ||
116 | EXYNOS_BO_CONTIG = 0 << 0, | ||
98 | /* Physically Non-Continuous memory. */ | 117 | /* Physically Non-Continuous memory. */ |
99 | EXYNOS_BO_NONCONTIG = 1 << 0, | 118 | EXYNOS_BO_NONCONTIG = 1 << 0, |
100 | EXYNOS_BO_MASK = EXYNOS_BO_NONCONTIG | 119 | /* non-cachable mapping and used as default. */ |
120 | EXYNOS_BO_NONCACHABLE = 0 << 1, | ||
121 | /* cachable mapping. */ | ||
122 | EXYNOS_BO_CACHABLE = 1 << 1, | ||
123 | /* write-combine mapping. */ | ||
124 | EXYNOS_BO_WC = 1 << 2, | ||
125 | EXYNOS_BO_MASK = EXYNOS_BO_NONCONTIG | EXYNOS_BO_CACHABLE | | ||
126 | EXYNOS_BO_WC | ||
127 | }; | ||
128 | |||
129 | struct drm_exynos_g2d_get_ver { | ||
130 | __u32 major; | ||
131 | __u32 minor; | ||
132 | }; | ||
133 | |||
134 | struct drm_exynos_g2d_cmd { | ||
135 | __u32 offset; | ||
136 | __u32 data; | ||
137 | }; | ||
138 | |||
139 | enum drm_exynos_g2d_event_type { | ||
140 | G2D_EVENT_NOT, | ||
141 | G2D_EVENT_NONSTOP, | ||
142 | G2D_EVENT_STOP, /* not yet */ | ||
143 | }; | ||
144 | |||
145 | struct drm_exynos_g2d_set_cmdlist { | ||
146 | __u64 cmd; | ||
147 | __u64 cmd_gem; | ||
148 | __u32 cmd_nr; | ||
149 | __u32 cmd_gem_nr; | ||
150 | |||
151 | /* for g2d event */ | ||
152 | __u64 event_type; | ||
153 | __u64 user_data; | ||
154 | }; | ||
155 | |||
156 | struct drm_exynos_g2d_exec { | ||
157 | __u64 async; | ||
101 | }; | 158 | }; |
102 | 159 | ||
103 | #define DRM_EXYNOS_GEM_CREATE 0x00 | 160 | #define DRM_EXYNOS_GEM_CREATE 0x00 |
104 | #define DRM_EXYNOS_GEM_MAP_OFFSET 0x01 | 161 | #define DRM_EXYNOS_GEM_MAP_OFFSET 0x01 |
105 | #define DRM_EXYNOS_GEM_MMAP 0x02 | 162 | #define DRM_EXYNOS_GEM_MMAP 0x02 |
106 | /* Reserved 0x03 ~ 0x05 for exynos specific gem ioctl */ | 163 | /* Reserved 0x03 ~ 0x05 for exynos specific gem ioctl */ |
164 | #define DRM_EXYNOS_GEM_GET 0x04 | ||
107 | #define DRM_EXYNOS_PLANE_SET_ZPOS 0x06 | 165 | #define DRM_EXYNOS_PLANE_SET_ZPOS 0x06 |
108 | #define DRM_EXYNOS_VIDI_CONNECTION 0x07 | 166 | #define DRM_EXYNOS_VIDI_CONNECTION 0x07 |
109 | 167 | ||
168 | /* G2D */ | ||
169 | #define DRM_EXYNOS_G2D_GET_VER 0x20 | ||
170 | #define DRM_EXYNOS_G2D_SET_CMDLIST 0x21 | ||
171 | #define DRM_EXYNOS_G2D_EXEC 0x22 | ||
172 | |||
110 | #define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \ | 173 | #define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \ |
111 | DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create) | 174 | DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create) |
112 | 175 | ||
@@ -116,12 +179,34 @@ enum e_drm_exynos_gem_mem_type { | |||
116 | #define DRM_IOCTL_EXYNOS_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + \ | 179 | #define DRM_IOCTL_EXYNOS_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + \ |
117 | DRM_EXYNOS_GEM_MMAP, struct drm_exynos_gem_mmap) | 180 | DRM_EXYNOS_GEM_MMAP, struct drm_exynos_gem_mmap) |
118 | 181 | ||
182 | #define DRM_IOCTL_EXYNOS_GEM_GET DRM_IOWR(DRM_COMMAND_BASE + \ | ||
183 | DRM_EXYNOS_GEM_GET, struct drm_exynos_gem_info) | ||
184 | |||
119 | #define DRM_IOCTL_EXYNOS_PLANE_SET_ZPOS DRM_IOWR(DRM_COMMAND_BASE + \ | 185 | #define DRM_IOCTL_EXYNOS_PLANE_SET_ZPOS DRM_IOWR(DRM_COMMAND_BASE + \ |
120 | DRM_EXYNOS_PLANE_SET_ZPOS, struct drm_exynos_plane_set_zpos) | 186 | DRM_EXYNOS_PLANE_SET_ZPOS, struct drm_exynos_plane_set_zpos) |
121 | 187 | ||
122 | #define DRM_IOCTL_EXYNOS_VIDI_CONNECTION DRM_IOWR(DRM_COMMAND_BASE + \ | 188 | #define DRM_IOCTL_EXYNOS_VIDI_CONNECTION DRM_IOWR(DRM_COMMAND_BASE + \ |
123 | DRM_EXYNOS_VIDI_CONNECTION, struct drm_exynos_vidi_connection) | 189 | DRM_EXYNOS_VIDI_CONNECTION, struct drm_exynos_vidi_connection) |
124 | 190 | ||
191 | #define DRM_IOCTL_EXYNOS_G2D_GET_VER DRM_IOWR(DRM_COMMAND_BASE + \ | ||
192 | DRM_EXYNOS_G2D_GET_VER, struct drm_exynos_g2d_get_ver) | ||
193 | #define DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST DRM_IOWR(DRM_COMMAND_BASE + \ | ||
194 | DRM_EXYNOS_G2D_SET_CMDLIST, struct drm_exynos_g2d_set_cmdlist) | ||
195 | #define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \ | ||
196 | DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec) | ||
197 | |||
198 | /* EXYNOS specific events */ | ||
199 | #define DRM_EXYNOS_G2D_EVENT 0x80000000 | ||
200 | |||
201 | struct drm_exynos_g2d_event { | ||
202 | struct drm_event base; | ||
203 | __u64 user_data; | ||
204 | __u32 tv_sec; | ||
205 | __u32 tv_usec; | ||
206 | __u32 cmdlist_no; | ||
207 | __u32 reserved; | ||
208 | }; | ||
209 | |||
125 | #ifdef __KERNEL__ | 210 | #ifdef __KERNEL__ |
126 | 211 | ||
127 | /** | 212 | /** |
@@ -169,16 +254,14 @@ struct exynos_drm_common_hdmi_pd { | |||
169 | /** | 254 | /** |
170 | * Platform Specific Structure for DRM based HDMI core. | 255 | * Platform Specific Structure for DRM based HDMI core. |
171 | * | 256 | * |
172 | * @timing: default video mode for initializing | ||
173 | * @default_win: default window layer number to be used for UI. | ||
174 | * @bpp: default bit per pixel. | ||
175 | * @is_v13: set if hdmi version 13 is. | 257 | * @is_v13: set if hdmi version 13 is. |
258 | * @cfg_hpd: function pointer to configure hdmi hotplug detection pin | ||
259 | * @get_hpd: function pointer to get value of hdmi hotplug detection pin | ||
176 | */ | 260 | */ |
177 | struct exynos_drm_hdmi_pdata { | 261 | struct exynos_drm_hdmi_pdata { |
178 | struct fb_videomode timing; | 262 | bool is_v13; |
179 | unsigned int default_win; | 263 | void (*cfg_hpd)(bool external); |
180 | unsigned int bpp; | 264 | int (*get_hpd)(void); |
181 | unsigned int is_v13:1; | ||
182 | }; | 265 | }; |
183 | 266 | ||
184 | #endif /* __KERNEL__ */ | 267 | #endif /* __KERNEL__ */ |
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 974c8f801c39..e15f2a89a270 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h | |||
@@ -124,11 +124,15 @@ struct ttm_mem_reg { | |||
124 | * | 124 | * |
125 | * @ttm_bo_type_kernel: These buffers are like ttm_bo_type_device buffers, | 125 | * @ttm_bo_type_kernel: These buffers are like ttm_bo_type_device buffers, |
126 | * but they cannot be accessed from user-space. For kernel-only use. | 126 | * but they cannot be accessed from user-space. For kernel-only use. |
127 | * | ||
128 | * @ttm_bo_type_sg: Buffer made from dmabuf sg table shared with another | ||
129 | * driver. | ||
127 | */ | 130 | */ |
128 | 131 | ||
129 | enum ttm_bo_type { | 132 | enum ttm_bo_type { |
130 | ttm_bo_type_device, | 133 | ttm_bo_type_device, |
131 | ttm_bo_type_kernel | 134 | ttm_bo_type_kernel, |
135 | ttm_bo_type_sg | ||
132 | }; | 136 | }; |
133 | 137 | ||
134 | struct ttm_tt; | 138 | struct ttm_tt; |
@@ -271,6 +275,8 @@ struct ttm_buffer_object { | |||
271 | 275 | ||
272 | unsigned long offset; | 276 | unsigned long offset; |
273 | uint32_t cur_placement; | 277 | uint32_t cur_placement; |
278 | |||
279 | struct sg_table *sg; | ||
274 | }; | 280 | }; |
275 | 281 | ||
276 | /** | 282 | /** |
@@ -503,6 +509,7 @@ extern int ttm_bo_init(struct ttm_bo_device *bdev, | |||
503 | bool interrubtible, | 509 | bool interrubtible, |
504 | struct file *persistent_swap_storage, | 510 | struct file *persistent_swap_storage, |
505 | size_t acc_size, | 511 | size_t acc_size, |
512 | struct sg_table *sg, | ||
506 | void (*destroy) (struct ttm_buffer_object *)); | 513 | void (*destroy) (struct ttm_buffer_object *)); |
507 | 514 | ||
508 | /** | 515 | /** |
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index d43e892307ff..a05f1b55714d 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
@@ -81,6 +81,7 @@ struct ttm_backend_func { | |||
81 | #define TTM_PAGE_FLAG_PERSISTENT_SWAP (1 << 5) | 81 | #define TTM_PAGE_FLAG_PERSISTENT_SWAP (1 << 5) |
82 | #define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6) | 82 | #define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6) |
83 | #define TTM_PAGE_FLAG_DMA32 (1 << 7) | 83 | #define TTM_PAGE_FLAG_DMA32 (1 << 7) |
84 | #define TTM_PAGE_FLAG_SG (1 << 8) | ||
84 | 85 | ||
85 | enum ttm_caching_state { | 86 | enum ttm_caching_state { |
86 | tt_uncached, | 87 | tt_uncached, |
@@ -116,6 +117,7 @@ struct ttm_tt { | |||
116 | struct page **pages; | 117 | struct page **pages; |
117 | uint32_t page_flags; | 118 | uint32_t page_flags; |
118 | unsigned long num_pages; | 119 | unsigned long num_pages; |
120 | struct sg_table *sg; /* for SG objects via dma-buf */ | ||
119 | struct ttm_bo_global *glob; | 121 | struct ttm_bo_global *glob; |
120 | struct ttm_backend *be; | 122 | struct ttm_backend *be; |
121 | struct file *swap_storage; | 123 | struct file *swap_storage; |