aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2014-06-06 05:07:09 -0400
committerDave Airlie <airlied@redhat.com>2014-06-06 05:07:09 -0400
commitecb889e6205171ecbf80b15d903549aa6b15d23b (patch)
tree64380a55d07a0e4c6dae660fa918e2f78e797949
parentc7560f1281640b1232d1c3cb242aabf5bd83a857 (diff)
parent15d24aa5602fb87c7b1358cfabcfeb9b26db290f (diff)
Merge tag 'drm-intel-fixes-2014-06-06' of git://anongit.freedesktop.org/drm-intel into drm-next
> Bunch of stuff for 3.16 still: > - Mipi dsi panel support for byt. Finally! From Shobhit&others. I've > squeezed this in since it's a regression compared to vbios and we've > been ridiculed about it a bit too often ... > - connection_mutex deadlock fix in get_connector (only affects i915). > - Core patches from Matt's primary plane from Matt Roper, I've pushed the > i915 stuff to 3.17. > - vlv power well sequencing fixes from Jesse. > - Fix for cursor size changes from Chris. > - agpbusy fixes from Ville. > - A few smaller things. > * tag 'drm-intel-fixes-2014-06-06' of git://anongit.freedesktop.org/drm-intel: (32 commits) drm/i915: BDW: Adding missing cursor offsets. drm: Fix getconnector connection_mutex locking drm/i915/bdw: Only use 2g GGTT for 32b platforms drm/i915: Nuke pipe A quirk on i830M drm/i915: fix display power sw state reporting drm/i915: Always apply cursor width changes drm/i915: tell the user if both KMS and UMS are disabled drm/plane-helper: Add drm_plane_helper_check_update() (v3) drm: Check CRTC compatibility in setplane drm/i915: use VBT to determine whether to enumerate the VGA port drm/i915: Don't WARN about ring idle bit on gen2 drm/i915: Silence the WARN if the user tries to GTT mmap an incoherent object drm/i915: Move the C3 LP write bit setup to gen3_init_clock_gating() for KMS drm/i915: Enable interrupt-based AGPBUSY# enable on 85x drm/i915: Flip the sense of AGPBUSY_DIS bit drm/i915: Set AGPBUSY# bit in init_clock_gating drm/i915/vlv: add pll assertion when disabling DPIO common well drm/i915/vlv: move DPIO common reset de-assert into __vlv_set_power_well drm/i915/vlv: re-order power wells so DPIO common comes after TX drm/i915/vlv: move CRI refclk enable into __vlv_set_power_well ...
-rw-r--r--drivers/gpu/drm/drm_crtc.c7
-rw-r--r--drivers/gpu/drm/drm_plane_helper.c131
-rw-r--r--drivers/gpu/drm/i915/Makefile1
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c6
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c19
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h2
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c4
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c7
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c83
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h6
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c13
-rw-r--r--drivers/gpu/drm/i915/intel_bios.h4
-rw-r--r--drivers/gpu/drm/i915/intel_display.c145
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h6
-rw-r--r--drivers/gpu/drm/i915/intel_dsi.c30
-rw-r--r--drivers/gpu/drm/i915/intel_dsi.h2
-rw-r--r--drivers/gpu/drm/i915/intel_dsi_panel_vbt.c589
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c95
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c2
-rw-r--r--drivers/gpu/drm/i915/intel_uncore.c21
-rw-r--r--include/drm/drm_plane_helper.h22
21 files changed, 979 insertions, 216 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 239342f554b4..fe94cc10cd35 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -2178,6 +2178,13 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
2178 goto out; 2178 goto out;
2179 } 2179 }
2180 2180
2181 /* Check whether this plane is usable on this CRTC */
2182 if (!(plane->possible_crtcs & drm_crtc_mask(crtc))) {
2183 DRM_DEBUG_KMS("Invalid crtc for plane\n");
2184 ret = -EINVAL;
2185 goto out;
2186 }
2187
2181 fb = drm_framebuffer_lookup(dev, plane_req->fb_id); 2188 fb = drm_framebuffer_lookup(dev, plane_req->fb_id);
2182 if (!fb) { 2189 if (!fb) {
2183 DRM_DEBUG_KMS("Unknown framebuffer ID %d\n", 2190 DRM_DEBUG_KMS("Unknown framebuffer ID %d\n",
diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
index 1b15643b4586..6d133149cc74 100644
--- a/drivers/gpu/drm/drm_plane_helper.c
+++ b/drivers/gpu/drm/drm_plane_helper.c
@@ -25,6 +25,7 @@
25 25
26#include <linux/list.h> 26#include <linux/list.h>
27#include <drm/drmP.h> 27#include <drm/drmP.h>
28#include <drm/drm_plane_helper.h>
28#include <drm/drm_rect.h> 29#include <drm/drm_rect.h>
29#include <drm/drm_plane_helper.h> 30#include <drm/drm_plane_helper.h>
30 31
@@ -74,6 +75,79 @@ static int get_connectors_for_crtc(struct drm_crtc *crtc,
74} 75}
75 76
76/** 77/**
78 * drm_plane_helper_check_update() - Check plane update for validity
79 * @plane: plane object to update
80 * @crtc: owning CRTC of owning plane
81 * @fb: framebuffer to flip onto plane
82 * @src: source coordinates in 16.16 fixed point
83 * @dest: integer destination coordinates
84 * @clip: integer clipping coordinates
85 * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point
86 * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point
87 * @can_position: is it legal to position the plane such that it
88 * doesn't cover the entire crtc? This will generally
89 * only be false for primary planes.
90 * @can_update_disabled: can the plane be updated while the crtc
91 * is disabled?
92 * @visible: output parameter indicating whether plane is still visible after
93 * clipping
94 *
95 * Checks that a desired plane update is valid. Drivers that provide
96 * their own plane handling rather than helper-provided implementations may
97 * still wish to call this function to avoid duplication of error checking
98 * code.
99 *
100 * RETURNS:
101 * Zero if update appears valid, error code on failure
102 */
103int drm_plane_helper_check_update(struct drm_plane *plane,
104 struct drm_crtc *crtc,
105 struct drm_framebuffer *fb,
106 struct drm_rect *src,
107 struct drm_rect *dest,
108 const struct drm_rect *clip,
109 int min_scale,
110 int max_scale,
111 bool can_position,
112 bool can_update_disabled,
113 bool *visible)
114{
115 int hscale, vscale;
116
117 if (!crtc->enabled && !can_update_disabled) {
118 DRM_DEBUG_KMS("Cannot update plane of a disabled CRTC.\n");
119 return -EINVAL;
120 }
121
122 /* Check scaling */
123 hscale = drm_rect_calc_hscale(src, dest, min_scale, max_scale);
124 vscale = drm_rect_calc_vscale(src, dest, min_scale, max_scale);
125 if (hscale < 0 || vscale < 0) {
126 DRM_DEBUG_KMS("Invalid scaling of plane\n");
127 return -ERANGE;
128 }
129
130 *visible = drm_rect_clip_scaled(src, dest, clip, hscale, vscale);
131 if (!*visible)
132 /*
133 * Plane isn't visible; some drivers can handle this
134 * so we just return success here. Drivers that can't
135 * (including those that use the primary plane helper's
136 * update function) will return an error from their
137 * update_plane handler.
138 */
139 return 0;
140
141 if (!can_position && !drm_rect_equals(dest, clip)) {
142 DRM_DEBUG_KMS("Plane must cover entire CRTC\n");
143 return -EINVAL;
144 }
145
146 return 0;
147}
148EXPORT_SYMBOL(drm_plane_helper_check_update);
149
150/**
77 * drm_primary_helper_update() - Helper for primary plane update 151 * drm_primary_helper_update() - Helper for primary plane update
78 * @plane: plane object to update 152 * @plane: plane object to update
79 * @crtc: owning CRTC of owning plane 153 * @crtc: owning CRTC of owning plane
@@ -121,57 +195,42 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc,
121 .x = src_x >> 16, 195 .x = src_x >> 16,
122 .y = src_y >> 16, 196 .y = src_y >> 16,
123 }; 197 };
198 struct drm_rect src = {
199 .x1 = src_x,
200 .y1 = src_y,
201 .x2 = src_x + src_w,
202 .y2 = src_y + src_h,
203 };
124 struct drm_rect dest = { 204 struct drm_rect dest = {
125 .x1 = crtc_x, 205 .x1 = crtc_x,
126 .y1 = crtc_y, 206 .y1 = crtc_y,
127 .x2 = crtc_x + crtc_w, 207 .x2 = crtc_x + crtc_w,
128 .y2 = crtc_y + crtc_h, 208 .y2 = crtc_y + crtc_h,
129 }; 209 };
130 struct drm_rect clip = { 210 const struct drm_rect clip = {
131 .x2 = crtc->mode.hdisplay, 211 .x2 = crtc->mode.hdisplay,
132 .y2 = crtc->mode.vdisplay, 212 .y2 = crtc->mode.vdisplay,
133 }; 213 };
134 struct drm_connector **connector_list; 214 struct drm_connector **connector_list;
135 int num_connectors, ret; 215 int num_connectors, ret;
216 bool visible;
136 217
137 if (!crtc->enabled) { 218 ret = drm_plane_helper_check_update(plane, crtc, fb,
138 DRM_DEBUG_KMS("Cannot update primary plane of a disabled CRTC.\n"); 219 &src, &dest, &clip,
139 return -EINVAL; 220 DRM_PLANE_HELPER_NO_SCALING,