aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-03-21 16:48:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-03-21 16:48:00 -0400
commit266c73b77706f2d05b4a3e70a5bb702ed35431d6 (patch)
tree381461b90a8bd10c0c36b0cdbb2e6e4bbf6c5e87 /include/drm
parent2c856e14dad8cb1b085ae1f30c5e125c6d46019b (diff)
parent568d7c764ae01f3706085ac8f0d8a8ac7e826bd7 (diff)
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm updates from Dave Airlie: "This is the main drm pull request for 4.6 kernel. Overall the coolest thing here for me is the nouveau maxwell signed firmware support from NVidia, it's taken a long while to extract this from them. I also wish the ARM vendors just designed one set of display IP, ARM display block proliferation is definitely increasing. Core: - drm_event cleanups - Internal API cleanup making mode_fixup optional. - Apple GMUX vga switcheroo support. - DP AUX testing interface Panel: - Refactoring of DSI core for use over more transports. New driver: - ARM hdlcd driver i915: - FBC/PSR (framebuffer compression, panel self refresh) enabled by default. - Ongoing atomic display support work - Ongoing runtime PM work - Pixel clock limit checks - VBT DSI description support - GEM fixes - GuC firmware scheduler enhancements amdkfd: - Deferred probing fixes to avoid make file or link ordering. amdgpu/radeon: - ACP support for i2s audio support. - Command Submission/GPU scheduler/GPUVM optimisations - Initial GPU reset support for amdgpu vmwgfx: - Support for DX10 gen mipmaps - Pageflipping and other fixes. exynos: - Exynos5420 SoC support for FIMD - Exynos5422 SoC support for MIPI-DSI nouveau: - GM20x secure boot support - adds acceleration for Maxwell GPUs. - GM200 support - GM20B clock driver support - Power sensors work etnaviv: - Correctness fixes for GPU cache flushing - Better support for i.MX6 systems. imx-drm: - VBlank IRQ support - Fence support - OF endpoint support msm: - HDMI support for 8996 (snapdragon 820) - Adreno 430 support - Timestamp queries support virtio-gpu: - Fixes for Android support. rockchip: - Add support for Innosilicion HDMI rcar-du: - Support for 4 crtcs - R8A7795 support - RCar Gen 3 support omapdrm: - HDMI interlace output support - dma-buf import support - Refactoring to remove a lot of legacy code. tilcdc: - Rewrite of pageflipping code - dma-buf support - pinctrl support vc4: - HDMI modesetting bug fixes - Significant 3D performance improvement. fsl-dcu (FreeScale): - Lots of fixes tegra: - Two small fixes sti: - Atomic support for planes - Improved HDMI support" * 'drm-next' of git://people.freedesktop.org/~airlied/linux: (1063 commits) drm/amdgpu: release_pages requires linux/pagemap.h drm/sti: restore mode_fixup callback drm/amdgpu/gfx7: add MTYPE definition drm/amdgpu: removing BO_VAs shouldn't be interruptible drm/amd/powerplay: show uvd/vce power gate enablement for tonga. drm/amd/powerplay: show uvd/vce power gate info for fiji drm/amdgpu: use sched fence if possible drm/amdgpu: move ib.fence to job.fence drm/amdgpu: give a fence param to ib_free drm/amdgpu: include the right version of gmc header files for iceland drm/radeon: fix indentation. drm/amd/powerplay: add uvd/vce dpm enabling flag to fix the performance issue for CZ drm/amdgpu: switch back to 32bit hw fences v2 drm/amdgpu: remove amdgpu_fence_is_signaled drm/amdgpu: drop the extra fence range check v2 drm/amdgpu: signal fences directly in amdgpu_fence_process drm/amdgpu: cleanup amdgpu_fence_wait_empty v2 drm/amdgpu: keep all fences in an RCU protected array v2 drm/amdgpu: add number of hardware submissions to amdgpu_fence_driver_init_ring drm/amdgpu: RCU protected amd_sched_fence_release ...
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drmP.h30
-rw-r--r--include/drm/drm_atomic_helper.h3
-rw-r--r--include/drm/drm_crtc.h74
-rw-r--r--include/drm/drm_crtc_helper.h3
-rw-r--r--include/drm/drm_dp_aux_dev.h62
-rw-r--r--include/drm/drm_fb_helper.h6
-rw-r--r--include/drm/drm_mipi_dsi.h26
-rw-r--r--include/drm/drm_modeset_helper_vtables.h2
-rw-r--r--include/drm/drm_of.h33
-rw-r--r--include/drm/exynos_drm.h101
-rw-r--r--include/drm/i915_pciids.h6
11 files changed, 233 insertions, 113 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index d7162cf1c3e1..3c8422c69572 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -283,6 +283,7 @@ struct drm_ioctl_desc {
283struct drm_pending_event { 283struct drm_pending_event {
284 struct drm_event *event; 284 struct drm_event *event;
285 struct list_head link; 285 struct list_head link;
286 struct list_head pending_link;
286 struct drm_file *file_priv; 287 struct drm_file *file_priv;
287 pid_t pid; /* pid of requester, no guarantee it's valid by the time 288 pid_t pid; /* pid of requester, no guarantee it's valid by the time
288 we deliver the event, for tracing only */ 289 we deliver the event, for tracing only */
@@ -346,6 +347,7 @@ struct drm_file {
346 struct list_head blobs; 347 struct list_head blobs;
347 348
348 wait_queue_head_t event_wait; 349 wait_queue_head_t event_wait;
350 struct list_head pending_event_list;
349 struct list_head event_list; 351 struct list_head event_list;
350 int event_space; 352 int event_space;
351 353
@@ -919,15 +921,25 @@ extern long drm_compat_ioctl(struct file *filp,
919 unsigned int cmd, unsigned long arg); 921 unsigned int cmd, unsigned long arg);
920extern bool drm_ioctl_flags(unsigned int nr, unsigned int *flags); 922extern bool drm_ioctl_flags(unsigned int nr, unsigned int *flags);
921 923
922 /* Device support (drm_fops.h) */ 924/* File Operations (drm_fops.c) */
923extern int drm_open(struct inode *inode, struct file *filp); 925int drm_open(struct inode *inode, struct file *filp);
924extern ssize_t drm_read(struct file *filp, char __user *buffer, 926ssize_t drm_read(struct file *filp, char __user *buffer,
925 size_t count, loff_t *offset); 927 size_t count, loff_t *offset);
926extern int drm_release(struct inode *inode, struct file *filp); 928int drm_release(struct inode *inode, struct file *filp);
927extern int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv); 929int drm_new_set_master(struct drm_device *dev, struct drm_file *fpriv);
928 930unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
929 /* Mapping support (drm_vm.h) */ 931int drm_event_reserve_init_locked(struct drm_device *dev,
930extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait); 932 struct drm_file *file_priv,
933 struct drm_pending_event *p,
934 struct drm_event *e);
935int drm_event_reserve_init(struct drm_device *dev,
936 struct drm_file *file_priv,
937 struct drm_pending_event *p,
938 struct drm_event *e);
939void drm_event_cancel_free(struct drm_device *dev,
940 struct drm_pending_event *p);
941void drm_send_event_locked(struct drm_device *dev, struct drm_pending_event *e);
942void drm_send_event(struct drm_device *dev, struct drm_pending_event *e);
931 943
932/* Misc. IOCTL support (drm_ioctl.c) */ 944/* Misc. IOCTL support (drm_ioctl.c) */
933int drm_noop(struct drm_device *dev, void *data, 945int drm_noop(struct drm_device *dev, void *data,
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
index fe5efada9d68..9054598c9a7a 100644
--- a/include/drm/drm_atomic_helper.h
+++ b/include/drm/drm_atomic_helper.h
@@ -146,6 +146,9 @@ __drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
146 struct drm_connector_state *state); 146 struct drm_connector_state *state);
147void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector, 147void drm_atomic_helper_connector_destroy_state(struct drm_connector *connector,
148 struct drm_connector_state *state); 148 struct drm_connector_state *state);
149void drm_atomic_helper_legacy_gamma_set(struct drm_crtc *crtc,
150 u16 *red, u16 *green, u16 *blue,
151 uint32_t start, uint32_t size);
149 152
150/** 153/**
151 * drm_atomic_crtc_for_each_plane - iterate over planes currently attached to CRTC 154 * drm_atomic_crtc_for_each_plane - iterate over planes currently attached to CRTC
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index c5b4b81a831b..e0170bf80bb0 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -305,12 +305,20 @@ struct drm_plane_helper_funcs;
305 * @mode_changed: crtc_state->mode or crtc_state->enable has been changed 305 * @mode_changed: crtc_state->mode or crtc_state->enable has been changed
306 * @active_changed: crtc_state->active has been toggled. 306 * @active_changed: crtc_state->active has been toggled.
307 * @connectors_changed: connectors to this crtc have been updated 307 * @connectors_changed: connectors to this crtc have been updated
308 * @color_mgmt_changed: color management properties have changed (degamma or
309 * gamma LUT or CSC matrix)
308 * @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes 310 * @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes
309 * @connector_mask: bitmask of (1 << drm_connector_index(connector)) of attached connectors 311 * @connector_mask: bitmask of (1 << drm_connector_index(connector)) of attached connectors
312 * @encoder_mask: bitmask of (1 << drm_encoder_index(encoder)) of attached encoders
310 * @last_vblank_count: for helpers and drivers to capture the vblank of the 313 * @last_vblank_count: for helpers and drivers to capture the vblank of the
311 * update to ensure framebuffer cleanup isn't done too early 314 * update to ensure framebuffer cleanup isn't done too early
312 * @adjusted_mode: for use by helpers and drivers to compute adjusted mode timings 315 * @adjusted_mode: for use by helpers and drivers to compute adjusted mode timings
313 * @mode: current mode timings 316 * @mode: current mode timings
317 * @degamma_lut: Lookup table for converting framebuffer pixel data
318 * before apply the conversion matrix
319 * @ctm: Transformation matrix
320 * @gamma_lut: Lookup table for converting pixel data after the
321 * conversion matrix
314 * @event: optional pointer to a DRM event to signal upon completion of the 322 * @event: optional pointer to a DRM event to signal upon completion of the
315 * state update 323 * state update
316 * @state: backpointer to global drm_atomic_state 324 * @state: backpointer to global drm_atomic_state
@@ -332,6 +340,7 @@ struct drm_crtc_state {
332 bool mode_changed : 1; 340 bool mode_changed : 1;
333 bool active_changed : 1; 341 bool active_changed : 1;
334 bool connectors_changed : 1; 342 bool connectors_changed : 1;
343 bool color_mgmt_changed : 1;
335 344
336 /* attached planes bitmask: 345 /* attached planes bitmask:
337 * WARNING: transitional helpers do not maintain plane_mask so 346 * WARNING: transitional helpers do not maintain plane_mask so
@@ -341,6 +350,7 @@ struct drm_crtc_state {
341 u32 plane_mask; 350 u32 plane_mask;
342 351
343 u32 connector_mask; 352 u32 connector_mask;
353 u32 encoder_mask;
344 354
345 /* last_vblank_count: for vblank waits before cleanup */ 355 /* last_vblank_count: for vblank waits before cleanup */
346 u32 last_vblank_count; 356 u32 last_vblank_count;
@@ -353,6 +363,11 @@ struct drm_crtc_state {
353 /* blob property to expose current mode to atomic userspace */ 363 /* blob property to expose current mode to atomic userspace */
354 struct drm_property_blob *mode_blob; 364 struct drm_property_blob *mode_blob;
355 365
366 /* blob property to expose color management to userspace */
367 struct drm_property_blob *degamma_lut;
368 struct drm_property_blob *ctm;
369 struct drm_property_blob *gamma_lut;
370
356 struct drm_pending_vblank_event *event; 371 struct drm_pending_vblank_event *event;
357 372
358 struct drm_atomic_state *state; 373 struct drm_atomic_state *state;
@@ -755,7 +770,7 @@ struct drm_crtc {
755 int x, y; 770 int x, y;
756 const struct drm_crtc_funcs *funcs; 771 const struct drm_crtc_funcs *funcs;
757 772
758 /* CRTC gamma size for reporting to userspace */ 773 /* Legacy FB CRTC gamma size for reporting to userspace */
759 uint32_t gamma_size; 774 uint32_t gamma_size;
760 uint16_t *gamma_store; 775 uint16_t *gamma_store;
761 776
@@ -1582,6 +1597,8 @@ struct drm_bridge_funcs {
1582 * 1597 *
1583 * The bridge can assume that the display pipe (i.e. clocks and timing 1598 * The bridge can assume that the display pipe (i.e. clocks and timing
1584 * signals) feeding it is still running when this callback is called. 1599 * signals) feeding it is still running when this callback is called.
1600 *
1601 * The disable callback is optional.
1585 */ 1602 */
1586 void (*disable)(struct drm_bridge *bridge); 1603 void (*disable)(struct drm_bridge *bridge);
1587 1604
@@ -1598,6 +1615,8 @@ struct drm_bridge_funcs {
1598 * The bridge must assume that the display pipe (i.e. clocks and timing 1615 * The bridge must assume that the display pipe (i.e. clocks and timing
1599 * singals) feeding it is no longer running when this callback is 1616 * singals) feeding it is no longer running when this callback is
1600 * called. 1617 * called.
1618 *
1619 * The post_disable callback is optional.
1601 */ 1620 */
1602 void (*post_disable)(struct drm_bridge *bridge); 1621 void (*post_disable)(struct drm_bridge *bridge);
1603 1622
@@ -1626,6 +1645,8 @@ struct drm_bridge_funcs {
1626 * will not yet be running when this callback is called. The bridge must 1645 * will not yet be running when this callback is called. The bridge must
1627 * not enable the display link feeding the next bridge in the chain (if 1646 * not enable the display link feeding the next bridge in the chain (if
1628 * there is one) when this callback is called. 1647 * there is one) when this callback is called.
1648 *
1649 * The pre_enable callback is optional.
1629 */ 1650 */
1630 void (*pre_enable)(struct drm_bridge *bridge); 1651 void (*pre_enable)(struct drm_bridge *bridge);
1631 1652
@@ -1643,6 +1664,8 @@ struct drm_bridge_funcs {
1643 * signals) feeding it is running when this callback is called. This 1664 * signals) feeding it is running when this callback is called. This
1644 * callback must enable the display link feeding the next bridge in the 1665 * callback must enable the display link feeding the next bridge in the
1645 * chain if there is one. 1666 * chain if there is one.
1667 *
1668 * The enable callback is optional.
1646 */ 1669 */
1647 void (*enable)(struct drm_bridge *bridge); 1670 void (*enable)(struct drm_bridge *bridge);
1648}; 1671};
@@ -1675,6 +1698,7 @@ struct drm_bridge {
1675 * @dev: parent DRM device 1698 * @dev: parent DRM device
1676 * @allow_modeset: allow full modeset 1699 * @allow_modeset: allow full modeset
1677 * @legacy_cursor_update: hint to enforce legacy cursor IOCTL semantics 1700 * @legacy_cursor_update: hint to enforce legacy cursor IOCTL semantics
1701 * @legacy_set_config: Disable conflicting encoders instead of failing with -EINVAL.
1678 * @planes: pointer to array of plane pointers 1702 * @planes: pointer to array of plane pointers
1679 * @plane_states: pointer to array of plane states pointers 1703 * @plane_states: pointer to array of plane states pointers
1680 * @crtcs: pointer to array of CRTC pointers 1704 * @crtcs: pointer to array of CRTC pointers
@@ -1688,6 +1712,7 @@ struct drm_atomic_state {
1688 struct drm_device *dev; 1712 struct drm_device *dev;
1689 bool allow_modeset : 1; 1713 bool allow_modeset : 1;
1690 bool legacy_cursor_update : 1; 1714 bool legacy_cursor_update : 1;
1715 bool legacy_set_config : 1;
1691 struct drm_plane **planes; 1716 struct drm_plane **planes;
1692 struct drm_plane_state **plane_states; 1717 struct drm_plane_state **plane_states;
1693 struct drm_crtc **crtcs; 1718 struct drm_crtc **crtcs;
@@ -2024,6 +2049,15 @@ struct drm_mode_config_funcs {
2024 * @property_blob_list: list of all the blob property objects 2049 * @property_blob_list: list of all the blob property objects
2025 * @blob_lock: mutex for blob property allocation and management 2050 * @blob_lock: mutex for blob property allocation and management
2026 * @*_property: core property tracking 2051 * @*_property: core property tracking
2052 * @degamma_lut_property: LUT used to convert the framebuffer's colors to linear
2053 * gamma
2054 * @degamma_lut_size_property: size of the degamma LUT as supported by the
2055 * driver (read-only)
2056 * @ctm_property: Matrix used to convert colors after the lookup in the
2057 * degamma LUT
2058 * @gamma_lut_property: LUT used to convert the colors, after the CSC matrix, to
2059 * the gamma space of the connected screen (read-only)
2060 * @gamma_lut_size_property: size of the gamma LUT as supported by the driver
2027 * @preferred_depth: preferred RBG pixel depth, used by fb helpers 2061 * @preferred_depth: preferred RBG pixel depth, used by fb helpers
2028 * @prefer_shadow: hint to userspace to prefer shadow-fb rendering 2062 * @prefer_shadow: hint to userspace to prefer shadow-fb rendering
2029 * @async_page_flip: does this device support async flips on the primary plane? 2063 * @async_page_flip: does this device support async flips on the primary plane?
@@ -2126,6 +2160,13 @@ struct drm_mode_config {
2126 struct drm_property *aspect_ratio_property; 2160 struct drm_property *aspect_ratio_property;
2127 struct drm_property *dirty_info_property; 2161 struct drm_property *dirty_info_property;
2128 2162
2163 /* Optional color correction properties */
2164 struct drm_property *degamma_lut_property;
2165 struct drm_property *degamma_lut_size_property;
2166 struct drm_property *ctm_property;
2167 struct drm_property *gamma_lut_property;
2168 struct drm_property *gamma_lut_size_property;
2169
2129 /* properties for virtual machine layout */ 2170 /* properties for virtual machine layout */
2130 struct drm_property *suggested_x_property; 2171 struct drm_property *suggested_x_property;
2131 struct drm_property *suggested_y_property; 2172 struct drm_property *suggested_y_property;
@@ -2155,6 +2196,17 @@ struct drm_mode_config {
2155 list_for_each_entry((plane), &(dev)->mode_config.plane_list, head) \ 2196 list_for_each_entry((plane), &(dev)->mode_config.plane_list, head) \
2156 for_each_if ((plane_mask) & (1 << drm_plane_index(plane))) 2197 for_each_if ((plane_mask) & (1 << drm_plane_index(plane)))
2157 2198
2199/**
2200 * drm_for_each_encoder_mask - iterate over encoders specified by bitmask
2201 * @encoder: the loop cursor
2202 * @dev: the DRM device
2203 * @encoder_mask: bitmask of encoder indices
2204 *
2205 * Iterate over all encoders specified by bitmask.
2206 */
2207#define drm_for_each_encoder_mask(encoder, dev, encoder_mask) \
2208 list_for_each_entry((encoder), &(dev)->mode_config.encoder_list, head) \
2209 for_each_if ((encoder_mask) & (1 << drm_encoder_index(encoder)))
2158 2210
2159#define obj_to_crtc(x) container_of(x, struct drm_crtc, base) 2211#define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
2160#define obj_to_connector(x) container_of(x, struct drm_connector, base) 2212#define obj_to_connector(x) container_of(x, struct drm_connector, base)
@@ -2231,6 +2283,7 @@ int drm_encoder_init(struct drm_device *dev,
2231 struct drm_encoder *encoder, 2283 struct drm_encoder *encoder,
2232 const struct drm_encoder_funcs *funcs, 2284 const struct drm_encoder_funcs *funcs,
2233 int encoder_type, const char *name, ...); 2285 int encoder_type, const char *name, ...);
2286extern unsigned int drm_encoder_index(struct drm_encoder *encoder);
2234 2287
2235/** 2288/**
2236 * drm_encoder_crtc_ok - can a given crtc drive a given encoder? 2289 * drm_encoder_crtc_ok - can a given crtc drive a given encoder?
@@ -2288,6 +2341,8 @@ extern void drm_property_destroy_user_blobs(struct drm_device *dev,
2288extern bool drm_probe_ddc(struct i2c_adapter *adapter); 2341extern bool drm_probe_ddc(struct i2c_adapter *adapter);
2289extern struct edid *drm_get_edid(struct drm_connector *connector, 2342extern struct edid *drm_get_edid(struct drm_connector *connector,
2290 struct i2c_adapter *adapter); 2343 struct i2c_adapter *adapter);
2344extern struct edid *drm_get_edid_switcheroo(struct drm_connector *connector,
2345 struct i2c_adapter *adapter);
2291extern struct edid *drm_edid_duplicate(const struct edid *edid); 2346extern struct edid *drm_edid_duplicate(const struct edid *edid);
2292extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid); 2347extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
2293extern void drm_mode_config_init(struct drm_device *dev); 2348extern void drm_mode_config_init(struct drm_device *dev);
@@ -2488,6 +2543,8 @@ extern int drm_format_num_planes(uint32_t format);
2488extern int drm_format_plane_cpp(uint32_t format, int plane); 2543extern int drm_format_plane_cpp(uint32_t format, int plane);
2489extern int drm_format_horz_chroma_subsampling(uint32_t format); 2544extern int drm_format_horz_chroma_subsampling(uint32_t format);
2490extern int drm_format_vert_chroma_subsampling(uint32_t format); 2545extern int drm_format_vert_chroma_subsampling(uint32_t format);
2546extern int drm_format_plane_width(int width, uint32_t format, int plane);
2547extern int drm_format_plane_height(int height, uint32_t format, int plane);
2491extern const char *drm_get_format_name(uint32_t format); 2548extern const char *drm_get_format_name(uint32_t format);
2492extern struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, 2549extern struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev,
2493 unsigned int supported_rotations); 2550 unsigned int supported_rotations);
@@ -2536,6 +2593,21 @@ static inline struct drm_property *drm_property_find(struct drm_device *dev,
2536 return mo ? obj_to_property(mo) : NULL; 2593 return mo ? obj_to_property(mo) : NULL;
2537} 2594}
2538 2595
2596/*
2597 * Extract a degamma/gamma LUT value provided by user and round it to the
2598 * precision supported by the hardware.
2599 */
2600static inline uint32_t drm_color_lut_extract(uint32_t user_input,
2601 uint32_t bit_precision)
2602{
2603 uint32_t val = user_input + (1 << (16 - bit_precision - 1));
2604 uint32_t max = 0xffff >> (16 - bit_precision);
2605
2606 val >>= 16 - bit_precision;
2607
2608 return clamp_val(val, 0, max);
2609}
2610
2539/* Plane list iterator for legacy (overlay only) planes. */ 2611/* Plane list iterator for legacy (overlay only) planes. */
2540#define drm_for_each_legacy_plane(plane, dev) \ 2612#define drm_for_each_legacy_plane(plane, dev) \
2541 list_for_each_entry(plane, &(dev)->mode_config.plane_list, head) \ 2613 list_for_each_entry(plane, &(dev)->mode_config.plane_list, head) \
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
index 4b37afa2b73b..97fa894d4ee2 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
@@ -48,6 +48,9 @@ extern bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
48 struct drm_display_mode *mode, 48 struct drm_display_mode *mode,
49 int x, int y, 49 int x, int y,
50 struct drm_framebuffer *old_fb); 50 struct drm_framebuffer *old_fb);
51extern void drm_helper_crtc_enable_color_mgmt(struct drm_crtc *crtc,
52 int degamma_lut_size,
53 int gamma_lut_size);
51extern bool drm_helper_crtc_in_use(struct drm_crtc *crtc); 54extern bool drm_helper_crtc_in_use(struct drm_crtc *crtc);
52extern bool drm_helper_encoder_in_use(struct drm_encoder *encoder); 55extern bool drm_helper_encoder_in_use(struct drm_encoder *encoder);
53 56
diff --git a/include/drm/drm_dp_aux_dev.h b/include/drm/drm_dp_aux_dev.h
new file mode 100644
index 000000000000..1b76d990d8ab
--- /dev/null
+++ b/include/drm/drm_dp_aux_dev.h
@@ -0,0 +1,62 @@
1/*
2 * Copyright © 2015 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
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 *
23 * Authors:
24 * Rafael Antognolli <rafael.antognolli@intel.com>
25 *
26 */
27
28#ifndef DRM_DP_AUX_DEV
29#define DRM_DP_AUX_DEV
30
31#include <drm/drm_dp_helper.h>
32
33#ifdef CONFIG_DRM_DP_AUX_CHARDEV
34
35int drm_dp_aux_dev_init(void);
36void drm_dp_aux_dev_exit(void);
37int drm_dp_aux_register_devnode(struct drm_dp_aux *aux);
38void drm_dp_aux_unregister_devnode(struct drm_dp_aux *aux);
39
40#else
41
42static inline int drm_dp_aux_dev_init(void)
43{
44 return 0;
45}
46
47static inline void drm_dp_aux_dev_exit(void)
48{
49}
50
51static inline int drm_dp_aux_register_devnode(struct drm_dp_aux *aux)
52{
53 return 0;
54}
55
56static inline void drm_dp_aux_unregister_devnode(struct drm_dp_aux *aux)
57{
58}
59
60#endif
61
62#endif
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index d8a40dff0d1d..062723bdcabe 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -219,6 +219,7 @@ struct drm_fb_helper {
219}; 219};
220 220
221#ifdef CONFIG_DRM_FBDEV_EMULATION 221#ifdef CONFIG_DRM_FBDEV_EMULATION
222int drm_fb_helper_modinit(void);
222void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper, 223void drm_fb_helper_prepare(struct drm_device *dev, struct drm_fb_helper *helper,
223 const struct drm_fb_helper_funcs *funcs); 224 const struct drm_fb_helper_funcs *funcs);
224int drm_fb_helper_init(struct drm_device *dev, 225int drm_fb_helper_init(struct drm_device *dev,
@@ -283,6 +284,11 @@ int drm_fb_helper_add_one_connector(struct drm_fb_helper *fb_helper, struct drm_
283int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper, 284int drm_fb_helper_remove_one_connector(struct drm_fb_helper *fb_helper,
284 struct drm_connector *connector); 285 struct drm_connector *connector);
285#else 286#else
287static inline int drm_fb_helper_modinit(void)
288{
289 return 0;
290}
291
286static inline void drm_fb_helper_prepare(struct drm_device *dev, 292static inline void drm_fb_helper_prepare(struct drm_device *dev,
287 struct drm_fb_helper *helper, 293 struct drm_fb_helper *helper,
288 const struct drm_fb_helper_funcs *funcs) 294 const struct drm_fb_helper_funcs *funcs)
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
index 1b3b1f8c8cdf..7a9840f8b38e 100644
--- a/include/drm/drm_mipi_dsi.h
+++ b/include/drm/drm_mipi_dsi.h
@@ -96,14 +96,17 @@ struct mipi_dsi_host_ops {
96 * struct mipi_dsi_host - DSI host device 96 * struct mipi_dsi_host - DSI host device
97 * @dev: driver model device node for this DSI host 97 * @dev: driver model device node for this DSI host
98 * @ops: DSI host operations 98 * @ops: DSI host operations
99 * @list: list management
99 */ 100 */
100struct mipi_dsi_host { 101struct mipi_dsi_host {
101 struct device *dev; 102 struct device *dev;
102 const struct mipi_dsi_host_ops *ops; 103 const struct mipi_dsi_host_ops *ops;
104 struct list_head list;
103}; 105};
104 106
105int mipi_dsi_host_register(struct mipi_dsi_host *host); 107int mipi_dsi_host_register(struct mipi_dsi_host *host);
106void mipi_dsi_host_unregister(struct mipi_dsi_host *host); 108void mipi_dsi_host_unregister(struct mipi_dsi_host *host);
109struct mipi_dsi_host *of_find_mipi_dsi_host_by_node(struct device_node *node);
107 110
108/* DSI mode flags */ 111/* DSI mode flags */
109 112
@@ -139,10 +142,28 @@ enum mipi_dsi_pixel_format {
139 MIPI_DSI_FMT_RGB565, 142 MIPI_DSI_FMT_RGB565,
140}; 143};
141 144
145#define DSI_DEV_NAME_SIZE 20
146
147/**
148 * struct mipi_dsi_device_info - template for creating a mipi_dsi_device
149 * @type: DSI peripheral chip type
150 * @channel: DSI virtual channel assigned to peripheral
151 * @node: pointer to OF device node or NULL
152 *
153 * This is populated and passed to mipi_dsi_device_new to create a new
154 * DSI device
155 */
156struct mipi_dsi_device_info {
157 char type[DSI_DEV_NAME_SIZE];
158 u32 channel;
159 struct device_node *node;
160};
161
142/** 162/**
143 * struct mipi_dsi_device - DSI peripheral device 163 * struct mipi_dsi_device - DSI peripheral device
144 * @host: DSI host for this peripheral 164 * @host: DSI host for this peripheral
145 * @dev: driver model device node for this peripheral 165 * @dev: driver model device node for this peripheral
166 * @name: DSI peripheral chip type
146 * @channel: virtual channel assigned to the peripheral 167 * @channel: virtual channel assigned to the peripheral
147 * @format: pixel format for video mode 168 * @format: pixel format for video mode
148 * @lanes: number of active data lanes 169 * @lanes: number of active data lanes
@@ -152,6 +173,7 @@ struct mipi_dsi_device {
152 struct mipi_dsi_host *host; 173 struct mipi_dsi_host *host;
153 struct device dev; 174 struct device dev;
154 175
176 char name[DSI_DEV_NAME_SIZE];
155 unsigned int channel; 177 unsigned int channel;
156 unsigned int lanes; 178 unsigned int lanes;
157 enum mipi_dsi_pixel_format format; 179 enum mipi_dsi_pixel_format format;
@@ -188,6 +210,10 @@ static inline int mipi_dsi_pixel_format_to_bpp(enum mipi_dsi_pixel_format fmt)
188 return -EINVAL; 210 return -EINVAL;
189} 211}
190 212
213struct mipi_dsi_device *
214mipi_dsi_device_register_full(struct mipi_dsi_host *host,
215 const struct mipi_dsi_device_info *info);
216void mipi_dsi_device_unregister(struct mipi_dsi_device *dsi);
191struct mipi_dsi_device *of_find_mipi_dsi_device_by_node(struct device_node *np); 217struct mipi_dsi_device *of_find_mipi_dsi_device_by_node(struct device_node *np);
192int mipi_dsi_attach(struct mipi_dsi_device *dsi); 218int mipi_dsi_attach(struct mipi_dsi_device *dsi);
193int mipi_dsi_detach(struct mipi_dsi_device *dsi); 219int mipi_dsi_detach(struct mipi_dsi_device *dsi);
diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h
index a126a0d7aed4..b61c2d45192e 100644
--- a/include/drm/drm_modeset_helper_vtables.h
+++ b/include/drm/drm_modeset_helper_vtables.h
@@ -439,7 +439,7 @@ struct drm_encoder_helper_funcs {
439 * can be modified by this callback and does not need to match mode. 439 * can be modified by this callback and does not need to match mode.
440 * 440 *
441 * This function is used by both legacy CRTC helpers and atomic helpers. 441 * This function is used by both legacy CRTC helpers and atomic helpers.
442 * With atomic helpers it is optional. 442 * This hook is optional.
443 * 443 *
444 * NOTE: 444 * NOTE:
445 * 445 *
diff --git a/include/drm/drm_of.h b/include/drm/drm_of.h
index 8544665ee4f4..3fd87b386ed7 100644
--- a/include/drm/drm_of.h
+++ b/include/drm/drm_of.h
@@ -1,9 +1,12 @@
1#ifndef __DRM_OF_H__ 1#ifndef __DRM_OF_H__
2#define __DRM_OF_H__ 2#define __DRM_OF_H__
3 3
4#include <linux/of_graph.h>
5
4struct component_master_ops; 6struct component_master_ops;
5struct device; 7struct device;
6struct drm_device; 8struct drm_device;
9struct drm_encoder;
7struct device_node; 10struct device_node;
8 11
9#ifdef CONFIG_OF 12#ifdef CONFIG_OF
@@ -12,6 +15,9 @@ extern uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
12extern int drm_of_component_probe(struct device *dev, 15extern int drm_of_component_probe(struct device *dev,
13 int (*compare_of)(struct device *, void *), 16 int (*compare_of)(struct device *, void *),
14 const struct component_master_ops *m_ops); 17 const struct component_master_ops *m_ops);
18extern int drm_of_encoder_active_endpoint(struct device_node *node,
19 struct drm_encoder *encoder,
20 struct of_endpoint *endpoint);
15#else 21#else
16static inline uint32_t drm_of_find_possible_crtcs(struct drm_device *dev, 22static inline uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
17 struct device_node *port) 23 struct device_node *port)
@@ -26,6 +32,33 @@ drm_of_component_probe(struct device *dev,
26{ 32{
27 return -EINVAL; 33 return -EINVAL;
28} 34}
35
36static inline int drm_of_encoder_active_endpoint(struct device_node *node,
37 struct drm_encoder *encoder,
38 struct of_endpoint *endpoint)
39{
40 return -EINVAL;
41}
29#endif 42#endif
30 43
44static inline int drm_of_encoder_active_endpoint_id(struct device_node *node,
45 struct drm_encoder *encoder)
46{
47 struct of_endpoint endpoint;
48 int ret = drm_of_encoder_active_endpoint(node, encoder,
49 &endpoint);
50
51 return ret ?: endpoint.id;
52}
53
54static inline int drm_of_encoder_active_port_id(struct device_node *node,
55 struct drm_encoder *encoder)
56{
57 struct of_endpoint endpoint;
58 int ret = drm_of_encoder_active_endpoint(node, encoder,
59 &endpoint);
60
61 return ret ?: endpoint.port;
62}
63
31#endif /* __DRM_OF_H__ */ 64#endif /* __DRM_OF_H__ */
diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h
deleted file mode 100644
index cb65fa14acfc..000000000000
--- a/include/drm/exynos_drm.h
+++ /dev/null
@@ -1,101 +0,0 @@
1/* exynos_drm.h
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * Authors:
5 * Inki Dae <inki.dae@samsung.com>
6 * Joonyoung Shim <jy0922.shim@samsung.com>
7 * Seung-Woo Kim <sw0312.kim@samsung.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14#ifndef _EXYNOS_DRM_H_
15#define _EXYNOS_DRM_H_
16
17#include <uapi/drm/exynos_drm.h>
18#include <video/videomode.h>
19
20/**
21 * A structure for lcd panel information.
22 *
23 * @timing: default video mode for initializing
24 * @width_mm: physical size of lcd width.
25 * @height_mm: physical size of lcd height.
26 */
27struct exynos_drm_panel_info {
28 struct videomode vm;
29 u32 width_mm;
30 u32 height_mm;
31};
32
33/**
34 * Platform Specific Structure for DRM based FIMD.
35 *
36 * @panel: default panel info for initializing
37 * @default_win: default window layer number to be used for UI.
38 * @bpp: default bit per pixel.
39 */
40struct exynos_drm_fimd_pdata {
41 struct exynos_drm_panel_info panel;
42 u32 vidcon0;
43 u32 vidcon1;
44 unsigned int default_win;
45 unsigned int bpp;
46};
47
48/**
49 * Platform Specific Structure for DRM based HDMI.
50 *
51 * @hdmi_dev: device point to specific hdmi driver.
52 * @mixer_dev: device point to specific mixer driver.
53 *
54 * this structure is used for common hdmi driver and each device object
55 * would be used to access specific device driver(hdmi or mixer driver)
56 */
57struct exynos_drm_common_hdmi_pd {
58 struct device *hdmi_dev;
59 struct device *mixer_dev;
60};
61
62/**
63 * Platform Specific Structure for DRM based HDMI core.
64 *
65 * @is_v13: set if hdmi version 13 is.
66 * @cfg_hpd: function pointer to configure hdmi hotplug detection pin
67 * @get_hpd: function pointer to get value of hdmi hotplug detection pin
68 */
69struct exynos_drm_hdmi_pdata {
70 bool is_v13;
71 void (*cfg_hpd)(bool external);
72 int (*get_hpd)(void);
73};
74
75/**
76 * Platform Specific Structure for DRM based IPP.
77 *
78 * @inv_pclk: if set 1. invert pixel clock
79 * @inv_vsync: if set 1. invert vsync signal for wb
80 * @inv_href: if set 1. invert href signal
81 * @inv_hsync: if set 1. invert hsync signal for wb
82 */
83struct exynos_drm_ipp_pol {
84 unsigned int inv_pclk;
85 unsigned int inv_vsync;
86 unsigned int inv_href;
87 unsigned int inv_hsync;
88};
89
90/**
91 * Platform Specific Structure for DRM based FIMC.
92 *
93 * @pol: current hardware block polarity settings.
94 * @clk_rate: current hardware clock rate.
95 */
96struct exynos_drm_fimc_pdata {
97 struct exynos_drm_ipp_pol pol;
98 int clk_rate;
99};
100
101#endif /* _EXYNOS_DRM_H_ */
diff --git a/include/drm/i915_pciids.h b/include/drm/i915_pciids.h
index f97020904717..9094599a1150 100644
--- a/include/drm/i915_pciids.h
+++ b/include/drm/i915_pciids.h
@@ -277,7 +277,9 @@
277 INTEL_VGA_DEVICE(0x191D, info) /* WKS GT2 */ 277 INTEL_VGA_DEVICE(0x191D, info) /* WKS GT2 */
278 278
279#define INTEL_SKL_GT3_IDS(info) \ 279#define INTEL_SKL_GT3_IDS(info) \
280 INTEL_VGA_DEVICE(0x1923, info), /* ULT GT3 */ \
280 INTEL_VGA_DEVICE(0x1926, info), /* ULT GT3 */ \ 281 INTEL_VGA_DEVICE(0x1926, info), /* ULT GT3 */ \
282 INTEL_VGA_DEVICE(0x1927, info), /* ULT GT3 */ \
281 INTEL_VGA_DEVICE(0x192B, info), /* Halo GT3 */ \ 283 INTEL_VGA_DEVICE(0x192B, info), /* Halo GT3 */ \
282 INTEL_VGA_DEVICE(0x192A, info) /* SRV GT3 */ 284 INTEL_VGA_DEVICE(0x192A, info) /* SRV GT3 */
283 285
@@ -296,7 +298,9 @@
296#define INTEL_BXT_IDS(info) \ 298#define INTEL_BXT_IDS(info) \
297 INTEL_VGA_DEVICE(0x0A84, info), \ 299 INTEL_VGA_DEVICE(0x0A84, info), \
298 INTEL_VGA_DEVICE(0x1A84, info), \ 300 INTEL_VGA_DEVICE(0x1A84, info), \
299 INTEL_VGA_DEVICE(0x5A84, info) 301 INTEL_VGA_DEVICE(0x1A85, info), \
302 INTEL_VGA_DEVICE(0x5A84, info), /* APL HD Graphics 505 */ \
303 INTEL_VGA_DEVICE(0x5A85, info) /* APL HD Graphics 500 */
300 304
301#define INTEL_KBL_GT1_IDS(info) \ 305#define INTEL_KBL_GT1_IDS(info) \
302 INTEL_VGA_DEVICE(0x5913, info), /* ULT GT1.5 */ \ 306 INTEL_VGA_DEVICE(0x5913, info), /* ULT GT1.5 */ \