aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-25 19:46:44 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-25 19:46:44 -0500
commitfffddfd6c8e0c10c42c6e2cc54ba880fcc36ebbb (patch)
tree71bc5e597124dbaf7550f1e089d675718b3ed5c0 /include
parent69086a78bdc973ec0b722be790b146e84ba8a8c4 (diff)
parentbe88298b0a3f771a4802f20c5e66af74bfd1dff1 (diff)
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm merge from Dave Airlie: "Highlights: - TI LCD controller KMS driver - TI OMAP KMS driver merged from staging - drop gma500 stub driver - the fbcon locking fixes - the vgacon dirty like zebra fix. - open firmware videomode and hdmi common code helpers - major locking rework for kms object handling - pageflip/cursor won't block on polling anymore! - fbcon helper and prime helper cleanups - i915: all over the map, haswell power well enhancements, valleyview macro horrors cleaned up, killing lots of legacy GTT code, - radeon: CS ioctl unification, deprecated UMS support, gpu reset rework, VM fixes - nouveau: reworked thermal code, external dp/tmds encoder support (anx9805), fences sleep instead of polling, - exynos: all over the driver fixes." Lovely conflict in radeon/evergreen_cs.c between commit de0babd60d8d ("drm/radeon: enforce use of radeon_get_ib_value when reading user cmd") and the new changes that modified that evergreen_dma_cs_parse() function. * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (508 commits) drm/tilcdc: only build on arm drm/i915: Revert hdmi HDP pin checks drm/tegra: Add list of framebuffers to debugfs drm/tegra: Fix color expansion drm/tegra: Split DC_CMD_STATE_CONTROL register write drm/tegra: Implement page-flipping support drm/tegra: Implement VBLANK support drm/tegra: Implement .mode_set_base() drm/tegra: Add plane support drm/tegra: Remove bogus tegra_framebuffer structure drm: Add consistency check for page-flipping drm/radeon: Use generic HDMI infoframe helpers drm/tegra: Use generic HDMI infoframe helpers drm: Add EDID helper documentation drm: Add HDMI infoframe helpers video: Add generic HDMI infoframe helpers drm: Add some missing forward declarations drm: Move mode tables to drm_edid.c drm: Remove duplicate drm_mode_cea_vic() gma500: Fix n, m1 and m2 clock limits for sdvo and lvds ...
Diffstat (limited to 'include')
-rw-r--r--include/drm/drmP.h34
-rw-r--r--include/drm/drm_crtc.h38
-rw-r--r--include/drm/drm_edid.h6
-rw-r--r--include/drm/drm_encoder_slave.h20
-rw-r--r--include/drm/drm_fb_cma_helper.h5
-rw-r--r--include/drm/drm_fb_helper.h18
-rw-r--r--include/drm/drm_gem_cma_helper.h4
-rw-r--r--include/drm/drm_mm.h40
-rw-r--r--include/drm/drm_pciids.h13
-rw-r--r--include/drm/intel-gtt.h22
-rw-r--r--include/drm/ttm/ttm_bo_driver.h61
-rw-r--r--include/linux/console.h2
-rw-r--r--include/linux/fb.h8
-rw-r--r--include/linux/hdmi.h231
-rw-r--r--include/linux/vt_kern.h3
-rw-r--r--include/uapi/drm/i915_drm.h20
-rw-r--r--include/uapi/drm/omap_drm.h123
-rw-r--r--include/video/display_timing.h124
-rw-r--r--include/video/of_display_timing.h20
-rw-r--r--include/video/of_videomode.h18
-rw-r--r--include/video/videomode.h48
21 files changed, 802 insertions, 56 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index fad21c927a38..2d94d7413d71 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -85,6 +85,9 @@ struct module;
85struct drm_file; 85struct drm_file;
86struct drm_device; 86struct drm_device;
87 87
88struct device_node;
89struct videomode;
90
88#include <drm/drm_os_linux.h> 91#include <drm/drm_os_linux.h>
89#include <drm/drm_hashtab.h> 92#include <drm/drm_hashtab.h>
90#include <drm/drm_mm.h> 93#include <drm/drm_mm.h>
@@ -446,7 +449,15 @@ struct drm_file {
446 int is_master; /* this file private is a master for a minor */ 449 int is_master; /* this file private is a master for a minor */
447 struct drm_master *master; /* master this node is currently associated with 450 struct drm_master *master; /* master this node is currently associated with
448 N.B. not always minor->master */ 451 N.B. not always minor->master */
452
453 /**
454 * fbs - List of framebuffers associated with this file.
455 *
456 * Protected by fbs_lock. Note that the fbs list holds a reference on
457 * the fb object to prevent it from untimely disappearing.
458 */
449 struct list_head fbs; 459 struct list_head fbs;
460 struct mutex fbs_lock;
450 461
451 wait_queue_head_t event_wait; 462 wait_queue_head_t event_wait;
452 struct list_head event_list; 463 struct list_head event_list;
@@ -919,6 +930,14 @@ struct drm_driver {
919 /* import dmabuf -> GEM */ 930 /* import dmabuf -> GEM */
920 struct drm_gem_object * (*gem_prime_import)(struct drm_device *dev, 931 struct drm_gem_object * (*gem_prime_import)(struct drm_device *dev,
921 struct dma_buf *dma_buf); 932 struct dma_buf *dma_buf);
933 /* low-level interface used by drm_gem_prime_{import,export} */
934 int (*gem_prime_pin)(struct drm_gem_object *obj);
935 struct sg_table *(*gem_prime_get_sg_table)(struct drm_gem_object *obj);
936 struct drm_gem_object *(*gem_prime_import_sg_table)(
937 struct drm_device *dev, size_t size,
938 struct sg_table *sgt);
939 void *(*gem_prime_vmap)(struct drm_gem_object *obj);
940 void (*gem_prime_vunmap)(struct drm_gem_object *obj, void *vaddr);
922 941
923 /* vga arb irq handler */ 942 /* vga arb irq handler */
924 void (*vgaarb_irq)(struct drm_device *dev, bool state); 943 void (*vgaarb_irq)(struct drm_device *dev, bool state);
@@ -1276,6 +1295,11 @@ static inline int drm_device_is_unplugged(struct drm_device *dev)
1276 return ret; 1295 return ret;
1277} 1296}
1278 1297
1298static inline bool drm_modeset_is_locked(struct drm_device *dev)
1299{
1300 return mutex_is_locked(&dev->mode_config.mutex);
1301}
1302
1279/******************************************************************/ 1303/******************************************************************/
1280/** \name Internal function definitions */ 1304/** \name Internal function definitions */
1281/*@{*/ 1305/*@{*/
@@ -1456,6 +1480,12 @@ extern struct drm_display_mode *
1456drm_mode_create_from_cmdline_mode(struct drm_device *dev, 1480drm_mode_create_from_cmdline_mode(struct drm_device *dev,
1457 struct drm_cmdline_mode *cmd); 1481 struct drm_cmdline_mode *cmd);
1458 1482
1483extern int drm_display_mode_from_videomode(const struct videomode *vm,
1484 struct drm_display_mode *dmode);
1485extern int of_get_drm_display_mode(struct device_node *np,
1486 struct drm_display_mode *dmode,
1487 int index);
1488
1459/* Modesetting support */ 1489/* Modesetting support */
1460extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); 1490extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc);
1461extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc); 1491extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc);
@@ -1540,9 +1570,13 @@ extern int drm_clients_info(struct seq_file *m, void* data);
1540extern int drm_gem_name_info(struct seq_file *m, void *data); 1570extern int drm_gem_name_info(struct seq_file *m, void *data);
1541 1571
1542 1572
1573extern struct dma_buf *drm_gem_prime_export(struct drm_device *dev,
1574 struct drm_gem_object *obj, int flags);
1543extern int drm_gem_prime_handle_to_fd(struct drm_device *dev, 1575extern int drm_gem_prime_handle_to_fd(struct drm_device *dev,
1544 struct drm_file *file_priv, uint32_t handle, uint32_t flags, 1576 struct drm_file *file_priv, uint32_t handle, uint32_t flags,
1545 int *prime_fd); 1577 int *prime_fd);
1578extern struct drm_gem_object *drm_gem_prime_import(struct drm_device *dev,
1579 struct dma_buf *dma_buf);
1546extern int drm_gem_prime_fd_to_handle(struct drm_device *dev, 1580extern int drm_gem_prime_fd_to_handle(struct drm_device *dev,
1547 struct drm_file *file_priv, int prime_fd, uint32_t *handle); 1581 struct drm_file *file_priv, int prime_fd, uint32_t *handle);
1548 1582
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 00d78b5161c0..8839b3a24660 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -38,7 +38,8 @@ struct drm_device;
38struct drm_mode_set; 38struct drm_mode_set;
39struct drm_framebuffer; 39struct drm_framebuffer;
40struct drm_object_properties; 40struct drm_object_properties;
41 41struct drm_file;
42struct drm_clip_rect;
42 43
43#define DRM_MODE_OBJECT_CRTC 0xcccccccc 44#define DRM_MODE_OBJECT_CRTC 0xcccccccc
44#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0 45#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0
@@ -254,6 +255,10 @@ struct drm_framebuffer {
254 * userspace perspective. 255 * userspace perspective.
255 */ 256 */
256 struct kref refcount; 257 struct kref refcount;
258 /*
259 * Place on the dev->mode_config.fb_list, access protected by
260 * dev->mode_config.fb_lock.
261 */
257 struct list_head head; 262 struct list_head head;
258 struct drm_mode_object base; 263 struct drm_mode_object base;
259 const struct drm_framebuffer_funcs *funcs; 264 const struct drm_framebuffer_funcs *funcs;
@@ -390,6 +395,15 @@ struct drm_crtc {
390 struct drm_device *dev; 395 struct drm_device *dev;
391 struct list_head head; 396 struct list_head head;
392 397
398 /**
399 * crtc mutex
400 *
401 * This provides a read lock for the overall crtc state (mode, dpms
402 * state, ...) and a write lock for everything which can be update
403 * without a full modeset (fb, cursor data, ...)
404 */
405 struct mutex mutex;
406
393 struct drm_mode_object base; 407 struct drm_mode_object base;
394 408
395 /* framebuffer the connector is currently bound to */ 409 /* framebuffer the connector is currently bound to */
@@ -771,8 +785,18 @@ struct drm_mode_config {
771 struct mutex idr_mutex; /* for IDR management */ 785 struct mutex idr_mutex; /* for IDR management */
772 struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, connector, modes - just makes life easier */ 786 struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, connector, modes - just makes life easier */
773 /* this is limited to one for now */ 787 /* this is limited to one for now */
788
789
790 /**
791 * fb_lock - mutex to protect fb state
792 *
793 * Besides the global fb list his also protects the fbs list in the
794 * file_priv
795 */
796 struct mutex fb_lock;
774 int num_fb; 797 int num_fb;
775 struct list_head fb_list; 798 struct list_head fb_list;
799
776 int num_connector; 800 int num_connector;
777 struct list_head connector_list; 801 struct list_head connector_list;
778 int num_encoder; 802 int num_encoder;
@@ -842,6 +866,10 @@ struct drm_prop_enum_list {
842 char *name; 866 char *name;
843}; 867};
844 868
869extern void drm_modeset_lock_all(struct drm_device *dev);
870extern void drm_modeset_unlock_all(struct drm_device *dev);
871extern void drm_warn_on_modeset_not_all_locked(struct drm_device *dev);
872
845extern int drm_crtc_init(struct drm_device *dev, 873extern int drm_crtc_init(struct drm_device *dev,
846 struct drm_crtc *crtc, 874 struct drm_crtc *crtc,
847 const struct drm_crtc_funcs *funcs); 875 const struct drm_crtc_funcs *funcs);
@@ -932,10 +960,13 @@ extern void drm_framebuffer_set_object(struct drm_device *dev,
932extern int drm_framebuffer_init(struct drm_device *dev, 960extern int drm_framebuffer_init(struct drm_device *dev,
933 struct drm_framebuffer *fb, 961 struct drm_framebuffer *fb,
934 const struct drm_framebuffer_funcs *funcs); 962 const struct drm_framebuffer_funcs *funcs);
963extern struct drm_framebuffer *drm_framebuffer_lookup(struct drm_device *dev,
964 uint32_t id);
935extern void drm_framebuffer_unreference(struct drm_framebuffer *fb); 965extern void drm_framebuffer_unreference(struct drm_framebuffer *fb);
936extern void drm_framebuffer_reference(struct drm_framebuffer *fb); 966extern void drm_framebuffer_reference(struct drm_framebuffer *fb);
937extern void drm_framebuffer_remove(struct drm_framebuffer *fb); 967extern void drm_framebuffer_remove(struct drm_framebuffer *fb);
938extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb); 968extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb);
969extern void drm_framebuffer_unregister_private(struct drm_framebuffer *fb);
939extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc); 970extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc);
940extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb); 971extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
941extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY); 972extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY);
@@ -985,6 +1016,7 @@ extern int drm_mode_getcrtc(struct drm_device *dev,
985 void *data, struct drm_file *file_priv); 1016 void *data, struct drm_file *file_priv);
986extern int drm_mode_getconnector(struct drm_device *dev, 1017extern int drm_mode_getconnector(struct drm_device *dev,
987 void *data, struct drm_file *file_priv); 1018 void *data, struct drm_file *file_priv);
1019extern int drm_mode_set_config_internal(struct drm_mode_set *set);
988extern int drm_mode_setcrtc(struct drm_device *dev, 1020extern int drm_mode_setcrtc(struct drm_device *dev,
989 void *data, struct drm_file *file_priv); 1021 void *data, struct drm_file *file_priv);
990extern int drm_mode_getplane(struct drm_device *dev, 1022extern int drm_mode_getplane(struct drm_device *dev,
@@ -1030,9 +1062,10 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev,
1030extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, 1062extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
1031 void *data, struct drm_file *file_priv); 1063 void *data, struct drm_file *file_priv);
1032extern u8 *drm_find_cea_extension(struct edid *edid); 1064extern u8 *drm_find_cea_extension(struct edid *edid);
1033extern u8 drm_match_cea_mode(struct drm_display_mode *to_match); 1065extern u8 drm_match_cea_mode(const struct drm_display_mode *to_match);
1034extern bool drm_detect_hdmi_monitor(struct edid *edid); 1066extern bool drm_detect_hdmi_monitor(struct edid *edid);
1035extern bool drm_detect_monitor_audio(struct edid *edid); 1067extern bool drm_detect_monitor_audio(struct edid *edid);
1068extern bool drm_rgb_quant_range_selectable(struct edid *edid);
1036extern int drm_mode_page_flip_ioctl(struct drm_device *dev, 1069extern int drm_mode_page_flip_ioctl(struct drm_device *dev,
1037 void *data, struct drm_file *file_priv); 1070 void *data, struct drm_file *file_priv);
1038extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, 1071extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
@@ -1047,7 +1080,6 @@ extern struct drm_display_mode *drm_gtf_mode_complex(struct drm_device *dev,
1047 int GTF_2C, int GTF_K, int GTF_2J); 1080 int GTF_2C, int GTF_K, int GTF_2J);
1048extern int drm_add_modes_noedid(struct drm_connector *connector, 1081extern int drm_add_modes_noedid(struct drm_connector *connector,
1049 int hdisplay, int vdisplay); 1082 int hdisplay, int vdisplay);
1050extern uint8_t drm_mode_cea_vic(const struct drm_display_mode *mode);
1051 1083
1052extern int drm_edid_header_is_valid(const u8 *raw_edid); 1084extern int drm_edid_header_is_valid(const u8 *raw_edid);
1053extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid); 1085extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid);
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index 0cac551c5347..5da1b4ae7d84 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -247,6 +247,8 @@ struct edid {
247struct drm_encoder; 247struct drm_encoder;
248struct drm_connector; 248struct drm_connector;
249struct drm_display_mode; 249struct drm_display_mode;
250struct hdmi_avi_infoframe;
251
250void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid); 252void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid);
251int drm_av_sync_delay(struct drm_connector *connector, 253int drm_av_sync_delay(struct drm_connector *connector,
252 struct drm_display_mode *mode); 254 struct drm_display_mode *mode);
@@ -254,4 +256,8 @@ struct drm_connector *drm_select_eld(struct drm_encoder *encoder,
254 struct drm_display_mode *mode); 256 struct drm_display_mode *mode);
255int drm_load_edid_firmware(struct drm_connector *connector); 257int drm_load_edid_firmware(struct drm_connector *connector);
256 258
259int
260drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
261 const struct drm_display_mode *mode);
262
257#endif /* __DRM_EDID_H__ */ 263#endif /* __DRM_EDID_H__ */
diff --git a/include/drm/drm_encoder_slave.h b/include/drm/drm_encoder_slave.h
index b0c11a7809bb..8b9cc3671858 100644
--- a/include/drm/drm_encoder_slave.h
+++ b/include/drm/drm_encoder_slave.h
@@ -159,4 +159,24 @@ static inline void drm_i2c_encoder_unregister(struct drm_i2c_encoder_driver *dri
159 159
160void drm_i2c_encoder_destroy(struct drm_encoder *encoder); 160void drm_i2c_encoder_destroy(struct drm_encoder *encoder);
161 161
162
163/*
164 * Wrapper fxns which can be plugged in to drm_encoder_helper_funcs:
165 */
166
167void drm_i2c_encoder_dpms(struct drm_encoder *encoder, int mode);
168bool drm_i2c_encoder_mode_fixup(struct drm_encoder *encoder,
169 const struct drm_display_mode *mode,
170 struct drm_display_mode *adjusted_mode);
171void drm_i2c_encoder_prepare(struct drm_encoder *encoder);
172void drm_i2c_encoder_commit(struct drm_encoder *encoder);
173void drm_i2c_encoder_mode_set(struct drm_encoder *encoder,
174 struct drm_display_mode *mode,
175 struct drm_display_mode *adjusted_mode);
176enum drm_connector_status drm_i2c_encoder_detect(struct drm_encoder *encoder,
177 struct drm_connector *connector);
178void drm_i2c_encoder_save(struct drm_encoder *encoder);
179void drm_i2c_encoder_restore(struct drm_encoder *encoder);
180
181
162#endif 182#endif
diff --git a/include/drm/drm_fb_cma_helper.h b/include/drm/drm_fb_cma_helper.h
index 76c709837543..4a3fc244301c 100644
--- a/include/drm/drm_fb_cma_helper.h
+++ b/include/drm/drm_fb_cma_helper.h
@@ -23,5 +23,10 @@ struct drm_framebuffer *drm_fb_cma_create(struct drm_device *dev,
23struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb, 23struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb,
24 unsigned int plane); 24 unsigned int plane);
25 25
26#ifdef CONFIG_DEBUG_FS
27void drm_fb_cma_describe(struct drm_framebuffer *fb, struct seq_file *m);
28int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg);
29#endif
30
26#endif 31#endif
27 32
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 5120b01c2eeb..c09511625a11 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -48,6 +48,18 @@ struct drm_fb_helper_surface_size {
48 u32 surface_depth; 48 u32 surface_depth;
49}; 49};
50 50
51/**
52 * struct drm_fb_helper_funcs - driver callbacks for the fbdev emulation library
53 * @gamma_set: - Set the given gamma lut register on the given crtc.
54 * @gamma_get: - Read the given gamma lut register on the given crtc, used to
55 * save the current lut when force-restoring the fbdev for e.g.
56 * kdbg.
57 * @fb_probe: - Driver callback to allocate and initialize the fbdev info
58 * structure. Futhermore it also needs to allocate the drm
59 * framebuffer used to back the fbdev.
60 *
61 * Driver callbacks used by the fbdev emulation helper library.
62 */
51struct drm_fb_helper_funcs { 63struct drm_fb_helper_funcs {
52 void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green, 64 void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green,
53 u16 blue, int regno); 65 u16 blue, int regno);
@@ -65,9 +77,7 @@ struct drm_fb_helper_connector {
65 77
66struct drm_fb_helper { 78struct drm_fb_helper {
67 struct drm_framebuffer *fb; 79 struct drm_framebuffer *fb;
68 struct drm_framebuffer *saved_fb;
69 struct drm_device *dev; 80 struct drm_device *dev;
70 struct drm_display_mode *mode;
71 int crtc_count; 81 int crtc_count;
72 struct drm_fb_helper_crtc *crtc_info; 82 struct drm_fb_helper_crtc *crtc_info;
73 int connector_count; 83 int connector_count;
@@ -82,9 +92,6 @@ struct drm_fb_helper {
82 bool delayed_hotplug; 92 bool delayed_hotplug;
83}; 93};
84 94
85int drm_fb_helper_single_fb_probe(struct drm_fb_helper *helper,
86 int preferred_bpp);
87
88int drm_fb_helper_init(struct drm_device *dev, 95int drm_fb_helper_init(struct drm_device *dev,
89 struct drm_fb_helper *helper, int crtc_count, 96 struct drm_fb_helper *helper, int crtc_count,
90 int max_conn); 97 int max_conn);
@@ -103,7 +110,6 @@ int drm_fb_helper_setcolreg(unsigned regno,
103 struct fb_info *info); 110 struct fb_info *info);
104 111
105bool drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper); 112bool drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper);
106void drm_fb_helper_restore(void);
107void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper, 113void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
108 uint32_t fb_width, uint32_t fb_height); 114 uint32_t fb_width, uint32_t fb_height);
109void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, 115void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h
index f0f6b1af25ad..63397ced9254 100644
--- a/include/drm/drm_gem_cma_helper.h
+++ b/include/drm/drm_gem_cma_helper.h
@@ -41,4 +41,8 @@ struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm,
41 41
42extern const struct vm_operations_struct drm_gem_cma_vm_ops; 42extern const struct vm_operations_struct drm_gem_cma_vm_ops;
43 43
44#ifdef CONFIG_DEBUG_FS
45void drm_gem_cma_describe(struct drm_gem_cma_object *obj, struct seq_file *m);
46#endif
47
44#endif /* __DRM_GEM_CMA_HELPER_H__ */ 48#endif /* __DRM_GEM_CMA_HELPER_H__ */
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index 3527fb3f75bb..88591ef8fa24 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -89,6 +89,29 @@ static inline bool drm_mm_initialized(struct drm_mm *mm)
89{ 89{
90 return mm->hole_stack.next; 90 return mm->hole_stack.next;
91} 91}
92
93static inline unsigned long __drm_mm_hole_node_start(struct drm_mm_node *hole_node)
94{
95 return hole_node->start + hole_node->size;
96}
97
98static inline unsigned long drm_mm_hole_node_start(struct drm_mm_node *hole_node)
99{
100 BUG_ON(!hole_node->hole_follows);
101 return __drm_mm_hole_node_start(hole_node);
102}
103
104static inline unsigned long __drm_mm_hole_node_end(struct drm_mm_node *hole_node)
105{
106 return list_entry(hole_node->node_list.next,
107 struct drm_mm_node, node_list)->start;
108}
109
110static inline unsigned long drm_mm_hole_node_end(struct drm_mm_node *hole_node)
111{
112 return __drm_mm_hole_node_end(hole_node);
113}
114
92#define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \ 115#define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \
93 &(mm)->head_node.node_list, \ 116 &(mm)->head_node.node_list, \
94 node_list) 117 node_list)
@@ -99,9 +122,26 @@ static inline bool drm_mm_initialized(struct drm_mm *mm)
99 entry != NULL; entry = next, \ 122 entry != NULL; entry = next, \
100 next = entry ? list_entry(entry->node_list.next, \ 123 next = entry ? list_entry(entry->node_list.next, \
101 struct drm_mm_node, node_list) : NULL) \ 124 struct drm_mm_node, node_list) : NULL) \
125
126/* Note that we need to unroll list_for_each_entry in order to inline
127 * setting hole_start and hole_end on each iteration and keep the
128 * macro sane.
129 */
130#define drm_mm_for_each_hole(entry, mm, hole_start, hole_end) \
131 for (entry = list_entry((mm)->hole_stack.next, struct drm_mm_node, hole_stack); \
132 &entry->hole_stack != &(mm)->hole_stack ? \
133 hole_start = drm_mm_hole_node_start(entry), \
134 hole_end = drm_mm_hole_node_end(entry), \
135 1 : 0; \
136 entry = list_entry(entry->hole_stack.next, struct drm_mm_node, hole_stack))
137
102/* 138/*
103 * Basic range manager support (drm_mm.c) 139 * Basic range manager support (drm_mm.c)
104 */ 140 */
141extern struct drm_mm_node *drm_mm_create_block(struct drm_mm *mm,
142 unsigned long start,
143 unsigned long size,
144 bool atomic);
105extern struct drm_mm_node *drm_mm_get_block_generic(struct drm_mm_node *node, 145extern struct drm_mm_node *drm_mm_get_block_generic(struct drm_mm_node *node,
106 unsigned long size, 146 unsigned long size,
107 unsigned alignment, 147 unsigned alignment,
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index c5c35e629426..a386b0b654cc 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -139,6 +139,19 @@
139 {0x1002, 0x5e4c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ 139 {0x1002, 0x5e4c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \
140 {0x1002, 0x5e4d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ 140 {0x1002, 0x5e4d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \
141 {0x1002, 0x5e4f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \ 141 {0x1002, 0x5e4f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV410|RADEON_NEW_MEMMAP}, \
142 {0x1002, 0x6600, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
143 {0x1002, 0x6601, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
144 {0x1002, 0x6602, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
145 {0x1002, 0x6603, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
146 {0x1002, 0x6606, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
147 {0x1002, 0x6607, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
148 {0x1002, 0x6610, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \
149 {0x1002, 0x6611, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \
150 {0x1002, 0x6613, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \
151 {0x1002, 0x6620, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
152 {0x1002, 0x6621, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
153 {0x1002, 0x6623, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
154 {0x1002, 0x6631, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \
142 {0x1002, 0x6700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \ 155 {0x1002, 0x6700, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \
143 {0x1002, 0x6701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \ 156 {0x1002, 0x6701, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \
144 {0x1002, 0x6702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \ 157 {0x1002, 0x6702, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAYMAN|RADEON_NEW_MEMMAP}, \
diff --git a/include/drm/intel-gtt.h b/include/drm/intel-gtt.h
index 6eb76a1f11ab..b08bdade6002 100644
--- a/include/drm/intel-gtt.h
+++ b/include/drm/intel-gtt.h
@@ -3,26 +3,8 @@
3#ifndef _DRM_INTEL_GTT_H 3#ifndef _DRM_INTEL_GTT_H
4#define _DRM_INTEL_GTT_H 4#define _DRM_INTEL_GTT_H
5 5
6struct intel_gtt { 6void intel_gtt_get(size_t *gtt_total, size_t *stolen_size,
7 /* Size of memory reserved for graphics by the BIOS */ 7 phys_addr_t *mappable_base, unsigned long *mappable_end);
8 unsigned int stolen_size;
9 /* Total number of gtt entries. */
10 unsigned int gtt_total_entries;
11 /* Part of the gtt that is mappable by the cpu, for those chips where
12 * this is not the full gtt. */
13 unsigned int gtt_mappable_entries;
14 /* Whether i915 needs to use the dmar apis or not. */
15 unsigned int needs_dmar : 1;
16 /* Whether we idle the gpu before mapping/unmapping */
17 unsigned int do_idle_maps : 1;
18 /* Share the scratch page dma with ppgtts. */
19 dma_addr_t scratch_page_dma;
20 struct page *scratch_page;
21 /* for ppgtt PDE access */
22 u32 __iomem *gtt;
23 /* needed for ioremap in drm/i915 */
24 phys_addr_t gma_bus_addr;
25} *intel_gtt_get(void);
26 8
27int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev, 9int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev,
28 struct agp_bridge_data *bridge); 10 struct agp_bridge_data *bridge);
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index e3a43a47d78c..0fbd046e7c93 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -790,16 +790,7 @@ extern void ttm_mem_io_unlock(struct ttm_mem_type_manager *man);
790 * to make room for a buffer already reserved. (Buffers are reserved before 790 * to make room for a buffer already reserved. (Buffers are reserved before
791 * they are evicted). The following algorithm prevents such deadlocks from 791 * they are evicted). The following algorithm prevents such deadlocks from
792 * occurring: 792 * occurring:
793 * 1) Buffers are reserved with the lru spinlock held. Upon successful 793 * Processes attempting to reserve multiple buffers other than for eviction,
794 * reservation they are removed from the lru list. This stops a reserved buffer
795 * from being evicted. However the lru spinlock is released between the time
796 * a buffer is selected for eviction and the time it is reserved.
797 * Therefore a check is made when a buffer is reserved for eviction, that it
798 * is still the first buffer in the lru list, before it is removed from the
799 * list. @check_lru == 1 forces this check. If it fails, the function returns
800 * -EINVAL, and the caller should then choose a new buffer to evict and repeat
801 * the procedure.
802 * 2) Processes attempting to reserve multiple buffers other than for eviction,
803 * (typically execbuf), should first obtain a unique 32-bit 794 * (typically execbuf), should first obtain a unique 32-bit
804 * validation sequence number, 795 * validation sequence number,
805 * and call this function with @use_sequence == 1 and @sequence == the unique 796 * and call this function with @use_sequence == 1 and @sequence == the unique
@@ -830,9 +821,39 @@ extern int ttm_bo_reserve(struct ttm_buffer_object *bo,
830 bool interruptible, 821 bool interruptible,
831 bool no_wait, bool use_sequence, uint32_t sequence); 822 bool no_wait, bool use_sequence, uint32_t sequence);
832 823
824/**
825 * ttm_bo_reserve_slowpath_nolru:
826 * @bo: A pointer to a struct ttm_buffer_object.
827 * @interruptible: Sleep interruptible if waiting.
828 * @sequence: Set (@bo)->sequence to this value after lock
829 *
830 * This is called after ttm_bo_reserve returns -EAGAIN and we backed off
831 * from all our other reservations. Because there are no other reservations
832 * held by us, this function cannot deadlock any more.
833 *
834 * Will not remove reserved buffers from the lru lists.
835 * Otherwise identical to ttm_bo_reserve_slowpath.
836 */
837extern int ttm_bo_reserve_slowpath_nolru(struct ttm_buffer_object *bo,
838 bool interruptible,
839 uint32_t sequence);
840
833 841
834/** 842/**
835 * ttm_bo_reserve_locked: 843 * ttm_bo_reserve_slowpath:
844 * @bo: A pointer to a struct ttm_buffer_object.
845 * @interruptible: Sleep interruptible if waiting.
846 * @sequence: Set (@bo)->sequence to this value after lock
847 *
848 * This is called after ttm_bo_reserve returns -EAGAIN and we backed off
849 * from all our other reservations. Because there are no other reservations
850 * held by us, this function cannot deadlock any more.
851 */
852extern int ttm_bo_reserve_slowpath(struct ttm_buffer_object *bo,
853 bool interruptible, uint32_t sequence);
854
855/**
856 * ttm_bo_reserve_nolru:
836 * 857 *
837 * @bo: A pointer to a struct ttm_buffer_object. 858 * @bo: A pointer to a struct ttm_buffer_object.
838 * @interruptible: Sleep interruptible if waiting. 859 * @interruptible: Sleep interruptible if waiting.
@@ -840,9 +861,7 @@ extern int ttm_bo_reserve(struct ttm_buffer_object *bo,
840 * @use_sequence: If @bo is already reserved, Only sleep waiting for 861 * @use_sequence: If @bo is already reserved, Only sleep waiting for
841 * it to become unreserved if @sequence < (@bo)->sequence. 862 * it to become unreserved if @sequence < (@bo)->sequence.
842 * 863 *
843 * Must be called with struct ttm_bo_global::lru_lock held, 864 * Will not remove reserved buffers from the lru lists.
844 * and will not remove reserved buffers from the lru lists.
845 * The function may release the LRU spinlock if it needs to sleep.
846 * Otherwise identical to ttm_bo_reserve. 865 * Otherwise identical to ttm_bo_reserve.
847 * 866 *
848 * Returns: 867 * Returns:
@@ -855,7 +874,7 @@ extern int ttm_bo_reserve(struct ttm_buffer_object *bo,
855 * -EDEADLK: Bo already reserved using @sequence. This error code will only 874 * -EDEADLK: Bo already reserved using @sequence. This error code will only
856 * be returned if @use_sequence is set to true. 875 * be returned if @use_sequence is set to true.
857 */ 876 */
858extern int ttm_bo_reserve_locked(struct ttm_buffer_object *bo, 877extern int ttm_bo_reserve_nolru(struct ttm_buffer_object *bo,
859 bool interruptible, 878 bool interruptible,
860 bool no_wait, bool use_sequence, 879 bool no_wait, bool use_sequence,
861 uint32_t sequence); 880 uint32_t sequence);
@@ -879,18 +898,6 @@ extern void ttm_bo_unreserve(struct ttm_buffer_object *bo);
879 */ 898 */
880extern void ttm_bo_unreserve_locked(struct ttm_buffer_object *bo); 899extern void ttm_bo_unreserve_locked(struct ttm_buffer_object *bo);
881 900
882/**
883 * ttm_bo_wait_unreserved
884 *
885 * @bo: A pointer to a struct ttm_buffer_object.
886 *
887 * Wait for a struct ttm_buffer_object to become unreserved.
888 * This is typically used in the execbuf code to relax cpu-usage when
889 * a potential deadlock condition backoff.
890 */
891extern int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo,
892 bool interruptible);
893
894/* 901/*
895 * ttm_bo_util.c 902 * ttm_bo_util.c
896 */ 903 */
diff --git a/include/linux/console.h b/include/linux/console.h
index 3b709da1786e..29680a8cda99 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -77,7 +77,9 @@ extern const struct consw prom_con; /* SPARC PROM console */
77int con_is_bound(const struct consw *csw); 77int con_is_bound(const struct consw *csw);
78int register_con_driver(const struct consw *csw, int first, int last); 78int register_con_driver(const struct consw *csw, int first, int last);
79int unregister_con_driver(const struct consw *csw); 79int unregister_con_driver(const struct consw *csw);
80int do_unregister_con_driver(const struct consw *csw);
80int take_over_console(const struct consw *sw, int first, int last, int deflt); 81int take_over_console(const struct consw *sw, int first, int last, int deflt);
82int do_take_over_console(const struct consw *sw, int first, int last, int deflt);
81void give_up_console(const struct consw *sw); 83void give_up_console(const struct consw *sw);
82#ifdef CONFIG_HW_CONSOLE 84#ifdef CONFIG_HW_CONSOLE
83int con_debug_enter(struct vc_data *vc); 85int con_debug_enter(struct vc_data *vc);
diff --git a/include/linux/fb.h b/include/linux/fb.h
index c7a95714b1fe..58b98606ac26 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -19,6 +19,8 @@ struct vm_area_struct;
19struct fb_info; 19struct fb_info;
20struct device; 20struct device;
21struct file; 21struct file;
22struct videomode;
23struct device_node;
22 24
23/* Definitions below are used in the parsed monitor specs */ 25/* Definitions below are used in the parsed monitor specs */
24#define FB_DPMS_ACTIVE_OFF 1 26#define FB_DPMS_ACTIVE_OFF 1
@@ -714,6 +716,12 @@ extern void fb_destroy_modedb(struct fb_videomode *modedb);
714extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); 716extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb);
715extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter); 717extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter);
716 718
719extern int of_get_fb_videomode(struct device_node *np,
720 struct fb_videomode *fb,
721 int index);
722extern int fb_videomode_from_videomode(const struct videomode *vm,
723 struct fb_videomode *fbmode);
724
717/* drivers/video/modedb.c */ 725/* drivers/video/modedb.c */
718#define VESA_MODEDB_SIZE 34 726#define VESA_MODEDB_SIZE 34
719extern void fb_var_to_videomode(struct fb_videomode *mode, 727extern void fb_var_to_videomode(struct fb_videomode *mode,
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
new file mode 100644
index 000000000000..3b589440ecfe
--- /dev/null
+++ b/include/linux/hdmi.h
@@ -0,0 +1,231 @@
1/*
2 * Copyright (C) 2012 Avionic Design GmbH
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __LINUX_HDMI_H_
10#define __LINUX_HDMI_H_
11
12#include <linux/types.h>
13
14enum hdmi_infoframe_type {
15 HDMI_INFOFRAME_TYPE_VENDOR = 0x81,
16 HDMI_INFOFRAME_TYPE_AVI = 0x82,
17 HDMI_INFOFRAME_TYPE_SPD = 0x83,
18 HDMI_INFOFRAME_TYPE_AUDIO = 0x84,
19};
20
21#define HDMI_INFOFRAME_HEADER_SIZE 4
22#define HDMI_AVI_INFOFRAME_SIZE 13
23#define HDMI_SPD_INFOFRAME_SIZE 25
24#define HDMI_AUDIO_INFOFRAME_SIZE 10
25
26enum hdmi_colorspace {
27 HDMI_COLORSPACE_RGB,
28 HDMI_COLORSPACE_YUV422,
29 HDMI_COLORSPACE_YUV444,
30};
31
32enum hdmi_scan_mode {
33 HDMI_SCAN_MODE_NONE,
34 HDMI_SCAN_MODE_OVERSCAN,
35 HDMI_SCAN_MODE_UNDERSCAN,
36};
37
38enum hdmi_colorimetry {
39 HDMI_COLORIMETRY_NONE,
40 HDMI_COLORIMETRY_ITU_601,
41 HDMI_COLORIMETRY_ITU_709,
42 HDMI_COLORIMETRY_EXTENDED,
43};
44
45enum hdmi_picture_aspect {
46 HDMI_PICTURE_ASPECT_NONE,
47 HDMI_PICTURE_ASPECT_4_3,
48 HDMI_PICTURE_ASPECT_16_9,
49};
50
51enum hdmi_active_aspect {
52 HDMI_ACTIVE_ASPECT_16_9_TOP = 2,
53 HDMI_ACTIVE_ASPECT_14_9_TOP = 3,
54 HDMI_ACTIVE_ASPECT_16_9_CENTER = 4,
55 HDMI_ACTIVE_ASPECT_PICTURE = 8,
56 HDMI_ACTIVE_ASPECT_4_3 = 9,
57 HDMI_ACTIVE_ASPECT_16_9 = 10,
58 HDMI_ACTIVE_ASPECT_14_9 = 11,
59 HDMI_ACTIVE_ASPECT_4_3_SP_14_9 = 13,
60 HDMI_ACTIVE_ASPECT_16_9_SP_14_9 = 14,
61 HDMI_ACTIVE_ASPECT_16_9_SP_4_3 = 15,
62};
63
64enum hdmi_extended_colorimetry {
65 HDMI_EXTENDED_COLORIMETRY_XV_YCC_601,
66 HDMI_EXTENDED_COLORIMETRY_XV_YCC_709,
67 HDMI_EXTENDED_COLORIMETRY_S_YCC_601,
68 HDMI_EXTENDED_COLORIMETRY_ADOBE_YCC_601,
69 HDMI_EXTENDED_COLORIMETRY_ADOBE_RGB,
70};
71
72enum hdmi_quantization_range {
73 HDMI_QUANTIZATION_RANGE_DEFAULT,
74 HDMI_QUANTIZATION_RANGE_LIMITED,
75 HDMI_QUANTIZATION_RANGE_FULL,
76};
77
78/* non-uniform picture scaling */
79enum hdmi_nups {
80 HDMI_NUPS_UNKNOWN,
81 HDMI_NUPS_HORIZONTAL,
82 HDMI_NUPS_VERTICAL,
83 HDMI_NUPS_BOTH,
84};
85
86enum hdmi_ycc_quantization_range {
87 HDMI_YCC_QUANTIZATION_RANGE_LIMITED,
88 HDMI_YCC_QUANTIZATION_RANGE_FULL,
89};
90
91enum hdmi_content_type {
92 HDMI_CONTENT_TYPE_NONE,
93 HDMI_CONTENT_TYPE_PHOTO,
94 HDMI_CONTENT_TYPE_CINEMA,
95 HDMI_CONTENT_TYPE_GAME,
96};
97
98struct hdmi_avi_infoframe {
99 enum hdmi_infoframe_type type;
100 unsigned char version;
101 unsigned char length;
102 enum hdmi_colorspace colorspace;
103 bool active_info_valid;
104 bool horizontal_bar_valid;
105 bool vertical_bar_valid;
106 enum hdmi_scan_mode scan_mode;
107 enum hdmi_colorimetry colorimetry;
108 enum hdmi_picture_aspect picture_aspect;
109 enum hdmi_active_aspect active_aspect;
110 bool itc;
111 enum hdmi_extended_colorimetry extended_colorimetry;
112 enum hdmi_quantization_range quantization_range;
113 enum hdmi_nups nups;
114 unsigned char video_code;
115 enum hdmi_ycc_quantization_range ycc_quantization_range;
116 enum hdmi_content_type content_type;
117 unsigned char pixel_repeat;
118 unsigned short top_bar;
119 unsigned short bottom_bar;
120 unsigned short left_bar;
121 unsigned short right_bar;
122};
123
124int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame);
125ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe *frame, void *buffer,
126 size_t size);
127
128enum hdmi_spd_sdi {
129 HDMI_SPD_SDI_UNKNOWN,
130 HDMI_SPD_SDI_DSTB,
131 HDMI_SPD_SDI_DVDP,
132 HDMI_SPD_SDI_DVHS,
133 HDMI_SPD_SDI_HDDVR,
134 HDMI_SPD_SDI_DVC,
135 HDMI_SPD_SDI_DSC,
136 HDMI_SPD_SDI_VCD,
137 HDMI_SPD_SDI_GAME,
138 HDMI_SPD_SDI_PC,
139 HDMI_SPD_SDI_BD,
140 HDMI_SPD_SDI_SACD,
141 HDMI_SPD_SDI_HDDVD,
142 HDMI_SPD_SDI_PMP,
143};
144
145struct hdmi_spd_infoframe {
146 enum hdmi_infoframe_type type;
147 unsigned char version;
148 unsigned char length;
149 char vendor[8];
150 char product[16];
151 enum hdmi_spd_sdi sdi;
152};
153
154int hdmi_spd_infoframe_init(struct hdmi_spd_infoframe *frame,
155 const char *vendor, const char *product);
156ssize_t hdmi_spd_infoframe_pack(struct hdmi_spd_infoframe *frame, void *buffer,
157 size_t size);
158
159enum hdmi_audio_coding_type {
160 HDMI_AUDIO_CODING_TYPE_STREAM,
161 HDMI_AUDIO_CODING_TYPE_PCM,
162 HDMI_AUDIO_CODING_TYPE_AC3,
163 HDMI_AUDIO_CODING_TYPE_MPEG1,
164 HDMI_AUDIO_CODING_TYPE_MP3,
165 HDMI_AUDIO_CODING_TYPE_MPEG2,
166 HDMI_AUDIO_CODING_TYPE_AAC_LC,
167 HDMI_AUDIO_CODING_TYPE_DTS,
168 HDMI_AUDIO_CODING_TYPE_ATRAC,
169 HDMI_AUDIO_CODING_TYPE_DSD,
170 HDMI_AUDIO_CODING_TYPE_EAC3,
171 HDMI_AUDIO_CODING_TYPE_DTS_HD,
172 HDMI_AUDIO_CODING_TYPE_MLP,
173 HDMI_AUDIO_CODING_TYPE_DST,
174 HDMI_AUDIO_CODING_TYPE_WMA_PRO,
175};
176
177enum hdmi_audio_sample_size {
178 HDMI_AUDIO_SAMPLE_SIZE_STREAM,
179 HDMI_AUDIO_SAMPLE_SIZE_16,
180 HDMI_AUDIO_SAMPLE_SIZE_20,
181 HDMI_AUDIO_SAMPLE_SIZE_24,
182};
183
184enum hdmi_audio_sample_frequency {
185 HDMI_AUDIO_SAMPLE_FREQUENCY_STREAM,
186 HDMI_AUDIO_SAMPLE_FREQUENCY_32000,
187 HDMI_AUDIO_SAMPLE_FREQUENCY_44100,
188 HDMI_AUDIO_SAMPLE_FREQUENCY_48000,
189 HDMI_AUDIO_SAMPLE_FREQUENCY_88200,
190 HDMI_AUDIO_SAMPLE_FREQUENCY_96000,
191 HDMI_AUDIO_SAMPLE_FREQUENCY_176400,
192 HDMI_AUDIO_SAMPLE_FREQUENCY_192000,
193};
194
195enum hdmi_audio_coding_type_ext {
196 HDMI_AUDIO_CODING_TYPE_EXT_STREAM,
197 HDMI_AUDIO_CODING_TYPE_EXT_HE_AAC,
198 HDMI_AUDIO_CODING_TYPE_EXT_HE_AAC_V2,
199 HDMI_AUDIO_CODING_TYPE_EXT_MPEG_SURROUND,
200};
201
202struct hdmi_audio_infoframe {
203 enum hdmi_infoframe_type type;
204 unsigned char version;
205 unsigned char length;
206 unsigned char channels;
207 enum hdmi_audio_coding_type coding_type;
208 enum hdmi_audio_sample_size sample_size;
209 enum hdmi_audio_sample_frequency sample_frequency;
210 enum hdmi_audio_coding_type_ext coding_type_ext;
211 unsigned char channel_allocation;
212 unsigned char level_shift_value;
213 bool downmix_inhibit;
214
215};
216
217int hdmi_audio_infoframe_init(struct hdmi_audio_infoframe *frame);
218ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame,
219 void *buffer, size_t size);
220
221struct hdmi_vendor_infoframe {
222 enum hdmi_infoframe_type type;
223 unsigned char version;
224 unsigned char length;
225 u8 data[27];
226};
227
228ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame,
229 void *buffer, size_t size);
230
231#endif /* _DRM_HDMI_H */
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 50ae7d0c279e..e8d65718560b 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -47,6 +47,7 @@ int con_set_cmap(unsigned char __user *cmap);
47int con_get_cmap(unsigned char __user *cmap); 47int con_get_cmap(unsigned char __user *cmap);
48void scrollback(struct vc_data *vc, int lines); 48void scrollback(struct vc_data *vc, int lines);
49void scrollfront(struct vc_data *vc, int lines); 49void scrollfront(struct vc_data *vc, int lines);
50void clear_buffer_attributes(struct vc_data *vc);
50void update_region(struct vc_data *vc, unsigned long start, int count); 51void update_region(struct vc_data *vc, unsigned long start, int count);
51void redraw_screen(struct vc_data *vc, int is_switch); 52void redraw_screen(struct vc_data *vc, int is_switch);
52#define update_screen(x) redraw_screen(x, 0) 53#define update_screen(x) redraw_screen(x, 0)
@@ -130,6 +131,8 @@ void vt_event_post(unsigned int event, unsigned int old, unsigned int new);
130int vt_waitactive(int n); 131int vt_waitactive(int n);
131void change_console(struct vc_data *new_vc); 132void change_console(struct vc_data *new_vc);
132void reset_vc(struct vc_data *vc); 133void reset_vc(struct vc_data *vc);
134extern int do_unbind_con_driver(const struct consw *csw, int first, int last,
135 int deflt);
133extern int unbind_con_driver(const struct consw *csw, int first, int last, 136extern int unbind_con_driver(const struct consw *csw, int first, int last,
134 int deflt); 137 int deflt);
135int vty_init(const struct file_operations *console_fops); 138int vty_init(const struct file_operations *console_fops);
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index c4d2e9c74002..07d59419fe6b 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -308,6 +308,8 @@ typedef struct drm_i915_irq_wait {
308#define I915_PARAM_RSVD_FOR_FUTURE_USE 22 308#define I915_PARAM_RSVD_FOR_FUTURE_USE 22
309#define I915_PARAM_HAS_SECURE_BATCHES 23 309#define I915_PARAM_HAS_SECURE_BATCHES 23
310#define I915_PARAM_HAS_PINNED_BATCHES 24 310#define I915_PARAM_HAS_PINNED_BATCHES 24
311#define I915_PARAM_HAS_EXEC_NO_RELOC 25
312#define I915_PARAM_HAS_EXEC_HANDLE_LUT 26
311 313
312typedef struct drm_i915_getparam { 314typedef struct drm_i915_getparam {
313 int param; 315 int param;
@@ -628,7 +630,11 @@ struct drm_i915_gem_exec_object2 {
628 __u64 offset; 630 __u64 offset;
629 631
630#define EXEC_OBJECT_NEEDS_FENCE (1<<0) 632#define EXEC_OBJECT_NEEDS_FENCE (1<<0)
633#define EXEC_OBJECT_NEEDS_GTT (1<<1)
634#define EXEC_OBJECT_WRITE (1<<2)
635#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_WRITE<<1)
631 __u64 flags; 636 __u64 flags;
637
632 __u64 rsvd1; 638 __u64 rsvd1;
633 __u64 rsvd2; 639 __u64 rsvd2;
634}; 640};
@@ -687,6 +693,20 @@ struct drm_i915_gem_execbuffer2 {
687 */ 693 */
688#define I915_EXEC_IS_PINNED (1<<10) 694#define I915_EXEC_IS_PINNED (1<<10)
689 695
696/** Provide a hint to the kernel that the command stream and auxilliary
697 * state buffers already holds the correct presumed addresses and so the
698 * relocation process may be skipped if no buffers need to be moved in
699 * preparation for the execbuffer.
700 */
701#define I915_EXEC_NO_RELOC (1<<11)
702
703/** Use the reloc.handle as an index into the exec object array rather
704 * than as the per-file handle.
705 */
706#define I915_EXEC_HANDLE_LUT (1<<12)
707
708#define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_HANDLE_LUT<<1)
709
690#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) 710#define I915_EXEC_CONTEXT_ID_MASK (0xffffffff)
691#define i915_execbuffer2_set_context_id(eb2, context) \ 711#define i915_execbuffer2_set_context_id(eb2, context) \
692 (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK 712 (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK
diff --git a/include/uapi/drm/omap_drm.h b/include/uapi/drm/omap_drm.h
new file mode 100644
index 000000000000..1d0b1172664e
--- /dev/null
+++ b/include/uapi/drm/omap_drm.h
@@ -0,0 +1,123 @@
1/*
2 * include/uapi/drm/omap_drm.h
3 *
4 * Copyright (C) 2011 Texas Instruments
5 * Author: Rob Clark <rob@ti.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef __OMAP_DRM_H__
21#define __OMAP_DRM_H__
22
23#include <drm/drm.h>
24
25/* Please note that modifications to all structs defined here are
26 * subject to backwards-compatibility constraints.
27 */
28
29#define OMAP_PARAM_CHIPSET_ID 1 /* ie. 0x3430, 0x4430, etc */
30
31struct drm_omap_param {
32 uint64_t param; /* in */
33 uint64_t value; /* in (set_param), out (get_param) */
34};
35
36#define OMAP_BO_SCANOUT 0x00000001 /* scanout capable (phys contiguous) */
37#define OMAP_BO_CACHE_MASK 0x00000006 /* cache type mask, see cache modes */
38#define OMAP_BO_TILED_MASK 0x00000f00 /* tiled mapping mask, see tiled modes */
39
40/* cache modes */
41#define OMAP_BO_CACHED 0x00000000 /* default */
42#define OMAP_BO_WC 0x00000002 /* write-combine */
43#define OMAP_BO_UNCACHED 0x00000004 /* strongly-ordered (uncached) */
44
45/* tiled modes */
46#define OMAP_BO_TILED_8 0x00000100
47#define OMAP_BO_TILED_16 0x00000200
48#define OMAP_BO_TILED_32 0x00000300
49#define OMAP_BO_TILED (OMAP_BO_TILED_8 | OMAP_BO_TILED_16 | OMAP_BO_TILED_32)
50
51union omap_gem_size {
52 uint32_t bytes; /* (for non-tiled formats) */
53 struct {
54 uint16_t width;
55 uint16_t height;
56 } tiled; /* (for tiled formats) */
57};
58
59struct drm_omap_gem_new {
60 union omap_gem_size size; /* in */
61 uint32_t flags; /* in */
62 uint32_t handle; /* out */
63 uint32_t __pad;
64};
65
66/* mask of operations: */
67enum omap_gem_op {
68 OMAP_GEM_READ = 0x01,
69 OMAP_GEM_WRITE = 0x02,
70};
71
72struct drm_omap_gem_cpu_prep {
73 uint32_t handle; /* buffer handle (in) */
74 uint32_t op; /* mask of omap_gem_op (in) */
75};
76
77struct drm_omap_gem_cpu_fini {
78 uint32_t handle; /* buffer handle (in) */
79 uint32_t op; /* mask of omap_gem_op (in) */
80 /* TODO maybe here we pass down info about what regions are touched
81 * by sw so we can be clever about cache ops? For now a placeholder,
82 * set to zero and we just do full buffer flush..
83 */
84 uint32_t nregions;
85 uint32_t __pad;
86};
87
88struct drm_omap_gem_info {
89 uint32_t handle; /* buffer handle (in) */
90 uint32_t pad;
91 uint64_t offset; /* mmap offset (out) */
92 /* note: in case of tiled buffers, the user virtual size can be
93 * different from the physical size (ie. how many pages are needed
94 * to back the object) which is returned in DRM_IOCTL_GEM_OPEN..
95 * This size here is the one that should be used if you want to
96 * mmap() the buffer:
97 */
98 uint32_t size; /* virtual size for mmap'ing (out) */
99 uint32_t __pad;
100};
101
102#define DRM_OMAP_GET_PARAM 0x00
103#define DRM_OMAP_SET_PARAM 0x01
104/* placeholder for plugin-api
105#define DRM_OMAP_GET_BASE 0x02
106*/
107#define DRM_OMAP_GEM_NEW 0x03
108#define DRM_OMAP_GEM_CPU_PREP 0x04
109#define DRM_OMAP_GEM_CPU_FINI 0x05
110#define DRM_OMAP_GEM_INFO 0x06
111#define DRM_OMAP_NUM_IOCTLS 0x07
112
113#define DRM_IOCTL_OMAP_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GET_PARAM, struct drm_omap_param)
114#define DRM_IOCTL_OMAP_SET_PARAM DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_SET_PARAM, struct drm_omap_param)
115/* placeholder for plugin-api
116#define DRM_IOCTL_OMAP_GET_BASE DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GET_BASE, struct drm_omap_get_base)
117*/
118#define DRM_IOCTL_OMAP_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GEM_NEW, struct drm_omap_gem_new)
119#define DRM_IOCTL_OMAP_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_GEM_CPU_PREP, struct drm_omap_gem_cpu_prep)
120#define DRM_IOCTL_OMAP_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_OMAP_GEM_CPU_FINI, struct drm_omap_gem_cpu_fini)
121#define DRM_IOCTL_OMAP_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_OMAP_GEM_INFO, struct drm_omap_gem_info)
122
123#endif /* __OMAP_DRM_H__ */
diff --git a/include/video/display_timing.h b/include/video/display_timing.h
new file mode 100644
index 000000000000..71e9a383a981
--- /dev/null
+++ b/include/video/display_timing.h
@@ -0,0 +1,124 @@
1/*
2 * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>
3 *
4 * description of display timings
5 *
6 * This file is released under the GPLv2
7 */
8
9#ifndef __LINUX_DISPLAY_TIMING_H
10#define __LINUX_DISPLAY_TIMING_H
11
12#include <linux/bitops.h>
13#include <linux/types.h>
14
15/* VESA display monitor timing parameters */
16#define VESA_DMT_HSYNC_LOW BIT(0)
17#define VESA_DMT_HSYNC_HIGH BIT(1)
18#define VESA_DMT_VSYNC_LOW BIT(2)
19#define VESA_DMT_VSYNC_HIGH BIT(3)
20
21/* display specific flags */
22#define DISPLAY_FLAGS_DE_LOW BIT(0) /* data enable flag */
23#define DISPLAY_FLAGS_DE_HIGH BIT(1)
24#define DISPLAY_FLAGS_PIXDATA_POSEDGE BIT(2) /* drive data on pos. edge */
25#define DISPLAY_FLAGS_PIXDATA_NEGEDGE BIT(3) /* drive data on neg. edge */
26#define DISPLAY_FLAGS_INTERLACED BIT(4)
27#define DISPLAY_FLAGS_DOUBLESCAN BIT(5)
28
29/*
30 * A single signal can be specified via a range of minimal and maximal values
31 * with a typical value, that lies somewhere inbetween.
32 */
33struct timing_entry {
34 u32 min;
35 u32 typ;
36 u32 max;
37};
38
39enum timing_entry_index {
40 TE_MIN = 0,
41 TE_TYP = 1,
42 TE_MAX = 2,
43};
44
45/*
46 * Single "mode" entry. This describes one set of signal timings a display can
47 * have in one setting. This struct can later be converted to struct videomode
48 * (see include/video/videomode.h). As each timing_entry can be defined as a
49 * range, one struct display_timing may become multiple struct videomodes.
50 *
51 * Example: hsync active high, vsync active low
52 *
53 * Active Video
54 * Video ______________________XXXXXXXXXXXXXXXXXXXXXX_____________________
55 * |<- sync ->|<- back ->|<----- active ----->|<- front ->|<- sync..
56 * | | porch | | porch |
57 *
58 * HSync _|¯¯¯¯¯¯¯¯¯¯|___________________________________________|¯¯¯¯¯¯¯¯¯
59 *
60 * VSync ¯|__________|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|_________
61 */
62struct display_timing {
63 struct timing_entry pixelclock;
64
65 struct timing_entry hactive; /* hor. active video */
66 struct timing_entry hfront_porch; /* hor. front porch */
67 struct timing_entry hback_porch; /* hor. back porch */
68 struct timing_entry hsync_len; /* hor. sync len */
69
70 struct timing_entry vactive; /* ver. active video */
71 struct timing_entry vfront_porch; /* ver. front porch */
72 struct timing_entry vback_porch; /* ver. back porch */
73 struct timing_entry vsync_len; /* ver. sync len */
74
75 unsigned int dmt_flags; /* VESA DMT flags */
76 unsigned int data_flags; /* video data flags */
77};
78
79/*
80 * This describes all timing settings a display provides.
81 * The native_mode is the default setting for this display.
82 * Drivers that can handle multiple videomodes should work with this struct and
83 * convert each entry to the desired end result.
84 */
85struct display_timings {
86 unsigned int num_timings;
87 unsigned int native_mode;
88
89 struct display_timing **timings;
90};
91
92/* get value specified by index from struct timing_entry */
93static inline u32 display_timing_get_value(const struct timing_entry *te,
94 enum timing_entry_index index)
95{
96 switch (index) {
97 case TE_MIN:
98 return te->min;
99 break;
100 case TE_TYP:
101 return te->typ;
102 break;
103 case TE_MAX:
104 return te->max;
105 break;
106 default:
107 return te->typ;
108 }
109}
110
111/* get one entry from struct display_timings */
112static inline struct display_timing *display_timings_get(const struct
113 display_timings *disp,
114 unsigned int index)
115{
116 if (disp->num_timings > index)
117 return disp->timings[index];
118 else
119 return NULL;
120}
121
122void display_timings_release(struct display_timings *disp);
123
124#endif
diff --git a/include/video/of_display_timing.h b/include/video/of_display_timing.h
new file mode 100644
index 000000000000..8016eb727cf3
--- /dev/null
+++ b/include/video/of_display_timing.h
@@ -0,0 +1,20 @@
1/*
2 * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>
3 *
4 * display timings of helpers
5 *
6 * This file is released under the GPLv2
7 */
8
9#ifndef __LINUX_OF_DISPLAY_TIMING_H
10#define __LINUX_OF_DISPLAY_TIMING_H
11
12struct device_node;
13struct display_timings;
14
15#define OF_USE_NATIVE_MODE -1
16
17struct display_timings *of_get_display_timings(struct device_node *np);
18int of_display_timings_exist(struct device_node *np);
19
20#endif
diff --git a/include/video/of_videomode.h b/include/video/of_videomode.h
new file mode 100644
index 000000000000..a07efcc51424
--- /dev/null
+++ b/include/video/of_videomode.h
@@ -0,0 +1,18 @@
1/*
2 * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>
3 *
4 * videomode of-helpers
5 *
6 * This file is released under the GPLv2
7 */
8
9#ifndef __LINUX_OF_VIDEOMODE_H
10#define __LINUX_OF_VIDEOMODE_H
11
12struct device_node;
13struct videomode;
14
15int of_get_videomode(struct device_node *np, struct videomode *vm,
16 int index);
17
18#endif /* __LINUX_OF_VIDEOMODE_H */
diff --git a/include/video/videomode.h b/include/video/videomode.h
new file mode 100644
index 000000000000..a42156234dd4
--- /dev/null
+++ b/include/video/videomode.h
@@ -0,0 +1,48 @@
1/*
2 * Copyright 2012 Steffen Trumtrar <s.trumtrar@pengutronix.de>
3 *
4 * generic videomode description
5 *
6 * This file is released under the GPLv2
7 */
8
9#ifndef __LINUX_VIDEOMODE_H
10#define __LINUX_VIDEOMODE_H
11
12#include <linux/types.h>
13#include <video/display_timing.h>
14
15/*
16 * Subsystem independent description of a videomode.
17 * Can be generated from struct display_timing.
18 */
19struct videomode {
20 unsigned long pixelclock; /* pixelclock in Hz */
21
22 u32 hactive;
23 u32 hfront_porch;
24 u32 hback_porch;
25 u32 hsync_len;
26
27 u32 vactive;
28 u32 vfront_porch;
29 u32 vback_porch;
30 u32 vsync_len;
31
32 unsigned int dmt_flags; /* VESA DMT flags */
33 unsigned int data_flags; /* video data flags */
34};
35
36/**
37 * videomode_from_timing - convert display timing to videomode
38 * @disp: structure with all possible timing entries
39 * @vm: return value
40 * @index: index into the list of display timings in devicetree
41 *
42 * DESCRIPTION:
43 * This function converts a struct display_timing to a struct videomode.
44 */
45int videomode_from_timing(const struct display_timings *disp,
46 struct videomode *vm, unsigned int index);
47
48#endif