aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e5c1c80d1f90..1204d26b50db 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -986,19 +986,17 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
986 uint32_t base = (pipe == 0) ? CURABASE : CURBBASE; 986 uint32_t base = (pipe == 0) ? CURABASE : CURBBASE;
987 uint32_t temp; 987 uint32_t temp;
988 size_t addr; 988 size_t addr;
989 int ret;
989 990
990 DRM_DEBUG("\n"); 991 DRM_DEBUG("\n");
991 992
992 /* if we want to turn off the cursor ignore width and height */ 993 /* if we want to turn off the cursor ignore width and height */
993 if (!handle) { 994 if (!handle) {
994 DRM_DEBUG("cursor off\n"); 995 DRM_DEBUG("cursor off\n");
995 /* turn of the cursor */ 996 temp = CURSOR_MODE_DISABLE;
996 temp = 0; 997 addr = 0;
997 temp |= CURSOR_MODE_DISABLE; 998 bo = NULL;
998 999 goto finish;
999 I915_WRITE(control, temp);
1000 I915_WRITE(base, 0);
1001 return 0;
1002 } 1000 }
1003 1001
1004 /* Currently we only support 64x64 cursors */ 1002 /* Currently we only support 64x64 cursors */
@@ -1025,15 +1023,30 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
1025 addr = obj_priv->gtt_offset; 1023 addr = obj_priv->gtt_offset;
1026 } 1024 }
1027 1025
1028 intel_crtc->cursor_addr = addr; 1026 ret = i915_gem_object_pin(bo, PAGE_SIZE);
1027 if (ret) {
1028 DRM_ERROR("failed to pin cursor bo\n");
1029 drm_gem_object_unreference(bo);
1030 return ret;
1031 }
1032
1029 temp = 0; 1033 temp = 0;
1030 /* set the pipe for the cursor */ 1034 /* set the pipe for the cursor */
1031 temp |= (pipe << 28); 1035 temp |= (pipe << 28);
1032 temp |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE; 1036 temp |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE;
1033 1037
1038 finish:
1034 I915_WRITE(control, temp); 1039 I915_WRITE(control, temp);
1035 I915_WRITE(base, addr); 1040 I915_WRITE(base, addr);
1036 1041
1042 if (intel_crtc->cursor_bo) {
1043 i915_gem_object_unpin(intel_crtc->cursor_bo);
1044 drm_gem_object_unreference(intel_crtc->cursor_bo);
1045 }
1046
1047 intel_crtc->cursor_addr = addr;
1048 intel_crtc->cursor_bo = bo;
1049
1037 return 0; 1050 return 0;
1038} 1051}
1039 1052