diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-12-24 16:34:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-12-24 16:34:44 -0500 |
commit | 4962516b2309d76964f9df0d33e74f43b624a42d (patch) | |
tree | 815e16e71e76b2ca6ffc09b176ecfb4263f426df | |
parent | 5f0a6e2d503896062f641639dacfe5055c2f593b (diff) | |
parent | 8a78389651b3e411ec5a7df61404734f52d6f4eb (diff) |
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
vmwgfx: fix incorrect VRAM size check in vmw_kms_fb_create()
drm/radeon/kms: bail on BTC parts if MC ucode is missing
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 6 |
2 files changed, 15 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 5e00d1670aa9..92c9628c572d 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -3276,6 +3276,18 @@ int evergreen_init(struct radeon_device *rdev) | |||
3276 | rdev->accel_working = false; | 3276 | rdev->accel_working = false; |
3277 | } | 3277 | } |
3278 | } | 3278 | } |
3279 | |||
3280 | /* Don't start up if the MC ucode is missing on BTC parts. | ||
3281 | * The default clocks and voltages before the MC ucode | ||
3282 | * is loaded are not suffient for advanced operations. | ||
3283 | */ | ||
3284 | if (ASIC_IS_DCE5(rdev)) { | ||
3285 | if (!rdev->mc_fw && !(rdev->flags & RADEON_IS_IGP)) { | ||
3286 | DRM_ERROR("radeon: MC ucode required for NI+.\n"); | ||
3287 | return -EINVAL; | ||
3288 | } | ||
3289 | } | ||
3290 | |||
3279 | return 0; | 3291 | return 0; |
3280 | } | 3292 | } |
3281 | 3293 | ||
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 8aa1dbb45c67..f94b33ae2215 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | |||
@@ -1093,7 +1093,6 @@ static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev, | |||
1093 | struct vmw_surface *surface = NULL; | 1093 | struct vmw_surface *surface = NULL; |
1094 | struct vmw_dma_buffer *bo = NULL; | 1094 | struct vmw_dma_buffer *bo = NULL; |
1095 | struct ttm_base_object *user_obj; | 1095 | struct ttm_base_object *user_obj; |
1096 | u64 required_size; | ||
1097 | int ret; | 1096 | int ret; |
1098 | 1097 | ||
1099 | /** | 1098 | /** |
@@ -1102,8 +1101,9 @@ static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev, | |||
1102 | * requested framebuffer. | 1101 | * requested framebuffer. |
1103 | */ | 1102 | */ |
1104 | 1103 | ||
1105 | required_size = mode_cmd->pitch * mode_cmd->height; | 1104 | if (!vmw_kms_validate_mode_vram(dev_priv, |
1106 | if (unlikely(required_size > (u64) dev_priv->vram_size)) { | 1105 | mode_cmd->pitch, |
1106 | mode_cmd->height)) { | ||
1107 | DRM_ERROR("VRAM size is too small for requested mode.\n"); | 1107 | DRM_ERROR("VRAM size is too small for requested mode.\n"); |
1108 | return ERR_PTR(-ENOMEM); | 1108 | return ERR_PTR(-ENOMEM); |
1109 | } | 1109 | } |