aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-10 06:44:43 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-10 06:44:43 -0400
commit967ad7f1489da7babbe0746f81c283458ecd3f84 (patch)
tree812608fd6efcfe81096bd51b1ec1c2a4167385f6 /include
parentd7bf63f2465b3b6335dd66ffbf387768d81a59d5 (diff)
parent6aba5b6cf098ba305fc31b23cc14114a16768d22 (diff)
Merge remote-tracking branch 'airlied/drm-next' into drm-intel-next
The conflict in intel_drv.h tripped me up a bit since a patch in dinq moves all the functions around, but another one in drm-next removes a single function. So I'ev figured backing this into a backmerge would be good. i915_dma.c is just adjacent lines changed, nothing nefarious there. Conflicts: drivers/gpu/drm/i915/i915_dma.c drivers/gpu/drm/i915/intel_drv.h Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'include')
-rw-r--r--include/drm/drmP.h55
-rw-r--r--include/drm/drm_crtc.h1
-rw-r--r--include/drm/drm_dp_helper.h31
3 files changed, 43 insertions, 44 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index c65f496ad6b6..2b954adf5bd4 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -670,8 +670,6 @@ struct drm_gem_object {
670 uint32_t pending_read_domains; 670 uint32_t pending_read_domains;
671 uint32_t pending_write_domain; 671 uint32_t pending_write_domain;
672 672
673 void *driver_private;
674
675 /** 673 /**
676 * dma_buf - dma buf associated with this GEM object 674 * dma_buf - dma buf associated with this GEM object
677 * 675 *
@@ -925,7 +923,6 @@ struct drm_driver {
925 * 923 *
926 * Returns 0 on success. 924 * Returns 0 on success.
927 */ 925 */
928 int (*gem_init_object) (struct drm_gem_object *obj);
929 void (*gem_free_object) (struct drm_gem_object *obj); 926 void (*gem_free_object) (struct drm_gem_object *obj);
930 int (*gem_open_object) (struct drm_gem_object *, struct drm_file *); 927 int (*gem_open_object) (struct drm_gem_object *, struct drm_file *);
931 void (*gem_close_object) (struct drm_gem_object *, struct drm_file *); 928 void (*gem_close_object) (struct drm_gem_object *, struct drm_file *);
@@ -1084,6 +1081,19 @@ struct drm_pending_vblank_event {
1084 struct drm_event_vblank event; 1081 struct drm_event_vblank event;
1085}; 1082};
1086 1083
1084struct drm_vblank_crtc {
1085 wait_queue_head_t queue; /**< VBLANK wait queue */
1086 struct timeval time[DRM_VBLANKTIME_RBSIZE]; /**< timestamp of current count */
1087 atomic_t count; /**< number of VBLANK interrupts */
1088 atomic_t refcount; /* number of users of vblank interruptsper crtc */
1089 u32 last; /* protected by dev->vbl_lock, used */
1090 /* for wraparound handling */
1091 u32 last_wait; /* Last vblank seqno waited per CRTC */
1092 unsigned int inmodeset; /* Display driver is setting mode */
1093 bool enabled; /* so we don't call enable more than
1094 once per disable */
1095};
1096
1087/** 1097/**
1088 * DRM device structure. This structure represent a complete card that 1098 * DRM device structure. This structure represent a complete card that
1089 * may contain multiple heads. 1099 * may contain multiple heads.
@@ -1108,25 +1118,16 @@ struct drm_device {
1108 atomic_t buf_alloc; /**< Buffer allocation in progress */ 1118 atomic_t buf_alloc; /**< Buffer allocation in progress */
1109 /*@} */ 1119 /*@} */
1110 1120
1111 /** \name Performance counters */
1112 /*@{ */
1113 unsigned long counters;
1114 enum drm_stat_type types[15];
1115 atomic_t counts[15];
1116 /*@} */
1117
1118 struct list_head filelist; 1121 struct list_head filelist;
1119 1122
1120 /** \name Memory management */ 1123 /** \name Memory management */
1121 /*@{ */ 1124 /*@{ */
1122 struct list_head maplist; /**< Linked list of regions */ 1125 struct list_head maplist; /**< Linked list of regions */
1123 int map_count; /**< Number of mappable regions */
1124 struct drm_open_hash map_hash; /**< User token hash table for maps */ 1126 struct drm_open_hash map_hash; /**< User token hash table for maps */
1125 1127
1126 /** \name Context handle management */ 1128 /** \name Context handle management */
1127 /*@{ */ 1129 /*@{ */
1128 struct list_head ctxlist; /**< Linked list of context handles */ 1130 struct list_head ctxlist; /**< Linked list of context handles */
1129 int ctx_count; /**< Number of context handles */
1130 struct mutex ctxlist_mutex; /**< For ctxlist */ 1131 struct mutex ctxlist_mutex; /**< For ctxlist */
1131 1132
1132 struct idr ctx_idr; 1133 struct idr ctx_idr;
@@ -1142,12 +1143,11 @@ struct drm_device {
1142 1143
1143 /** \name Context support */ 1144 /** \name Context support */
1144 /*@{ */ 1145 /*@{ */
1145 int irq_enabled; /**< True if irq handler is enabled */ 1146 bool irq_enabled; /**< True if irq handler is enabled */
1146 __volatile__ long context_flag; /**< Context swapping flag */ 1147 __volatile__ long context_flag; /**< Context swapping flag */
1147 int last_context; /**< Last current context */ 1148 int last_context; /**< Last current context */
1148 /*@} */ 1149 /*@} */
1149 1150
1150 struct work_struct work;
1151 /** \name VBLANK IRQ support */ 1151 /** \name VBLANK IRQ support */
1152 /*@{ */ 1152 /*@{ */
1153 1153
@@ -1157,20 +1157,13 @@ struct drm_device {
1157 * Once the modeset ioctl *has* been called though, we can safely 1157 * Once the modeset ioctl *has* been called though, we can safely
1158 * disable them when unused. 1158 * disable them when unused.
1159 */ 1159 */
1160 int vblank_disable_allowed; 1160 bool vblank_disable_allowed;
1161
1162 /* array of size num_crtcs */
1163 struct drm_vblank_crtc *vblank;
1161 1164
1162 wait_queue_head_t *vbl_queue; /**< VBLANK wait queue */
1163 atomic_t *_vblank_count; /**< number of VBLANK interrupts (driver must alloc the right number of counters) */
1164 struct timeval *_vblank_time; /**< timestamp of current vblank_count (drivers must alloc right number of fields) */
1165 spinlock_t vblank_time_lock; /**< Protects vblank count and time updates during vblank enable/disable */ 1165 spinlock_t vblank_time_lock; /**< Protects vblank count and time updates during vblank enable/disable */
1166 spinlock_t vbl_lock; 1166 spinlock_t vbl_lock;
1167 atomic_t *vblank_refcount; /* number of users of vblank interruptsper crtc */
1168 u32 *last_vblank; /* protected by dev->vbl_lock, used */
1169 /* for wraparound handling */
1170 int *vblank_enabled; /* so we don't call enable more than
1171 once per disable */
1172 int *vblank_inmodeset; /* Display driver is setting mode */
1173 u32 *last_vblank_wait; /* Last vblank seqno waited per CRTC */
1174 struct timer_list vblank_disable_timer; 1167 struct timer_list vblank_disable_timer;
1175 1168
1176 u32 max_vblank_count; /**< size of vblank counter register */ 1169 u32 max_vblank_count; /**< size of vblank counter register */
@@ -1187,8 +1180,6 @@ struct drm_device {
1187 1180
1188 struct device *dev; /**< Device structure */ 1181 struct device *dev; /**< Device structure */
1189 struct pci_dev *pdev; /**< PCI device structure */ 1182 struct pci_dev *pdev; /**< PCI device structure */
1190 int pci_vendor; /**< PCI vendor id */
1191 int pci_device; /**< PCI device id */
1192#ifdef __alpha__ 1183#ifdef __alpha__
1193 struct pci_controller *hose; 1184 struct pci_controller *hose;
1194#endif 1185#endif
@@ -1561,8 +1552,6 @@ int drm_gem_init(struct drm_device *dev);
1561void drm_gem_destroy(struct drm_device *dev); 1552void drm_gem_destroy(struct drm_device *dev);
1562void drm_gem_object_release(struct drm_gem_object *obj); 1553void drm_gem_object_release(struct drm_gem_object *obj);
1563void drm_gem_object_free(struct kref *kref); 1554void drm_gem_object_free(struct kref *kref);
1564struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev,
1565 size_t size);
1566int drm_gem_object_init(struct drm_device *dev, 1555int drm_gem_object_init(struct drm_device *dev,
1567 struct drm_gem_object *obj, size_t size); 1556 struct drm_gem_object *obj, size_t size);
1568void drm_gem_private_object_init(struct drm_device *dev, 1557void drm_gem_private_object_init(struct drm_device *dev,
@@ -1650,9 +1639,11 @@ static __inline__ void drm_core_dropmap(struct drm_local_map *map)
1650 1639
1651#include <drm/drm_mem_util.h> 1640#include <drm/drm_mem_util.h>
1652 1641
1653extern int drm_fill_in_dev(struct drm_device *dev, 1642struct drm_device *drm_dev_alloc(struct drm_driver *driver,
1654 const struct pci_device_id *ent, 1643 struct device *parent);
1655 struct drm_driver *driver); 1644void drm_dev_free(struct drm_device *dev);
1645int drm_dev_register(struct drm_device *dev, unsigned long flags);
1646void drm_dev_unregister(struct drm_device *dev);
1656int drm_get_minor(struct drm_device *dev, struct drm_minor **minor, int type); 1647int drm_get_minor(struct drm_device *dev, struct drm_minor **minor, int type);
1657/*@}*/ 1648/*@}*/
1658 1649
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 50cedadc9fcc..ba407f6b4f1f 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -973,6 +973,7 @@ extern int drm_mode_group_init_legacy_group(struct drm_device *dev, struct drm_m
973extern bool drm_probe_ddc(struct i2c_adapter *adapter); 973extern bool drm_probe_ddc(struct i2c_adapter *adapter);
974extern struct edid *drm_get_edid(struct drm_connector *connector, 974extern struct edid *drm_get_edid(struct drm_connector *connector,
975 struct i2c_adapter *adapter); 975 struct i2c_adapter *adapter);
976extern struct edid *drm_edid_duplicate(const struct edid *edid);
976extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid); 977extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
977extern void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode); 978extern void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
978extern void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src); 979extern void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src);
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index ae8dbfb1207c..a92c3754e3bb 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -77,10 +77,10 @@
77#define DP_DOWNSTREAMPORT_PRESENT 0x005 77#define DP_DOWNSTREAMPORT_PRESENT 0x005
78# define DP_DWN_STRM_PORT_PRESENT (1 << 0) 78# define DP_DWN_STRM_PORT_PRESENT (1 << 0)
79# define DP_DWN_STRM_PORT_TYPE_MASK 0x06 79# define DP_DWN_STRM_PORT_TYPE_MASK 0x06
80/* 00b = DisplayPort */ 80# define DP_DWN_STRM_PORT_TYPE_DP (0 << 1)
81/* 01b = Analog */ 81# define DP_DWN_STRM_PORT_TYPE_ANALOG (1 << 1)
82/* 10b = TMDS or HDMI */ 82# define DP_DWN_STRM_PORT_TYPE_TMDS (2 << 1)
83/* 11b = Other */ 83# define DP_DWN_STRM_PORT_TYPE_OTHER (3 << 1)
84# define DP_FORMAT_CONVERSION (1 << 3) 84# define DP_FORMAT_CONVERSION (1 << 3)
85# define DP_DETAILED_CAP_INFO_AVAILABLE (1 << 4) /* DPI */ 85# define DP_DETAILED_CAP_INFO_AVAILABLE (1 << 4) /* DPI */
86 86
@@ -333,20 +333,20 @@ i2c_dp_aux_add_bus(struct i2c_adapter *adapter);
333 333
334 334
335#define DP_LINK_STATUS_SIZE 6 335#define DP_LINK_STATUS_SIZE 6
336bool drm_dp_channel_eq_ok(u8 link_status[DP_LINK_STATUS_SIZE], 336bool drm_dp_channel_eq_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
337 int lane_count); 337 int lane_count);
338bool drm_dp_clock_recovery_ok(u8 link_status[DP_LINK_STATUS_SIZE], 338bool drm_dp_clock_recovery_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
339 int lane_count); 339 int lane_count);
340u8 drm_dp_get_adjust_request_voltage(u8 link_status[DP_LINK_STATUS_SIZE], 340u8 drm_dp_get_adjust_request_voltage(const u8 link_status[DP_LINK_STATUS_SIZE],
341 int lane); 341 int lane);
342u8 drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE], 342u8 drm_dp_get_adjust_request_pre_emphasis(const u8 link_status[DP_LINK_STATUS_SIZE],
343 int lane); 343 int lane);
344 344
345#define DP_RECEIVER_CAP_SIZE 0xf 345#define DP_RECEIVER_CAP_SIZE 0xf
346#define EDP_PSR_RECEIVER_CAP_SIZE 2 346#define EDP_PSR_RECEIVER_CAP_SIZE 2
347 347
348void drm_dp_link_train_clock_recovery_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]); 348void drm_dp_link_train_clock_recovery_delay(const u8 dpcd[DP_RECEIVER_CAP_SIZE]);
349void drm_dp_link_train_channel_eq_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]); 349void drm_dp_link_train_channel_eq_delay(const u8 dpcd[DP_RECEIVER_CAP_SIZE]);
350 350
351u8 drm_dp_link_rate_to_bw_code(int link_rate); 351u8 drm_dp_link_rate_to_bw_code(int link_rate);
352int drm_dp_bw_code_to_link_rate(u8 link_bw); 352int drm_dp_bw_code_to_link_rate(u8 link_bw);
@@ -379,15 +379,22 @@ struct edp_vsc_psr {
379#define EDP_VSC_PSR_CRC_VALUES_VALID (1<<2) 379#define EDP_VSC_PSR_CRC_VALUES_VALID (1<<2)
380 380
381static inline int 381static inline int
382drm_dp_max_link_rate(u8 dpcd[DP_RECEIVER_CAP_SIZE]) 382drm_dp_max_link_rate(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
383{ 383{
384 return drm_dp_bw_code_to_link_rate(dpcd[DP_MAX_LINK_RATE]); 384 return drm_dp_bw_code_to_link_rate(dpcd[DP_MAX_LINK_RATE]);
385} 385}
386 386
387static inline u8 387static inline u8
388drm_dp_max_lane_count(u8 dpcd[DP_RECEIVER_CAP_SIZE]) 388drm_dp_max_lane_count(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
389{ 389{
390 return dpcd[DP_MAX_LANE_COUNT] & DP_MAX_LANE_COUNT_MASK; 390 return dpcd[DP_MAX_LANE_COUNT] & DP_MAX_LANE_COUNT_MASK;
391} 391}
392 392
393static inline bool
394drm_dp_enhanced_frame_cap(const u8 dpcd[DP_RECEIVER_CAP_SIZE])
395{
396 return dpcd[DP_DPCD_REV] >= 0x11 &&
397 (dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP);
398}
399
393#endif /* _DRM_DP_HELPER_H_ */ 400#endif /* _DRM_DP_HELPER_H_ */