aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2009-06-08 07:21:27 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-06-08 07:21:27 -0400
commite635a01ea0a16cf7cd31ecd2305870385dca9be6 (patch)
treec7153e7dee5caf6ac90d85694ff27e4d0b606290 /drivers/gpu/drm/i915/intel_display.c
parent143070e74630b9557e1bb64d899ff2cc5a1dcb48 (diff)
parent947391cfbaa3b08558844c0b187bcd0223c3f660 (diff)
Merge branch 'next-mtd' of git://aeryn.fluff.org.uk/bjdooks/linux
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c57
1 files changed, 51 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index bdcda36953b0..c9d6f10ba92e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1357,7 +1357,7 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
1357 int pipe = intel_crtc->pipe; 1357 int pipe = intel_crtc->pipe;
1358 uint32_t control = (pipe == 0) ? CURACNTR : CURBCNTR; 1358 uint32_t control = (pipe == 0) ? CURACNTR : CURBCNTR;
1359 uint32_t base = (pipe == 0) ? CURABASE : CURBBASE; 1359 uint32_t base = (pipe == 0) ? CURABASE : CURBBASE;
1360 uint32_t temp; 1360 uint32_t temp = I915_READ(control);
1361 size_t addr; 1361 size_t addr;
1362 int ret; 1362 int ret;
1363 1363
@@ -1366,7 +1366,12 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
1366 /* if we want to turn off the cursor ignore width and height */ 1366 /* if we want to turn off the cursor ignore width and height */
1367 if (!handle) { 1367 if (!handle) {
1368 DRM_DEBUG("cursor off\n"); 1368 DRM_DEBUG("cursor off\n");
1369 temp = CURSOR_MODE_DISABLE; 1369 if (IS_MOBILE(dev) || IS_I9XX(dev)) {
1370 temp &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE);
1371 temp |= CURSOR_MODE_DISABLE;
1372 } else {
1373 temp &= ~(CURSOR_ENABLE | CURSOR_GAMMA_ENABLE);
1374 }
1370 addr = 0; 1375 addr = 0;
1371 bo = NULL; 1376 bo = NULL;
1372 mutex_lock(&dev->struct_mutex); 1377 mutex_lock(&dev->struct_mutex);
@@ -1409,10 +1414,19 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
1409 addr = obj_priv->phys_obj->handle->busaddr; 1414 addr = obj_priv->phys_obj->handle->busaddr;
1410 } 1415 }
1411 1416
1412 temp = 0; 1417 if (!IS_I9XX(dev))
1413 /* set the pipe for the cursor */ 1418 I915_WRITE(CURSIZE, (height << 12) | width);
1414 temp |= (pipe << 28); 1419
1415 temp |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE; 1420 /* Hooray for CUR*CNTR differences */
1421 if (IS_MOBILE(dev) || IS_I9XX(dev)) {
1422 temp &= ~(CURSOR_MODE | MCURSOR_PIPE_SELECT);
1423 temp |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE;
1424 temp |= (pipe << 28); /* Connect to correct pipe */
1425 } else {
1426 temp &= ~(CURSOR_FORMAT_MASK);
1427 temp |= CURSOR_ENABLE;
1428 temp |= CURSOR_FORMAT_ARGB | CURSOR_GAMMA_ENABLE;
1429 }
1416 1430
1417 finish: 1431 finish:
1418 I915_WRITE(control, temp); 1432 I915_WRITE(control, temp);
@@ -1804,6 +1818,37 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
1804 } 1818 }
1805} 1819}
1806 1820
1821int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data,
1822 struct drm_file *file_priv)
1823{
1824 drm_i915_private_t *dev_priv = dev->dev_private;
1825 struct drm_i915_get_pipe_from_crtc_id *pipe_from_crtc_id = data;
1826 struct drm_crtc *crtc = NULL;
1827 int pipe = -1;
1828
1829 if (!dev_priv) {
1830 DRM_ERROR("called with no initialization\n");
1831 return -EINVAL;
1832 }
1833
1834 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
1835 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
1836 if (crtc->base.id == pipe_from_crtc_id->crtc_id) {
1837 pipe = intel_crtc->pipe;
1838 break;
1839 }
1840 }
1841
1842 if (pipe == -1) {
1843 DRM_ERROR("no such CRTC id\n");
1844 return -EINVAL;
1845 }
1846
1847 pipe_from_crtc_id->pipe = pipe;
1848
1849 return 0;
1850}
1851
1807struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe) 1852struct drm_crtc *intel_get_crtc_from_pipe(struct drm_device *dev, int pipe)
1808{ 1853{
1809 struct drm_crtc *crtc = NULL; 1854 struct drm_crtc *crtc = NULL;