diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-07 05:06:44 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-07 05:06:44 +0300 |
commit | c89a9f5a42811aa5b2f258e32750c0109f570fc1 (patch) | |
tree | 53f64a1326f0c3884261ad2160e1b18cc7af5fb6 /drivers/gpu/drm/i915/intel_display.c | |
parent | db30c70575822cc84d87b5613c19cac24734b99f (diff) | |
parent | a75f28419a7efff611a81293d41d0e2137d7591e (diff) | |
download | linux-c89a9f5a42811aa5b2f258e32750c0109f570fc1.tar.xz |
Merge branch 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
drm: fix ordering of driver unload vs agp unload.
drm/i915: Respect the other stolen memory sizes we know of.
drm/i915: Non-mobile parts don't have integrated TV-out.
drm/i915: Add support for integrated HDMI on G4X hardware.
drm/i915: Pin cursor bo and unpin old bo when setting cursor.
drm/i915: Don't allow objects to get bound while VT switched.
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 48 |
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 e5c1c80d1f90..8ccb9c3ab868 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, is_lvds = true; break; case INTEL_OUTPUT_SDVO: + case INTEL_OUTPUT_HDMI: is_sdvo = true; break; case INTEL_OUTPUT_DVO: @@ -986,19 +987,17 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, uint32_t base = (pipe == 0) ? CURABASE : CURBBASE; uint32_t temp; size_t addr; + int ret; DRM_DEBUG("\n"); /* if we want to turn off the cursor ignore width and height */ if (!handle) { DRM_DEBUG("cursor off\n"); - /* turn of the cursor */ - temp = 0; - temp |= CURSOR_MODE_DISABLE; - - I915_WRITE(control, temp); - I915_WRITE(base, 0); - return 0; + temp = CURSOR_MODE_DISABLE; + addr = 0; + bo = NULL; + goto finish; } /* Currently we only support 64x64 cursors */ @@ -1025,15 +1024,30 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, addr = obj_priv->gtt_offset; } - intel_crtc->cursor_addr = addr; + ret = i915_gem_object_pin(bo, PAGE_SIZE); + if (ret) { + DRM_ERROR("failed to pin cursor bo\n"); + drm_gem_object_unreference(bo); + return ret; + } + temp = 0; /* set the pipe for the cursor */ temp |= (pipe << 28); temp |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE; + finish: I915_WRITE(control, temp); I915_WRITE(base, addr); + if (intel_crtc->cursor_bo) { + i915_gem_object_unpin(intel_crtc->cursor_bo); + drm_gem_object_unreference(intel_crtc->cursor_bo); + } + + intel_crtc->cursor_addr = addr; + intel_crtc->cursor_bo = bo; + return 0; } @@ -1430,12 +1444,19 @@ static void intel_setup_outputs(struct drm_device *dev) intel_lvds_init(dev); if (IS_I9XX(dev)) { - intel_sdvo_init(dev, SDVOB); - intel_sdvo_init(dev, SDVOC); + int found; + + found = intel_sdvo_init(dev, SDVOB); + if (!found && SUPPORTS_INTEGRATED_HDMI(dev)) + intel_hdmi_init(dev, SDVOB); + + found = intel_sdvo_init(dev, SDVOC); + if (!found && SUPPORTS_INTEGRATED_HDMI(dev)) + intel_hdmi_init(dev, SDVOC); } else intel_dvo_init(dev); - if (IS_I9XX(dev) && !IS_I915G(dev)) + if (IS_I9XX(dev) && IS_MOBILE(dev)) intel_tv_init(dev); list_for_each_entry(connector, &dev->mode_config.connector_list, head) { @@ -1445,6 +1466,11 @@ static void intel_setup_outputs(struct drm_device *dev) /* valid crtcs */ switch(intel_output->type) { + case INTEL_OUTPUT_HDMI: + crtc_mask = ((1 << 0)| + (1 << 1)); + clone_mask = ((1 << INTEL_OUTPUT_HDMI)); + break; case INTEL_OUTPUT_DVO: case INTEL_OUTPUT_SDVO: crtc_mask = ((1 << 0)| |