Commit 739b0009 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge branch 'drm-vmwgfx-fixes' of git://people.freedesktop.org/~syeh/repos_linux into drm-fixes

misc vmwgfx fixes.

* 'drm-vmwgfx-fixes' of git://people.freedesktop.org/~syeh/repos_linux:
  drm/vmwgfx: constify pci_device_id.
  drm/vmwgfx: Fix gcc-7.1.1 warning
  drm/vmwgfx: Fix cursor hotspot issue with Wayland on Fedora
  drm/vmwgfx: Limit max desktop dimensions to 8Kx8K
  drm/vmwgfx: dma-buf: Constify ttm_place structures.
  drm/vmwgfx: fix comment mistake for vmw_cmd_dx_set_index_buffer()
  drm/vmwgfx: Use dma_pool_zalloc
  drm/vmwgfx: Fix handling of errors returned by 'vmw_cotable_alloc()'
  drm/vmwgfx: Fix NULL pointer comparison
parents 507e8e5e 8046306f
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -30,49 +30,49 @@
#include <drm/ttm/ttm_placement.h>
#include <drm/ttm/ttm_page_alloc.h>

static struct ttm_place vram_placement_flags = {
static const struct ttm_place vram_placement_flags = {
	.fpfn = 0,
	.lpfn = 0,
	.flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED
};

static struct ttm_place vram_ne_placement_flags = {
static const struct ttm_place vram_ne_placement_flags = {
	.fpfn = 0,
	.lpfn = 0,
	.flags = TTM_PL_FLAG_VRAM | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
};

static struct ttm_place sys_placement_flags = {
static const struct ttm_place sys_placement_flags = {
	.fpfn = 0,
	.lpfn = 0,
	.flags = TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED
};

static struct ttm_place sys_ne_placement_flags = {
static const struct ttm_place sys_ne_placement_flags = {
	.fpfn = 0,
	.lpfn = 0,
	.flags = TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
};

static struct ttm_place gmr_placement_flags = {
static const struct ttm_place gmr_placement_flags = {
	.fpfn = 0,
	.lpfn = 0,
	.flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED
};

static struct ttm_place gmr_ne_placement_flags = {
static const struct ttm_place gmr_ne_placement_flags = {
	.fpfn = 0,
	.lpfn = 0,
	.flags = VMW_PL_FLAG_GMR | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
};

static struct ttm_place mob_placement_flags = {
static const struct ttm_place mob_placement_flags = {
	.fpfn = 0,
	.lpfn = 0,
	.flags = VMW_PL_FLAG_MOB | TTM_PL_FLAG_CACHED
};

static struct ttm_place mob_ne_placement_flags = {
static const struct ttm_place mob_ne_placement_flags = {
	.fpfn = 0,
	.lpfn = 0,
	.flags = VMW_PL_FLAG_MOB | TTM_PL_FLAG_CACHED | TTM_PL_FLAG_NO_EVICT
@@ -85,7 +85,7 @@ struct ttm_placement vmw_vram_placement = {
	.busy_placement = &vram_placement_flags
};

static struct ttm_place vram_gmr_placement_flags[] = {
static const struct ttm_place vram_gmr_placement_flags[] = {
	{
		.fpfn = 0,
		.lpfn = 0,
@@ -97,7 +97,7 @@ static struct ttm_place vram_gmr_placement_flags[] = {
	}
};

static struct ttm_place gmr_vram_placement_flags[] = {
static const struct ttm_place gmr_vram_placement_flags[] = {
	{
		.fpfn = 0,
		.lpfn = 0,
@@ -116,7 +116,7 @@ struct ttm_placement vmw_vram_gmr_placement = {
	.busy_placement = &gmr_placement_flags
};

static struct ttm_place vram_gmr_ne_placement_flags[] = {
static const struct ttm_place vram_gmr_ne_placement_flags[] = {
	{
		.fpfn = 0,
		.lpfn = 0,
@@ -165,7 +165,7 @@ struct ttm_placement vmw_sys_ne_placement = {
	.busy_placement = &sys_ne_placement_flags
};

static struct ttm_place evictable_placement_flags[] = {
static const struct ttm_place evictable_placement_flags[] = {
	{
		.fpfn = 0,
		.lpfn = 0,
+4 −6
Original line number Diff line number Diff line
@@ -779,7 +779,7 @@ static int vmw_cmdbuf_space_pool(struct vmw_cmdbuf_man *man,
	if (ret)
		return ret;

	header->cb_header = dma_pool_alloc(man->headers, GFP_KERNEL,
	header->cb_header = dma_pool_zalloc(man->headers, GFP_KERNEL,
					    &header->handle);
	if (!header->cb_header) {
		ret = -ENOMEM;
@@ -790,7 +790,6 @@ static int vmw_cmdbuf_space_pool(struct vmw_cmdbuf_man *man,
	cb_hdr = header->cb_header;
	offset = header->node.start << PAGE_SHIFT;
	header->cmd = man->map + offset;
	memset(cb_hdr, 0, sizeof(*cb_hdr));
	if (man->using_mob) {
		cb_hdr->flags = SVGA_CB_FLAG_MOB;
		cb_hdr->ptr.mob.mobid = man->cmd_space->mem.start;
@@ -827,7 +826,7 @@ static int vmw_cmdbuf_space_inline(struct vmw_cmdbuf_man *man,
	if (WARN_ON_ONCE(size > VMW_CMDBUF_INLINE_SIZE))
		return -ENOMEM;

	dheader = dma_pool_alloc(man->dheaders, GFP_KERNEL,
	dheader = dma_pool_zalloc(man->dheaders, GFP_KERNEL,
				  &header->handle);
	if (!dheader)
		return -ENOMEM;
@@ -837,7 +836,6 @@ static int vmw_cmdbuf_space_inline(struct vmw_cmdbuf_man *man,
	cb_hdr = &dheader->cb_header;
	header->cb_header = cb_hdr;
	header->cmd = dheader->cmd;
	memset(dheader, 0, sizeof(*dheader));
	cb_hdr->status = SVGA_CB_STATUS_NONE;
	cb_hdr->flags = SVGA_CB_FLAG_NONE;
	cb_hdr->ptr.pa = (u64)header->handle +
+2 −2
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ int vmw_cmdbuf_res_add(struct vmw_cmdbuf_res_manager *man,
	int ret;

	cres = kzalloc(sizeof(*cres), GFP_KERNEL);
	if (unlikely(cres == NULL))
	if (unlikely(!cres))
		return -ENOMEM;

	cres->hash.key = user_key | (res_type << 24);
@@ -291,7 +291,7 @@ vmw_cmdbuf_res_man_create(struct vmw_private *dev_priv)
	int ret;

	man = kzalloc(sizeof(*man), GFP_KERNEL);
	if (man == NULL)
	if (!man)
		return ERR_PTR(-ENOMEM);

	man->dev_priv = dev_priv;
+3 −3
Original line number Diff line number Diff line
@@ -210,8 +210,8 @@ static int vmw_gb_context_init(struct vmw_private *dev_priv,
		for (i = 0; i < SVGA_COTABLE_DX10_MAX; ++i) {
			uctx->cotables[i] = vmw_cotable_alloc(dev_priv,
							      &uctx->res, i);
			if (unlikely(uctx->cotables[i] == NULL)) {
				ret = -ENOMEM;
			if (unlikely(IS_ERR(uctx->cotables[i]))) {
				ret = PTR_ERR(uctx->cotables[i]);
				goto out_cotables;
			}
		}
@@ -777,7 +777,7 @@ static int vmw_context_define(struct drm_device *dev, void *data,
	}

	ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
	if (unlikely(ctx == NULL)) {
	if (unlikely(!ctx)) {
		ttm_mem_global_free(vmw_mem_glob(dev_priv),
				    vmw_user_context_size);
		ret = -ENOMEM;
+1 −1
Original line number Diff line number Diff line
@@ -584,7 +584,7 @@ struct vmw_resource *vmw_cotable_alloc(struct vmw_private *dev_priv,
		return ERR_PTR(ret);

	vcotbl = kzalloc(sizeof(*vcotbl), GFP_KERNEL);
	if (unlikely(vcotbl == NULL)) {
	if (unlikely(!vcotbl)) {
		ret = -ENOMEM;
		goto out_no_alloc;
	}
Loading