drm/vmwgfx: Fix a couple of sparse warnings and errors
Introduced with 3.14-rc1 Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
This commit is contained in:
@@ -551,8 +551,7 @@ static int vmw_context_scrub_shader(struct vmw_ctx_bindinfo *bi, bool rebind)
|
|||||||
cmd->header.size = sizeof(cmd->body);
|
cmd->header.size = sizeof(cmd->body);
|
||||||
cmd->body.cid = bi->ctx->id;
|
cmd->body.cid = bi->ctx->id;
|
||||||
cmd->body.type = bi->i1.shader_type;
|
cmd->body.type = bi->i1.shader_type;
|
||||||
cmd->body.shid =
|
cmd->body.shid = ((rebind) ? bi->res->id : SVGA3D_INVALID_ID);
|
||||||
cpu_to_le32((rebind) ? bi->res->id : SVGA3D_INVALID_ID);
|
|
||||||
vmw_fifo_commit(dev_priv, sizeof(*cmd));
|
vmw_fifo_commit(dev_priv, sizeof(*cmd));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -585,8 +584,7 @@ static int vmw_context_scrub_render_target(struct vmw_ctx_bindinfo *bi,
|
|||||||
cmd->header.size = sizeof(cmd->body);
|
cmd->header.size = sizeof(cmd->body);
|
||||||
cmd->body.cid = bi->ctx->id;
|
cmd->body.cid = bi->ctx->id;
|
||||||
cmd->body.type = bi->i1.rt_type;
|
cmd->body.type = bi->i1.rt_type;
|
||||||
cmd->body.target.sid =
|
cmd->body.target.sid = ((rebind) ? bi->res->id : SVGA3D_INVALID_ID);
|
||||||
cpu_to_le32((rebind) ? bi->res->id : SVGA3D_INVALID_ID);
|
|
||||||
cmd->body.target.face = 0;
|
cmd->body.target.face = 0;
|
||||||
cmd->body.target.mipmap = 0;
|
cmd->body.target.mipmap = 0;
|
||||||
vmw_fifo_commit(dev_priv, sizeof(*cmd));
|
vmw_fifo_commit(dev_priv, sizeof(*cmd));
|
||||||
@@ -628,8 +626,7 @@ static int vmw_context_scrub_texture(struct vmw_ctx_bindinfo *bi,
|
|||||||
cmd->body.c.cid = bi->ctx->id;
|
cmd->body.c.cid = bi->ctx->id;
|
||||||
cmd->body.s1.stage = bi->i1.texture_stage;
|
cmd->body.s1.stage = bi->i1.texture_stage;
|
||||||
cmd->body.s1.name = SVGA3D_TS_BIND_TEXTURE;
|
cmd->body.s1.name = SVGA3D_TS_BIND_TEXTURE;
|
||||||
cmd->body.s1.value =
|
cmd->body.s1.value = ((rebind) ? bi->res->id : SVGA3D_INVALID_ID);
|
||||||
cpu_to_le32((rebind) ? bi->res->id : SVGA3D_INVALID_ID);
|
|
||||||
vmw_fifo_commit(dev_priv, sizeof(*cmd));
|
vmw_fifo_commit(dev_priv, sizeof(*cmd));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -602,7 +602,7 @@ static int vmw_cmd_cid_check(struct vmw_private *dev_priv,
|
|||||||
{
|
{
|
||||||
struct vmw_cid_cmd {
|
struct vmw_cid_cmd {
|
||||||
SVGA3dCmdHeader header;
|
SVGA3dCmdHeader header;
|
||||||
__le32 cid;
|
uint32_t cid;
|
||||||
} *cmd;
|
} *cmd;
|
||||||
|
|
||||||
cmd = container_of(header, struct vmw_cid_cmd, header);
|
cmd = container_of(header, struct vmw_cid_cmd, header);
|
||||||
|
|||||||
@@ -371,13 +371,13 @@ int vmw_shader_destroy_ioctl(struct drm_device *dev, void *data,
|
|||||||
TTM_REF_USAGE);
|
TTM_REF_USAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int vmw_shader_alloc(struct vmw_private *dev_priv,
|
static int vmw_shader_alloc(struct vmw_private *dev_priv,
|
||||||
struct vmw_dma_buffer *buffer,
|
struct vmw_dma_buffer *buffer,
|
||||||
size_t shader_size,
|
size_t shader_size,
|
||||||
size_t offset,
|
size_t offset,
|
||||||
SVGA3dShaderType shader_type,
|
SVGA3dShaderType shader_type,
|
||||||
struct ttm_object_file *tfile,
|
struct ttm_object_file *tfile,
|
||||||
u32 *handle)
|
u32 *handle)
|
||||||
{
|
{
|
||||||
struct vmw_user_shader *ushader;
|
struct vmw_user_shader *ushader;
|
||||||
struct vmw_resource *res, *tmp;
|
struct vmw_resource *res, *tmp;
|
||||||
@@ -779,6 +779,8 @@ vmw_compat_shader_man_create(struct vmw_private *dev_priv)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
man = kzalloc(sizeof(*man), GFP_KERNEL);
|
man = kzalloc(sizeof(*man), GFP_KERNEL);
|
||||||
|
if (man == NULL)
|
||||||
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
man->dev_priv = dev_priv;
|
man->dev_priv = dev_priv;
|
||||||
INIT_LIST_HEAD(&man->list);
|
INIT_LIST_HEAD(&man->list);
|
||||||
|
|||||||
Reference in New Issue
Block a user