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.c48
1 files changed, 37 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e5c1c80d1f9..8ccb9c3ab86 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -751,6 +751,7 @@ static void intel_crtc_mode_set(struct drm_crtc *crtc,
751 is_lvds = true; 751 is_lvds = true;
752 break; 752 break;
753 case INTEL_OUTPUT_SDVO: 753 case INTEL_OUTPUT_SDVO:
754 case INTEL_OUTPUT_HDMI:
754 is_sdvo = true; 755 is_sdvo = true;
755 break; 756 break;
756 case INTEL_OUTPUT_DVO: 757 case INTEL_OUTPUT_DVO:
@@ -986,19 +987,17 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
986 uint32_t base = (pipe == 0) ? CURABASE : CURBBASE; 987 uint32_t base = (pipe == 0) ? CURABASE : CURBBASE;
987 uint32_t temp; 988 uint32_t temp;
988 size_t addr; 989 size_t addr;
990 int ret;
989 991
990 DRM_DEBUG("\n"); 992 DRM_DEBUG("\n");
991 993
992 /* if we want to turn off the cursor ignore width and height */ 994 /* if we want to turn off the cursor ignore width and height */
993 if (!handle) { 995 if (!handle) {
994 DRM_DEBUG("cursor off\n"); 996 DRM_DEBUG("cursor off\n");
995 /* turn of the cursor */ 997 temp = CURSOR_MODE_DISABLE;
996 temp = 0; 998 addr = 0;
997 temp |= CURSOR_MODE_DISABLE; 999 bo = NULL;
998 1000 goto finish;
999 I915_WRITE(control, temp);
1000 I915_WRITE(base, 0);
1001 return 0;
1002 } 1001 }
1003 1002
1004 /* Currently we only support 64x64 cursors */ 1003 /* Currently we only support 64x64 cursors */
@@ -1025,15 +1024,30 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
1025 addr = obj_priv->gtt_offset; 1024 addr = obj_priv->gtt_offset;
1026 } 1025 }
1027 1026
1028 intel_crtc->cursor_addr = addr; 1027 ret = i915_gem_object_pin(bo, PAGE_SIZE);
1028 if (ret) {
1029 DRM_ERROR("failed to pin cursor bo\n");
1030 drm_gem_object_unreference(bo);
1031 return ret;
1032 }
1033
1029 temp = 0; 1034 temp = 0;
1030 /* set the pipe for the cursor */ 1035 /* set the pipe for the cursor */
1031 temp |= (pipe << 28); 1036 temp |= (pipe << 28);
1032 temp |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE; 1037 temp |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE;
1033 1038
1039 finish:
1034 I915_WRITE(control, temp); 1040 I915_WRITE(control, temp);
1035 I915_WRITE(base, addr); 1041 I915_WRITE(base, addr);
1036 1042
1043 if (intel_crtc->cursor_bo) {
1044 i915_gem_object_unpin(intel_crtc->cursor_bo);
1045 drm_gem_object_unreference(intel_crtc->cursor_bo);
1046 }
1047
1048 intel_crtc->cursor_addr = addr;
1049 intel_crtc->cursor_bo = bo;
1050
1037 return 0; 1051 return 0;
1038} 1052}
1039 1053
@@ -1430,12 +1444,19 @@ static void intel_setup_outputs(struct drm_device *dev)
1430 intel_lvds_init(dev); 1444 intel_lvds_init(dev);
1431 1445
1432 if (IS_I9XX(dev)) { 1446 if (IS_I9XX(dev)) {
1433 intel_sdvo_init(dev, SDVOB); 1447 int found;
1434 intel_sdvo_init(dev, SDVOC); 1448
1449 found = intel_sdvo_init(dev, SDVOB);
1450 if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
1451 intel_hdmi_init(dev, SDVOB);
1452
1453 found = intel_sdvo_init(dev, SDVOC);
1454 if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
1455 intel_hdmi_init(dev, SDVOC);
1435 } else 1456 } else
1436 intel_dvo_init(dev); 1457 intel_dvo_init(dev);
1437 1458
1438 if (IS_I9XX(dev) && !IS_I915G(dev)) 1459 if (IS_I9XX(dev) && IS_MOBILE(dev))
1439 intel_tv_init(dev); 1460 intel_tv_init(dev);
1440 1461
1441 list_for_each_entry(connector, &dev->mode_config.connector_list, head) { 1462 list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
@@ -1445,6 +1466,11 @@ static void intel_setup_outputs(struct drm_device *dev)
1445 1466
1446 /* valid crtcs */ 1467 /* valid crtcs */
1447 switch(intel_output->type) { 1468 switch(intel_output->type) {
1469 case INTEL_OUTPUT_HDMI:
1470 crtc_mask = ((1 << 0)|
1471 (1 << 1));
1472 clone_mask = ((1 << INTEL_OUTPUT_HDMI));
1473 break;
1448 case INTEL_OUTPUT_DVO: 1474 case INTEL_OUTPUT_DVO:
1449 case INTEL_OUTPUT_SDVO: 1475 case INTEL_OUTPUT_SDVO:
1450 crtc_mask = ((1 << 0)| 1476 crtc_mask = ((1 << 0)|