diff options
| author | Dave Airlie <airlied@redhat.com> | 2013-10-15 04:04:08 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2013-10-15 04:04:08 -0400 |
| commit | 5259c522a0b2e827b402c2993b8088071a87d7e2 (patch) | |
| tree | 812608fd6efcfe81096bd51b1ec1c2a4167385f6 | |
| parent | 6aba5b6cf098ba305fc31b23cc14114a16768d22 (diff) | |
| parent | 967ad7f1489da7babbe0746f81c283458ecd3f84 (diff) | |
Merge branch 'drm-intel-next' of git://people.freedesktop.org/~danvet/drm-intel into drm-next
New feature pile for 3.12! Highlights:
- Stereo/3d support for hdmi from Damien, both the drm core bits and
the i915 integration.
- Manual boost/deboost logic for gpu turbo (Chris)
- Fixed up clock readout support for vlv (Chris).
- Tons of little fixes and improvements for vlv in general (Chon Minng
Lee and Jesse Barnes).
- Power well support for the legacy vga plane (Ville).
- DP impromevents from Jani.
- Improvements to the Haswell modeset sequence (Ville+Paulo).
- Haswell DDI improvements, using the VBT for some tuning values and
to check the configuration (Paulo).
- Tons of other small improvements and fixups.
* 'drm-intel-next' of git://people.freedesktop.org/~danvet/drm-intel: (92 commits)
drm/i915: Use adjusted_mode in the fastboot hack to disable pfit
drm/i915: Add a more detailed comment about the set_base() fastboot hack
drm/i915/vlv: Turn off power gate for BIOS-less system.
drm/i915/vlv: reset DPIO on load and resume v2
drm/i915: Simplify PSR debugfs
drm/i915: Tweak RPS thresholds to more aggressively downclock
drm/i915: Boost RPS frequency for CPU stalls
drm/i915: Fix __wait_seqno to use true infinite timeouts
drm/i915: Add some missing steps to i915_driver_load error path
drm/i915: Clean up the ring scaling calculations
drm/i915: Don't populate pipe_src_{w,h} multiple times
drm/i915: implement the Haswell mode set sequence workaround
drm/i915: Disable/enable planes as the first/last thing during modeset on HSW
i915/vlv: untangle integrated clock source handling v4
drm/i915: fix typo s/PatherPoint/PantherPoint/
drm/i915: Make intel_resume_power_well() static
drm/i915: destroy connector sysfs files earlier
drm/i915/dp: do not write DP_TRAINING_PATTERN_SET all the time
drm/i915/dp: retry i2c-over-aux seven times on AUX DEFER
drm/i915/vlv: reduce GT FIFO error info to a debug message
...
46 files changed, 2268 insertions, 1150 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index e79577cb4665..d7a8370e3cdc 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
| @@ -1319,6 +1319,9 @@ static int drm_crtc_convert_umode(struct drm_display_mode *out, | |||
| 1319 | if (in->clock > INT_MAX || in->vrefresh > INT_MAX) | 1319 | if (in->clock > INT_MAX || in->vrefresh > INT_MAX) |
| 1320 | return -ERANGE; | 1320 | return -ERANGE; |
| 1321 | 1321 | ||
| 1322 | if ((in->flags & DRM_MODE_FLAG_3D_MASK) > DRM_MODE_FLAG_3D_MAX) | ||
| 1323 | return -EINVAL; | ||
| 1324 | |||
| 1322 | out->clock = in->clock; | 1325 | out->clock = in->clock; |
| 1323 | out->hdisplay = in->hdisplay; | 1326 | out->hdisplay = in->hdisplay; |
| 1324 | out->hsync_start = in->hsync_start; | 1327 | out->hsync_start = in->hsync_start; |
| @@ -1581,6 +1584,19 @@ out: | |||
| 1581 | return ret; | 1584 | return ret; |
| 1582 | } | 1585 | } |
| 1583 | 1586 | ||
| 1587 | static bool drm_mode_expose_to_userspace(const struct drm_display_mode *mode, | ||
| 1588 | const struct drm_file *file_priv) | ||
| 1589 | { | ||
| 1590 | /* | ||
| 1591 | * If user-space hasn't configured the driver to expose the stereo 3D | ||
| 1592 | * modes, don't expose them. | ||
| 1593 | */ | ||
| 1594 | if (!file_priv->stereo_allowed && drm_mode_is_stereo(mode)) | ||
| 1595 | return false; | ||
| 1596 | |||
| 1597 | return true; | ||
| 1598 | } | ||
| 1599 | |||
| 1584 | /** | 1600 | /** |
| 1585 | * drm_mode_getconnector - get connector configuration | 1601 | * drm_mode_getconnector - get connector configuration |
| 1586 | * @dev: drm device for the ioctl | 1602 | * @dev: drm device for the ioctl |
| @@ -1646,7 +1662,8 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, | |||
| 1646 | 1662 | ||
| 1647 | /* delayed so we get modes regardless of pre-fill_modes state */ | 1663 | /* delayed so we get modes regardless of pre-fill_modes state */ |
| 1648 | list_for_each_entry(mode, &connector->modes, head) | 1664 | list_for_each_entry(mode, &connector->modes, head) |
| 1649 | mode_count++; | 1665 | if (drm_mode_expose_to_userspace(mode, file_priv)) |
| 1666 | mode_count++; | ||
| 1650 | 1667 | ||
| 1651 | out_resp->connector_id = connector->base.id; | 1668 | out_resp->connector_id = connector->base.id; |
| 1652 | out_resp->connector_type = connector->connector_type; | 1669 | out_resp->connector_type = connector->connector_type; |
| @@ -1668,6 +1685,9 @@ int drm_mode_getconnector(struct drm_device *dev, void *data, | |||
| 1668 | copied = 0; | 1685 | copied = 0; |
| 1669 | mode_ptr = (struct drm_mode_modeinfo __user *)(unsigned long)out_resp->modes_ptr; | 1686 | mode_ptr = (struct drm_mode_modeinfo __user *)(unsigned long)out_resp->modes_ptr; |
| 1670 | list_for_each_entry(mode, &connector->modes, head) { | 1687 | list_for_each_entry(mode, &connector->modes, head) { |
| 1688 | if (!drm_mode_expose_to_userspace(mode, file_priv)) | ||
| 1689 | continue; | ||
| 1690 | |||
| 1671 | drm_crtc_convert_to_umode(&u_mode, mode); | 1691 | drm_crtc_convert_to_umode(&u_mode, mode); |
| 1672 | if (copy_to_user(mode_ptr + copied, | 1692 | if (copy_to_user(mode_ptr + copied, |
| 1673 | &u_mode, sizeof(u_mode))) { | 1693 | &u_mode, sizeof(u_mode))) { |
| @@ -2042,6 +2062,45 @@ int drm_mode_set_config_internal(struct drm_mode_set *set) | |||
| 2042 | } | 2062 | } |
| 2043 | EXPORT_SYMBOL(drm_mode_set_config_internal); | 2063 | EXPORT_SYMBOL(drm_mode_set_config_internal); |
| 2044 | 2064 | ||
| 2065 | /* | ||
| 2066 | * Checks that the framebuffer is big enough for the CRTC viewport | ||
| 2067 | * (x, y, hdisplay, vdisplay) | ||
| 2068 | */ | ||
| 2069 | static int drm_crtc_check_viewport(const struct drm_crtc *crtc, | ||
| 2070 | int x, int y, | ||
| 2071 | const struct drm_display_mode *mode, | ||
| 2072 | const struct drm_framebuffer *fb) | ||
| 2073 | |||
| 2074 | { | ||
| 2075 | int hdisplay, vdisplay; | ||
| 2076 | |||
| 2077 | hdisplay = mode->hdisplay; | ||
| 2078 | vdisplay = mode->vdisplay; | ||
| 2079 | |||
| 2080 | if (drm_mode_is_stereo(mode)) { | ||
| 2081 | struct drm_display_mode adjusted = *mode; | ||
| 2082 | |||
| 2083 | drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE); | ||
| 2084 | hdisplay = adjusted.crtc_hdisplay; | ||
| 2085 | vdisplay = adjusted.crtc_vdisplay; | ||
| 2086 | } | ||
| 2087 | |||
| 2088 | if (crtc->invert_dimensions) | ||
| 2089 | swap(hdisplay, vdisplay); | ||
| 2090 | |||
| 2091 | if (hdisplay > fb->width || | ||
| 2092 | vdisplay > fb->height || | ||
| 2093 | x > fb->width - hdisplay || | ||
| 2094 | y > fb->height - vdisplay) { | ||
| 2095 | DRM_DEBUG_KMS("Invalid fb size %ux%u for CRTC viewport %ux%u+%d+%d%s.\n", | ||
| 2096 | fb->width, fb->height, hdisplay, vdisplay, x, y, | ||
| 2097 | crtc->invert_dimensions ? " (inverted)" : ""); | ||
| 2098 | return -ENOSPC; | ||
| 2099 | } | ||
| 2100 | |||
| 2101 | return 0; | ||
| 2102 | } | ||
| 2103 | |||
| 2045 | /** | 2104 | /** |
| 2046 | * drm_mode_setcrtc - set CRTC configuration | 2105 | * drm_mode_setcrtc - set CRTC configuration |
| 2047 | * @dev: drm device for the ioctl | 2106 | * @dev: drm device for the ioctl |
| @@ -2089,7 +2148,6 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, | |||
| 2089 | DRM_DEBUG_KMS("[CRTC:%d]\n", crtc->base.id); | 2148 | DRM_DEBUG_KMS("[CRTC:%d]\n", crtc->base.id); |
