summaryrefslogtreecommitdiff
path: root/vmwgfx_kms.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2010-07-23 08:07:21 +0200
committerThomas Hellstrom <thellstrom@vmware.com>2010-07-23 08:07:21 +0200
commit3b8e55a870c65a92d5f4d30adf161b73c126c819 (patch)
tree7d10feecfb802412e70e4070b1a3717b2a73829d /vmwgfx_kms.c
parent21b1221aac8b00b6f0649d4904204627aa773c92 (diff)
vmwgfx: Fix an indentation issue and some integer overflow issues
Pointed out by Michel Daenzer. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Diffstat (limited to 'vmwgfx_kms.c')
-rw-r--r--vmwgfx_kms.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/vmwgfx_kms.c b/vmwgfx_kms.c
index e570605..99def2d 100644
--- a/vmwgfx_kms.c
+++ b/vmwgfx_kms.c
@@ -393,12 +393,13 @@ static void vmw_framebuffer_present_fs_callback(struct work_struct *work)
SVGA3dCopyRect cr;
} *cmd;
-/**
- * Strictly we should take the ttm_lock in read mode before accessing
- * the fifo, to make sure the fifo is present and up. However,
- * instead we flush all workqueues under the ttm lock in exclusive mode
- * before taking down the fifo.
- */
+ /**
+ * Strictly we should take the ttm_lock in read mode before accessing
+ * the fifo, to make sure the fifo is present and up. However,
+ * instead we flush all workqueues under the ttm lock in exclusive mode
+ * before taking down the fifo.
+ */
+
mutex_lock(&vfbs->work_lock);
if (!vfbs->present_fs)
goto out_unlock;
@@ -797,7 +798,7 @@ static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev,
struct vmw_framebuffer *vfb = NULL;
struct vmw_surface *surface = NULL;
struct vmw_dma_buffer *bo = NULL;
- unsigned int required_size;
+ u64 required_size;
int ret;
/**
@@ -807,7 +808,7 @@ static struct drm_framebuffer *vmw_kms_fb_create(struct drm_device *dev,
*/
required_size = mode_cmd->pitch * mode_cmd->height;
- if (unlikely(required_size > dev_priv->vram_size)) {
+ if (unlikely(required_size > (u64) dev_priv->vram_size)) {
DRM_ERROR("VRAM size is too small for requested mode.\n");
return NULL;
}
@@ -1085,5 +1086,5 @@ bool vmw_kms_validate_mode_vram(struct vmw_private *dev_priv,
uint32_t pitch,
uint32_t height)
{
- return (pitch * height) < dev_priv->vram_size;
+ return ((u64) pitch * (u64) height) < (u64) dev_priv->vram_size;
}