diff options
| author | Eric Anholt <eric@anholt.net> | 2009-12-01 12:01:54 -0500 |
|---|---|---|
| committer | Eric Anholt <eric@anholt.net> | 2009-12-01 12:01:54 -0500 |
| commit | f40d6817a5c2bf84f5fe7b5d1a83f1e8f8669951 (patch) | |
| tree | 1c515a34a60f65cbfd3cf1a387427d0a9fdf878f /drivers/gpu/drm | |
| parent | 103a196f4224dc6872081305cf7f82ebf67aa7bd (diff) | |
| parent | 46557bef3f3834ac33031c7be27d39d90d507442 (diff) | |
Merge remote branch 'airlied/drm-next' into drm-intel-next
Diffstat (limited to 'drivers/gpu/drm')
| -rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 69 | ||||
| -rw-r--r-- | drivers/gpu/drm/drm_drv.c | 41 | ||||
| -rw-r--r-- | drivers/gpu/drm/drm_irq.c | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/Makefile | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/r420.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/r520.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 21 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/r600_blit_kms.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 8 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_asic.h | 23 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_atombios.c | 97 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_clocks.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_combios.c | 162 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_connectors.c | 56 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_encoders.c | 19 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_mode.h | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/radeon_pm.c | 65 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/rs600.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/rs690.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/rv515.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/radeon/rv770.c | 3 |
21 files changed, 509 insertions, 73 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index ee0cde1ecca5..ac2fa193072b 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
| @@ -2479,3 +2479,72 @@ out: | |||
| 2479 | mutex_unlock(&dev->mode_config.mutex); | 2479 | mutex_unlock(&dev->mode_config.mutex); |
| 2480 | return ret; | 2480 | return ret; |
| 2481 | } | 2481 | } |
| 2482 | |||
| 2483 | int drm_mode_page_flip_ioctl(struct drm_device *dev, | ||
| 2484 | void *data, struct drm_file *file_priv) | ||
| 2485 | { | ||
| 2486 | struct drm_mode_crtc_page_flip *page_flip = data; | ||
| 2487 | struct drm_mode_object *obj; | ||
| 2488 | struct drm_crtc *crtc; | ||
| 2489 | struct drm_framebuffer *fb; | ||
| 2490 | struct drm_pending_vblank_event *e = NULL; | ||
| 2491 | unsigned long flags; | ||
| 2492 | int ret = -EINVAL; | ||
| 2493 | |||
| 2494 | if (page_flip->flags & ~DRM_MODE_PAGE_FLIP_FLAGS || | ||
| 2495 | page_flip->reserved != 0) | ||
| 2496 | return -EINVAL; | ||
| 2497 | |||
| 2498 | mutex_lock(&dev->mode_config.mutex); | ||
| 2499 | obj = drm_mode_object_find(dev, page_flip->crtc_id, DRM_MODE_OBJECT_CRTC); | ||
| 2500 | if (!obj) | ||
| 2501 | goto out; | ||
| 2502 | crtc = obj_to_crtc(obj); | ||
| 2503 | |||
| 2504 | if (crtc->funcs->page_flip == NULL) | ||
| 2505 | goto out; | ||
| 2506 | |||
| 2507 | obj = drm_mode_object_find(dev, page_flip->fb_id, DRM_MODE_OBJECT_FB); | ||
| 2508 | if (!obj) | ||
| 2509 | goto out; | ||
| 2510 | fb = obj_to_fb(obj); | ||
| 2511 | |||
| 2512 | if (page_flip->flags & DRM_MODE_PAGE_FLIP_EVENT) { | ||
| 2513 | ret = -ENOMEM; | ||
| 2514 | spin_lock_irqsave(&dev->event_lock, flags); | ||
| 2515 | if (file_priv->event_space < sizeof e->event) { | ||
| 2516 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
| 2517 | goto out; | ||
| 2518 | } | ||
| 2519 | file_priv->event_space -= sizeof e->event; | ||
| 2520 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
| 2521 | |||
| 2522 | e = kzalloc(sizeof *e, GFP_KERNEL); | ||
| 2523 | if (e == NULL) { | ||
| 2524 | spin_lock_irqsave(&dev->event_lock, flags); | ||
| 2525 | file_priv->event_space += sizeof e->event; | ||
| 2526 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
| 2527 | goto out; | ||
| 2528 | } | ||
| 2529 | |||
| 2530 | e->event.base.type = DRM_EVENT_VBLANK; | ||
| 2531 | e->event.base.length = sizeof e->event; | ||
| 2532 | e->event.user_data = page_flip->user_data; | ||
| 2533 | e->base.event = &e->event.base; | ||
| 2534 | e->base.file_priv = file_priv; | ||
| 2535 | e->base.destroy = | ||
| 2536 | (void (*) (struct drm_pending_event *)) kfree; | ||
| 2537 | } | ||
| 2538 | |||
| 2539 | ret = crtc->funcs->page_flip(crtc, fb, e); | ||
| 2540 | if (ret) { | ||
| 2541 | spin_lock_irqsave(&dev->event_lock, flags); | ||
| 2542 | file_priv->event_space += sizeof e->event; | ||
| 2543 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
| 2544 | kfree(e); | ||
| 2545 | } | ||
| 2546 | |||
| 2547 | out: | ||
| 2548 | mutex_unlock(&dev->mode_config.mutex); | ||
| 2549 | return ret; | ||
| 2550 | } | ||
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index a75ca63deea6..bfaf59b02bda 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c | |||
| @@ -145,6 +145,7 @@ static struct drm_ioctl_desc drm_ioctls[] = { | |||
| 145 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETFB, drm_mode_getfb, DRM_MASTER|DRM_CONTROL_ALLOW), | 145 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_GETFB, drm_mode_getfb, DRM_MASTER|DRM_CONTROL_ALLOW), |
| 146 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_ADDFB, drm_mode_addfb, DRM_MASTER|DRM_CONTROL_ALLOW), | 146 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_ADDFB, drm_mode_addfb, DRM_MASTER|DRM_CONTROL_ALLOW), |
| 147 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_RMFB, drm_mode_rmfb, DRM_MASTER|DRM_CONTROL_ALLOW), | 147 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_RMFB, drm_mode_rmfb, DRM_MASTER|DRM_CONTROL_ALLOW), |
| 148 | DRM_IOCTL_DEF(DRM_IOCTL_MODE_PAGE_FLIP, drm_mode_page_flip_ioctl, DRM_MASTER|DRM_CONTROL_ALLOW), | ||
| 148 | }; | 149 | }; |
| 149 | 150 | ||
| 150 | #define DRM_CORE_IOCTL_COUNT ARRAY_SIZE( drm_ioctls ) | 151 | #define DRM_CORE_IOCTL_COUNT ARRAY_SIZE( drm_ioctls ) |
| @@ -366,6 +367,29 @@ module_init(drm_core_init); | |||
| 366 | module_exit(drm_core_exit); | 367 | module_exit(drm_core_exit); |
| 367 | 368 | ||
| 368 | /** | 369 | /** |
| 370 | * Copy and IOCTL return string to user space | ||
| 371 | */ | ||
| 372 | static int drm_copy_field(char *buf, size_t *buf_len, const char *value) | ||
| 373 | { | ||
| 374 | int len; | ||
| 375 | |||
| 376 | /* don't overflow userbuf */ | ||
| 377 | len = strlen(value); | ||
| 378 | if (len > *buf_len) | ||
| 379 | len = *buf_len; | ||
| 380 | |||
| 381 | /* let userspace know exact length of driver value (which could be | ||
| 382 | * larger than the userspace-supplied buffer) */ | ||
| 383 | *buf_len = strlen(value); | ||
| 384 | |||
| 385 | /* finally, try filling in the userbuf */ | ||
| 386 | if (len && buf) | ||
| 387 | if (copy_to_user(buf, value, len)) | ||
| 388 | return -EFAULT; | ||
| 389 | return 0; | ||
| 390 | } | ||
| 391 | |||
| 392 | /** | ||
| 369 | * Get version information | 393 | * Get version information |
| 370 | * | 394 | * |
| 371 | * \param inode device inode. | 395 | * \param inode device inode. |
| @@ -380,16 +404,21 @@ static int drm_version(struct drm_device *dev, void *data, | |||
| 380 | struct drm_file *file_priv) | 404 | struct drm_file *file_priv) |
| 381 | { | 405 | { |
| 382 | struct drm_version *version = data; | 406 | struct drm_version *version = data; |
| 383 | int len; | 407 | int err; |
| 384 | 408 | ||
| 385 | version->version_major = dev->driver->major; | 409 | version->version_major = dev->driver->major; |
| 386 | version->version_minor = dev->driver->minor; | 410 | version->version_minor = dev->driver->minor; |
| 387 | version->version_patchlevel = dev->driver->patchlevel; | 411 | version->version_patchlevel = dev->driver->patchlevel; |
| 388 | DRM_COPY(version->name, dev->driver->name); | 412 | err = drm_copy_field(version->name, &version->name_len, |
| 389 | DRM_COPY(version->date, dev->driver->date); | 413 | dev->driver->name); |
| 390 | DRM_COPY(version->desc, dev->driver->desc); | 414 | if (!err) |
| 391 | 415 | err = drm_copy_field(version->date, &version->date_len, | |
| 392 | return 0; | 416 | dev->driver->date); |
| 417 | if (!err) | ||
| 418 | err = drm_copy_field(version->desc, &version->desc_len, | ||
| 419 | dev->driver->desc); | ||
| 420 | |||
| 421 | return err; | ||
| 393 | } | 422 | } |
| 394 | 423 | ||
| 395 | /** | 424 | /** |
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 72754aca7abf..6b3ce6d38848 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
| @@ -585,6 +585,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe, | |||
| 585 | if ((vblwait->request.type & _DRM_VBLANK_NEXTONMISS) && | 585 | if ((vblwait->request.type & _DRM_VBLANK_NEXTONMISS) && |
| 586 | (seq - vblwait->request.sequence) <= (1 << 23)) { | 586 | (seq - vblwait->request.sequence) <= (1 << 23)) { |
| 587 | vblwait->request.sequence = seq + 1; | 587 | vblwait->request.sequence = seq + 1; |
| 588 | vblwait->reply.sequence = vblwait->request.sequence; | ||
| 588 | } | 589 | } |
| 589 | 590 | ||
| 590 | DRM_DEBUG("event on vblank count %d, current %d, crtc %d\n", | 591 | DRM_DEBUG("event on vblank count %d, current %d, crtc %d\n", |
diff --git a/drivers/gpu/drm/radeon/Makefile b/drivers/gpu/drm/radeon/Makefile index 09a28923f46e..b5713eedd6e1 100644 --- a/drivers/gpu/drm/radeon/Makefile +++ b/drivers/gpu/drm/radeon/Makefile | |||
| @@ -49,7 +49,7 @@ radeon-y += radeon_device.o radeon_kms.o \ | |||
| 49 | radeon_cs.o radeon_bios.o radeon_benchmark.o r100.o r300.o r420.o \ | 49 | radeon_cs.o radeon_bios.o radeon_benchmark.o r100.o r300.o r420.o \ |
| 50 | rs400.o rs600.o rs690.o rv515.o r520.o r600.o rv770.o radeon_test.o \ | 50 | rs400.o rs600.o rs690.o rv515.o r520.o r600.o rv770.o radeon_test.o \ |
| 51 | r200.o radeon_legacy_tv.o r600_cs.o r600_blit.o r600_blit_shaders.o \ | 51 | r200.o radeon_legacy_tv.o r600_cs.o r600_blit.o r600_blit_shaders.o \ |
| 52 | r600_blit_kms.o | 52 | r600_blit_kms.o radeon_pm.o |
| 53 | 53 | ||
| 54 | radeon-$(CONFIG_COMPAT) += radeon_ioc32.o | 54 | radeon-$(CONFIG_COMPAT) += radeon_ioc32.o |
| 55 | 55 | ||
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c index 5c7fe52de30e..1cefdbcc0850 100644 --- a/drivers/gpu/drm/radeon/r420.c +++ b/drivers/gpu/drm/radeon/r420.c | |||
| @@ -311,6 +311,8 @@ int r420_init(struct radeon_device *rdev) | |||
| 311 | } | 311 | } |
| 312 | /* Initialize clocks */ | 312 | /* Initialize clocks */ |
| 313 | radeon_get_clock_info(rdev->ddev); | 313 | radeon_get_clock_info(rdev->ddev); |
| 314 | /* Initialize power management */ | ||
| 315 | radeon_pm_init(rdev); | ||
| 314 | /* Get vram informations */ | 316 | /* Get vram informations */ |
| 315 | r300_vram_info(rdev); | 317 | r300_vram_info(rdev); |
| 316 | /* Initialize memory controller (also test AGP) */ | 318 | /* Initialize memory controller (also test AGP) */ |
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c index a555b7b19b48..f7435185c0a6 100644 --- a/drivers/gpu/drm/radeon/r520.c +++ b/drivers/gpu/drm/radeon/r520.c | |||
| @@ -260,6 +260,8 @@ int r520_init(struct radeon_device *rdev) | |||
| 260 | } | 260 | } |
| 261 | /* Initialize clocks */ | 261 | /* Initialize clocks */ |
| 262 | radeon_get_clock_info(rdev->ddev); | 262 | radeon_get_clock_info(rdev->ddev); |
| 263 | /* Initialize power management */ | ||
| 264 | radeon_pm_init(rdev); | ||
| 263 | /* Get vram informations */ | 265 | /* Get vram informations */ |
| 264 | r520_vram_info(rdev); | 266 | r520_vram_info(rdev); |
| 265 | /* Initialize memory controller (also test AGP) */ | 267 | /* Initialize memory controller (also test AGP) */ |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 00cd0500ca7f..278f646bc18e 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
| @@ -858,7 +858,8 @@ void r600_gpu_init(struct radeon_device *rdev) | |||
| 858 | ((rdev->family) == CHIP_RV630) || | 858 | ((rdev->family) == CHIP_RV630) || |
| 859 | ((rdev->family) == CHIP_RV610) || | 859 | ((rdev->family) == CHIP_RV610) || |
| 860 | ((rdev->family) == CHIP_RV620) || | 860 | ((rdev->family) == CHIP_RV620) || |
| 861 | ((rdev->family) == CHIP_RS780)) { | 861 | ((rdev->family) == CHIP_RS780) || |
| 862 | ((rdev->family) == CHIP_RS880)) { | ||
| 862 | WREG32(DB_DEBUG, PREZ_MUST_WAIT_FOR_POSTZ_DONE); | 863 | WREG32(DB_DEBUG, PREZ_MUST_WAIT_FOR_POSTZ_DONE); |
| 863 | } else { | 864 | } else { |
| 864 | WREG32(DB_DEBUG, 0); | 865 | WREG32(DB_DEBUG, 0); |
| @@ -875,7 +876,8 @@ void r600_gpu_init(struct radeon_device *rdev) | |||
| 875 | tmp = RREG32(SQ_MS_FIFO_SIZES); | 876 | tmp = RREG32(SQ_MS_FIFO_SIZES); |
| 876 | if (((rdev->family) == CHIP_RV610) || | 877 | if (((rdev->family) == CHIP_RV610) || |
| 877 | ((rdev->family) == CHIP_RV620) || | 878 | ((rdev->family) == CHIP_RV620) || |
| 878 | ((rdev->family) == CHIP_RS780)) { | 879 | ((rdev->family) == CHIP_RS780) || |
| 880 | ((rdev->family) == CHIP_RS880)) { | ||
| 879 | tmp = (CACHE_FIFO_SIZE(0xa) | | 881 | tmp = (CACHE_FIFO_SIZE(0xa) | |
| 880 | FETCH_FIFO_HIWATER(0xa) | | 882 | FETCH_FIFO_HIWATER(0xa) | |
| 881 | DONE_FIFO_HIWATER(0xe0) | | 883 | DONE_FIFO_HIWATER(0xe0) | |
| @@ -918,7 +920,8 @@ void r600_gpu_init(struct radeon_device *rdev) | |||
| 918 | NUM_ES_STACK_ENTRIES(0)); | 920 | NUM_ES_STACK_ENTRIES(0)); |
| 919 | } else if (((rdev->family) == CHIP_RV610) || | 921 | } else if (((rdev->family) == CHIP_RV610) || |
| 920 | ((rdev->family) == CHIP_RV620) || | 922 | ((rdev->family) == CHIP_RV620) || |
| 921 | ((rdev->family) == CHIP_RS780)) { | 923 | ((rdev->family) == CHIP_RS780) || |
| 924 | ((rdev->family) == CHIP_RS880)) { | ||
| 922 | /* no vertex cache */ | 925 | /* no vertex cache */ |
| 923 | sq_config &= ~VC_ENABLE; | 926 | sq_config &= ~VC_ENABLE; |
| 924 | 927 | ||
| @@ -975,7 +978,8 @@ void r600_gpu_init(struct radeon_device *rdev) | |||
| 975 | 978 | ||
| 976 | if (((rdev->family) == CHIP_RV610) || | 979 | if (((rdev->family) == CHIP_RV610) || |
| 977 | ((rdev->family) == CHIP_RV620) || | 980 | ((rdev->family) == CHIP_RV620) || |
| 978 | ((rdev->family) == CHIP_RS780)) { | 981 | ((rdev->family) == CHIP_RS780) || |
| 982 | ((rdev->family) == CHIP_RS880)) { | ||
| 979 | WREG32(VGT_CACHE_INVALIDATION, CACHE_INVALIDATION(TC_ONLY)); | 983 | WREG32(VGT_CACHE_INVALIDATION, CACHE_INVALIDATION(TC_ONLY)); |
| 980 | } else { | 984 | } else { |
| 981 | WREG32(VGT_CACHE_INVALIDATION, CACHE_INVALIDATION(VC_AND_TC)); | 985 | WREG32(VGT_CACHE_INVALIDATION, CACHE_INVALIDATION(VC_AND_TC)); |
| @@ -1001,8 +1005,9 @@ void r600_gpu_init(struct radeon_device *rdev) | |||
| 1001 | tmp = rdev->config.r600.max_pipes * 16; | 1005 | tmp = rdev->config.r600.max_pipes * 16; |
| 1002 | switch (rdev->family) { | 1006 | switch (rdev->family) { |
| 1003 | case CHIP_RV610: | 1007 | case CHIP_RV610: |
| 1004 | case CHIP_RS780: | ||
| 1005 | case CHIP_RV620: | 1008 | case CHIP_RV620: |
| 1009 | case CHIP_RS780: | ||
| 1010 | case CHIP_RS880: | ||
| 1006 | tmp += 32; | 1011 | tmp += 32; |
| 1007 | break; | 1012 | break; |
| 1008 | case CHIP_RV670: | 1013 | case CHIP_RV670: |
| @@ -1043,8 +1048,9 @@ void r600_gpu_init(struct radeon_device *rdev) | |||
| 1043 | 1048 | ||
| 1044 | switch (rdev->family) { | 1049 | switch (rdev->family) { |
| 1045 | case CHIP_RV610: | 1050 | case CHIP_RV610: |
| 1046 | case CHIP_RS780: | ||
| 1047 | case CHIP_RV620: | 1051 | case CHIP_RV620: |
| 1052 | case CHIP_RS780: | ||
| 1053 | case CHIP_RS880: | ||
| 1048 | tmp = TC_L2_SIZE(8); | 1054 | tmp = TC_L2_SIZE(8); |
| 1049 | break; | 1055 | break; |
| 1050 | case CHIP_RV630: | 1056 | case CHIP_RV630: |
| @@ -1629,10 +1635,13 @@ int r600_init(struct radeon_device *rdev) | |||
| 1629 | r600_scratch_init(rdev); | 1635 | r600_scratch_init(rdev); |
| 1630 | /* Initialize surface registers */ | 1636 | /* Initialize surface registers */ |
| 1631 | radeon_surface_init(rdev); | 1637 | radeon_surface_init(rdev); |
| 1638 | /* Initialize clocks */ | ||
| 1632 | radeon_get_clock_info(rdev->ddev); | 1639 | radeon_get_clock_info(rdev->ddev); |
| 1633 | r = radeon_clocks_init(rdev); | 1640 | r = radeon_clocks_init(rdev); |
| 1634 | if (r) | 1641 | if (r) |
| 1635 | return r; | 1642 | return r; |
| 1643 | /* Initialize power management */ | ||
| 1644 | radeon_pm_init(rdev); | ||
| 1636 | /* Fence driver */ | 1645 | /* Fence driver */ |
| 1637 | r = radeon_fence_driver_init(rdev); | 1646 | r = radeon_fence_driver_init(rdev); |
| 1638 | if (r) | 1647 | if (r) |
diff --git a/drivers/gpu/drm/radeon/r600_blit_kms.c b/drivers/gpu/drm/radeon/r600_blit_kms.c index acae33e2ad51..dbf716e1fbf3 100644 --- a/drivers/gpu/drm/radeon/r600_blit_kms.c +++ b/drivers/gpu/drm/radeon/r600_blit_kms.c | |||
| @@ -368,7 +368,7 @@ set_default_state(struct radeon_device *rdev) | |||
| 368 | if ((rdev->family == CHIP_RV610) || | 368 | if ((rdev->family == CHIP_RV610) || |
| 369 | (rdev->family == CHIP_RV620) || | 369 | (rdev->family == CHIP_RV620) || |
| 370 | (rdev->family == CHIP_RS780) || | 370 | (rdev->family == CHIP_RS780) || |
| 371 | (rdev->family == CHIP_RS780) || | 371 | (rdev->family == CHIP_RS880) || |
| 372 | (rdev->family == CHIP_RV710)) | 372 | (rdev->family == CHIP_RV710)) |
| 373 | sq_config = 0; | 373 | sq_config = 0; |
| 374 | else | 374 | else |
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 620a7c8ca016..757f5cd37744 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
| @@ -139,6 +139,10 @@ struct radeon_clock { | |||
| 139 | uint32_t default_sclk; | 139 | uint32_t default_sclk; |
| 140 | }; | 140 | }; |
| 141 | 141 | ||
| 142 | /* | ||
| 143 | * Power management | ||
| 144 | */ | ||
| 145 | int radeon_pm_init(struct radeon_device *rdev); | ||
| 142 | 146 | ||
| 143 | /* | 147 | /* |
| 144 | * Fences. | 148 | * Fences. |
| @@ -623,7 +627,9 @@ struct radeon_asic { | |||
| 623 | uint64_t dst_offset, | 627 | uint64_t dst_offset, |
| 624 | unsigned num_pages, | 628 | unsigned num_pages, |
| 625 | struct radeon_fence *fence); | 629 | struct radeon_fence *fence); |
| 630 | uint32_t (*get_engine_clock)(struct radeon_device *rdev); | ||
| 626 | void (*set_engine_clock)(struct radeon_device *rdev, uint32_t eng_clock); | 631 | void (*set_engine_clock)(struct radeon_device *rdev, uint32_t eng_clock); |
| 632 | uint32_t (*get_memory_clock)(struct radeon_device *rdev); | ||
| 627 | void (*set_memory_clock)(struct radeon_device *rdev, uint32_t mem_clock); | 633 | void (*set_memory_clock)(struct radeon_device *rdev, uint32_t mem_clock); |
| 628 | void (*set_pcie_lanes)(struct radeon_device *rdev, int lanes); | 634 | void (*set_pcie_lanes)(struct radeon_device *rdev, int lanes); |
| 629 | void (*set_clock_gating)(struct radeon_device *rdev, int enable); | 635 | void (*set_clock_gating)(struct radeon_device *rdev, int enable); |
| @@ -955,7 +961,9 @@ static inline void radeon_ring_write(struct radeon_device *rdev, uint32_t v) | |||
| 955 | #define radeon_copy_blit(rdev, s, d, np, f) (rdev)->asic->copy_blit((rdev), (s), (d), (np), (f)) | 961 | #define radeon_copy_blit(rdev, s, d, np, f) (rdev)->asic->copy_blit((rdev), (s), (d), (np), (f)) |
| 956 | #define radeon_copy_dma(rdev, s, d, np, f) (rdev)->asic->copy_dma((rdev), (s), (d), (np), (f)) | 962 | #define radeon_copy_dma(rdev, s, d, np, f) (rdev)->asic->copy_dma((rdev), (s), (d), (np), (f)) |
| 957 | #define radeon_copy(rdev, s, d, np, f) (rdev)->asic->copy((rdev), (s), (d), (np), (f)) | 963 | #define radeon_copy(rdev, s, d, np, f) (rdev)->asic->copy((rdev), (s), (d), (np), (f)) |
| 964 | #define radeon_get_engine_clock(rdev) (rdev)->asic->get_engine_clock((rdev)) | ||
| 958 | #define radeon_set_engine_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e)) | 965 | #define radeon_set_engine_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e)) |
| 966 | #define radeon_get_memory_clock(rdev) (rdev)->asic->get_memory_clock((rdev)) | ||
| 959 | #define radeon_set_memory_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e)) | 967 | #define radeon_set_memory_clock(rdev, e) (rdev)->asic->set_engine_clock((rdev), (e)) |
| 960 | #define radeon_set_pcie_lanes(rdev, l) (rdev)->asic->set_pcie_lanes((rdev), (l)) | 968 | #define radeon_set_pcie_lanes(rdev, l) (rdev)->asic->set_pcie_lanes((rdev), (l)) |
| 961 | #define radeon_set_clock_gating(rdev, e) (rdev)->asic->set_clock_gating((rdev), (e)) | 969 | #define radeon_set_clock_gating(rdev, e) (rdev)->asic->set_clock_gating((rdev), (e)) |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h index c3532c7a6f3f..c18fbee387d7 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.h +++ b/drivers/gpu/drm/radeon/radeon_asic.h | |||
| @@ -31,10 +31,13 @@ | |||
| 31 | /* | 31 | /* |
| 32 | * common functions | 32 | * common functions |
| 33 | */ | 33 | */ |
| 34 | uint32_t radeon_legacy_get_engine_clock(struct radeon_device *rdev); | ||
| 34 | void radeon_legacy_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock); | 35 | void radeon_legacy_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock); |
| 35 | void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable); | 36 | void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable); |
| 36 | 37 | ||
| 38 | uint32_t radeon_atom_get_engine_clock(struct radeon_device *rdev); | ||
| 37 | void radeon_atom_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock); | 39 | void radeon_atom_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock); |
| 40 | uint32_t radeon_atom_get_memory_clock(struct radeon_device *rdev); | ||
| 38 | void radeon_atom_set_memory_clock(struct radeon_device *rdev, uint32_t mem_clock); | 41 | void radeon_atom_set_memory_clock(struct radeon_device *rdev, uint32_t mem_clock); |
| 39 | void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable); | 42 | void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable); |
| 40 | 43 | ||
| @@ -95,7 +98,9 @@ static struct radeon_asic r100_asic = { | |||
| 95 | .copy_blit = &r100_copy_blit, | 98 | .copy_blit = &r100_copy_blit, |
| 96 | .copy_dma = NULL, | 99 | .copy_dma = NULL, |
| 97 | .copy = &r100_copy_blit, | 100 | .copy = &r100_copy_blit, |
| 101 | .get_engine_clock = &radeon_legacy_get_engine_clock, | ||
| 98 | .set_engine_clock = &radeon_legacy_set_engine_clock, | 102 | .set_engine_clock = &radeon_legacy_set_engine_clock, |
| 103 | .get_memory_clock = NULL, | ||
| 99 | .set_memory_clock = NULL, | 104 | .set_memory_clock = NULL, |
| 100 | .set_pcie_lanes = NULL, | 105 | .set_pcie_lanes = NULL, |
| 101 | .set_clock_gating = &radeon_legacy_set_clock_gating, | 106 | .set_clock_gating = &radeon_legacy_set_clock_gating, |
| @@ -148,7 +153,9 @@ static struct radeon_asic r300_asic = { | |||
| 148 | .copy_blit = &r100_copy_blit, | 153 | .copy_blit = &r100_copy_blit, |
| 149 | .copy_dma = &r300_copy_dma, | 154 | .copy_dma = &r300_copy_dma, |
| 150 | .copy = &r100_copy_blit, | 155 | .copy = &r100_copy_blit, |
| 156 | .get_engine_clock = &radeon_legacy_get_engine_clock, | ||
| 151 | .set_engine_clock = &radeon_legacy_set_engine_clock, | 157 | .set_engine_clock = &radeon_legacy_set_engine_clock, |
| 158 | .get_memory_clock = NULL, | ||
| 152 | .set_memory_clock = NULL, | 159 | .set_memory_clock = NULL, |
| 153 | .set_pcie_lanes = &rv370_set_pcie_lanes, | 160 | .set_pcie_lanes = &rv370_set_pcie_lanes, |
| 154 | .set_clock_gating = &radeon_legacy_set_clock_gating, | 161 | .set_clock_gating = &radeon_legacy_set_clock_gating, |
| @@ -185,7 +192,9 @@ static struct radeon_asic r420_asic = { | |||
| 185 | .copy_blit = &r100_copy_blit, | 192 | .copy_blit = &r100_copy_blit, |
| 186 | .copy_dma = &r300_copy_dma, | 193 | .copy_dma = &r300_copy_dma, |
| 187 | .copy = &r100_copy_blit, | 194 | .copy = &r100_copy_blit, |
| 195 | .get_engine_clock = &radeon_atom_get_engine_clock, | ||
| 188 | .set_engine_clock = &radeon_atom_set_engine_clock, | 196 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 197 | .get_memory_clock = &radeon_atom_get_memory_clock, | ||
| 189 | .set_memory_clock = &radeon_atom_set_memory_clock, | 198 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 190 | .set_pcie_lanes = &rv370_set_pcie_lanes, | 199 | .set_pcie_lanes = &rv370_set_pcie_lanes, |
| 191 | .set_clock_gating = &radeon_atom_set_clock_gating, | 200 | .set_clock_gating = &radeon_atom_set_clock_gating, |
| @@ -227,7 +236,9 @@ static struct radeon_asic rs400_asic = { | |||
| 227 | .copy_blit = &r100_copy_blit, | 236 | .copy_blit = &r100_copy_blit, |
| 228 | .copy_dma = &r300_copy_dma, | 237 | .copy_dma = &r300_copy_dma, |
| 229 | .copy = &r100_copy_blit, | 238 | .copy = &r100_copy_blit, |
| 239 | .get_engine_clock = &radeon_legacy_get_engine_clock, | ||
| 230 | .set_engine_clock = &radeon_legacy_set_engine_clock, | 240 | .set_engine_clock = &radeon_legacy_set_engine_clock, |
| 241 | .get_memory_clock = NULL, | ||
| 231 | .set_memory_clock = NULL, | 242 | .set_memory_clock = NULL, |
| 232 | .set_pcie_lanes = NULL, | 243 | .set_pcie_lanes = NULL, |
| 233 | .set_clock_gating = &radeon_legacy_set_clock_gating, | 244 | .set_clock_gating = &radeon_legacy_set_clock_gating, |
| @@ -273,7 +284,9 @@ static struct radeon_asic rs600_asic = { | |||
| 273 | .copy_blit = &r100_copy_blit, | 284 | .copy_blit = &r100_copy_blit, |
| 274 | .copy_dma = &r300_copy_dma, | 285 | .copy_dma = &r300_copy_dma, |
| 275 | .copy = &r100_copy_blit, | 286 | .copy = &r100_copy_blit, |
| 287 | .get_engine_clock = &radeon_atom_get_engine_clock, | ||
| 276 | .set_engine_clock = &radeon_atom_set_engine_clock, | 288 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 289 | .get_memory_clock = &radeon_atom_get_memory_clock, | ||
| 277 | .set_memory_clock = &radeon_atom_set_memory_clock, | 290 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 278 | .set_pcie_lanes = NULL, | 291 | .set_pcie_lanes = NULL, |
| 279 | .set_clock_gating = &radeon_atom_set_clock_gating, | 292 | .set_clock_gating = &radeon_atom_set_clock_gating, |
| @@ -312,7 +325,9 @@ static struct radeon_asic rs690_asic = { | |||
| 312 | .copy_blit = &r100_copy_blit, | 325 | .copy_blit = &r100_copy_blit, |
| 313 | .copy_dma = &r300_copy_dma, | 326 | .copy_dma = &r300_copy_dma, |
| 314 | .copy = &r300_copy_dma, | 327 | .copy = &r300_copy_dma, |
| 328 | .get_engine_clock = &radeon_atom_get_engine_clock, | ||
| 315 | .set_engine_clock = &radeon_atom_set_engine_clock, | 329 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 330 | .get_memory_clock = &radeon_atom_get_memory_clock, | ||
| 316 | .set_memory_clock = &radeon_atom_set_memory_clock, | 331 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 317 | .set_pcie_lanes = NULL, | 332 | .set_pcie_lanes = NULL, |
| 318 | .set_clock_gating = &radeon_atom_set_clock_gating, | 333 | .set_clock_gating = &radeon_atom_set_clock_gating, |
| @@ -357,7 +372,9 @@ static struct radeon_asic rv515_asic = { | |||
| 357 | .copy_blit = &r100_copy_blit, | 372 | .copy_blit = &r100_copy_blit, |
| 358 | .copy_dma = &r300_copy_dma, | 373 | .copy_dma = &r300_copy_dma, |
| 359 | .copy = &r100_copy_blit, | 374 | .copy = &r100_copy_blit, |
| 375 | .get_engine_clock = &radeon_atom_get_engine_clock, | ||
| 360 | .set_engine_clock = &radeon_atom_set_engine_clock, | 376 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 377 | .get_memory_clock = &radeon_atom_get_memory_clock, | ||
| 361 | .set_memory_clock = &radeon_atom_set_memory_clock, | 378 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 362 | .set_pcie_lanes = &rv370_set_pcie_lanes, | 379 | .set_pcie_lanes = &rv370_set_pcie_lanes, |
| 363 | .set_clock_gating = &radeon_atom_set_clock_gating, | 380 | .set_clock_gating = &radeon_atom_set_clock_gating, |
| @@ -393,7 +410,9 @@ static struct radeon_asic r520_asic = { | |||
| 393 | .copy_blit = &r100_copy_blit, | 410 | .copy_blit = &r100_copy_blit, |
| 394 | .copy_dma = &r300_copy_dma, | 411 | .copy_dma = &r300_copy_dma, |
| 395 | .copy = &r100_copy_blit, | 412 | .copy = &r100_copy_blit, |
| 413 | .get_engine_clock = &radeon_atom_get_engine_clock, | ||
| 396 | .set_engine_clock = &radeon_atom_set_engine_clock, | 414 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 415 | .get_memory_clock = &radeon_atom_get_memory_clock, | ||
| 397 | .set_memory_clock = &radeon_atom_set_memory_clock, | 416 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 398 | .set_pcie_lanes = &rv370_set_pcie_lanes, | 417 | .set_pcie_lanes = &rv370_set_pcie_lanes, |
| 399 | .set_clock_gating = &radeon_atom_set_clock_gating, | 418 | .set_clock_gating = &radeon_atom_set_clock_gating, |
| @@ -456,7 +475,9 @@ static struct radeon_asic r600_asic = { | |||
| 456 | .copy_blit = &r600_copy_blit, | 475 | .copy_blit = &r600_copy_blit, |
| 457 | .copy_dma = &r600_copy_blit, | 476 | .copy_dma = &r600_copy_blit, |
| 458 | .copy = &r600_copy_blit, | 477 | .copy = &r600_copy_blit, |
| 478 | .get_engine_clock = &radeon_atom_get_engine_clock, | ||
| 459 | .set_engine_clock = &radeon_atom_set_engine_clock, | 479 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 480 | .get_memory_clock = &radeon_atom_get_memory_clock, | ||
| 460 | .set_memory_clock = &radeon_atom_set_memory_clock, | 481 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 461 | .set_pcie_lanes = NULL, | 482 | .set_pcie_lanes = NULL, |
| 462 | .set_clock_gating = &radeon_atom_set_clock_gating, | 483 | .set_clock_gating = &radeon_atom_set_clock_gating, |
| @@ -493,7 +514,9 @@ static struct radeon_asic rv770_asic = { | |||
| 493 | .copy_blit = &r600_copy_blit, | 514 | .copy_blit = &r600_copy_blit, |
| 494 | .copy_dma = &r600_copy_blit, | 515 | .copy_dma = &r600_copy_blit, |
| 495 | .copy = &r600_copy_blit, | 516 | .copy = &r600_copy_blit, |
| 517 | .get_engine_clock = &radeon_atom_get_engine_clock, | ||
| 496 | .set_engine_clock = &radeon_atom_set_engine_clock, | 518 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 519 | .get_memory_clock = &radeon_atom_get_memory_clock, | ||
| 497 | .set_memory_clock = &radeon_atom_set_memory_clock, | 520 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 498 | .set_pcie_lanes = NULL, | 521 | .set_pcie_lanes = NULL, |
| 499 | .set_clock_gating = &radeon_atom_set_clock_gating, | 522 | .set_clock_gating = &radeon_atom_set_clock_gating, |
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 1c9a9c461762..2ed88a820935 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
| @@ -46,7 +46,8 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
| 46 | uint32_t supported_device, | 46 | uint32_t supported_device, |
| 47 | int connector_type, | 47 | int connector_type, |
| 48 | struct radeon_i2c_bus_rec *i2c_bus, | 48 | struct radeon_i2c_bus_rec *i2c_bus, |
| 49 | bool linkb, uint32_t igp_lane_info); | 49 | bool linkb, uint32_t igp_lane_info, |
| 50 | uint16_t connector_object_id); | ||
| 50 | 51 | ||
| 51 | /* from radeon_legacy_encoder.c */ | 52 | /* from radeon_legacy_encoder.c */ |
| 52 | extern void | 53 | extern void |
| @@ -193,6 +194,23 @@ const int supported_devices_connector_convert[] = { | |||
| 193 | DRM_MODE_CONNECTOR_DisplayPort | 194 | DRM_MODE_CONNECTOR_DisplayPort |
| 194 | }; | 195 | }; |
| 195 | 196 | ||
| 197 | const uint16_t supported_devices_connector_object_id_convert[] = { | ||
| 198 | CONNECTOR_OBJECT_ID_NONE, | ||
| 199 | CONNECTOR_OBJECT_ID_VGA, | ||
| 200 | CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I, /* not all boards support DL */ | ||
| 201 | CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D, /* not all boards support DL */ | ||
| 202 | CONNECTOR_OBJECT_ID_VGA, /* technically DVI-A */ | ||
| 203 | CONNECTOR_OBJECT_ID_COMPOSITE, | ||
| 204 | CONNECTOR_OBJECT_ID_SVIDEO, | ||
| 205 | CONNECTOR_OBJECT_ID_LVDS, | ||
| 206 | CONNECTOR_OBJECT_ID_9PIN_DIN, | ||
| 207 | CONNECTOR_OBJECT_ID_9PIN_DIN, | ||
| 208 | CONNECTOR_OBJECT_ID_DISPLAYPORT, | ||
| 209 | CONNECTOR_OBJECT_ID_HDMI_TYPE_A, | ||
| 210 | CONNECTOR_OBJECT_ID_HDMI_TYPE_B, | ||
| 211 | CONNECTOR_OBJECT_ID_SVIDEO | ||
| 212 | }; | ||
| 213 | |||
| 196 | const int object_connector_convert[] = { | 214 | const int object_connector_convert[] = { |
| 197 | DRM_MODE_CONNECTOR_Unknown, | 215 | DRM_MODE_CONNECTOR_Unknown, |
| 198 | DRM_MODE_CONNECTOR_DVII, | 216 | DRM_MODE_CONNECTOR_DVII, |
| @@ -229,7 +247,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) | |||
| 229 | ATOM_OBJECT_HEADER *obj_header; | 247 | ATOM_OBJECT_HEADER *obj_header; |
| 230 | int i, j, path_size, device_support; | 248 | int i, j, path_size, device_support; |
| 231 | int connector_type; | 249 | int connector_type; |
| 232 | uint16_t igp_lane_info, conn_id; | 250 | uint16_t igp_lane_info, conn_id, connector_object_id; |
| 233 | bool linkb; | 251 | bool linkb; |
| 234 | struct radeon_i2c_bus_rec ddc_bus; | 252 | struct radeon_i2c_bus_rec ddc_bus; |
| 235 | 253 | ||
| @@ -277,7 +295,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) | |||
| 277 | ATOM_DEVICE_CV_SUPPORT) | 295 | ATOM_DEVICE_CV_SUPPORT) |
| 278 | continue; | 296 | continue; |
| 279 | 297 | ||
| 280 | if ((rdev->family == CHIP_RS780) && | 298 | /* IGP chips */ |
| 299 | if ((rdev->flags & RADEON_IS_IGP) && | ||
| 281 | (con_obj_id == | 300 | (con_obj_id == |
| 282 | CONNECTOR_OBJECT_ID_PCIE_CONNECTOR)) { | 301 | CONNECTOR_OBJECT_ID_PCIE_CONNECTOR)) { |
| 283 | uint16_t igp_offset = 0; | 302 | uint16_t igp_offset = 0; |
| @@ -311,6 +330,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) | |||
| 311 | connector_type = | 330 | connector_type = |
| 312 | object_connector_convert | 331 | object_connector_convert |
| 313 | [ct]; | 332 | [ct]; |
| 333 | connector_object_id = ct; | ||
| 314 | igp_lane_info = | 334 | igp_lane_info = |
| 315 | slot_config & 0xffff; | 335 | slot_config & 0xffff; |
| 316 | } else | 336 | } else |
| @@ -321,6 +341,7 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) | |||
| 321 | igp_lane_info = 0; | 341 | igp_lane_info = 0; |
| 322 | connector_type = | 342 | connector_type = |
| 323 | object_connector_convert[con_obj_id]; | 343 | object_connector_convert[con_obj_id]; |
| 344 | connector_object_id = con_obj_id; | ||
| 324 | } | 345 | } |
| 325 | 346 | ||
| 326 | if (connector_type == DRM_MODE_CONNECTOR_Unknown) | 347 | if (connector_type == DRM_MODE_CONNECTOR_Unknown) |
| @@ -425,7 +446,8 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) | |||
| 425 | le16_to_cpu(path-> | 446 | le16_to_cpu(path-> |
| 426 | usDeviceTag), | 447 | usDeviceTag), |
| 427 | connector_type, &ddc_bus, | 448 | connector_type, &ddc_bus, |
| 428 | linkb, igp_lane_info); | 449 | linkb, igp_lane_info, |
| 450 | connector_object_id); | ||
| 429 | 451 | ||
| 430 | } | 452 | } |
| 431 | } | 453 | } |
| @@ -435,6 +457,45 @@ bool radeon_get_atom_connector_info_from_object_table(struct drm_device *dev) | |||
| 435 | return true; | 457 | return true; |
| 436 | } | 458 | } |
| 437 | 459 | ||
| 460 | static uint16_t atombios_get_connector_object_id(struct drm_device *dev, | ||
| 461 | int connector_type, | ||
| 462 | uint16_t devices) | ||
| 463 | { | ||
| 464 | struct radeon_device *rdev = dev->dev_private; | ||
| 465 | |||
| 466 | if (rdev->flags & RADEON_IS_IGP) { | ||
| 467 | return supported_devices_connector_object_id_convert | ||
| 468 | [connector_type]; | ||
| 469 | } else if (((connector_type == DRM_MODE_CONNECTOR_DVII) || | ||
| 470 | (connector_type == DRM_MODE_CONNECTOR_DVID)) && | ||
| 471 | (devices & ATOM_DEVICE_DFP2_SUPPORT)) { | ||
| 472 | struct radeon_mode_info *mode_info = &rdev->mode_info; | ||
| 473 | struct atom_context *ctx = mode_info->atom_context; | ||
| 474 | int index = GetIndexIntoMasterTable(DATA, XTMDS_Info); | ||
| 475 | uint16_t size, data_offset; | ||
| 476 | uint8_t frev, crev; | ||
| 477 | ATOM_XTMDS_INFO *xtmds; | ||
| 478 | |||
| 479 | atom_parse_data_header(ctx, index, &size, &frev, &crev, &data_offset); | ||
| 480 | xtmds = (ATOM_XTMDS_INFO *)(ctx->bios + data_offset); | ||
| 481 | |||
| 482 | if (xtmds->ucSupportedLink & ATOM_XTMDS_SUPPORTED_DUALLINK) { | ||
| 483 | if (connector_type == DRM_MODE_CONNECTOR_DVII) | ||
| 484 | return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I; | ||
| 485 | else | ||
| 486 | return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D; | ||
| 487 | } else { | ||
| 488 | if (connector_type == DRM_MODE_CONNECTOR_DVII) | ||
| 489 | return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I; | ||
| 490 | else | ||
| 491 | return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D; | ||
| 492 | } | ||
| 493 | } else { | ||
| 494 | return supported_devices_connector_object_id_convert | ||
| 495 | [connector_type]; | ||
| 496 | } | ||
| 497 | } | ||
| 498 | |||
| 438 | struct bios_connector { | 499 | struct bios_connector { |
| 439 | bool valid; | 500 | bool valid; |
| 440 | uint16_t line_mux; | 501 | uint16_t line_mux; |
| @@ -593,14 +654,20 @@ bool radeon_get_atom_connector_info_from_supported_devices_table(struct | |||
| 593 | 654 | ||
| 594 | /* add the connectors */ | 655 | /* add the connectors */ |
| 595 | for (i = 0; i < ATOM_MAX_SUPPORTED_DEVICE; i++) { | 656 | for (i = 0; i < ATOM_MAX_SUPPORTED_DEVICE; i++) { |
| 596 | if (bios_connectors[i].valid) | 657 | if (bios_connectors[i].valid) { |
| 658 | uint16_t connector_object_id = | ||
| 659 | atombios_get_connector_object_id(dev, | ||
| 660 | bios_connectors[i].connector_type, | ||
| 661 | bios_connectors[i].devices); | ||
| 597 | radeon_add_atom_connector(dev, | 662 | radeon_add_atom_connector(dev, |
| 598 | bios_connectors[i].line_mux, | 663 | bios_connectors[i].line_mux, |
| 599 | bios_connectors[i].devices, | 664 | bios_connectors[i].devices, |
| 600 | bios_connectors[i]. | 665 | bios_connectors[i]. |
| 601 | connector_type, | 666 | connector_type, |
| 602 | &bios_connectors[i].ddc_bus, | 667 | &bios_connectors[i].ddc_bus, |
| 603 | false, 0); | 668 | false, 0, |
| 669 | connector_object_id); | ||
| 670 | } | ||
| 604 | } | 671 | } |
| 605 | 672 | ||
| 606 | radeon_link_encoder_connector(dev); | 673 | radeon_link_encoder_connector(dev); |
| @@ -1066,6 +1133,24 @@ void radeon_atom_static_pwrmgt_setup(struct radeon_device *rdev, int enable) | |||
| 1066 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | 1133 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); |
| 1067 | } | 1134 | } |
| 1068 | 1135 | ||
| 1136 | uint32_t radeon_atom_get_engine_clock(struct radeon_device *rdev) | ||
| 1137 | { | ||
| 1138 | GET_ENGINE_CLOCK_PS_ALLOCATION args; | ||
| 1139 | int index = GetIndexIntoMasterTable(COMMAND, GetEngineClock); | ||
| 1140 | |||
| 1141 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | ||
| 1142 | return args.ulReturnEngineClock; | ||
| 1143 | } | ||
| 1144 | |||
| 1145 | uint32_t radeon_atom_get_memory_clock(struct radeon_device *rdev) | ||
| 1146 | { | ||
| 1147 | GET_MEMORY_CLOCK_PS_ALLOCATION args; | ||
| 1148 | int index = GetIndexIntoMasterTable(COMMAND, GetMemoryClock); | ||
| 1149 | |||
| 1150 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | ||
| 1151 | return args.ulReturnMemoryClock; | ||
| 1152 | } | ||
| 1153 | |||
| 1069 | void radeon_atom_set_engine_clock(struct radeon_device *rdev, | 1154 | void radeon_atom_set_engine_clock(struct radeon_device *rdev, |
| 1070 | uint32_t eng_clock) | 1155 | uint32_t eng_clock) |
| 1071 | { | 1156 | { |
diff --git a/drivers/gpu/drm/radeon/radeon_clocks.c b/drivers/gpu/drm/radeon/radeon_clocks.c index f5c32a766b10..a81354167621 100644 --- a/drivers/gpu/drm/radeon/radeon_clocks.c +++ b/drivers/gpu/drm/radeon/radeon_clocks.c | |||
| @@ -32,7 +32,7 @@ | |||
| 32 | #include "atom.h" | 32 | #include "atom.h" |
| 33 | 33 | ||
| 34 | /* 10 khz */ | 34 | /* 10 khz */ |
| 35 | static uint32_t radeon_legacy_get_engine_clock(struct radeon_device *rdev) | 35 | uint32_t radeon_legacy_get_engine_clock(struct radeon_device *rdev) |
| 36 | { | 36 | { |
| 37 | struct radeon_pll *spll = &rdev->clock.spll; | 37 | struct radeon_pll *spll = &rdev->clock.spll; |
| 38 | uint32_t fb_div, ref_div, post_div, sclk; | 38 | uint32_t fb_div, ref_div, post_div, sclk; |
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index a36ede002ee4..5253cbf6db1f 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
| @@ -49,7 +49,8 @@ radeon_add_legacy_connector(struct drm_device *dev, | |||
| 49 | uint32_t connector_id, | 49 | uint32_t connector_id, |
| 50 | uint32_t supported_device, | 50 | uint32_t supported_device, |
| 51 | int connector_type, | 51 | int connector_type, |
| 52 | struct radeon_i2c_bus_rec *i2c_bus); | 52 | struct radeon_i2c_bus_rec *i2c_bus, |
| 53 | uint16_t connector_object_id); | ||
| 53 | 54 | ||
| 54 | /* from radeon_legacy_encoder.c */ | 55 | /* from radeon_legacy_encoder.c */ |
| 55 | extern void | 56 | extern void |
| @@ -1176,7 +1177,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1176 | radeon_add_legacy_connector(dev, 0, | 1177 | radeon_add_legacy_connector(dev, 0, |
| 1177 | ATOM_DEVICE_CRT1_SUPPORT, | 1178 | ATOM_DEVICE_CRT1_SUPPORT, |
| 1178 | DRM_MODE_CONNECTOR_VGA, | 1179 | DRM_MODE_CONNECTOR_VGA, |
| 1179 | &ddc_i2c); | 1180 | &ddc_i2c, |
| 1181 | CONNECTOR_OBJECT_ID_VGA); | ||
| 1180 | } else if (rdev->flags & RADEON_IS_MOBILITY) { | 1182 | } else if (rdev->flags & RADEON_IS_MOBILITY) { |
| 1181 | /* LVDS */ | 1183 | /* LVDS */ |
| 1182 | ddc_i2c = combios_setup_i2c_bus(RADEON_LCD_GPIO_MASK); | 1184 | ddc_i2c = combios_setup_i2c_bus(RADEON_LCD_GPIO_MASK); |
| @@ -1188,7 +1190,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1188 | radeon_add_legacy_connector(dev, 0, | 1190 | radeon_add_legacy_connector(dev, 0, |
| 1189 | ATOM_DEVICE_LCD1_SUPPORT, | 1191 | ATOM_DEVICE_LCD1_SUPPORT, |
| 1190 | DRM_MODE_CONNECTOR_LVDS, | 1192 | DRM_MODE_CONNECTOR_LVDS, |
| 1191 | &ddc_i2c); | 1193 | &ddc_i2c, |
| 1194 | CONNECTOR_OBJECT_ID_LVDS); | ||
| 1192 | 1195 | ||
| 1193 | /* VGA - primary dac */ | 1196 | /* VGA - primary dac */ |
| 1194 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); | 1197 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); |
| @@ -1200,7 +1203,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1200 | radeon_add_legacy_connector(dev, 1, | 1203 | radeon_add_legacy_connector(dev, 1, |
| 1201 | ATOM_DEVICE_CRT1_SUPPORT, | 1204 | ATOM_DEVICE_CRT1_SUPPORT, |
| 1202 | DRM_MODE_CONNECTOR_VGA, | 1205 | DRM_MODE_CONNECTOR_VGA, |
| 1203 | &ddc_i2c); | 1206 | &ddc_i2c, |
| 1207 | CONNECTOR_OBJECT_ID_VGA); | ||
| 1204 | } else { | 1208 | } else { |
| 1205 | /* DVI-I - tv dac, int tmds */ | 1209 | /* DVI-I - tv dac, int tmds */ |
| 1206 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_DVI_DDC); | 1210 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_DVI_DDC); |
| @@ -1218,7 +1222,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1218 | ATOM_DEVICE_DFP1_SUPPORT | | 1222 | ATOM_DEVICE_DFP1_SUPPORT | |
| 1219 | ATOM_DEVICE_CRT2_SUPPORT, | 1223 | ATOM_DEVICE_CRT2_SUPPORT, |
| 1220 | DRM_MODE_CONNECTOR_DVII, | 1224 | DRM_MODE_CONNECTOR_DVII, |
| 1221 | &ddc_i2c); | 1225 | &ddc_i2c, |
| 1226 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I); | ||
| 1222 | 1227 | ||
| 1223 | /* VGA - primary dac */ | 1228 | /* VGA - primary dac */ |
| 1224 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); | 1229 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); |
| @@ -1230,7 +1235,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1230 | radeon_add_legacy_connector(dev, 1, | 1235 | radeon_add_legacy_connector(dev, 1, |
| 1231 | ATOM_DEVICE_CRT1_SUPPORT, | 1236 | ATOM_DEVICE_CRT1_SUPPORT, |
| 1232 | DRM_MODE_CONNECTOR_VGA, | 1237 | DRM_MODE_CONNECTOR_VGA, |
| 1233 | &ddc_i2c); | 1238 | &ddc_i2c, |
| 1239 | CONNECTOR_OBJECT_ID_VGA); | ||
| 1234 | } | 1240 | } |
| 1235 | 1241 | ||
| 1236 | if (rdev->family != CHIP_R100 && rdev->family != CHIP_R200) { | 1242 | if (rdev->family != CHIP_R100 && rdev->family != CHIP_R200) { |
| @@ -1243,7 +1249,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1243 | radeon_add_legacy_connector(dev, 2, | 1249 | radeon_add_legacy_connector(dev, 2, |
| 1244 | ATOM_DEVICE_TV1_SUPPORT, | 1250 | ATOM_DEVICE_TV1_SUPPORT, |
| 1245 | DRM_MODE_CONNECTOR_SVIDEO, | 1251 | DRM_MODE_CONNECTOR_SVIDEO, |
| 1246 | &ddc_i2c); | 1252 | &ddc_i2c, |
| 1253 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
| 1247 | } | 1254 | } |
| 1248 | break; | 1255 | break; |
| 1249 | case CT_IBOOK: | 1256 | case CT_IBOOK: |
| @@ -1257,7 +1264,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1257 | 0), | 1264 | 0), |
| 1258 | ATOM_DEVICE_LCD1_SUPPORT); | 1265 | ATOM_DEVICE_LCD1_SUPPORT); |
| 1259 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, | 1266 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, |
| 1260 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c); | 1267 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c, |
| 1268 | CONNECTOR_OBJECT_ID_LVDS); | ||
| 1261 | /* VGA - TV DAC */ | 1269 | /* VGA - TV DAC */ |
| 1262 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); | 1270 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); |
| 1263 | radeon_add_legacy_encoder(dev, | 1271 | radeon_add_legacy_encoder(dev, |
| @@ -1266,7 +1274,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1266 | 2), | 1274 | 2), |
| 1267 | ATOM_DEVICE_CRT2_SUPPORT); | 1275 | ATOM_DEVICE_CRT2_SUPPORT); |
| 1268 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, | 1276 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, |
| 1269 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c); | 1277 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, |
| 1278 | CONNECTOR_OBJECT_ID_VGA); | ||
| 1270 | /* TV - TV DAC */ | 1279 | /* TV - TV DAC */ |
| 1271 | radeon_add_legacy_encoder(dev, | 1280 | radeon_add_legacy_encoder(dev, |
| 1272 | radeon_get_encoder_id(dev, | 1281 | radeon_get_encoder_id(dev, |
| @@ -1275,7 +1284,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1275 | ATOM_DEVICE_TV1_SUPPORT); | 1284 | ATOM_DEVICE_TV1_SUPPORT); |
| 1276 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1285 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
| 1277 | DRM_MODE_CONNECTOR_SVIDEO, | 1286 | DRM_MODE_CONNECTOR_SVIDEO, |
| 1278 | &ddc_i2c); | 1287 | &ddc_i2c, |
| 1288 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
| 1279 | break; | 1289 | break; |
| 1280 | case CT_POWERBOOK_EXTERNAL: | 1290 | case CT_POWERBOOK_EXTERNAL: |
| 1281 | DRM_INFO("Connector Table: %d (powerbook external tmds)\n", | 1291 | DRM_INFO("Connector Table: %d (powerbook external tmds)\n", |
| @@ -1288,7 +1298,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1288 | 0), | 1298 | 0), |
| 1289 | ATOM_DEVICE_LCD1_SUPPORT); | 1299 | ATOM_DEVICE_LCD1_SUPPORT); |
| 1290 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, | 1300 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, |
| 1291 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c); | 1301 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c, |
| 1302 | CONNECTOR_OBJECT_ID_LVDS); | ||
| 1292 | /* DVI-I - primary dac, ext tmds */ | 1303 | /* DVI-I - primary dac, ext tmds */ |
| 1293 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); | 1304 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); |
| 1294 | radeon_add_legacy_encoder(dev, | 1305 | radeon_add_legacy_encoder(dev, |
| @@ -1301,10 +1312,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1301 | ATOM_DEVICE_CRT1_SUPPORT, | 1312 | ATOM_DEVICE_CRT1_SUPPORT, |
| 1302 | 1), | 1313 | 1), |
| 1303 | ATOM_DEVICE_CRT1_SUPPORT); | 1314 | ATOM_DEVICE_CRT1_SUPPORT); |
| 1315 | /* XXX some are SL */ | ||
| 1304 | radeon_add_legacy_connector(dev, 1, | 1316 | radeon_add_legacy_connector(dev, 1, |
| 1305 | ATOM_DEVICE_DFP2_SUPPORT | | 1317 | ATOM_DEVICE_DFP2_SUPPORT | |
| 1306 | ATOM_DEVICE_CRT1_SUPPORT, | 1318 | ATOM_DEVICE_CRT1_SUPPORT, |
| 1307 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c); | 1319 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, |
| 1320 | CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I); | ||
| 1308 | /* TV - TV DAC */ | 1321 | /* TV - TV DAC */ |
| 1309 | radeon_add_legacy_encoder(dev, | 1322 | radeon_add_legacy_encoder(dev, |
| 1310 | radeon_get_encoder_id(dev, | 1323 | radeon_get_encoder_id(dev, |
| @@ -1313,7 +1326,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1313 | ATOM_DEVICE_TV1_SUPPORT); | 1326 | ATOM_DEVICE_TV1_SUPPORT); |
| 1314 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1327 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
| 1315 | DRM_MODE_CONNECTOR_SVIDEO, | 1328 | DRM_MODE_CONNECTOR_SVIDEO, |
| 1316 | &ddc_i2c); | 1329 | &ddc_i2c, |
| 1330 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
| 1317 | break; | 1331 | break; |
| 1318 | case CT_POWERBOOK_INTERNAL: | 1332 | case CT_POWERBOOK_INTERNAL: |
| 1319 | DRM_INFO("Connector Table: %d (powerbook internal tmds)\n", | 1333 | DRM_INFO("Connector Table: %d (powerbook internal tmds)\n", |
| @@ -1326,7 +1340,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1326 | 0), | 1340 | 0), |
| 1327 | ATOM_DEVICE_LCD1_SUPPORT); | 1341 | ATOM_DEVICE_LCD1_SUPPORT); |
| 1328 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, | 1342 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, |
| 1329 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c); | 1343 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c, |
| 1344 | CONNECTOR_OBJECT_ID_LVDS); | ||
| 1330 | /* DVI-I - primary dac, int tmds */ | 1345 | /* DVI-I - primary dac, int tmds */ |
| 1331 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); | 1346 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); |
| 1332 | radeon_add_legacy_encoder(dev, | 1347 | radeon_add_legacy_encoder(dev, |
| @@ -1342,7 +1357,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1342 | radeon_add_legacy_connector(dev, 1, | 1357 | radeon_add_legacy_connector(dev, 1, |
| 1343 | ATOM_DEVICE_DFP1_SUPPORT | | 1358 | ATOM_DEVICE_DFP1_SUPPORT | |
| 1344 | ATOM_DEVICE_CRT1_SUPPORT, | 1359 | ATOM_DEVICE_CRT1_SUPPORT, |
| 1345 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c); | 1360 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, |
| 1361 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I); | ||
| 1346 | /* TV - TV DAC */ | 1362 | /* TV - TV DAC */ |
| 1347 | radeon_add_legacy_encoder(dev, | 1363 | radeon_add_legacy_encoder(dev, |
| 1348 | radeon_get_encoder_id(dev, | 1364 | radeon_get_encoder_id(dev, |
| @@ -1351,7 +1367,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1351 | ATOM_DEVICE_TV1_SUPPORT); | 1367 | ATOM_DEVICE_TV1_SUPPORT); |
| 1352 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1368 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
| 1353 | DRM_MODE_CONNECTOR_SVIDEO, | 1369 | DRM_MODE_CONNECTOR_SVIDEO, |
| 1354 | &ddc_i2c); | 1370 | &ddc_i2c, |
| 1371 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
| 1355 | break; | 1372 | break; |
| 1356 | case CT_POWERBOOK_VGA: | 1373 | case CT_POWERBOOK_VGA: |
| 1357 | DRM_INFO("Connector Table: %d (powerbook vga)\n", | 1374 | DRM_INFO("Connector Table: %d (powerbook vga)\n", |
| @@ -1364,7 +1381,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1364 | 0), | 1381 | 0), |
| 1365 | ATOM_DEVICE_LCD1_SUPPORT); | 1382 | ATOM_DEVICE_LCD1_SUPPORT); |
| 1366 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, | 1383 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_LCD1_SUPPORT, |
| 1367 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c); | 1384 | DRM_MODE_CONNECTOR_LVDS, &ddc_i2c, |
| 1385 | CONNECTOR_OBJECT_ID_LVDS); | ||
| 1368 | /* VGA - primary dac */ | 1386 | /* VGA - primary dac */ |
| 1369 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); | 1387 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_VGA_DDC); |
| 1370 | radeon_add_legacy_encoder(dev, | 1388 | radeon_add_legacy_encoder(dev, |
| @@ -1373,7 +1391,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1373 | 1), | 1391 | 1), |
| 1374 | ATOM_DEVICE_CRT1_SUPPORT); | 1392 | ATOM_DEVICE_CRT1_SUPPORT); |
| 1375 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT1_SUPPORT, | 1393 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT1_SUPPORT, |
| 1376 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c); | 1394 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, |
| 1395 | CONNECTOR_OBJECT_ID_VGA); | ||
| 1377 | /* TV - TV DAC */ | 1396 | /* TV - TV DAC */ |
| 1378 | radeon_add_legacy_encoder(dev, | 1397 | radeon_add_legacy_encoder(dev, |
| 1379 | radeon_get_encoder_id(dev, | 1398 | radeon_get_encoder_id(dev, |
| @@ -1382,7 +1401,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1382 | ATOM_DEVICE_TV1_SUPPORT); | 1401 | ATOM_DEVICE_TV1_SUPPORT); |
| 1383 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1402 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
| 1384 | DRM_MODE_CONNECTOR_SVIDEO, | 1403 | DRM_MODE_CONNECTOR_SVIDEO, |
| 1385 | &ddc_i2c); | 1404 | &ddc_i2c, |
| 1405 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
| 1386 | break; | 1406 | break; |
| 1387 | case CT_MINI_EXTERNAL: | 1407 | case CT_MINI_EXTERNAL: |
| 1388 | DRM_INFO("Connector Table: %d (mini external tmds)\n", | 1408 | DRM_INFO("Connector Table: %d (mini external tmds)\n", |
| @@ -1399,10 +1419,12 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1399 | ATOM_DEVICE_CRT2_SUPPORT, | 1419 | ATOM_DEVICE_CRT2_SUPPORT, |
| 1400 | 2), | 1420 | 2), |
| 1401 | ATOM_DEVICE_CRT2_SUPPORT); | 1421 | ATOM_DEVICE_CRT2_SUPPORT); |
| 1422 | /* XXX are any DL? */ | ||
| 1402 | radeon_add_legacy_connector(dev, 0, | 1423 | radeon_add_legacy_connector(dev, 0, |
| 1403 | ATOM_DEVICE_DFP2_SUPPORT | | 1424 | ATOM_DEVICE_DFP2_SUPPORT | |
| 1404 | ATOM_DEVICE_CRT2_SUPPORT, | 1425 | ATOM_DEVICE_CRT2_SUPPORT, |
| 1405 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c); | 1426 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, |
| 1427 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I); | ||
| 1406 | /* TV - TV DAC */ | 1428 | /* TV - TV DAC */ |
| 1407 | radeon_add_legacy_encoder(dev, | 1429 | radeon_add_legacy_encoder(dev, |
| 1408 | radeon_get_encoder_id(dev, | 1430 | radeon_get_encoder_id(dev, |
| @@ -1411,7 +1433,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1411 | ATOM_DEVICE_TV1_SUPPORT); | 1433 | ATOM_DEVICE_TV1_SUPPORT); |
| 1412 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT, | 1434 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT, |
| 1413 | DRM_MODE_CONNECTOR_SVIDEO, | 1435 | DRM_MODE_CONNECTOR_SVIDEO, |
| 1414 | &ddc_i2c); | 1436 | &ddc_i2c, |
| 1437 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
| 1415 | break; | 1438 | break; |
| 1416 | case CT_MINI_INTERNAL: | 1439 | case CT_MINI_INTERNAL: |
| 1417 | DRM_INFO("Connector Table: %d (mini internal tmds)\n", | 1440 | DRM_INFO("Connector Table: %d (mini internal tmds)\n", |
| @@ -1431,7 +1454,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1431 | radeon_add_legacy_connector(dev, 0, | 1454 | radeon_add_legacy_connector(dev, 0, |
| 1432 | ATOM_DEVICE_DFP1_SUPPORT | | 1455 | ATOM_DEVICE_DFP1_SUPPORT | |
| 1433 | ATOM_DEVICE_CRT2_SUPPORT, | 1456 | ATOM_DEVICE_CRT2_SUPPORT, |
| 1434 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c); | 1457 | DRM_MODE_CONNECTOR_DVII, &ddc_i2c, |
| 1458 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I); | ||
| 1435 | /* TV - TV DAC */ | 1459 | /* TV - TV DAC */ |
| 1436 | radeon_add_legacy_encoder(dev, | 1460 | radeon_add_legacy_encoder(dev, |
| 1437 | radeon_get_encoder_id(dev, | 1461 | radeon_get_encoder_id(dev, |
| @@ -1440,7 +1464,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1440 | ATOM_DEVICE_TV1_SUPPORT); | 1464 | ATOM_DEVICE_TV1_SUPPORT); |
| 1441 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT, | 1465 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_TV1_SUPPORT, |
| 1442 | DRM_MODE_CONNECTOR_SVIDEO, | 1466 | DRM_MODE_CONNECTOR_SVIDEO, |
| 1443 | &ddc_i2c); | 1467 | &ddc_i2c, |
| 1468 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
| 1444 | break; | 1469 | break; |
| 1445 | case CT_IMAC_G5_ISIGHT: | 1470 | case CT_IMAC_G5_ISIGHT: |
| 1446 | DRM_INFO("Connector Table: %d (imac g5 isight)\n", | 1471 | DRM_INFO("Connector Table: %d (imac g5 isight)\n", |
| @@ -1453,7 +1478,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1453 | 0), | 1478 | 0), |
| 1454 | ATOM_DEVICE_DFP1_SUPPORT); | 1479 | ATOM_DEVICE_DFP1_SUPPORT); |
| 1455 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_DFP1_SUPPORT, | 1480 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_DFP1_SUPPORT, |
| 1456 | DRM_MODE_CONNECTOR_DVID, &ddc_i2c); | 1481 | DRM_MODE_CONNECTOR_DVID, &ddc_i2c, |
| 1482 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D); | ||
| 1457 | /* VGA - tv dac */ | 1483 | /* VGA - tv dac */ |
| 1458 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_DVI_DDC); | 1484 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_DVI_DDC); |
| 1459 | radeon_add_legacy_encoder(dev, | 1485 | radeon_add_legacy_encoder(dev, |
| @@ -1462,7 +1488,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1462 | 2), | 1488 | 2), |
| 1463 | ATOM_DEVICE_CRT2_SUPPORT); | 1489 | ATOM_DEVICE_CRT2_SUPPORT); |
| 1464 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, | 1490 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, |
| 1465 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c); | 1491 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, |
| 1492 | CONNECTOR_OBJECT_ID_VGA); | ||
| 1466 | /* TV - TV DAC */ | 1493 | /* TV - TV DAC */ |
| 1467 | radeon_add_legacy_encoder(dev, | 1494 | radeon_add_legacy_encoder(dev, |
| 1468 | radeon_get_encoder_id(dev, | 1495 | radeon_get_encoder_id(dev, |
| @@ -1471,7 +1498,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1471 | ATOM_DEVICE_TV1_SUPPORT); | 1498 | ATOM_DEVICE_TV1_SUPPORT); |
| 1472 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1499 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
| 1473 | DRM_MODE_CONNECTOR_SVIDEO, | 1500 | DRM_MODE_CONNECTOR_SVIDEO, |
| 1474 | &ddc_i2c); | 1501 | &ddc_i2c, |
| 1502 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
| 1475 | break; | 1503 | break; |
| 1476 | case CT_EMAC: | 1504 | case CT_EMAC: |
| 1477 | DRM_INFO("Connector Table: %d (emac)\n", | 1505 | DRM_INFO("Connector Table: %d (emac)\n", |
| @@ -1484,7 +1512,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1484 | 1), | 1512 | 1), |
| 1485 | ATOM_DEVICE_CRT1_SUPPORT); | 1513 | ATOM_DEVICE_CRT1_SUPPORT); |
| 1486 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_CRT1_SUPPORT, | 1514 | radeon_add_legacy_connector(dev, 0, ATOM_DEVICE_CRT1_SUPPORT, |
| 1487 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c); | 1515 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, |
| 1516 | CONNECTOR_OBJECT_ID_VGA); | ||
| 1488 | /* VGA - tv dac */ | 1517 | /* VGA - tv dac */ |
| 1489 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_CRT2_DDC); | 1518 | ddc_i2c = combios_setup_i2c_bus(RADEON_GPIO_CRT2_DDC); |
| 1490 | radeon_add_legacy_encoder(dev, | 1519 | radeon_add_legacy_encoder(dev, |
| @@ -1493,7 +1522,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1493 | 2), | 1522 | 2), |
| 1494 | ATOM_DEVICE_CRT2_SUPPORT); | 1523 | ATOM_DEVICE_CRT2_SUPPORT); |
| 1495 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, | 1524 | radeon_add_legacy_connector(dev, 1, ATOM_DEVICE_CRT2_SUPPORT, |
| 1496 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c); | 1525 | DRM_MODE_CONNECTOR_VGA, &ddc_i2c, |
| 1526 | CONNECTOR_OBJECT_ID_VGA); | ||
| 1497 | /* TV - TV DAC */ | 1527 | /* TV - TV DAC */ |
| 1498 | radeon_add_legacy_encoder(dev, | 1528 | radeon_add_legacy_encoder(dev, |
| 1499 | radeon_get_encoder_id(dev, | 1529 | radeon_get_encoder_id(dev, |
| @@ -1502,7 +1532,8 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
| 1502 | ATOM_DEVICE_TV1_SUPPORT); | 1532 | ATOM_DEVICE_TV1_SUPPORT); |
| 1503 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, | 1533 | radeon_add_legacy_connector(dev, 2, ATOM_DEVICE_TV1_SUPPORT, |
| 1504 | DRM_MODE_CONNECTOR_SVIDEO, | 1534 | DRM_MODE_CONNECTOR_SVIDEO, |
| 1505 | &ddc_i2c); | 1535 | &ddc_i2c, |
| 1536 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
| 1506 | break; | 1537 | break; |
| 1507 | default: | 1538 | default: |
| 1508 | DRM_INFO("Connector table: %d (invalid)\n", | 1539 | DRM_INFO("Connector table: %d (invalid)\n", |
| @@ -1596,11 +1627,46 @@ static bool radeon_apply_legacy_tv_quirks(struct drm_device *dev) | |||
| 1596 | return true; | 1627 | return true; |
| 1597 | } | 1628 | } |
| 1598 | 1629 | ||
| 1630 | static uint16_t combios_check_dl_dvi(struct drm_device *dev, int is_dvi_d) | ||
| 1631 | { | ||
| 1632 | struct radeon_device *rdev = dev->dev_private; | ||
| 1633 | uint32_t ext_tmds_info; | ||
| 1634 | |||
| 1635 | if (rdev->flags & RADEON_IS_IGP) { | ||
| 1636 | if (is_dvi_d) | ||
| 1637 | return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D; | ||
| 1638 | else | ||
| 1639 | return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I; | ||
| 1640 | } | ||
| 1641 | ext_tmds_info = combios_get_table_offset(dev, COMBIOS_EXT_TMDS_INFO_TABLE); | ||
| 1642 | if (ext_tmds_info) { | ||
| 1643 | uint8_t rev = RBIOS8(ext_tmds_info); | ||
| 1644 | uint8_t flags = RBIOS8(ext_tmds_info + 4 + 5); | ||
| 1645 | if (rev >= 3) { | ||
| 1646 | if (is_dvi_d) | ||
| 1647 | return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D; | ||
| 1648 | else | ||
| 1649 | return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I; | ||
| 1650 | } else { | ||
| 1651 | if (flags & 1) { | ||
| 1652 | if (is_dvi_d) | ||
| 1653 | return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D; | ||
| 1654 | else | ||
| 1655 | return CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I; | ||
| 1656 | } | ||
| 1657 | } | ||
| 1658 | } | ||
| 1659 | if (is_dvi_d) | ||
| 1660 | return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D; | ||
| 1661 | else | ||
| 1662 | return CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I; | ||
| 1663 | } | ||
| 1664 | |||
| 1599 | bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | 1665 | bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) |
| 1600 | { | 1666 | { |
| 1601 | struct radeon_device *rdev = dev->dev_private; | 1667 | struct radeon_device *rdev = dev->dev_private; |
| 1602 | uint32_t conn_info, entry, devices; | 1668 | uint32_t conn_info, entry, devices; |
| 1603 | uint16_t tmp; | 1669 | uint16_t tmp, connector_object_id; |
| 1604 | enum radeon_combios_ddc ddc_type; | 1670 | enum radeon_combios_ddc ddc_type; |
| 1605 | enum radeon_combios_connector connector; | 1671 | enum radeon_combios_connector connector; |
| 1606 | int i = 0; | 1672 | int i = 0; |
| @@ -1660,7 +1726,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
| 1660 | radeon_add_legacy_connector(dev, i, devices, | 1726 | radeon_add_legacy_connector(dev, i, devices, |
| 1661 | legacy_connector_convert | 1727 | legacy_connector_convert |
| 1662 | [connector], | 1728 | [connector], |
| 1663 | &ddc_i2c); | 1729 | &ddc_i2c, |
| 1730 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_D); | ||
| 1664 | break; | 1731 | break; |
| 1665 | case CONNECTOR_CRT_LEGACY: | 1732 | case CONNECTOR_CRT_LEGACY: |
| 1666 | if (tmp & 0x1) { | 1733 | if (tmp & 0x1) { |
| @@ -1685,7 +1752,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
| 1685 | devices, | 1752 | devices, |
| 1686 | legacy_connector_convert | 1753 | legacy_connector_convert |
| 1687 | [connector], | 1754 | [connector], |
| 1688 | &ddc_i2c); | 1755 | &ddc_i2c, |
| 1756 | CONNECTOR_OBJECT_ID_VGA); | ||
| 1689 | break; | 1757 | break; |
| 1690 | case CONNECTOR_DVI_I_LEGACY: | 1758 | case CONNECTOR_DVI_I_LEGACY: |
| 1691 | devices = 0; | 1759 | devices = 0; |
| @@ -1714,6 +1782,7 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
| 1714 | ATOM_DEVICE_DFP2_SUPPORT, | 1782 | ATOM_DEVICE_DFP2_SUPPORT, |
| 1715 | 0), | 1783 | 0), |
| 1716 | ATOM_DEVICE_DFP2_SUPPORT); | 1784 | ATOM_DEVICE_DFP2_SUPPORT); |
| 1785 | connector_object_id = combios_check_dl_dvi(dev, 0); | ||
| 1717 | } else { | 1786 | } else { |
| 1718 | devices |= ATOM_DEVICE_DFP1_SUPPORT; | 1787 | devices |= ATOM_DEVICE_DFP1_SUPPORT; |
| 1719 | radeon_add_legacy_encoder(dev, | 1788 | radeon_add_legacy_encoder(dev, |
| @@ -1722,19 +1791,24 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
| 1722 | ATOM_DEVICE_DFP1_SUPPORT, | 1791 | ATOM_DEVICE_DFP1_SUPPORT, |
| 1723 | 0), | 1792 | 0), |
| 1724 | ATOM_DEVICE_DFP1_SUPPORT); | 1793 | ATOM_DEVICE_DFP1_SUPPORT); |
| 1794 | connector_object_id = CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I; | ||
| 1725 | } | 1795 | } |
| 1726 | radeon_add_legacy_connector(dev, | 1796 | radeon_add_legacy_connector(dev, |
| 1727 | i, | 1797 | i, |
| 1728 | devices, | 1798 | devices, |
| 1729 | legacy_connector_convert | 1799 | legacy_connector_convert |
| 1730 | [connector], | 1800 | [connector], |
| 1731 | &ddc_i2c); | 1801 | &ddc_i2c, |
| 1802 | connector_object_id); | ||
| 1732 | break; | 1803 | break; |
| 1733 | case CONNECTOR_DVI_D_LEGACY: | 1804 | case CONNECTOR_DVI_D_LEGACY: |
| 1734 | if ((tmp >> 4) & 0x1) | 1805 | if ((tmp >> 4) & 0x1) { |
| 1735 | devices = ATOM_DEVICE_DFP2_SUPPORT; | 1806 | devices = ATOM_DEVICE_DFP2_SUPPORT; |
| 1736 | else | 1807 | connector_object_id = combios_check_dl_dvi(dev, 1); |
| 1808 | } else { | ||
| 1737 | devices = ATOM_DEVICE_DFP1_SUPPORT; | 1809 | devices = ATOM_DEVICE_DFP1_SUPPORT; |
| 1810 | connector_object_id = CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I; | ||
| 1811 | } | ||
| 1738 | radeon_add_legacy_encoder(dev, | 1812 | radeon_add_legacy_encoder(dev, |
| 1739 | radeon_get_encoder_id | 1813 | radeon_get_encoder_id |
| 1740 | (dev, devices, 0), | 1814 | (dev, devices, 0), |
| @@ -1742,7 +1816,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
| 1742 | radeon_add_legacy_connector(dev, i, devices, | 1816 | radeon_add_legacy_connector(dev, i, devices, |
| 1743 | legacy_connector_convert | 1817 | legacy_connector_convert |
| 1744 | [connector], | 1818 | [connector], |
| 1745 | &ddc_i2c); | 1819 | &ddc_i2c, |
| 1820 | connector_object_id); | ||
| 1746 | break; | 1821 | break; |
| 1747 | case CONNECTOR_CTV_LEGACY: | 1822 | case CONNECTOR_CTV_LEGACY: |
| 1748 | case CONNECTOR_STV_LEGACY: | 1823 | case CONNECTOR_STV_LEGACY: |
| @@ -1756,7 +1831,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
| 1756 | ATOM_DEVICE_TV1_SUPPORT, | 1831 | ATOM_DEVICE_TV1_SUPPORT, |
| 1757 | legacy_connector_convert | 1832 | legacy_connector_convert |
| 1758 | [connector], | 1833 | [connector], |
| 1759 | &ddc_i2c); | 1834 | &ddc_i2c, |
| 1835 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
| 1760 | break; | 1836 | break; |
| 1761 | default: | 1837 | default: |
| 1762 | DRM_ERROR("Unknown connector type: %d\n", | 1838 | DRM_ERROR("Unknown connector type: %d\n", |
| @@ -1788,7 +1864,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
| 1788 | ATOM_DEVICE_CRT1_SUPPORT | | 1864 | ATOM_DEVICE_CRT1_SUPPORT | |
| 1789 | ATOM_DEVICE_DFP1_SUPPORT, | 1865 | ATOM_DEVICE_DFP1_SUPPORT, |
| 1790 | DRM_MODE_CONNECTOR_DVII, | 1866 | DRM_MODE_CONNECTOR_DVII, |
| 1791 | &ddc_i2c); | 1867 | &ddc_i2c, |
| 1868 | CONNECTOR_OBJECT_ID_SINGLE_LINK_DVI_I); | ||
| 1792 | } else { | 1869 | } else { |
| 1793 | uint16_t crt_info = | 1870 | uint16_t crt_info = |
| 1794 | combios_get_table_offset(dev, COMBIOS_CRT_INFO_TABLE); | 1871 | combios_get_table_offset(dev, COMBIOS_CRT_INFO_TABLE); |
| @@ -1804,7 +1881,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
| 1804 | 0, | 1881 | 0, |
| 1805 | ATOM_DEVICE_CRT1_SUPPORT, | 1882 | ATOM_DEVICE_CRT1_SUPPORT, |
| 1806 | DRM_MODE_CONNECTOR_VGA, | 1883 | DRM_MODE_CONNECTOR_VGA, |
| 1807 | &ddc_i2c); | 1884 | &ddc_i2c, |
| 1885 | CONNECTOR_OBJECT_ID_VGA); | ||
| 1808 | } else { | 1886 | } else { |
| 1809 | DRM_DEBUG("No connector info found\n"); | 1887 | DRM_DEBUG("No connector info found\n"); |
| 1810 | return false; | 1888 | return false; |
| @@ -1903,7 +1981,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
| 1903 | 5, | 1981 | 5, |
| 1904 | ATOM_DEVICE_LCD1_SUPPORT, | 1982 | ATOM_DEVICE_LCD1_SUPPORT, |
| 1905 | DRM_MODE_CONNECTOR_LVDS, | 1983 | DRM_MODE_CONNECTOR_LVDS, |
| 1906 | &ddc_i2c); | 1984 | &ddc_i2c, |
| 1985 | CONNECTOR_OBJECT_ID_LVDS); | ||
| 1907 | } | 1986 | } |
| 1908 | } | 1987 | } |
| 1909 | 1988 | ||
| @@ -1923,7 +2002,8 @@ bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev) | |||
| 1923 | radeon_add_legacy_connector(dev, 6, | 2002 | radeon_add_legacy_connector(dev, 6, |
| 1924 | ATOM_DEVICE_TV1_SUPPORT, | 2003 | ATOM_DEVICE_TV1_SUPPORT, |
| 1925 | DRM_MODE_CONNECTOR_SVIDEO, | 2004 | DRM_MODE_CONNECTOR_SVIDEO, |
| 1926 | &ddc_i2c); | 2005 | &ddc_i2c, |
| 2006 | CONNECTOR_OBJECT_ID_SVIDEO); | ||
| 1927 | } | 2007 | } |
| 1928 | } | 2008 | } |
| 1929 | } | 2009 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index ce3a785a633b..fce4c4087fda 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
| @@ -397,6 +397,30 @@ static int radeon_lvds_get_modes(struct drm_connector *connector) | |||
| 397 | static int radeon_lvds_mode_valid(struct drm_connector *connector, | 397 | static int radeon_lvds_mode_valid(struct drm_connector *connector, |
| 398 | struct drm_display_mode *mode) | 398 | struct drm_display_mode *mode) |
| 399 | { | 399 | { |
| 400 | struct drm_encoder *encoder = radeon_best_single_encoder(connector); | ||
| 401 | |||
| 402 | if ((mode->hdisplay < 320) || (mode->vdisplay < 240)) | ||
| 403 | return MODE_PANEL; | ||
| 404 | |||
| 405 | if (encoder) { | ||
| 406 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | ||
| 407 | struct drm_display_mode *native_mode = &radeon_encoder->native_mode; | ||
| 408 | |||
| 409 | /* AVIVO hardware supports downscaling modes larger than the panel | ||
| 410 | * to the panel size, but I'm not sure this is desirable. | ||
| 411 | */ | ||
| 412 | if ((mode->hdisplay > native_mode->hdisplay) || | ||
| 413 | (mode->vdisplay > native_mode->vdisplay)) | ||
| 414 | return MODE_PANEL; | ||
| 415 | |||
| 416 | /* if scaling is disabled, block non-native modes */ | ||
| 417 | if (radeon_encoder->rmx_type == RMX_OFF) { | ||
| 418 | if ((mode->hdisplay != native_mode->hdisplay) || | ||
| 419 | (mode->vdisplay != native_mode->vdisplay)) | ||
| 420 | return MODE_PANEL; | ||
| 421 | } | ||
| 422 | } | ||
| 423 | |||
| 400 | return MODE_OK; | 424 | return MODE_OK; |
| 401 | } | 425 | } |
| 402 | 426 | ||
| @@ -512,6 +536,8 @@ static int radeon_vga_get_modes(struct drm_connector *connector) | |||
| 512 | static int radeon_vga_mode_valid(struct drm_connector *connector, | 536 | static int radeon_vga_mode_valid(struct drm_connector *connector, |
| 513 | struct drm_display_mode *mode) | 537 | struct drm_display_mode *mode) |
| 514 | { | 538 | { |
| 539 | /* XXX check mode bandwidth */ | ||
| 540 | /* XXX verify against max DAC output frequency */ | ||
| 515 | return MODE_OK; | 541 | return MODE_OK; |
| 516 | } | 542 | } |
| 517 | 543 | ||
| @@ -609,6 +635,8 @@ static int radeon_tv_get_modes(struct drm_connector *connector) | |||
| 609 | static int radeon_tv_mode_valid(struct drm_connector *connector, | 635 | static int radeon_tv_mode_valid(struct drm_connector *connector, |
| 610 | struct drm_display_mode *mode) | 636 | struct drm_display_mode *mode) |
| 611 | { | 637 | { |
| 638 | if ((mode->hdisplay > 1024) || (mode->vdisplay > 768)) | ||
| 639 | return MODE_CLOCK_RANGE; | ||
| 612 | return MODE_OK; | 640 | return MODE_OK; |
| 613 | } | 641 | } |
| 614 | 642 | ||
| @@ -801,9 +829,27 @@ static void radeon_dvi_force(struct drm_connector *connector) | |||
| 801 | radeon_connector->use_digital = true; | 829 | radeon_connector->use_digital = true; |
| 802 | } | 830 | } |
| 803 | 831 | ||
| 832 | static int radeon_dvi_mode_valid(struct drm_connector *connector, | ||
| 833 | struct drm_display_mode *mode) | ||
| 834 | { | ||
| 835 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | ||
| 836 | |||
| 837 | /* XXX check mode bandwidth */ | ||
| 838 | |||
| 839 | if (radeon_connector->use_digital && (mode->clock > 165000)) { | ||
| 840 | if ((radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I) || | ||
| 841 | (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) || | ||
| 842 | (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_B)) | ||
| 843 | return MODE_OK; | ||
| 844 | else | ||
| 845 | return MODE_CLOCK_HIGH; | ||
| 846 | } | ||
| 847 | return MODE_OK; | ||
| 848 | } | ||
| 849 | |||
| 804 | struct drm_connector_helper_funcs radeon_dvi_connector_helper_funcs = { | 850 | struct drm_connector_helper_funcs radeon_dvi_connector_helper_funcs = { |
| 805 | .get_modes = radeon_dvi_get_modes, | 851 | .get_modes = radeon_dvi_get_modes, |
| 806 | .mode_valid = radeon_vga_mode_valid, | 852 | .mode_valid = radeon_dvi_mode_valid, |
| 807 | .best_encoder = radeon_dvi_encoder, | 853 | .best_encoder = radeon_dvi_encoder, |
| 808 | }; | 854 | }; |
| 809 | 855 | ||
| @@ -823,7 +869,8 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
| 823 | int connector_type, | 869 | int connector_type, |
| 824 | struct radeon_i2c_bus_rec *i2c_bus, | 870 | struct radeon_i2c_bus_rec *i2c_bus, |
| 825 | bool linkb, | 871 | bool linkb, |
| 826 | uint32_t igp_lane_info) | 872 | uint32_t igp_lane_info, |
| 873 | uint16_t connector_object_id) | ||
| 827 | { | 874 | { |
| 828 | struct radeon_device *rdev = dev->dev_private; | 875 | struct radeon_device *rdev = dev->dev_private; |
| 829 | struct drm_connector *connector; | 876 | struct drm_connector *connector; |
| @@ -862,6 +909,7 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
| 862 | radeon_connector->connector_id = connector_id; | 909 | radeon_connector->connector_id = connector_id; |
| 863 | radeon_connector->devices = supported_device; | 910 | radeon_connector->devices = supported_device; |
| 864 | radeon_connector->shared_ddc = shared_ddc; | 911 | radeon_connector->shared_ddc = shared_ddc; |
| 912 | radeon_connector->connector_object_id = connector_object_id; | ||
| 865 | switch (connector_type) { | 913 | switch (connector_type) { |
| 866 | case DRM_MODE_CONNECTOR_VGA: | 914 | case DRM_MODE_CONNECTOR_VGA: |
| 867 | drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); | 915 | drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); |
| @@ -1013,7 +1061,8 @@ radeon_add_legacy_connector(struct drm_device *dev, | |||
| 1013 | uint32_t connector_id, | 1061 | uint32_t connector_id, |
| 1014 | uint32_t supported_device, | 1062 | uint32_t supported_device, |
| 1015 | int connector_type, | 1063 | int connector_type, |
| 1016 | struct radeon_i2c_bus_rec *i2c_bus) | 1064 | struct radeon_i2c_bus_rec *i2c_bus, |
| 1065 | uint16_t connector_object_id) | ||
| 1017 | { | 1066 | { |
| 1018 | struct radeon_device *rdev = dev->dev_private; | 1067 | struct radeon_device *rdev = dev->dev_private; |
| 1019 | struct drm_connector *connector; | 1068 | struct drm_connector *connector; |
| @@ -1042,6 +1091,7 @@ radeon_add_legacy_connector(struct drm_device *dev, | |||
| 1042 | 1091 | ||
| 1043 | radeon_connector->connector_id = connector_id; | 1092 | radeon_connector->connector_id = connector_id; |
| 1044 | radeon_connector->devices = supported_device; | 1093 | radeon_connector->devices = supported_device; |
| 1094 | radeon_connector->connector_object_id = connector_object_id; | ||
| 1045 | switch (connector_type) { | 1095 | switch (connector_type) { |
| 1046 | case DRM_MODE_CONNECTOR_VGA: | 1096 | case DRM_MODE_CONNECTOR_VGA: |
| 1047 | drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); | 1097 | drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); |
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c index 2aa5994a29d5..d42bc512d75a 100644 --- a/drivers/gpu/drm/radeon/radeon_encoders.c +++ b/drivers/gpu/drm/radeon/radeon_encoders.c | |||
| @@ -722,14 +722,17 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action) | |||
| 722 | atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev); | 722 | atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev); |
| 723 | 723 | ||
| 724 | args.v1.ucAction = action; | 724 | args.v1.ucAction = action; |
| 725 | 725 | if (action == ATOM_TRANSMITTER_ACTION_INIT) { | |
| 726 | args.v1.usInitInfo = radeon_connector->connector_object_id; | ||
| 727 | } else { | ||
| 728 | if (radeon_encoder->pixel_clock > 165000) | ||
| 729 | args.v1.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock / 2) / 10); | ||
| 730 | else | ||
| 731 | args.v1.usPixelClock = cpu_to_le16(radeon_encoder->pixel_clock / 10); | ||
| 732 | } | ||
| 726 | if (ASIC_IS_DCE32(rdev)) { | 733 | if (ASIC_IS_DCE32(rdev)) { |
| 727 | if (radeon_encoder->pixel_clock > 165000) { | 734 | if (radeon_encoder->pixel_clock > 165000) |
| 728 | args.v2.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock * 10 * 2) / 100); | 735 | args.v2.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock / 2) / 10); |
| 729 | args.v2.acConfig.fDualLinkConnector = 1; | ||
| 730 | } else { | ||
| 731 | args.v2.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock * 10 * 4) / 100); | ||
| 732 | } | ||
| 733 | if (dig->dig_block) | 736 | if (dig->dig_block) |
| 734 | args.v2.acConfig.ucEncoderSel = 1; | 737 | args.v2.acConfig.ucEncoderSel = 1; |
| 735 | 738 | ||
| @@ -754,7 +757,6 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action) | |||
| 754 | } | 757 | } |
| 755 | } else { | 758 | } else { |
| 756 | args.v1.ucConfig = ATOM_TRANSMITTER_CONFIG_CLKSRC_PPLL; | 759 | args.v1.ucConfig = ATOM_TRANSMITTER_CONFIG_CLKSRC_PPLL; |
| 757 | args.v1.usPixelClock = cpu_to_le16((radeon_encoder->pixel_clock) / 10); | ||
| 758 | 760 | ||
| 759 | switch (radeon_encoder->encoder_id) { | 761 | switch (radeon_encoder->encoder_id) { |
| 760 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: | 762 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: |
| @@ -1137,6 +1139,7 @@ radeon_atom_encoder_mode_set(struct drm_encoder *encoder, | |||
| 1137 | 1139 | ||
| 1138 | /* setup and enable the encoder and transmitter */ | 1140 | /* setup and enable the encoder and transmitter */ |
| 1139 | atombios_dig_encoder_setup(encoder, ATOM_ENABLE); | 1141 | atombios_dig_encoder_setup(encoder, ATOM_ENABLE); |
| 1142 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_INIT); | ||
| 1140 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP); | 1143 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_SETUP); |
| 1141 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE); | 1144 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE); |
| 1142 | break; | 1145 | break; |
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index ccb783868ad6..ace726aa0d76 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
| @@ -317,6 +317,7 @@ struct radeon_connector { | |||
| 317 | struct edid *edid; | 317 | struct edid *edid; |
| 318 | void *con_priv; | 318 | void *con_priv; |
| 319 | bool dac_load_detect; | 319 | bool dac_load_detect; |
| 320 | uint16_t connector_object_id; | ||
| 320 | }; | 321 | }; |
| 321 | 322 | ||
| 322 | struct radeon_framebuffer { | 323 | struct radeon_framebuffer { |
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c new file mode 100644 index 000000000000..46146c6a2a06 --- /dev/null +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | /* | ||
| 2 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 3 | * copy of this software and associated documentation files (the "Software"), | ||
| 4 | * to deal in the Software without restriction, including without limitation | ||
| 5 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| 6 | * and/or sell copies of the Software, and to permit persons to whom the | ||
| 7 | * Software is furnished to do so, subject to the following conditions: | ||
| 8 | * | ||
| 9 | * The above copyright notice and this permission notice shall be included in | ||
| 10 | * all copies or substantial portions of the Software. | ||
| 11 | * | ||
| 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| 15 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
| 16 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
| 17 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
| 18 | * OTHER DEALINGS IN THE SOFTWARE. | ||
| 19 | * | ||
| 20 | * Authors: Rafał Miłecki <zajec5@gmail.com> | ||
| 21 | */ | ||
| 22 | #include "drmP.h" | ||
| 23 | #include "radeon.h" | ||
| 24 | |||
| 25 | int radeon_debugfs_pm_init(struct radeon_device *rdev); | ||
| 26 | |||
| 27 | int radeon_pm_init(struct radeon_device *rdev) | ||
| 28 | { | ||
| 29 | if (radeon_debugfs_pm_init(rdev)) { | ||
| 30 | DRM_ERROR("Failed to register debugfs file for CP !\n"); | ||
| 31 | } | ||
| 32 | |||
| 33 | return 0; | ||
| 34 | } | ||
| 35 | |||
| 36 | /* | ||
| 37 | * Debugfs info | ||
| 38 | */ | ||
| 39 | #if defined(CONFIG_DEBUG_FS) | ||
| 40 | |||
| 41 | static int radeon_debugfs_pm_info(struct seq_file *m, void *data) | ||
| 42 | { | ||
| 43 | struct drm_info_node *node = (struct drm_info_node *) m->private; | ||
| 44 | struct drm_device *dev = node->minor->dev; | ||
| 45 | struct radeon_device *rdev = dev->dev_private; | ||
| 46 | |||
| 47 | seq_printf(m, "engine clock: %u0 Hz\n", radeon_get_engine_clock(rdev)); | ||
| 48 | seq_printf(m, "memory clock: %u0 Hz\n", radeon_get_memory_clock(rdev)); | ||
| 49 | |||
| 50 | return 0; | ||
| 51 | } | ||
| 52 | |||
| 53 | static struct drm_info_list radeon_pm_info_list[] = { | ||
| 54 | {"radeon_pm_info", radeon_debugfs_pm_info, 0, NULL}, | ||
| 55 | }; | ||
| 56 | #endif | ||
| 57 | |||
| 58 | int radeon_debugfs_pm_init(struct radeon_device *rdev) | ||
| 59 | { | ||
| 60 | #if defined(CONFIG_DEBUG_FS) | ||
| 61 | return radeon_debugfs_add_files(rdev, radeon_pm_info_list, ARRAY_SIZE(radeon_pm_info_list)); | ||
| 62 | #else | ||
| 63 | return 0; | ||
| 64 | #endif | ||
| 65 | } | ||
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c index 942754c39be9..5f117cd8736a 100644 --- a/drivers/gpu/drm/radeon/rs600.c +++ b/drivers/gpu/drm/radeon/rs600.c | |||
| @@ -488,6 +488,8 @@ int rs600_init(struct radeon_device *rdev) | |||
| 488 | } | 488 | } |
| 489 | /* Initialize clocks */ | 489 | /* Initialize clocks */ |
| 490 | radeon_get_clock_info(rdev->ddev); | 490 | radeon_get_clock_info(rdev->ddev); |
| 491 | /* Initialize power management */ | ||
| 492 | radeon_pm_init(rdev); | ||
| 491 | /* Get vram informations */ | 493 | /* Get vram informations */ |
| 492 | rs600_vram_info(rdev); | 494 | rs600_vram_info(rdev); |
| 493 | /* Initialize memory controller (also test AGP) */ | 495 | /* Initialize memory controller (also test AGP) */ |
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c index 025e3225346c..27547175cf93 100644 --- a/drivers/gpu/drm/radeon/rs690.c +++ b/drivers/gpu/drm/radeon/rs690.c | |||
| @@ -706,6 +706,8 @@ int rs690_init(struct radeon_device *rdev) | |||
| 706 | } | 706 | } |
| 707 | /* Initialize clocks */ | 707 | /* Initialize clocks */ |
| 708 | radeon_get_clock_info(rdev->ddev); | 708 | radeon_get_clock_info(rdev->ddev); |
| 709 | /* Initialize power management */ | ||
| 710 | radeon_pm_init(rdev); | ||
| 709 | /* Get vram informations */ | 711 | /* Get vram informations */ |
| 710 | rs690_vram_info(rdev); | 712 | rs690_vram_info(rdev); |
| 711 | /* Initialize memory controller (also test AGP) */ | 713 | /* Initialize memory controller (also test AGP) */ |
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c index 03c052d892c0..7935f793bf62 100644 --- a/drivers/gpu/drm/radeon/rv515.c +++ b/drivers/gpu/drm/radeon/rv515.c | |||
| @@ -587,6 +587,8 @@ int rv515_init(struct radeon_device *rdev) | |||
| 587 | } | 587 | } |
| 588 | /* Initialize clocks */ | 588 | /* Initialize clocks */ |
| 589 | radeon_get_clock_info(rdev->ddev); | 589 | radeon_get_clock_info(rdev->ddev); |
| 590 | /* Initialize power management */ | ||
| 591 | radeon_pm_init(rdev); | ||
| 590 | /* Get vram informations */ | 592 | /* Get vram informations */ |
| 591 | rv515_vram_info(rdev); | 593 | rv515_vram_info(rdev); |
| 592 | /* Initialize memory controller (also test AGP) */ | 594 | /* Initialize memory controller (also test AGP) */ |
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index ae074fdf804d..b0efd0ddae7a 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
| @@ -983,10 +983,13 @@ int rv770_init(struct radeon_device *rdev) | |||
| 983 | r600_scratch_init(rdev); | 983 | r600_scratch_init(rdev); |
| 984 | /* Initialize surface registers */ | 984 | /* Initialize surface registers */ |
| 985 | radeon_surface_init(rdev); | 985 | radeon_surface_init(rdev); |
| 986 | /* Initialize clocks */ | ||
| 986 | radeon_get_clock_info(rdev->ddev); | 987 | radeon_get_clock_info(rdev->ddev); |
| 987 | r = radeon_clocks_init(rdev); | 988 | r = radeon_clocks_init(rdev); |
| 988 | if (r) | 989 | if (r) |
| 989 | return r; | 990 | return r; |
| 991 | /* Initialize power management */ | ||
| 992 | radeon_pm_init(rdev); | ||
| 990 | /* Fence driver */ | 993 | /* Fence driver */ |
| 991 | r = radeon_fence_driver_init(rdev); | 994 | r = radeon_fence_driver_init(rdev); |
| 992 | if (r) | 995 | if (r) |
