aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-09-04 11:25:31 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-09-17 03:25:28 -0400
commitd6e4db15ed93e6c3857b904f33ac759d4c66fba9 (patch)
treee23d3e1fca7c9b7554b425dfa95a26eebb1612c9 /drivers/gpu
parentefc9064e7282aab65b281738089245c229c2df45 (diff)
drm/i915: Fix cursor visibility checks also for the right/bottom screen edges
First of all we should not be looking at fb->{width,height} as those do not tell us what the actual pipe size is. Second of all we need to use >= for the comparison. So fix the comparison, and make use of the new pipe_src_{w,h} to determine the real pipe source dimensions. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index f5e80b18eb16..c0849569da90 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6921,19 +6921,16 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,
6921 int pipe = intel_crtc->pipe; 6921 int pipe = intel_crtc->pipe;
6922 int x = intel_crtc->cursor_x; 6922 int x = intel_crtc->cursor_x;
6923 int y = intel_crtc->cursor_y; 6923 int y = intel_crtc->cursor_y;
6924 u32 base, pos; 6924 u32 base = 0, pos = 0;
6925 bool visible; 6925 bool visible;
6926 6926
6927 pos = 0; 6927 if (on)
6928
6929 if (on && crtc->enabled && crtc->fb) {
6930 base = intel_crtc->cursor_addr; 6928 base = intel_crtc->cursor_addr;
6931 if (x > (int) crtc->fb->width)
6932 base = 0;
6933 6929
6934 if (y > (int) crtc->fb->height) 6930 if (x >= intel_crtc->config.pipe_src_w)
6935 base = 0; 6931 base = 0;
6936 } else 6932
6933 if (y >= intel_crtc->config.pipe_src_h)
6937 base = 0; 6934 base = 0;
6938 6935
6939 if (x < 0) { 6936 if (x < 0) {