| From 7b012e3012e293e8e2ddfec8701bd7fb5bcb206c Mon Sep 17 00:00:00 2001 |
| From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com> |
| Date: Wed, 4 Sep 2013 18:25:30 +0300 |
| Subject: drm/i915: Fix cursor visibility check with negative coordinates |
| MIME-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| When the cursor x coordinate is exactly -cursor_width, the cursor is |
| invisible. And obviously the same holds for the y coordinate and |
| cursor_height. |
| |
| 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> |
| (cherry picked from commit efc9064e7282aab65b281738089245c229c2df45) |
| Signed-off-by: Darren Hart <dvhart@linux.intel.com> |
| --- |
| drivers/gpu/drm/i915/intel_display.c | 4 ++-- |
| 1 file changed, 2 insertions(+), 2 deletions(-) |
| |
| diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c |
| index 6a0242a143dc..3c13578573fa 100644 |
| --- a/drivers/gpu/drm/i915/intel_display.c |
| +++ b/drivers/gpu/drm/i915/intel_display.c |
| @@ -6942,7 +6942,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc, |
| base = 0; |
| |
| if (x < 0) { |
| - if (x + intel_crtc->cursor_width < 0) |
| + if (x + intel_crtc->cursor_width <= 0) |
| base = 0; |
| |
| pos |= CURSOR_POS_SIGN << CURSOR_X_SHIFT; |
| @@ -6951,7 +6951,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc, |
| pos |= x << CURSOR_X_SHIFT; |
| |
| if (y < 0) { |
| - if (y + intel_crtc->cursor_height < 0) |
| + if (y + intel_crtc->cursor_height <= 0) |
| base = 0; |
| |
| pos |= CURSOR_POS_SIGN << CURSOR_Y_SHIFT; |
| -- |
| 1.8.5.rc3 |
| |