aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/bridge/ptn3460.h37
-rw-r--r--include/drm/drmP.h243
-rw-r--r--include/drm/drm_crtc.h225
-rw-r--r--include/drm/drm_crtc_helper.h6
-rw-r--r--include/drm/drm_dp_helper.h125
-rw-r--r--include/drm/drm_fb_helper.h6
-rw-r--r--include/drm/drm_gem_cma_helper.h2
-rw-r--r--include/drm/drm_mipi_dsi.h6
-rw-r--r--include/drm/drm_mm.h182
-rw-r--r--include/drm/drm_modes.h237
-rw-r--r--include/drm/drm_plane_helper.h49
-rw-r--r--include/drm/drm_vma_manager.h6
-rw-r--r--include/drm/gma_drm.h70
-rw-r--r--include/drm/ttm/ttm_bo_driver.h49
-rw-r--r--include/drm/ttm/ttm_object.h4
-rw-r--r--include/drm/ttm/ttm_placement.h3
16 files changed, 820 insertions, 430 deletions
diff --git a/include/drm/bridge/ptn3460.h b/include/drm/bridge/ptn3460.h
new file mode 100644
index 000000000000..ff62344fec6c
--- /dev/null
+++ b/include/drm/bridge/ptn3460.h
@@ -0,0 +1,37 @@
1/*
2 * Copyright (C) 2013 Google, Inc.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13
14#ifndef _DRM_BRIDGE_PTN3460_H_
15#define _DRM_BRIDGE_PTN3460_H_
16
17struct drm_device;
18struct drm_encoder;
19struct i2c_client;
20struct device_node;
21
22#if defined(CONFIG_DRM_PTN3460) || defined(CONFIG_DRM_PTN3460_MODULE)
23
24int ptn3460_init(struct drm_device *dev, struct drm_encoder *encoder,
25 struct i2c_client *client, struct device_node *node);
26#else
27
28static inline int ptn3460_init(struct drm_device *dev,
29 struct drm_encoder *encoder, struct i2c_client *client,
30 struct device_node *node)
31{
32 return 0;
33}
34
35#endif
36
37#endif
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 04a7f31301f8..a7c2a862b4f4 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -43,6 +43,7 @@
43#include <asm/current.h> 43#include <asm/current.h>
44#endif /* __alpha__ */ 44#endif /* __alpha__ */
45#include <linux/kernel.h> 45#include <linux/kernel.h>
46#include <linux/kref.h>
46#include <linux/miscdevice.h> 47#include <linux/miscdevice.h>
47#include <linux/fs.h> 48#include <linux/fs.h>
48#include <linux/init.h> 49#include <linux/init.h>
@@ -87,46 +88,41 @@ struct videomode;
87#include <drm/drm_hashtab.h> 88#include <drm/drm_hashtab.h>
88#include <drm/drm_mm.h> 89#include <drm/drm_mm.h>
89 90
90#define DRM_UT_CORE 0x01
91#define DRM_UT_DRIVER 0x02
92#define DRM_UT_KMS 0x04
93#define DRM_UT_PRIME 0x08
94/* 91/*
95 * Three debug levels are defined. 92 * 4 debug categories are defined:
96 * drm_core, drm_driver, drm_kms 93 *
97 * drm_core level can be used in the generic drm code. For example: 94 * CORE: Used in the generic drm code: drm_ioctl.c, drm_mm.c, drm_memory.c, ...
98 * drm_ioctl, drm_mm, drm_memory 95 * This is the category used by the DRM_DEBUG() macro.
99 * The macro definition of DRM_DEBUG is used. 96 *
100 * DRM_DEBUG(fmt, args...) 97 * DRIVER: Used in the vendor specific part of the driver: i915, radeon, ...
101 * The debug info by using the DRM_DEBUG can be obtained by adding 98 * This is the category used by the DRM_DEBUG_DRIVER() macro.
102 * the boot option of "drm.debug=1". 99 *
100 * KMS: used in the modesetting code.
101 * This is the category used by the DRM_DEBUG_KMS() macro.
102 *
103 * PRIME: used in the prime code.
104 * This is the category used by the DRM_DEBUG_PRIME() macro.
103 * 105 *
104 * drm_driver level can be used in the specific drm driver. It is used 106 * Enabling verbose debug messages is done through the drm.debug parameter,
105 * to add the debug info related with the drm driver. For example: 107 * each category being enabled by a bit.
106 * i915_drv, i915_dma, i915_gem, radeon_drv,
107 * The macro definition of DRM_DEBUG_DRIVER can be used.
108 * DRM_DEBUG_DRIVER(fmt, args...)
109 * The debug info by using the DRM_DEBUG_DRIVER can be obtained by
110 * adding the boot option of "drm.debug=0x02"
111 * 108 *
112 * drm_kms level can be used in the KMS code related with specific drm driver. 109 * drm.debug=0x1 will enable CORE messages
113 * It is used to add the debug info related with KMS mode. For example: 110 * drm.debug=0x2 will enable DRIVER messages
114 * the connector/crtc , 111 * drm.debug=0x3 will enable CORE and DRIVER messages
115 * The macro definition of DRM_DEBUG_KMS can be used. 112 * ...
116 * DRM_DEBUG_KMS(fmt, args...) 113 * drm.debug=0xf will enable all messages
117 * The debug info by using the DRM_DEBUG_KMS can be obtained by
118 * adding the boot option of "drm.debug=0x04"
119 * 114 *
120 * If we add the boot option of "drm.debug=0x06", we can get the debug info by 115 * An interesting feature is that it's possible to enable verbose logging at
121 * using the DRM_DEBUG_KMS and DRM_DEBUG_DRIVER. 116 * run-time by echoing the debug value in its sysfs node:
122 * If we add the boot option of "drm.debug=0x05", we can get the debug info by 117 * # echo 0xf > /sys/module/drm/parameters/debug
123 * using the DRM_DEBUG_KMS and DRM_DEBUG.
124 */ 118 */
119#define DRM_UT_CORE 0x01
120#define DRM_UT_DRIVER 0x02
121#define DRM_UT_KMS 0x04
122#define DRM_UT_PRIME 0x08
125 123
126extern __printf(4, 5) 124extern __printf(2, 3)
127void drm_ut_debug_printk(unsigned int request_level, 125void drm_ut_debug_printk(const char *function_name,
128 const char *prefix,
129 const char *function_name,
130 const char *format, ...); 126 const char *format, ...);
131extern __printf(2, 3) 127extern __printf(2, 3)
132int drm_err(const char *func, const char *format, ...); 128int drm_err(const char *func, const char *format, ...);
@@ -211,55 +207,30 @@ int drm_err(const char *func, const char *format, ...);
211#if DRM_DEBUG_CODE 207#if DRM_DEBUG_CODE
212#define DRM_DEBUG(fmt, args...) \ 208#define DRM_DEBUG(fmt, args...) \
213 do { \ 209 do { \
214 drm_ut_debug_printk(DRM_UT_CORE, DRM_NAME, \ 210 if (unlikely(drm_debug & DRM_UT_CORE)) \
215 __func__, fmt, ##args); \ 211 drm_ut_debug_printk(__func__, fmt, ##args); \
216 } while (0) 212 } while (0)
217 213
218#define DRM_DEBUG_DRIVER(fmt, args...) \ 214#define DRM_DEBUG_DRIVER(fmt, args...) \
219 do { \ 215 do { \
220 drm_ut_debug_printk(DRM_UT_DRIVER, DRM_NAME, \ 216 if (unlikely(drm_debug & DRM_UT_DRIVER)) \
221 __func__, fmt, ##args); \ 217 drm_ut_debug_printk(__func__, fmt, ##args); \
222 } while (0) 218 } while (0)
223#define DRM_DEBUG_KMS(fmt, args...) \ 219#define DRM_DEBUG_KMS(fmt, args...) \
224 do { \ 220 do { \
225 drm_ut_debug_printk(DRM_UT_KMS, DRM_NAME, \ 221 if (unlikely(drm_debug & DRM_UT_KMS)) \
226 __func__, fmt, ##args); \ 222 drm_ut_debug_printk(__func__, fmt, ##args); \
227 } while (0) 223 } while (0)
228#define DRM_DEBUG_PRIME(fmt, args...) \ 224#define DRM_DEBUG_PRIME(fmt, args...) \
229 do { \ 225 do { \
230 drm_ut_debug_printk(DRM_UT_PRIME, DRM_NAME, \ 226 if (unlikely(drm_debug & DRM_UT_PRIME)) \
231 __func__, fmt, ##args); \ 227 drm_ut_debug_printk(__func__, fmt, ##args); \
232 } while (0)
233#define DRM_LOG(fmt, args...) \
234 do { \
235 drm_ut_debug_printk(DRM_UT_CORE, NULL, \
236 NULL, fmt, ##args); \
237 } while (0)
238#define DRM_LOG_KMS(fmt, args...) \
239 do { \
240 drm_ut_debug_printk(DRM_UT_KMS, NULL, \
241 NULL, fmt, ##args); \
242 } while (0)
243#define DRM_LOG_MODE(fmt, args...) \
244 do { \
245 drm_ut_debug_printk(DRM_UT_MODE, NULL, \
246 NULL, fmt, ##args); \
247 } while (0)
248#define DRM_LOG_DRIVER(fmt, args...) \
249 do { \
250 drm_ut_debug_printk(DRM_UT_DRIVER, NULL, \
251 NULL, fmt, ##args); \
252 } while (0) 228 } while (0)
253#else 229#else
254#define DRM_DEBUG_DRIVER(fmt, args...) do { } while (0) 230#define DRM_DEBUG_DRIVER(fmt, args...) do { } while (0)
255#define DRM_DEBUG_KMS(fmt, args...) do { } while (0) 231#define DRM_DEBUG_KMS(fmt, args...) do { } while (0)
256#define DRM_DEBUG_PRIME(fmt, args...) do { } while (0) 232#define DRM_DEBUG_PRIME(fmt, args...) do { } while (0)
257#define DRM_DEBUG(fmt, arg...) do { } while (0) 233#define DRM_DEBUG(fmt, arg...) do { } while (0)
258#define DRM_LOG(fmt, arg...) do { } while (0)
259#define DRM_LOG_KMS(fmt, args...) do { } while (0)
260#define DRM_LOG_MODE(fmt, arg...) do { } while (0)
261#define DRM_LOG_DRIVER(fmt, arg...) do { } while (0)
262
263#endif 234#endif
264 235
265/*@}*/ 236/*@}*/
@@ -434,9 +405,15 @@ struct drm_prime_file_private {
434struct drm_file { 405struct drm_file {
435 unsigned always_authenticated :1; 406 unsigned always_authenticated :1;
436 unsigned authenticated :1; 407 unsigned authenticated :1;
437 unsigned is_master :1; /* this file private is a master for a minor */ 408 /* Whether we're master for a minor. Protected by master_mutex */
409 unsigned is_master :1;
438 /* true when the client has asked us to expose stereo 3D mode flags */ 410 /* true when the client has asked us to expose stereo 3D mode flags */
439 unsigned stereo_allowed :1; 411 unsigned stereo_allowed :1;
412 /*
413 * true if client understands CRTC primary planes and cursor planes
414 * in the plane list
415 */
416 unsigned universal_planes:1;
440 417
441 struct pid *pid; 418 struct pid *pid;
442 kuid_t uid; 419 kuid_t uid;
@@ -713,29 +690,29 @@ struct drm_gem_object {
713 690
714#include <drm/drm_crtc.h> 691#include <drm/drm_crtc.h>
715 692
716/* per-master structure */ 693/**
694 * struct drm_master - drm master structure
695 *
696 * @refcount: Refcount for this master object.
697 * @minor: Link back to minor char device we are master for. Immutable.
698 * @unique: Unique identifier: e.g. busid. Protected by drm_global_mutex.
699 * @unique_len: Length of unique field. Protected by drm_global_mutex.
700 * @unique_size: Amount allocated. Protected by drm_global_mutex.
701 * @magiclist: Hash of used authentication tokens. Protected by struct_mutex.
702 * @magicfree: List of used authentication tokens. Protected by struct_mutex.
703 * @lock: DRI lock information.
704 * @driver_priv: Pointer to driver-private information.
705 */
717struct drm_master { 706struct drm_master {
718 707 struct kref refcount;
719 struct kref refcount; /* refcount for this master */ 708 struct drm_minor *minor;
720 709 char *unique;
721 struct list_head head; /**< each minor contains a list of masters */ 710 int unique_len;
722 struct drm_minor *minor; /**< link back to minor we are a master for */ 711 int unique_size;
723
724 char *unique; /**< Unique identifier: e.g., busid */
725 int unique_len; /**< Length of unique field */
726 int unique_size; /**< amount allocated */
727
728 int blocked; /**< Blocked due to VC switch? */
729
730 /** \name Authentication */
731 /*@{ */
732 struct drm_open_hash magiclist; 712 struct drm_open_hash magiclist;
733 struct list_head magicfree; 713 struct list_head magicfree;
734 /*@} */ 714 struct drm_lock_data lock;
735 715 void *driver_priv;
736 struct drm_lock_data lock; /**< Information on hardware lock */
737
738 void *driver_priv; /**< Private structure for driver to use */
739}; 716};
740 717
741/* Size of ringbuffer for vblank timestamps. Just double-buffer 718/* Size of ringbuffer for vblank timestamps. Just double-buffer
@@ -1008,10 +985,12 @@ struct drm_driver {
1008 struct list_head legacy_dev_list; 985 struct list_head legacy_dev_list;
1009}; 986};
1010 987
1011#define DRM_MINOR_UNASSIGNED 0 988enum drm_minor_type {
1012#define DRM_MINOR_LEGACY 1 989 DRM_MINOR_LEGACY,
1013#define DRM_MINOR_CONTROL 2 990 DRM_MINOR_CONTROL,
1014#define DRM_MINOR_RENDER 3 991 DRM_MINOR_RENDER,
992 DRM_MINOR_CNT,
993};
1015 994
1016/** 995/**
1017 * Info file list entry. This structure represents a debugfs or proc file to 996 * Info file list entry. This structure represents a debugfs or proc file to
@@ -1040,7 +1019,6 @@ struct drm_info_node {
1040struct drm_minor { 1019struct drm_minor {
1041 int index; /**< Minor device number */ 1020 int index; /**< Minor device number */
1042 int type; /**< Control or render */ 1021 int type; /**< Control or render */
1043 dev_t device; /**< Device number for mknod */
1044 struct device *kdev; /**< Linux device */ 1022 struct device *kdev; /**< Linux device */
1045 struct drm_device *dev; 1023 struct drm_device *dev;
1046 1024
@@ -1049,26 +1027,11 @@ struct drm_minor {
1049 struct list_head debugfs_list; 1027 struct list_head debugfs_list;
1050 struct mutex debugfs_lock; /* Protects debugfs_list. */ 1028 struct mutex debugfs_lock; /* Protects debugfs_list. */
1051 1029
1052 struct drm_master *master; /* currently active master for this node */ 1030 /* currently active master for this node. Protected by master_mutex */
1053 struct list_head master_list; 1031 struct drm_master *master;
1054 struct drm_mode_group mode_group; 1032 struct drm_mode_group mode_group;
1055}; 1033};
1056 1034
1057/* mode specified on the command line */
1058struct drm_cmdline_mode {
1059 bool specified;
1060 bool refresh_specified;
1061 bool bpp_specified;
1062 int xres, yres;
1063 int bpp;
1064 int refresh;
1065 bool rb;
1066 bool interlace;
1067 bool cvt;
1068 bool margins;
1069 enum drm_connector_force force;
1070};
1071
1072 1035
1073struct drm_pending_vblank_event { 1036struct drm_pending_vblank_event {
1074 struct drm_pending_event base; 1037 struct drm_pending_event base;
@@ -1098,10 +1061,24 @@ struct drm_device {
1098 char *devname; /**< For /proc/interrupts */ 1061 char *devname; /**< For /proc/interrupts */
1099 int if_version; /**< Highest interface version set */ 1062 int if_version; /**< Highest interface version set */
1100 1063
1064 /** \name Lifetime Management */
1065 /*@{ */
1066 struct kref ref; /**< Object ref-count */
1067 struct device *dev; /**< Device structure of bus-device */
1068 struct drm_driver *driver; /**< DRM driver managing the device */
1069 void *dev_private; /**< DRM driver private data */
1070 struct drm_minor *control; /**< Control node */
1071 struct drm_minor *primary; /**< Primary node */
1072 struct drm_minor *render; /**< Render node */
1073 atomic_t unplugged; /**< Flag whether dev is dead */
1074 struct inode *anon_inode; /**< inode for private address-space */
1075 /*@} */
1076
1101 /** \name Locks */ 1077 /** \name Locks */
1102 /*@{ */ 1078 /*@{ */
1103 spinlock_t count_lock; /**< For inuse, drm_device::open_count, drm_device::buf_use */ 1079 spinlock_t count_lock; /**< For inuse, drm_device::open_count, drm_device::buf_use */
1104 struct mutex struct_mutex; /**< For others */ 1080 struct mutex struct_mutex; /**< For others */
1081 struct mutex master_mutex; /**< For drm_minor::master and drm_file::is_master */
1105 /*@} */ 1082 /*@} */
1106 1083
1107 /** \name Usage Counters */ 1084 /** \name Usage Counters */
@@ -1171,7 +1148,6 @@ struct drm_device {
1171 1148
1172 struct drm_agp_head *agp; /**< AGP data */ 1149 struct drm_agp_head *agp; /**< AGP data */
1173 1150
1174 struct device *dev; /**< Device structure */
1175 struct pci_dev *pdev; /**< PCI device structure */ 1151 struct pci_dev *pdev; /**< PCI device structure */
1176#ifdef __alpha__ 1152#ifdef __alpha__
1177 struct pci_controller *hose; 1153 struct pci_controller *hose;
@@ -1182,17 +1158,11 @@ struct drm_device {
1182 1158
1183 struct drm_sg_mem *sg; /**< Scatter gather memory */ 1159 struct drm_sg_mem *sg; /**< Scatter gather memory */
1184 unsigned int num_crtcs; /**< Number of CRTCs on this device */ 1160 unsigned int num_crtcs; /**< Number of CRTCs on this device */
1185 void *dev_private; /**< device private data */
1186 struct address_space *dev_mapping;
1187 struct drm_sigdata sigdata; /**< For block_all_signals */ 1161 struct drm_sigdata sigdata; /**< For block_all_signals */
1188 sigset_t sigmask; 1162 sigset_t sigmask;
1189 1163
1190 struct drm_driver *driver;
1191 struct drm_local_map *agp_buffer_map; 1164 struct drm_local_map *agp_buffer_map;
1192 unsigned int agp_buffer_token; 1165 unsigned int agp_buffer_token;
1193 struct drm_minor *control; /**< Control node for card */
1194 struct drm_minor *primary; /**< render type primary screen head */
1195 struct drm_minor *render; /**< render node for card */
1196 1166
1197 struct drm_mode_config mode_config; /**< Current mode config */ 1167 struct drm_mode_config mode_config; /**< Current mode config */
1198 1168
@@ -1203,8 +1173,6 @@ struct drm_device {
1203 struct drm_vma_offset_manager *vma_offset_manager; 1173 struct drm_vma_offset_manager *vma_offset_manager;
1204 /*@} */ 1174 /*@} */
1205 int switch_power_state; 1175 int switch_power_state;
1206
1207 atomic_t unplugged; /* device has been unplugged or gone away */
1208}; 1176};
1209 1177
1210#define DRM_SWITCH_POWER_ON 0 1178#define DRM_SWITCH_POWER_ON 0
@@ -1241,11 +1209,21 @@ static inline bool drm_modeset_is_locked(struct drm_device *dev)
1241 return mutex_is_locked(&dev->mode_config.mutex); 1209 return mutex_is_locked(&dev->mode_config.mutex);
1242} 1210}
1243 1211
1244static inline bool drm_is_render_client(struct drm_file *file_priv) 1212static inline bool drm_is_render_client(const struct drm_file *file_priv)
1245{ 1213{
1246 return file_priv->minor->type == DRM_MINOR_RENDER; 1214 return file_priv->minor->type == DRM_MINOR_RENDER;
1247} 1215}
1248 1216
1217static inline bool drm_is_control_client(const struct drm_file *file_priv)
1218{
1219 return file_priv->minor->type == DRM_MINOR_CONTROL;
1220}
1221
1222static inline bool drm_is_primary_client(const struct drm_file *file_priv)
1223{
1224 return file_priv->minor->type == DRM_MINOR_LEGACY;
1225}
1226
1249/******************************************************************/ 1227/******************************************************************/
1250/** \name Internal function definitions */ 1228/** \name Internal function definitions */
1251/*@{*/ 1229/*@{*/
@@ -1256,6 +1234,7 @@ extern long drm_ioctl(struct file *filp,
1256extern long drm_compat_ioctl(struct file *filp, 1234extern long drm_compat_ioctl(struct file *filp,
1257 unsigned int cmd, unsigned long arg); 1235 unsigned int cmd, unsigned long arg);
1258extern int drm_lastclose(struct drm_device *dev); 1236extern int drm_lastclose(struct drm_device *dev);
1237extern bool drm_ioctl_flags(unsigned int nr, unsigned int *flags);
1259 1238
1260 /* Device support (drm_fops.h) */ 1239 /* Device support (drm_fops.h) */
1261extern struct mutex drm_global_mutex; 1240extern struct mutex drm_global_mutex;
@@ -1411,20 +1390,6 @@ extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
1411extern void drm_calc_timestamping_constants(struct drm_crtc *crtc, 1390extern void drm_calc_timestamping_constants(struct drm_crtc *crtc,
1412 const struct drm_display_mode *mode); 1391 const struct drm_display_mode *mode);
1413 1392
1414extern bool
1415drm_mode_parse_command_line_for_connector(const char *mode_option,
1416 struct drm_connector *connector,
1417 struct drm_cmdline_mode *mode);
1418
1419extern struct drm_display_mode *
1420drm_mode_create_from_cmdline_mode(struct drm_device *dev,
1421 struct drm_cmdline_mode *cmd);
1422
1423extern int drm_display_mode_from_videomode(const struct videomode *vm,
1424 struct drm_display_mode *dmode);
1425extern int of_get_drm_display_mode(struct device_node *np,
1426 struct drm_display_mode *dmode,
1427 int index);
1428 1393
1429/* Modesetting support */ 1394/* Modesetting support */
1430extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); 1395extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc);
@@ -1449,6 +1414,7 @@ extern void drm_put_dev(struct drm_device *dev);
1449extern void drm_unplug_dev(struct drm_device *dev); 1414extern void drm_unplug_dev(struct drm_device *dev);
1450extern unsigned int drm_debug; 1415extern unsigned int drm_debug;
1451extern unsigned int drm_rnodes; 1416extern unsigned int drm_rnodes;
1417extern unsigned int drm_universal_planes;
1452 1418
1453extern unsigned int drm_vblank_offdelay; 1419extern unsigned int drm_vblank_offdelay;
1454extern unsigned int drm_timestamp_precision; 1420extern unsigned int drm_timestamp_precision;
@@ -1661,9 +1627,14 @@ static __inline__ void drm_core_dropmap(struct drm_local_map *map)
1661 1627
1662struct drm_device *drm_dev_alloc(struct drm_driver *driver, 1628struct drm_device *drm_dev_alloc(struct drm_driver *driver,
1663 struct device *parent); 1629 struct device *parent);
1664void drm_dev_free(struct drm_device *dev); 1630void drm_dev_ref(struct drm_device *dev);
1631void drm_dev_unref(struct drm_device *dev);
1665int drm_dev_register(struct drm_device *dev, unsigned long flags); 1632int drm_dev_register(struct drm_device *dev, unsigned long flags);
1666void drm_dev_unregister(struct drm_device *dev); 1633void drm_dev_unregister(struct drm_device *dev);
1634
1635struct drm_minor *drm_minor_acquire(unsigned int minor_id);
1636void drm_minor_release(struct drm_minor *minor);
1637
1667/*@}*/ 1638/*@}*/
1668 1639
1669/* PCI section */ 1640/* PCI section */
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 8f3dee097579..e55fccbe7c42 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -32,7 +32,6 @@
32#include <linux/fb.h> 32#include <linux/fb.h>
33#include <linux/hdmi.h> 33#include <linux/hdmi.h>
34#include <drm/drm_mode.h> 34#include <drm/drm_mode.h>
35
36#include <drm/drm_fourcc.h> 35#include <drm/drm_fourcc.h>
37 36
38struct drm_device; 37struct drm_device;
@@ -65,130 +64,14 @@ struct drm_object_properties {
65 uint64_t values[DRM_OBJECT_MAX_PROPERTY]; 64 uint64_t values[DRM_OBJECT_MAX_PROPERTY];
66}; 65};
67 66
68/* 67enum drm_connector_force {
69 * Note on terminology: here, for brevity and convenience, we refer to connector 68 DRM_FORCE_UNSPECIFIED,
70 * control chips as 'CRTCs'. They can control any type of connector, VGA, LVDS, 69 DRM_FORCE_OFF,
71 * DVI, etc. And 'screen' refers to the whole of the visible display, which 70 DRM_FORCE_ON, /* force on analog part normally */
72 * may span multiple monitors (and therefore multiple CRTC and connector 71 DRM_FORCE_ON_DIGITAL, /* for DVI-I use digital connector */
73 * structures).
74 */
75
76enum drm_mode_status {
77 MODE_OK = 0, /* Mode OK */
78 MODE_HSYNC, /* hsync out of range */
79 MODE_VSYNC, /* vsync out of range */
80 MODE_H_ILLEGAL, /* mode has illegal horizontal timings */
81 MODE_V_ILLEGAL, /* mode has illegal horizontal timings */
82 MODE_BAD_WIDTH, /* requires an unsupported linepitch */
83 MODE_NOMODE, /* no mode with a matching name */
84 MODE_NO_INTERLACE, /* interlaced mode not supported */
85 MODE_NO_DBLESCAN, /* doublescan mode not supported */
86 MODE_NO_VSCAN, /* multiscan mode not supported */
87 MODE_MEM, /* insufficient video memory */
88 MODE_VIRTUAL_X, /* mode width too large for specified virtual size */
89 MODE_VIRTUAL_Y, /* mode height too large for specified virtual size */
90 MODE_MEM_VIRT, /* insufficient video memory given virtual size */
91 MODE_NOCLOCK, /* no fixed clock available */
92 MODE_CLOCK_HIGH, /* clock required is too high */
93 MODE_CLOCK_LOW, /* clock required is too low */
94 MODE_CLOCK_RANGE, /* clock/mode isn't in a ClockRange */
95 MODE_BAD_HVALUE, /* horizontal timing was out of range */
96 MODE_BAD_VVALUE, /* vertical timing was out of range */
97 MODE_BAD_VSCAN, /* VScan value out of range */
98 MODE_HSYNC_NARROW, /* horizontal sync too narrow */
99 MODE_HSYNC_WIDE, /* horizontal sync too wide */
100 MODE_HBLANK_NARROW, /* horizontal blanking too narrow */
101 MODE_HBLANK_WIDE, /* horizontal blanking too wide */
102 MODE_VSYNC_NARROW, /* vertical sync too narrow */
103 MODE_VSYNC_WIDE, /* vertical sync too wide */
104 MODE_VBLANK_NARROW, /* vertical blanking too narrow */
105 MODE_VBLANK_WIDE, /* vertical blanking too wide */
106 MODE_PANEL, /* exceeds panel dimensions */
107 MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */
108 MODE_ONE_WIDTH, /* only one width is supported */
109 MODE_ONE_HEIGHT, /* only one height is supported */
110 MODE_ONE_SIZE, /* only one resolution is supported */
111 MODE_NO_REDUCED, /* monitor doesn't accept reduced blanking */
112 MODE_NO_STEREO, /* stereo modes not supported */
113 MODE_UNVERIFIED = -3, /* mode needs to reverified */
114 MODE_BAD = -2, /* unspecified reason */
115 MODE_ERROR = -1 /* error condition */
116};
117
118#define DRM_MODE_TYPE_CLOCK_CRTC_C (DRM_MODE_TYPE_CLOCK_C | \
119 DRM_MODE_TYPE_CRTC_C)
120
121#define DRM_MODE(nm, t, c, hd, hss, hse, ht, hsk, vd, vss, vse, vt, vs, f) \
122 .name = nm, .status = 0, .type = (t), .clock = (c), \
123 .hdisplay = (hd), .hsync_start = (hss), .hsync_end = (hse), \
124 .htotal = (ht), .hskew = (hsk), .vdisplay = (vd), \
125 .vsync_start = (vss), .vsync_end = (vse), .vtotal = (vt), \
126 .vscan = (vs), .flags = (f), \
127 .base.type = DRM_MODE_OBJECT_MODE
128
129#define CRTC_INTERLACE_HALVE_V (1 << 0) /* halve V values for interlacing */
130#define CRTC_STEREO_DOUBLE (1 << 1) /* adjust timings for stereo modes */
131
132#define DRM_MODE_FLAG_3D_MAX DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF
133
134struct drm_display_mode {
135 /* Header */
136 struct list_head head;
137 struct drm_mode_object base;
138
139 char name[DRM_DISPLAY_MODE_LEN];
140
141 enum drm_mode_status status;
142 unsigned int type;
143
144 /* Proposed mode values */
145 int clock; /* in kHz */
146 int hdisplay;
147 int hsync_start;
148 int hsync_end;
149 int htotal;
150 int hskew;
151 int vdisplay;
152 int vsync_start;
153 int vsync_end;
154 int vtotal;
155 int vscan;
156 unsigned int flags;
157
158 /* Addressable image size (may be 0 for projectors, etc.) */
159 int width_mm;
160 int height_mm;
161
162 /* Actual mode we give to hw */
163 int crtc_clock; /* in KHz */
164 int crtc_hdisplay;
165 int crtc_hblank_start;
166 int crtc_hblank_end;
167 int crtc_hsync_start;
168 int crtc_hsync_end;
169 int crtc_htotal;
170 int crtc_hskew;
171 int crtc_vdisplay;
172 int crtc_vblank_start;
173 int crtc_vblank_end;
174 int crtc_vsync_start;
175 int crtc_vsync_end;
176 int crtc_vtotal;
177
178 /* Driver private mode info */
179 int private_size;
180 int *private;
181 int private_flags;
182
183 int vrefresh; /* in Hz */
184 int hsync; /* in kHz */
185 enum hdmi_picture_aspect picture_aspect_ratio;
186}; 72};
187 73
188static inline bool drm_mode_is_stereo(const struct drm_display_mode *mode) 74#include <drm/drm_modes.h>
189{
190 return mode->flags & DRM_MODE_FLAG_3D_MASK;
191}
192 75
193enum drm_connector_status { 76enum drm_connector_status {
194 connector_status_connected = 1, 77 connector_status_connected = 1,
@@ -387,6 +270,8 @@ struct drm_crtc_funcs {
387 * @dev: parent DRM device 270 * @dev: parent DRM device
388 * @head: list management 271 * @head: list management
389 * @base: base KMS object for ID tracking etc. 272 * @base: base KMS object for ID tracking etc.
273 * @primary: primary plane for this CRTC
274 * @cursor: cursor plane for this CRTC
390 * @enabled: is this CRTC enabled? 275 * @enabled: is this CRTC enabled?
391 * @mode: current mode timings 276 * @mode: current mode timings
392 * @hwmode: mode timings as programmed to hw regs 277 * @hwmode: mode timings as programmed to hw regs
@@ -422,8 +307,9 @@ struct drm_crtc {
422 307
423 struct drm_mode_object base; 308 struct drm_mode_object base;
424 309
425 /* framebuffer the connector is currently bound to */ 310 /* primary and cursor planes for CRTC */
426 struct drm_framebuffer *fb; 311 struct drm_plane *primary;
312 struct drm_plane *cursor;
427 313
428 /* Temporary tracking of the old fb while a modeset is ongoing. Used 314 /* Temporary tracking of the old fb while a modeset is ongoing. Used
429 * by drm_mode_set_config_internal to implement correct refcounting. */ 315 * by drm_mode_set_config_internal to implement correct refcounting. */
@@ -540,13 +426,6 @@ struct drm_encoder {
540 void *helper_private; 426 void *helper_private;
541}; 427};
542 428
543enum drm_connector_force {
544 DRM_FORCE_UNSPECIFIED,
545 DRM_FORCE_OFF,
546 DRM_FORCE_ON, /* force on analog part normally */
547 DRM_FORCE_ON_DIGITAL, /* for DVI-I use digital connector */
548};
549
550/* should we poll this connector for connects and disconnects */ 429/* should we poll this connector for connects and disconnects */
551/* hot plug detectable */ 430/* hot plug detectable */
552#define DRM_CONNECTOR_POLL_HPD (1 << 0) 431#define DRM_CONNECTOR_POLL_HPD (1 << 0)
@@ -665,6 +544,12 @@ struct drm_plane_funcs {
665 struct drm_property *property, uint64_t val); 544 struct drm_property *property, uint64_t val);
666}; 545};
667 546
547enum drm_plane_type {
548 DRM_PLANE_TYPE_OVERLAY,
549 DRM_PLANE_TYPE_PRIMARY,
550 DRM_PLANE_TYPE_CURSOR,
551};
552
668/** 553/**
669 * drm_plane - central DRM plane control structure 554 * drm_plane - central DRM plane control structure
670 * @dev: DRM device this plane belongs to 555 * @dev: DRM device this plane belongs to
@@ -677,6 +562,7 @@ struct drm_plane_funcs {
677 * @fb: currently bound fb 562 * @fb: currently bound fb
678 * @funcs: helper functions 563 * @funcs: helper functions
679 * @properties: property tracking for this plane 564 * @properties: property tracking for this plane
565 * @type: type of plane (overlay, primary, cursor)
680 */ 566 */
681struct drm_plane { 567struct drm_plane {
682 struct drm_device *dev; 568 struct drm_device *dev;
@@ -694,6 +580,8 @@ struct drm_plane {
694 const struct drm_plane_funcs *funcs; 580 const struct drm_plane_funcs *funcs;
695 581
696 struct drm_object_properties properties; 582 struct drm_object_properties properties;
583
584 enum drm_plane_type type;
697}; 585};
698 586
699/** 587/**
@@ -856,7 +744,15 @@ struct drm_mode_config {
856 struct list_head bridge_list; 744 struct list_head bridge_list;
857 int num_encoder; 745 int num_encoder;
858 struct list_head encoder_list; 746 struct list_head encoder_list;
859 int num_plane; 747
748 /*
749 * Track # of overlay planes separately from # of total planes. By
750 * default we only advertise overlay planes to userspace; if userspace
751 * sets the "universal plane" capability bit, we'll go ahead and
752 * expose all planes.
753 */
754 int num_overlay_plane;
755 int num_total_plane;
860 struct list_head plane_list; 756 struct list_head plane_list;
861 757
862 int num_crtc; 758 int num_crtc;
@@ -878,6 +774,7 @@ struct drm_mode_config {
878 struct list_head property_blob_list; 774 struct list_head property_blob_list;
879 struct drm_property *edid_property; 775 struct drm_property *edid_property;
880 struct drm_property *dpms_property; 776 struct drm_property *dpms_property;
777 struct drm_property *plane_type_property;
881 778
882 /* DVI-I properties */ 779 /* DVI-I properties */
883 struct drm_property *dvi_i_subconnector_property; 780 struct drm_property *dvi_i_subconnector_property;
@@ -930,6 +827,11 @@ extern void drm_modeset_lock_all(struct drm_device *dev);
930extern void drm_modeset_unlock_all(struct drm_device *dev); 827extern void drm_modeset_unlock_all(struct drm_device *dev);
931extern void drm_warn_on_modeset_not_all_locked(struct drm_device *dev); 828extern void drm_warn_on_modeset_not_all_locked(struct drm_device *dev);
932 829
830extern int drm_crtc_init_with_planes(struct drm_device *dev,
831 struct drm_crtc *crtc,
832 struct drm_plane *primary,
833 void *cursor,
834 const struct drm_crtc_funcs *funcs);
933extern int drm_crtc_init(struct drm_device *dev, 835extern int drm_crtc_init(struct drm_device *dev,
934 struct drm_crtc *crtc, 836 struct drm_crtc *crtc,
935 const struct drm_crtc_funcs *funcs); 837 const struct drm_crtc_funcs *funcs);
@@ -981,19 +883,31 @@ static inline bool drm_encoder_crtc_ok(struct drm_encoder *encoder,
981 return !!(encoder->possible_crtcs & drm_crtc_mask(crtc)); 883 return !!(encoder->possible_crtcs & drm_crtc_mask(crtc));
982} 884}
983 885
886extern int drm_universal_plane_init(struct drm_device *dev,
887 struct drm_plane *plane,
888 unsigned long possible_crtcs,
889 const struct drm_plane_funcs *funcs,
890 const uint32_t *formats,
891 uint32_t format_count,
892 enum drm_plane_type type);
984extern int drm_plane_init(struct drm_device *dev, 893extern int drm_plane_init(struct drm_device *dev,
985 struct drm_plane *plane, 894 struct drm_plane *plane,
986 unsigned long possible_crtcs, 895 unsigned long possible_crtcs,
987 const struct drm_plane_funcs *funcs, 896 const struct drm_plane_funcs *funcs,
988 const uint32_t *formats, uint32_t format_count, 897 const uint32_t *formats, uint32_t format_count,
989 bool priv); 898 bool is_primary);
990extern void drm_plane_cleanup(struct drm_plane *plane); 899extern void drm_plane_cleanup(struct drm_plane *plane);
991extern void drm_plane_force_disable(struct drm_plane *plane); 900extern void drm_plane_force_disable(struct drm_plane *plane);
901extern int drm_crtc_check_viewport(const struct drm_crtc *crtc,
902 int x, int y,
903 const struct drm_display_mode *mode,
904 const struct drm_framebuffer *fb);
992 905
993extern void drm_encoder_cleanup(struct drm_encoder *encoder); 906extern void drm_encoder_cleanup(struct drm_encoder *encoder);
994 907
995extern const char *drm_get_connector_name(const struct drm_connector *connector); 908extern const char *drm_get_connector_name(const struct drm_connector *connector);
996extern const char *drm_get_connector_status_name(enum drm_connector_status status); 909extern const char *drm_get_connector_status_name(enum drm_connector_status status);
910extern const char *drm_get_subpixel_order_name(enum subpixel_order order);
997extern const char *drm_get_dpms_name(int val); 911extern const char *drm_get_dpms_name(int val);
998extern const char *drm_get_dvi_i_subconnector_name(int val); 912extern const char *drm_get_dvi_i_subconnector_name(int val);
999extern const char *drm_get_dvi_i_select_name(int val); 913extern const char *drm_get_dvi_i_select_name(int val);
@@ -1006,34 +920,10 @@ extern struct edid *drm_get_edid(struct drm_connector *connector,
1006 struct i2c_adapter *adapter); 920 struct i2c_adapter *adapter);
1007extern struct edid *drm_edid_duplicate(const struct edid *edid); 921extern struct edid *drm_edid_duplicate(const struct edid *edid);
1008extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid); 922extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
1009extern void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
1010extern void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src);
1011extern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
1012 const struct drm_display_mode *mode);
1013extern void drm_mode_debug_printmodeline(const struct drm_display_mode *mode);
1014extern void drm_mode_config_init(struct drm_device *dev); 923extern void drm_mode_config_init(struct drm_device *dev);
1015extern void drm_mode_config_reset(struct drm_device *dev); 924extern void drm_mode_config_reset(struct drm_device *dev);
1016extern void drm_mode_config_cleanup(struct drm_device *dev); 925extern void drm_mode_config_cleanup(struct drm_device *dev);
1017extern void drm_mode_set_name(struct drm_display_mode *mode); 926
1018extern bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2);
1019extern bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2);
1020extern int drm_mode_width(const struct drm_display_mode *mode);
1021extern int drm_mode_height(const struct drm_display_mode *mode);
1022
1023/* for us by fb module */
1024extern struct drm_display_mode *drm_mode_create(struct drm_device *dev);
1025extern void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode);
1026extern void drm_mode_validate_size(struct drm_device *dev,
1027 struct list_head *mode_list,
1028 int maxX, int maxY, int maxPitch);
1029extern void drm_mode_prune_invalid(struct drm_device *dev,
1030 struct list_head *mode_list, bool verbose);
1031extern void drm_mode_sort(struct list_head *mode_list);
1032extern int drm_mode_hsync(const struct drm_display_mode *mode);
1033extern int drm_mode_vrefresh(const struct drm_display_mode *mode);
1034extern void drm_mode_set_crtcinfo(struct drm_display_mode *p,
1035 int adjust_flags);
1036extern void drm_mode_connector_list_update(struct drm_connector *connector);
1037extern int drm_mode_connector_update_edid_property(struct drm_connector *connector, 927extern int drm_mode_connector_update_edid_property(struct drm_connector *connector,
1038 struct edid *edid); 928 struct edid *edid);
1039extern int drm_object_property_set_value(struct drm_mode_object *obj, 929extern int drm_object_property_set_value(struct drm_mode_object *obj,
@@ -1081,8 +971,6 @@ extern const char *drm_get_encoder_name(const struct drm_encoder *encoder);
1081 971
1082extern int drm_mode_connector_attach_encoder(struct drm_connector *connector, 972extern int drm_mode_connector_attach_encoder(struct drm_connector *connector,
1083 struct drm_encoder *encoder); 973 struct drm_encoder *encoder);
1084extern void drm_mode_connector_detach_encoder(struct drm_connector *connector,
1085 struct drm_encoder *encoder);
1086extern int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc, 974extern int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
1087 int gamma_size); 975 int gamma_size);
1088extern struct drm_mode_object *drm_mode_object_find(struct drm_device *dev, 976extern struct drm_mode_object *drm_mode_object_find(struct drm_device *dev,
@@ -1137,16 +1025,6 @@ extern bool drm_detect_monitor_audio(struct edid *edid);
1137extern bool drm_rgb_quant_range_selectable(struct edid *edid); 1025extern bool drm_rgb_quant_range_selectable(struct edid *edid);
1138extern int drm_mode_page_flip_ioctl(struct drm_device *dev, 1026extern int drm_mode_page_flip_ioctl(struct drm_device *dev,
1139 void *data, struct drm_file *file_priv); 1027 void *data, struct drm_file *file_priv);
1140extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
1141 int hdisplay, int vdisplay, int vrefresh,
1142 bool reduced, bool interlaced, bool margins);
1143extern struct drm_display_mode *drm_gtf_mode(struct drm_device *dev,
1144 int hdisplay, int vdisplay, int vrefresh,
1145 bool interlaced, int margins);
1146extern struct drm_display_mode *drm_gtf_mode_complex(struct drm_device *dev,
1147 int hdisplay, int vdisplay, int vrefresh,
1148 bool interlaced, int margins, int GTF_M,
1149 int GTF_2C, int GTF_K, int GTF_2J);
1150extern int drm_add_modes_noedid(struct drm_connector *connector, 1028extern int drm_add_modes_noedid(struct drm_connector *connector,
1151 int hdisplay, int vdisplay); 1029 int hdisplay, int vdisplay);
1152extern void drm_set_preferred_mode(struct drm_connector *connector, 1030extern void drm_set_preferred_mode(struct drm_connector *connector,
@@ -1195,4 +1073,9 @@ static inline struct drm_encoder *drm_encoder_find(struct drm_device *dev,
1195 return mo ? obj_to_encoder(mo) : NULL; 1073 return mo ? obj_to_encoder(mo) : NULL;
1196} 1074}
1197 1075
1076/* Plane list iterator for legacy (overlay only) planes. */
1077#define drm_for_each_legacy_plane(plane, planelist) \
1078 list_for_each_entry(plane, planelist, head) \
1079 if (plane->type == DRM_PLANE_TYPE_OVERLAY)
1080
1198#endif /* __DRM_CRTC_H__ */ 1081#endif /* __DRM_CRTC_H__ */
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
index b1388b5fe7ac..0bb34ca2ad2b 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
@@ -139,8 +139,8 @@ extern void drm_helper_connector_dpms(struct drm_connector *connector, int mode)
139 139
140extern void drm_helper_move_panel_connectors_to_head(struct drm_device *); 140extern void drm_helper_move_panel_connectors_to_head(struct drm_device *);
141 141
142extern int drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb, 142extern void drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb,
143 struct drm_mode_fb_cmd2 *mode_cmd); 143 struct drm_mode_fb_cmd2 *mode_cmd);
144 144
145static inline void drm_crtc_helper_add(struct drm_crtc *crtc, 145static inline void drm_crtc_helper_add(struct drm_crtc *crtc,
146 const struct drm_crtc_helper_funcs *funcs) 146 const struct drm_crtc_helper_funcs *funcs)
@@ -160,7 +160,7 @@ static inline void drm_connector_helper_add(struct drm_connector *connector,
160 connector->helper_private = (void *)funcs; 160 connector->helper_private = (void *)funcs;
161} 161}
162 162
163extern int drm_helper_resume_force_mode(struct drm_device *dev); 163extern void drm_helper_resume_force_mode(struct drm_device *dev);
164extern void drm_kms_helper_poll_init(struct drm_device *dev); 164extern void drm_kms_helper_poll_init(struct drm_device *dev);
165extern void drm_kms_helper_poll_fini(struct drm_device *dev); 165extern void drm_kms_helper_poll_fini(struct drm_device *dev);
166extern bool drm_helper_hpd_irq_event(struct drm_device *dev); 166extern bool drm_helper_hpd_irq_event(struct drm_device *dev);
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index 1d09050a8c00..b4f58914bf7d 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -279,11 +279,21 @@
279 279
280#define DP_TEST_PATTERN 0x221 280#define DP_TEST_PATTERN 0x221
281 281
282#define DP_TEST_CRC_R_CR 0x240
283#define DP_TEST_CRC_G_Y 0x242
284#define DP_TEST_CRC_B_CB 0x244
285
286#define DP_TEST_SINK_MISC 0x246
287#define DP_TEST_CRC_SUPPORTED (1 << 5)
288
282#define DP_TEST_RESPONSE 0x260 289#define DP_TEST_RESPONSE 0x260
283# define DP_TEST_ACK (1 << 0) 290# define DP_TEST_ACK (1 << 0)
284# define DP_TEST_NAK (1 << 1) 291# define DP_TEST_NAK (1 << 1)
285# define DP_TEST_EDID_CHECKSUM_WRITE (1 << 2) 292# define DP_TEST_EDID_CHECKSUM_WRITE (1 << 2)
286 293
294#define DP_TEST_SINK 0x270
295#define DP_TEST_SINK_START (1 << 0)
296
287#define DP_SOURCE_OUI 0x300 297#define DP_SOURCE_OUI 0x300
288#define DP_SINK_OUI 0x400 298#define DP_SINK_OUI 0x400
289#define DP_BRANCH_OUI 0x500 299#define DP_BRANCH_OUI 0x500
@@ -291,6 +301,7 @@
291#define DP_SET_POWER 0x600 301#define DP_SET_POWER 0x600
292# define DP_SET_POWER_D0 0x1 302# define DP_SET_POWER_D0 0x1
293# define DP_SET_POWER_D3 0x2 303# define DP_SET_POWER_D3 0x2
304# define DP_SET_POWER_MASK 0x3
294 305
295#define DP_PSR_ERROR_STATUS 0x2006 /* XXX 1.2? */ 306#define DP_PSR_ERROR_STATUS 0x2006 /* XXX 1.2? */
296# define DP_PSR_LINK_CRC_ERROR (1 << 0) 307# define DP_PSR_LINK_CRC_ERROR (1 << 0)
@@ -398,4 +409,118 @@ drm_dp_enhanced_frame_cap(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
398 (dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP); 409 (dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP);
399} 410}
400 411
412/*
413 * DisplayPort AUX channel
414 */
415
416/**
417 * struct drm_dp_aux_msg - DisplayPort AUX channel transaction
418 * @address: address of the (first) register to access
419 * @request: contains the type of transaction (see DP_AUX_* macros)
420 * @reply: upon completion, contains the reply type of the transaction
421 * @buffer: pointer to a transmission or reception buffer
422 * @size: size of @buffer
423 */
424struct drm_dp_aux_msg {
425 unsigned int address;
426 u8 request;
427 u8 reply;
428 void *buffer;
429 size_t size;
430};
431
432/**
433 * struct drm_dp_aux - DisplayPort AUX channel
434 * @ddc: I2C adapter that can be used for I2C-over-AUX communication
435 * @dev: pointer to struct device that is the parent for this AUX channel
436 * @transfer: transfers a message representing a single AUX transaction
437 *
438 * The .dev field should be set to a pointer to the device that implements
439 * the AUX channel.
440 *
441 * The .name field may be used to specify the name of the I2C adapter. If set to
442 * NULL, dev_name() of .dev will be used.
443 *
444 * Drivers provide a hardware-specific implementation of how transactions
445 * are executed via the .transfer() function. A pointer to a drm_dp_aux_msg
446 * structure describing the transaction is passed into this function. Upon
447 * success, the implementation should return the number of payload bytes
448 * that were transferred, or a negative error-code on failure. Helpers
449 * propagate errors from the .transfer() function, with the exception of
450 * the -EBUSY error, which causes a transaction to be retried. On a short,
451 * helpers will return -EPROTO to make it simpler to check for failure.
452 *
453 * An AUX channel can also be used to transport I2C messages to a sink. A
454 * typical application of that is to access an EDID that's present in the
455 * sink device. The .transfer() function can also be used to execute such
456 * transactions. The drm_dp_aux_register_i2c_bus() function registers an
457 * I2C adapter that can be passed to drm_probe_ddc(). Upon removal, drivers
458 * should call drm_dp_aux_unregister_i2c_bus() to remove the I2C adapter.
459 */
460struct drm_dp_aux {
461 const char *name;
462 struct i2c_adapter ddc;
463 struct device *dev;
464
465 ssize_t (*transfer)(struct drm_dp_aux *aux,
466 struct drm_dp_aux_msg *msg);
467};
468
469ssize_t drm_dp_dpcd_read(struct drm_dp_aux *aux, unsigned int offset,
470 void *buffer, size_t size);
471ssize_t drm_dp_dpcd_write(struct drm_dp_aux *aux, unsigned int offset,
472 void *buffer, size_t size);
473
474/**
475 * drm_dp_dpcd_readb() - read a single byte from the DPCD
476 * @aux: DisplayPort AUX channel
477 * @offset: address of the register to read
478 * @valuep: location where the value of the register will be stored
479 *
480 * Returns the number of bytes transferred (1) on success, or a negative
481 * error code on failure.
482 */
483static inline ssize_t drm_dp_dpcd_readb(struct drm_dp_aux *aux,
484 unsigned int offset, u8 *valuep)
485{
486 return drm_dp_dpcd_read(aux, offset, valuep, 1);
487}
488
489/**
490 * drm_dp_dpcd_writeb() - write a single byte to the DPCD
491 * @aux: DisplayPort AUX channel
492 * @offset: address of the register to write
493 * @value: value to write to the register
494 *
495 * Returns the number of bytes transferred (1) on success, or a negative
496 * error code on failure.
497 */
498static inline ssize_t drm_dp_dpcd_writeb(struct drm_dp_aux *aux,
499 unsigned int offset, u8 value)
500{
501 return drm_dp_dpcd_write(aux, offset, &value, 1);
502}
503
504int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
505 u8 status[DP_LINK_STATUS_SIZE]);
506
507/*
508 * DisplayPort link
509 */
510#define DP_LINK_CAP_ENHANCED_FRAMING (1 << 0)
511
512struct drm_dp_link {
513 unsigned char revision;
514 unsigned int rate;
515 unsigned int num_lanes;
516 unsigned long capabilities;
517};
518
519int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link);
520int drm_dp_link_power_up(struct drm_dp_aux *aux, struct drm_dp_link *link);
521int drm_dp_link_configure(struct drm_dp_aux *aux, struct drm_dp_link *link);
522
523int drm_dp_aux_register_i2c_bus(struct drm_dp_aux *aux);
524void drm_dp_aux_unregister_i2c_bus(struct drm_dp_aux *aux);
525
401#endif /* _DRM_DP_HELPER_H_ */ 526#endif /* _DRM_DP_HELPER_H_ */
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 0145b948b147..6e622f7d481d 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -121,5 +121,11 @@ bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel);
121int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper); 121int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper);
122int drm_fb_helper_debug_enter(struct fb_info *info); 122int drm_fb_helper_debug_enter(struct fb_info *info);
123int drm_fb_helper_debug_leave(struct fb_info *info); 123int drm_fb_helper_debug_leave(struct fb_info *info);
124struct drm_display_mode *
125drm_has_preferred_mode(struct drm_fb_helper_connector *fb_connector,
126 int width, int height);
127struct drm_display_mode *
128drm_pick_cmdline_mode(struct drm_fb_helper_connector *fb_helper_conn,
129 int width, int height);
124 130
125#endif 131#endif
diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h
index 89b4d7db1ebd..2a3cea91606d 100644
--- a/include/drm/drm_gem_cma_helper.h
+++ b/include/drm/drm_gem_cma_helper.h
@@ -1,6 +1,8 @@
1#ifndef __DRM_GEM_CMA_HELPER_H__ 1#ifndef __DRM_GEM_CMA_HELPER_H__
2#define __DRM_GEM_CMA_HELPER_H__ 2#define __DRM_GEM_CMA_HELPER_H__
3 3
4#include <drm/drmP.h>
5
4struct drm_gem_cma_object { 6struct drm_gem_cma_object {
5 struct drm_gem_object base; 7 struct drm_gem_object base;
6 dma_addr_t paddr; 8 dma_addr_t paddr;
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
index d32628acdd90..7209df15a3cd 100644
--- a/include/drm/drm_mipi_dsi.h
+++ b/include/drm/drm_mipi_dsi.h
@@ -17,6 +17,11 @@
17struct mipi_dsi_host; 17struct mipi_dsi_host;
18struct mipi_dsi_device; 18struct mipi_dsi_device;
19 19
20/* request ACK from peripheral */
21#define MIPI_DSI_MSG_REQ_ACK BIT(0)
22/* use Low Power Mode to transmit message */
23#define MIPI_DSI_MSG_USE_LPM BIT(1)
24
20/** 25/**
21 * struct mipi_dsi_msg - read/write DSI buffer 26 * struct mipi_dsi_msg - read/write DSI buffer
22 * @channel: virtual channel id 27 * @channel: virtual channel id
@@ -29,6 +34,7 @@ struct mipi_dsi_device;
29struct mipi_dsi_msg { 34struct mipi_dsi_msg {
30 u8 channel; 35 u8 channel;
31 u8 type; 36 u8 type;
37 u16 flags;
32 38
33 size_t tx_len; 39 size_t tx_len;
34 const void *tx_buf; 40 const void *tx_buf;
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index cba67865d18f..a24addfdfcec 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -47,8 +47,17 @@
47enum drm_mm_search_flags { 47enum drm_mm_search_flags {
48 DRM_MM_SEARCH_DEFAULT = 0, 48 DRM_MM_SEARCH_DEFAULT = 0,
49 DRM_MM_SEARCH_BEST = 1 << 0, 49 DRM_MM_SEARCH_BEST = 1 << 0,
50 DRM_MM_SEARCH_BELOW = 1 << 1,
50}; 51};
51 52
53enum drm_mm_allocator_flags {
54 DRM_MM_CREATE_DEFAULT = 0,
55 DRM_MM_CREATE_TOP = 1 << 0,
56};
57
58#define DRM_MM_BOTTOMUP DRM_MM_SEARCH_DEFAULT, DRM_MM_CREATE_DEFAULT
59#define DRM_MM_TOPDOWN DRM_MM_SEARCH_BELOW, DRM_MM_CREATE_TOP
60
52struct drm_mm_node { 61struct drm_mm_node {
53 struct list_head node_list; 62 struct list_head node_list;
54 struct list_head hole_stack; 63 struct list_head hole_stack;
@@ -85,11 +94,31 @@ struct drm_mm {
85 unsigned long *start, unsigned long *end); 94 unsigned long *start, unsigned long *end);
86}; 95};
87 96
97/**
98 * drm_mm_node_allocated - checks whether a node is allocated
99 * @node: drm_mm_node to check
100 *
101 * Drivers should use this helpers for proper encapusulation of drm_mm
102 * internals.
103 *
104 * Returns:
105 * True if the @node is allocated.
106 */
88static inline bool drm_mm_node_allocated(struct drm_mm_node *node) 107static inline bool drm_mm_node_allocated(struct drm_mm_node *node)
89{ 108{
90 return node->allocated; 109 return node->allocated;
91} 110}
92 111
112/**
113 * drm_mm_initialized - checks whether an allocator is initialized
114 * @mm: drm_mm to check
115 *
116 * Drivers should use this helpers for proper encapusulation of drm_mm
117 * internals.
118 *
119 * Returns:
120 * True if the @mm is initialized.
121 */
93static inline bool drm_mm_initialized(struct drm_mm *mm) 122static inline bool drm_mm_initialized(struct drm_mm *mm)
94{ 123{
95 return mm->hole_stack.next; 124 return mm->hole_stack.next;
@@ -100,6 +129,17 @@ static inline unsigned long __drm_mm_hole_node_start(struct drm_mm_node *hole_no
100 return hole_node->start + hole_node->size; 129 return hole_node->start + hole_node->size;
101} 130}
102 131
132/**
133 * drm_mm_hole_node_start - computes the start of the hole following @node
134 * @hole_node: drm_mm_node which implicitly tracks the following hole
135 *
136 * This is useful for driver-sepific debug dumpers. Otherwise drivers should not
137 * inspect holes themselves. Drivers must check first whether a hole indeed
138 * follows by looking at node->hole_follows.
139 *
140 * Returns:
141 * Start of the subsequent hole.
142 */
103static inline unsigned long drm_mm_hole_node_start(struct drm_mm_node *hole_node) 143static inline unsigned long drm_mm_hole_node_start(struct drm_mm_node *hole_node)
104{ 144{
105 BUG_ON(!hole_node->hole_follows); 145 BUG_ON(!hole_node->hole_follows);
@@ -112,18 +152,52 @@ static inline unsigned long __drm_mm_hole_node_end(struct drm_mm_node *hole_node
112 struct drm_mm_node, node_list)->start; 152 struct drm_mm_node, node_list)->start;
113} 153}
114 154
155/**
156 * drm_mm_hole_node_end - computes the end of the hole following @node
157 * @hole_node: drm_mm_node which implicitly tracks the following hole
158 *
159 * This is useful for driver-sepific debug dumpers. Otherwise drivers should not
160 * inspect holes themselves. Drivers must check first whether a hole indeed
161 * follows by looking at node->hole_follows.
162 *
163 * Returns:
164 * End of the subsequent hole.
165 */
115static inline unsigned long drm_mm_hole_node_end(struct drm_mm_node *hole_node) 166static inline unsigned long drm_mm_hole_node_end(struct drm_mm_node *hole_node)
116{ 167{
117 return __drm_mm_hole_node_end(hole_node); 168 return __drm_mm_hole_node_end(hole_node);
118} 169}
119 170
171/**
172 * drm_mm_for_each_node - iterator to walk over all allocated nodes
173 * @entry: drm_mm_node structure to assign to in each iteration step
174 * @mm: drm_mm allocator to walk
175 *
176 * This iterator walks over all nodes in the range allocator. It is implemented
177 * with list_for_each, so not save against removal of elements.
178 */
120#define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \ 179#define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \
121 &(mm)->head_node.node_list, \ 180 &(mm)->head_node.node_list, \
122 node_list) 181 node_list)
123 182
124/* Note that we need to unroll list_for_each_entry in order to inline 183/**
125 * setting hole_start and hole_end on each iteration and keep the 184 * drm_mm_for_each_hole - iterator to walk over all holes
126 * macro sane. 185 * @entry: drm_mm_node used internally to track progress
186 * @mm: drm_mm allocator to walk
187 * @hole_start: ulong variable to assign the hole start to on each iteration
188 * @hole_end: ulong variable to assign the hole end to on each iteration
189 *
190 * This iterator walks over all holes in the range allocator. It is implemented
191 * with list_for_each, so not save against removal of elements. @entry is used
192 * internally and will not reflect a real drm_mm_node for the very first hole.
193 * Hence users of this iterator may not access it.
194 *
195 * Implementation Note:
196 * We need to inline list_for_each_entry in order to be able to set hole_start
197 * and hole_end on each iteration while keeping the macro sane.
198 *
199 * The __drm_mm_for_each_hole version is similar, but with added support for
200 * going backwards.
127 */ 201 */
128#define drm_mm_for_each_hole(entry, mm, hole_start, hole_end) \ 202#define drm_mm_for_each_hole(entry, mm, hole_start, hole_end) \
129 for (entry = list_entry((mm)->hole_stack.next, struct drm_mm_node, hole_stack); \ 203 for (entry = list_entry((mm)->hole_stack.next, struct drm_mm_node, hole_stack); \
@@ -133,34 +207,79 @@ static inline unsigned long drm_mm_hole_node_end(struct drm_mm_node *hole_node)
133 1 : 0; \ 207 1 : 0; \
134 entry = list_entry(entry->hole_stack.next, struct drm_mm_node, hole_stack)) 208 entry = list_entry(entry->hole_stack.next, struct drm_mm_node, hole_stack))
135 209
210#define __drm_mm_for_each_hole(entry, mm, hole_start, hole_end, backwards) \
211 for (entry = list_entry((backwards) ? (mm)->hole_stack.prev : (mm)->hole_stack.next, struct drm_mm_node, hole_stack); \
212 &entry->hole_stack != &(mm)->hole_stack ? \
213 hole_start = drm_mm_hole_node_start(entry), \
214 hole_end = drm_mm_hole_node_end(entry), \
215 1 : 0; \
216 entry = list_entry((backwards) ? entry->hole_stack.prev : entry->hole_stack.next, struct drm_mm_node, hole_stack))
217
136/* 218/*
137 * Basic range manager support (drm_mm.c) 219 * Basic range manager support (drm_mm.c)
138 */ 220 */
139extern int drm_mm_reserve_node(struct drm_mm *mm, struct drm_mm_node *node); 221int drm_mm_reserve_node(struct drm_mm *mm, struct drm_mm_node *node);
140 222
141extern int drm_mm_insert_node_generic(struct drm_mm *mm, 223int drm_mm_insert_node_generic(struct drm_mm *mm,
142 struct drm_mm_node *node, 224 struct drm_mm_node *node,
143 unsigned long size, 225 unsigned long size,
144 unsigned alignment, 226 unsigned alignment,
145 unsigned long color, 227 unsigned long color,
146 enum drm_mm_search_flags flags); 228 enum drm_mm_search_flags sflags,
229 enum drm_mm_allocator_flags aflags);
230/**
231 * drm_mm_insert_node - search for space and insert @node
232 * @mm: drm_mm to allocate from
233 * @node: preallocate node to insert
234 * @size: size of the allocation
235 * @alignment: alignment of the allocation
236 * @flags: flags to fine-tune the allocation
237 *
238 * This is a simplified version of drm_mm_insert_node_generic() with @color set
239 * to 0.
240 *
241 * The preallocated node must be cleared to 0.
242 *
243 * Returns:
244 * 0 on success, -ENOSPC if there's no suitable hole.
245 */
147static inline int drm_mm_insert_node(struct drm_mm *mm, 246static inline int drm_mm_insert_node(struct drm_mm *mm,
148 struct drm_mm_node *node, 247 struct drm_mm_node *node,
149 unsigned long size, 248 unsigned long size,
150 unsigned alignment, 249 unsigned alignment,
151 enum drm_mm_search_flags flags) 250 enum drm_mm_search_flags flags)
152{ 251{
153 return drm_mm_insert_node_generic(mm, node, size, alignment, 0, flags); 252 return drm_mm_insert_node_generic(mm, node, size, alignment, 0, flags,
253 DRM_MM_CREATE_DEFAULT);
154} 254}
155 255
156extern int drm_mm_insert_node_in_range_generic(struct drm_mm *mm, 256int drm_mm_insert_node_in_range_generic(struct drm_mm *mm,
157 struct drm_mm_node *node, 257 struct drm_mm_node *node,
158 unsigned long size, 258 unsigned long size,
159 unsigned alignment, 259 unsigned alignment,
160 unsigned long color, 260 unsigned long color,
161 unsigned long start, 261 unsigned long start,
162 unsigned long end, 262 unsigned long end,
163 enum drm_mm_search_flags flags); 263 enum drm_mm_search_flags sflags,
264 enum drm_mm_allocator_flags aflags);
265/**
266 * drm_mm_insert_node_in_range - ranged search for space and insert @node
267 * @mm: drm_mm to allocate from
268 * @node: preallocate node to insert
269 * @size: size of the allocation
270 * @alignment: alignment of the allocation
271 * @start: start of the allowed range for this node
272 * @end: end of the allowed range for this node
273 * @flags: flags to fine-tune the allocation
274 *
275 * This is a simplified version of drm_mm_insert_node_in_range_generic() with
276 * @color set to 0.
277 *
278 * The preallocated node must be cleared to 0.
279 *
280 * Returns:
281 * 0 on success, -ENOSPC if there's no suitable hole.
282 */
164static inline int drm_mm_insert_node_in_range(struct drm_mm *mm, 283static inline int drm_mm_insert_node_in_range(struct drm_mm *mm,
165 struct drm_mm_node *node, 284 struct drm_mm_node *node,
166 unsigned long size, 285 unsigned long size,
@@ -170,16 +289,17 @@ static inline int drm_mm_insert_node_in_range(struct drm_mm *mm,
170 enum drm_mm_search_flags flags) 289 enum drm_mm_search_flags flags)
171{ 290{
172 return drm_mm_insert_node_in_range_generic(mm, node, size, alignment, 291 return drm_mm_insert_node_in_range_generic(mm, node, size, alignment,
173 0, start, end, flags); 292 0, start, end, flags,
293 DRM_MM_CREATE_DEFAULT);
174} 294}
175 295
176extern void drm_mm_remove_node(struct drm_mm_node *node); 296void drm_mm_remove_node(struct drm_mm_node *node);
177extern void drm_mm_replace_node(struct drm_mm_node *old, struct drm_mm_node *new); 297void drm_mm_replace_node(struct drm_mm_node *old, struct drm_mm_node *new);
178extern void drm_mm_init(struct drm_mm *mm, 298void drm_mm_init(struct drm_mm *mm,
179 unsigned long start, 299 unsigned long start,
180 unsigned long size); 300 unsigned long size);
181extern void drm_mm_takedown(struct drm_mm *mm); 301void drm_mm_takedown(struct drm_mm *mm);
182extern int drm_mm_clean(struct drm_mm *mm); 302bool drm_mm_clean(struct drm_mm *mm);
183 303
184void drm_mm_init_scan(struct drm_mm *mm, 304void drm_mm_init_scan(struct drm_mm *mm,
185 unsigned long size, 305 unsigned long size,
@@ -191,10 +311,10 @@ void drm_mm_init_scan_with_range(struct drm_mm *mm,
191 unsigned long color, 311 unsigned long color,
192 unsigned long start, 312 unsigned long start,
193 unsigned long end); 313 unsigned long end);
194int drm_mm_scan_add_block(struct drm_mm_node *node); 314bool drm_mm_scan_add_block(struct drm_mm_node *node);
195int drm_mm_scan_remove_block(struct drm_mm_node *node); 315bool drm_mm_scan_remove_block(struct drm_mm_node *node);
196 316
197extern void drm_mm_debug_table(struct drm_mm *mm, const char *prefix); 317void drm_mm_debug_table(struct drm_mm *mm, const char *prefix);
198#ifdef CONFIG_DEBUG_FS 318#ifdef CONFIG_DEBUG_FS
199int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm); 319int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm);
200#endif 320#endif
diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h
new file mode 100644
index 000000000000..2dbbf9976669
--- /dev/null
+++ b/include/drm/drm_modes.h
@@ -0,0 +1,237 @@
1/*
2 * Copyright © 2006 Keith Packard
3 * Copyright © 2007-2008 Dave Airlie
4 * Copyright © 2007-2008 Intel Corporation
5 * Jesse Barnes <jesse.barnes@intel.com>
6 * Copyright © 2014 Intel Corporation
7 * Daniel Vetter <daniel.vetter@ffwll.ch>
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25 * OTHER DEALINGS IN THE SOFTWARE.
26 */
27#ifndef __DRM_MODES_H__
28#define __DRM_MODES_H__
29
30/*
31 * Note on terminology: here, for brevity and convenience, we refer to connector
32 * control chips as 'CRTCs'. They can control any type of connector, VGA, LVDS,
33 * DVI, etc. And 'screen' refers to the whole of the visible display, which
34 * may span multiple monitors (and therefore multiple CRTC and connector
35 * structures).
36 */
37
38enum drm_mode_status {
39 MODE_OK = 0, /* Mode OK */
40 MODE_HSYNC, /* hsync out of range */
41 MODE_VSYNC, /* vsync out of range */
42 MODE_H_ILLEGAL, /* mode has illegal horizontal timings */
43 MODE_V_ILLEGAL, /* mode has illegal horizontal timings */
44 MODE_BAD_WIDTH, /* requires an unsupported linepitch */
45 MODE_NOMODE, /* no mode with a matching name */
46 MODE_NO_INTERLACE, /* interlaced mode not supported */
47 MODE_NO_DBLESCAN, /* doublescan mode not supported */
48 MODE_NO_VSCAN, /* multiscan mode not supported */
49 MODE_MEM, /* insufficient video memory */
50 MODE_VIRTUAL_X, /* mode width too large for specified virtual size */
51 MODE_VIRTUAL_Y, /* mode height too large for specified virtual size */
52 MODE_MEM_VIRT, /* insufficient video memory given virtual size */
53 MODE_NOCLOCK, /* no fixed clock available */
54 MODE_CLOCK_HIGH, /* clock required is too high */
55 MODE_CLOCK_LOW, /* clock required is too low */
56 MODE_CLOCK_RANGE, /* clock/mode isn't in a ClockRange */
57 MODE_BAD_HVALUE, /* horizontal timing was out of range */
58 MODE_BAD_VVALUE, /* vertical timing was out of range */
59 MODE_BAD_VSCAN, /* VScan value out of range */
60 MODE_HSYNC_NARROW, /* horizontal sync too narrow */
61 MODE_HSYNC_WIDE, /* horizontal sync too wide */
62 MODE_HBLANK_NARROW, /* horizontal blanking too narrow */
63 MODE_HBLANK_WIDE, /* horizontal blanking too wide */
64 MODE_VSYNC_NARROW, /* vertical sync too narrow */
65 MODE_VSYNC_WIDE, /* vertical sync too wide */
66 MODE_VBLANK_NARROW, /* vertical blanking too narrow */
67 MODE_VBLANK_WIDE, /* vertical blanking too wide */
68 MODE_PANEL, /* exceeds panel dimensions */
69 MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */
70 MODE_ONE_WIDTH, /* only one width is supported */
71 MODE_ONE_HEIGHT, /* only one height is supported */
72 MODE_ONE_SIZE, /* only one resolution is supported */
73 MODE_NO_REDUCED, /* monitor doesn't accept reduced blanking */
74 MODE_NO_STEREO, /* stereo modes not supported */
75 MODE_UNVERIFIED = -3, /* mode needs to reverified */
76 MODE_BAD = -2, /* unspecified reason */
77 MODE_ERROR = -1 /* error condition */
78};
79
80#define DRM_MODE_TYPE_CLOCK_CRTC_C (DRM_MODE_TYPE_CLOCK_C | \
81 DRM_MODE_TYPE_CRTC_C)
82
83#define DRM_MODE(nm, t, c, hd, hss, hse, ht, hsk, vd, vss, vse, vt, vs, f) \
84 .name = nm, .status = 0, .type = (t), .clock = (c), \
85 .hdisplay = (hd), .hsync_start = (hss), .hsync_end = (hse), \
86 .htotal = (ht), .hskew = (hsk), .vdisplay = (vd), \
87 .vsync_start = (vss), .vsync_end = (vse), .vtotal = (vt), \
88 .vscan = (vs), .flags = (f), \
89 .base.type = DRM_MODE_OBJECT_MODE
90
91#define CRTC_INTERLACE_HALVE_V (1 << 0) /* halve V values for interlacing */
92#define CRTC_STEREO_DOUBLE (1 << 1) /* adjust timings for stereo modes */
93
94#define DRM_MODE_FLAG_3D_MAX DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF
95
96struct drm_display_mode {
97 /* Header */
98 struct list_head head;
99 struct drm_mode_object base;
100
101 char name[DRM_DISPLAY_MODE_LEN];
102
103 enum drm_mode_status status;
104 unsigned int type;
105
106 /* Proposed mode values */
107 int clock; /* in kHz */
108 int hdisplay;
109 int hsync_start;
110 int hsync_end;
111 int htotal;
112 int hskew;
113 int vdisplay;
114 int vsync_start;
115 int vsync_end;
116 int vtotal;
117 int vscan;
118 unsigned int flags;
119
120 /* Addressable image size (may be 0 for projectors, etc.) */
121 int width_mm;
122 int height_mm;
123
124 /* Actual mode we give to hw */
125 int crtc_clock; /* in KHz */
126 int crtc_hdisplay;
127 int crtc_hblank_start;
128 int crtc_hblank_end;
129 int crtc_hsync_start;
130 int crtc_hsync_end;
131 int crtc_htotal;
132 int crtc_hskew;
133 int crtc_vdisplay;
134 int crtc_vblank_start;
135 int crtc_vblank_end;
136 int crtc_vsync_start;
137 int crtc_vsync_end;
138 int crtc_vtotal;
139
140 /* Driver private mode info */
141 int *private;
142 int private_flags;
143
144 int vrefresh; /* in Hz */
145 int hsync; /* in kHz */
146 enum hdmi_picture_aspect picture_aspect_ratio;
147};
148
149/* mode specified on the command line */
150struct drm_cmdline_mode {
151 bool specified;
152 bool refresh_specified;
153 bool bpp_specified;
154 int xres, yres;
155 int bpp;
156 int refresh;
157 bool rb;
158 bool interlace;
159 bool cvt;
160 bool margins;
161 enum drm_connector_force force;
162};
163
164/**
165 * drm_mode_is_stereo - check for stereo mode flags
166 * @mode: drm_display_mode to check
167 *
168 * Returns:
169 * True if the mode is one of the stereo modes (like side-by-side), false if
170 * not.
171 */
172static inline bool drm_mode_is_stereo(const struct drm_display_mode *mode)
173{
174 return mode->flags & DRM_MODE_FLAG_3D_MASK;
175}
176
177struct drm_connector;
178struct drm_cmdline_mode;
179
180struct drm_display_mode *drm_mode_create(struct drm_device *dev);
181void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode);
182void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
183void drm_mode_debug_printmodeline(const struct drm_display_mode *mode);
184
185struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
186 int hdisplay, int vdisplay, int vrefresh,
187 bool reduced, bool interlaced,
188 bool margins);
189struct drm_display_mode *drm_gtf_mode(struct drm_device *dev,
190 int hdisplay, int vdisplay, int vrefresh,
191 bool interlaced, int margins);
192struct drm_display_mode *drm_gtf_mode_complex(struct drm_device *dev,
193 int hdisplay, int vdisplay,
194 int vrefresh, bool interlaced,
195 int margins,
196 int GTF_M, int GTF_2C,
197 int GTF_K, int GTF_2J);
198void drm_display_mode_from_videomode(const struct videomode *vm,
199 struct drm_display_mode *dmode);
200int of_get_drm_display_mode(struct device_node *np,
201 struct drm_display_mode *dmode,
202 int index);
203
204void drm_mode_set_name(struct drm_display_mode *mode);
205int drm_mode_hsync(const struct drm_display_mode *mode);
206int drm_mode_vrefresh(const struct drm_display_mode *mode);
207
208void drm_mode_set_crtcinfo(struct drm_display_mode *p,
209 int adjust_flags);
210void drm_mode_copy(struct drm_display_mode *dst,
211 const struct drm_display_mode *src);
212struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
213 const struct drm_display_mode *mode);
214bool drm_mode_equal(const struct drm_display_mode *mode1,
215 const struct drm_display_mode *mode2);
216bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1,
217 const struct drm_display_mode *mode2);
218
219/* for use by the crtc helper probe functions */
220void drm_mode_validate_size(struct drm_device *dev,
221 struct list_head *mode_list,
222 int maxX, int maxY);
223void drm_mode_prune_invalid(struct drm_device *dev,
224 struct list_head *mode_list, bool verbose);
225void drm_mode_sort(struct list_head *mode_list);
226void drm_mode_connector_list_update(struct drm_connector *connector);
227
228/* parsing cmdline modes */
229bool
230drm_mode_parse_command_line_for_connector(const char *mode_option,
231 struct drm_connector *connector,
232 struct drm_cmdline_mode *mode);
233struct drm_display_mode *
234drm_mode_create_from_cmdline_mode(struct drm_device *dev,
235 struct drm_cmdline_mode *cmd);
236
237#endif /* __DRM_MODES_H__ */
diff --git a/include/drm/drm_plane_helper.h b/include/drm/drm_plane_helper.h
new file mode 100644
index 000000000000..09824becee3e
--- /dev/null
+++ b/include/drm/drm_plane_helper.h
@@ -0,0 +1,49 @@
1/*
2 * Copyright (C) 2011-2013 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 * SOFTWARE.
22 */
23
24#ifndef DRM_PLANE_HELPER_H
25#define DRM_PLANE_HELPER_H
26
27/**
28 * DOC: plane helpers
29 *
30 * Helper functions to assist with creation and handling of CRTC primary
31 * planes.
32 */
33
34extern int drm_primary_helper_update(struct drm_plane *plane,
35 struct drm_crtc *crtc,
36 struct drm_framebuffer *fb,
37 int crtc_x, int crtc_y,
38 unsigned int crtc_w, unsigned int crtc_h,
39 uint32_t src_x, uint32_t src_y,
40 uint32_t src_w, uint32_t src_h);
41extern int drm_primary_helper_disable(struct drm_plane *plane);
42extern void drm_primary_helper_destroy(struct drm_plane *plane);
43extern const struct drm_plane_funcs drm_primary_helper_funcs;
44extern struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev,
45 uint32_t *formats,
46 int num_formats);
47
48
49#endif
diff --git a/include/drm/drm_vma_manager.h b/include/drm/drm_vma_manager.h
index c18a593d1744..8cd402c73a5f 100644
--- a/include/drm/drm_vma_manager.h
+++ b/include/drm/drm_vma_manager.h
@@ -221,8 +221,8 @@ static inline __u64 drm_vma_node_offset_addr(struct drm_vma_offset_node *node)
221 * @file_mapping: Address space to unmap @node from 221 * @file_mapping: Address space to unmap @node from
222 * 222 *
223 * Unmap all userspace mappings for a given offset node. The mappings must be 223 * Unmap all userspace mappings for a given offset node. The mappings must be
224 * associated with the @file_mapping address-space. If no offset exists or 224 * associated with the @file_mapping address-space. If no offset exists
225 * the address-space is invalid, nothing is done. 225 * nothing is done.
226 * 226 *
227 * This call is unlocked. The caller must guarantee that drm_vma_offset_remove() 227 * This call is unlocked. The caller must guarantee that drm_vma_offset_remove()
228 * is not called on this node concurrently. 228 * is not called on this node concurrently.
@@ -230,7 +230,7 @@ static inline __u64 drm_vma_node_offset_addr(struct drm_vma_offset_node *node)
230static inline void drm_vma_node_unmap(struct drm_vma_offset_node *node, 230static inline void drm_vma_node_unmap(struct drm_vma_offset_node *node,
231 struct address_space *file_mapping) 231 struct address_space *file_mapping)
232{ 232{
233 if (file_mapping && drm_vma_node_has_offset(node)) 233 if (drm_vma_node_has_offset(node))
234 unmap_mapping_range(file_mapping, 234 unmap_mapping_range(file_mapping,
235 drm_vma_node_offset_addr(node), 235 drm_vma_node_offset_addr(node),
236 drm_vma_node_size(node) << PAGE_SHIFT, 1); 236 drm_vma_node_size(node) << PAGE_SHIFT, 1);
diff --git a/include/drm/gma_drm.h b/include/drm/gma_drm.h
index 884613ee00ad..87ac5e6ca551 100644
--- a/include/drm/gma_drm.h
+++ b/include/drm/gma_drm.h
@@ -19,73 +19,7 @@
19 * 19 *
20 **************************************************************************/ 20 **************************************************************************/
21 21
22#ifndef _PSB_DRM_H_ 22#ifndef _GMA_DRM_H_
23#define _PSB_DRM_H_ 23#define _GMA_DRM_H_
24
25/*
26 * Manage the LUT for an output
27 */
28struct drm_psb_dpst_lut_arg {
29 uint8_t lut[256];
30 int output_id;
31};
32
33/*
34 * Validate modes
35 */
36struct drm_psb_mode_operation_arg {
37 u32 obj_id;
38 u16 operation;
39 struct drm_mode_modeinfo mode;
40 u64 data;
41};
42
43/*
44 * Query the stolen memory for smarter management of
45 * memory by the server
46 */
47struct drm_psb_stolen_memory_arg {
48 u32 base;
49 u32 size;
50};
51
52struct drm_psb_get_pipe_from_crtc_id_arg {
53 /** ID of CRTC being requested **/
54 u32 crtc_id;
55 /** pipe of requested CRTC **/
56 u32 pipe;
57};
58
59struct drm_psb_gem_create {
60 __u64 size;
61 __u32 handle;
62 __u32 flags;
63#define GMA_GEM_CREATE_STOLEN 1 /* Stolen memory can be used */
64};
65
66struct drm_psb_gem_mmap {
67 __u32 handle;
68 __u32 pad;
69 /**
70 * Fake offset to use for subsequent mmap call
71 *
72 * This is a fixed-size type for 32/64 compatibility.
73 */
74 __u64 offset;
75};
76
77/* Controlling the kernel modesetting buffers */
78
79#define DRM_GMA_GEM_CREATE 0x00 /* Create a GEM object */
80#define DRM_GMA_GEM_MMAP 0x01 /* Map GEM memory */
81#define DRM_GMA_STOLEN_MEMORY 0x02 /* Report stolen memory */
82#define DRM_GMA_2D_OP 0x03 /* Will be merged later */
83#define DRM_GMA_GAMMA 0x04 /* Set gamma table */
84#define DRM_GMA_ADB 0x05 /* Get backlight */
85#define DRM_GMA_DPST_BL 0x06 /* Set backlight */
86#define DRM_GMA_MODE_OPERATION 0x07 /* Mode validation/DC set */
87#define PSB_MODE_OPERATION_MODE_VALID 0x01
88#define DRM_GMA_GET_PIPE_FROM_CRTC_ID 0x08 /* CRTC to physical pipe# */
89
90 24
91#endif 25#endif
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 32d34ebf0706..a5183da3ef92 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -747,6 +747,7 @@ extern int ttm_bo_device_release(struct ttm_bo_device *bdev);
747 * @bdev: A pointer to a struct ttm_bo_device to initialize. 747 * @bdev: A pointer to a struct ttm_bo_device to initialize.
748 * @glob: A pointer to an initialized struct ttm_bo_global. 748 * @glob: A pointer to an initialized struct ttm_bo_global.
749 * @driver: A pointer to a struct ttm_bo_driver set up by the caller. 749 * @driver: A pointer to a struct ttm_bo_driver set up by the caller.
750 * @mapping: The address space to use for this bo.
750 * @file_page_offset: Offset into the device address space that is available 751 * @file_page_offset: Offset into the device address space that is available
751 * for buffer data. This ensures compatibility with other users of the 752 * for buffer data. This ensures compatibility with other users of the
752 * address space. 753 * address space.
@@ -758,6 +759,7 @@ extern int ttm_bo_device_release(struct ttm_bo_device *bdev);
758extern int ttm_bo_device_init(struct ttm_bo_device *bdev, 759extern int ttm_bo_device_init(struct ttm_bo_device *bdev,
759 struct ttm_bo_global *glob, 760 struct ttm_bo_global *glob,
760 struct ttm_bo_driver *driver, 761 struct ttm_bo_driver *driver,
762 struct address_space *mapping,
761 uint64_t file_page_offset, bool need_dma32); 763 uint64_t file_page_offset, bool need_dma32);
762 764
763/** 765/**
@@ -786,7 +788,7 @@ extern void ttm_bo_del_sub_from_lru(struct ttm_buffer_object *bo);
786extern void ttm_bo_add_to_lru(struct ttm_buffer_object *bo); 788extern void ttm_bo_add_to_lru(struct ttm_buffer_object *bo);
787 789
788/** 790/**
789 * ttm_bo_reserve_nolru: 791 * __ttm_bo_reserve:
790 * 792 *
791 * @bo: A pointer to a struct ttm_buffer_object. 793 * @bo: A pointer to a struct ttm_buffer_object.
792 * @interruptible: Sleep interruptible if waiting. 794 * @interruptible: Sleep interruptible if waiting.
@@ -807,10 +809,10 @@ extern void ttm_bo_add_to_lru(struct ttm_buffer_object *bo);
807 * -EALREADY: Bo already reserved using @ticket. This error code will only 809 * -EALREADY: Bo already reserved using @ticket. This error code will only
808 * be returned if @use_ticket is set to true. 810 * be returned if @use_ticket is set to true.
809 */ 811 */
810static inline int ttm_bo_reserve_nolru(struct ttm_buffer_object *bo, 812static inline int __ttm_bo_reserve(struct ttm_buffer_object *bo,
811 bool interruptible, 813 bool interruptible,
812 bool no_wait, bool use_ticket, 814 bool no_wait, bool use_ticket,
813 struct ww_acquire_ctx *ticket) 815 struct ww_acquire_ctx *ticket)
814{ 816{
815 int ret = 0; 817 int ret = 0;
816 818
@@ -886,8 +888,7 @@ static inline int ttm_bo_reserve(struct ttm_buffer_object *bo,
886 888
887 WARN_ON(!atomic_read(&bo->kref.refcount)); 889 WARN_ON(!atomic_read(&bo->kref.refcount));
888 890
889 ret = ttm_bo_reserve_nolru(bo, interruptible, no_wait, use_ticket, 891 ret = __ttm_bo_reserve(bo, interruptible, no_wait, use_ticket, ticket);
890 ticket);
891 if (likely(ret == 0)) 892 if (likely(ret == 0))
892 ttm_bo_del_sub_from_lru(bo); 893 ttm_bo_del_sub_from_lru(bo);
893 894
@@ -927,20 +928,14 @@ static inline int ttm_bo_reserve_slowpath(struct ttm_buffer_object *bo,
927} 928}
928 929
929/** 930/**
930 * ttm_bo_unreserve_ticket 931 * __ttm_bo_unreserve
931 * @bo: A pointer to a struct ttm_buffer_object. 932 * @bo: A pointer to a struct ttm_buffer_object.
932 * @ticket: ww_acquire_ctx used for reserving
933 * 933 *
934 * Unreserve a previous reservation of @bo made with @ticket. 934 * Unreserve a previous reservation of @bo where the buffer object is
935 * already on lru lists.
935 */ 936 */
936static inline void ttm_bo_unreserve_ticket(struct ttm_buffer_object *bo, 937static inline void __ttm_bo_unreserve(struct ttm_buffer_object *bo)
937 struct ww_acquire_ctx *t)
938{ 938{
939 if (!(bo->mem.placement & TTM_PL_FLAG_NO_EVICT)) {
940 spin_lock(&bo->glob->lru_lock);
941 ttm_bo_add_to_lru(bo);
942 spin_unlock(&bo->glob->lru_lock);
943 }
944 ww_mutex_unlock(&bo->resv->lock); 939 ww_mutex_unlock(&bo->resv->lock);
945} 940}
946 941
@@ -953,7 +948,25 @@ static inline void ttm_bo_unreserve_ticket(struct ttm_buffer_object *bo,
953 */ 948 */
954static inline void ttm_bo_unreserve(struct ttm_buffer_object *bo) 949static inline void ttm_bo_unreserve(struct ttm_buffer_object *bo)
955{ 950{
956 ttm_bo_unreserve_ticket(bo, NULL); 951 if (!(bo->mem.placement & TTM_PL_FLAG_NO_EVICT)) {
952 spin_lock(&bo->glob->lru_lock);
953 ttm_bo_add_to_lru(bo);
954 spin_unlock(&bo->glob->lru_lock);
955 }
956 __ttm_bo_unreserve(bo);
957}
958
959/**
960 * ttm_bo_unreserve_ticket
961 * @bo: A pointer to a struct ttm_buffer_object.
962 * @ticket: ww_acquire_ctx used for reserving
963 *
964 * Unreserve a previous reservation of @bo made with @ticket.
965 */
966static inline void ttm_bo_unreserve_ticket(struct ttm_buffer_object *bo,
967 struct ww_acquire_ctx *t)
968{
969 ttm_bo_unreserve(bo);
957} 970}
958 971
959/* 972/*
diff --git a/include/drm/ttm/ttm_object.h b/include/drm/ttm/ttm_object.h
index 0097cc03034e..ed953f98f0e1 100644
--- a/include/drm/ttm/ttm_object.h
+++ b/include/drm/ttm/ttm_object.h
@@ -244,6 +244,10 @@ extern void ttm_base_object_unref(struct ttm_base_object **p_base);
244extern int ttm_ref_object_add(struct ttm_object_file *tfile, 244extern int ttm_ref_object_add(struct ttm_object_file *tfile,
245 struct ttm_base_object *base, 245 struct ttm_base_object *base,
246 enum ttm_ref_type ref_type, bool *existed); 246 enum ttm_ref_type ref_type, bool *existed);
247
248extern bool ttm_ref_object_exists(struct ttm_object_file *tfile,
249 struct ttm_base_object *base);
250
247/** 251/**
248 * ttm_ref_object_base_unref 252 * ttm_ref_object_base_unref
249 * 253 *
diff --git a/include/drm/ttm/ttm_placement.h b/include/drm/ttm/ttm_placement.h
index c84ff153a564..8ed44f9bbdfb 100644
--- a/include/drm/ttm/ttm_placement.h
+++ b/include/drm/ttm/ttm_placement.h
@@ -65,6 +65,8 @@
65 * reference the buffer. 65 * reference the buffer.
66 * TTM_PL_FLAG_NO_EVICT means that the buffer may never 66 * TTM_PL_FLAG_NO_EVICT means that the buffer may never
67 * be evicted to make room for other buffers. 67 * be evicted to make room for other buffers.
68 * TTM_PL_FLAG_TOPDOWN requests to be placed from the
69 * top of the memory area, instead of the bottom.
68 */ 70 */
69 71
70#define TTM_PL_FLAG_CACHED (1 << 16) 72#define TTM_PL_FLAG_CACHED (1 << 16)
@@ -72,6 +74,7 @@
72#define TTM_PL_FLAG_WC (1 << 18) 74#define TTM_PL_FLAG_WC (1 << 18)
73#define TTM_PL_FLAG_SHARED (1 << 20) 75#define TTM_PL_FLAG_SHARED (1 << 20)
74#define TTM_PL_FLAG_NO_EVICT (1 << 21) 76#define TTM_PL_FLAG_NO_EVICT (1 << 21)
77#define TTM_PL_FLAG_TOPDOWN (1 << 22)
75 78
76#define TTM_PL_MASK_CACHING (TTM_PL_FLAG_CACHED | \ 79#define TTM_PL_MASK_CACHING (TTM_PL_FLAG_CACHED | \
77 TTM_PL_FLAG_UNCACHED | \ 80 TTM_PL_FLAG_UNCACHED | \