drivers/gpu/drm/mgag200/mgag200_cursor.c:134:57: sparse: incorrect type in argument 1 (different address spaces)

Christopher Harvey charvey at matrox.com
Fri Jun 21 07:48:13 PDT 2013


Hey Dave,

Do we care about these warnings? I'm not sure how to get around them.

thanks,
Chris

P.S, this is my last day at Matrox, but I'll maintain it from another
email.

On Fri, Jun 21 2013, kbuild test robot <fengguang.wu at intel.com> wrote:
> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next master
> head:   849aa58856855ae73d9654b2e675f2c7a6ad4c9b
> commit: a080db9fdda77ffaa43679d21b4bd78ead0cf9e1 drm/mgag200: Hardware cursor support
> date:   4 days ago
>
>
> sparse warnings: (new ones prefixed by >>)
>
>>> drivers/gpu/drm/mgag200/mgag200_cursor.c:134:57: sparse: incorrect type in argument 1 (different address spaces)
>    drivers/gpu/drm/mgag200/mgag200_cursor.c:134:57:    expected void [noderef] <asn:2>*<noident>
>    drivers/gpu/drm/mgag200/mgag200_cursor.c:134:57:    got void *
>>> drivers/gpu/drm/mgag200/mgag200_cursor.c:200:65: sparse: incorrect type in argument 1 (different address spaces)
>    drivers/gpu/drm/mgag200/mgag200_cursor.c:200:65:    expected void [noderef] <asn:2>*<noident>
>    drivers/gpu/drm/mgag200/mgag200_cursor.c:200:65:    got void *
>>> drivers/gpu/drm/mgag200/mgag200_cursor.c:218:55: sparse: incorrect type in argument 1 (different address spaces)
>    drivers/gpu/drm/mgag200/mgag200_cursor.c:218:55:    expected void volatile [noderef] <asn:2>*dst
>    drivers/gpu/drm/mgag200/mgag200_cursor.c:218:55:    got void *
>
> vim +134 drivers/gpu/drm/mgag200/mgag200_cursor.c
>
>    128			}
>    129		}
>    130	
>    131		memset(&colour_set[0], 0, sizeof(uint32_t)*16);
>    132		/* width*height*4 = 16384 */
>    133		for (i = 0; i < 16384; i += 4) {
>  > 134			this_colour = ioread32(bo->kmap.virtual + i);
>    135			/* No transparency */
>    136			if (this_colour>>24 != 0xff &&
>    137				this_colour>>24 != 0x0) {
>    138				if (warn_transparent) {
>    139					dev_info(&dev->pdev->dev, "Video card doesn't support cursors with partial transparency.\n");
>    140					dev_info(&dev->pdev->dev, "Not enabling hardware cursor.\n");
>    141					warn_transparent = false; /* Only tell the user once. */
>    142				}
>    143				ret = -EINVAL;
>    144				goto out3;
>    145			}
>    146			/* Don't need to store transparent pixels as colours */
>    147			if (this_colour>>24 == 0x0)
>    148				continue;
>    149			found = false;
>    150			for (palette_iter = &colour_set[0]; palette_iter != next_space; palette_iter++) {
>    151				if (*palette_iter == this_colour) {
>    152					found = true;
>    153					break;
>    154				}
>    155			}
>    156			if (found)
>    157				continue;
>    158			/* We only support 4bit paletted cursors */
>    159			if (colour_count >= 16) {
>    160				if (warn_palette) {
>    161					dev_info(&dev->pdev->dev, "Video card only supports cursors with up to 16 colours.\n");
>    162					dev_info(&dev->pdev->dev, "Not enabling hardware cursor.\n");
>    163					warn_palette = false; /* Only tell the user once. */
>    164				}
>    165				ret = -EINVAL;
>    166				goto out3;
>    167			}
>    168			*next_space = this_colour;
>    169			next_space++;
>    170			colour_count++;
>    171		}
>    172	
>    173		/* Program colours from cursor icon into palette */
>    174		for (i = 0; i < colour_count; i++) {
>    175			if (i <= 2)
>    176				reg_index = 0x8 + i*0x4;
>    177			else
>    178				reg_index = 0x60 + i*0x3;
>    179			WREG_DAC(reg_index, colour_set[i] & 0xff);
>    180			WREG_DAC(reg_index+1, colour_set[i]>>8 & 0xff);
>    181			WREG_DAC(reg_index+2, colour_set[i]>>16 & 0xff);
>    182			BUG_ON((colour_set[i]>>24 & 0xff) != 0xff);
>    183		}
>    184	
>    185		/* Map up-coming buffer to write colour indices */
>    186		if (!pixels_prev->kmap.virtual) {
>    187			ret = ttm_bo_kmap(&pixels_prev->bo, 0,
>    188					  pixels_prev->bo.num_pages,
>    189					  &pixels_prev->kmap);
>    190			if (ret) {
>    191				dev_err(&dev->pdev->dev, "failed to kmap cursor updates\n");
>    192				goto out3;
>    193			}
>    194		}
>    195	
>    196		/* now write colour indices into hardware cursor buffer */
>    197		for (row = 0; row < 64; row++) {
>    198			memset(&this_row[0], 0, 48);
>    199			for (col = 0; col < 64; col++) {
>    200				this_colour = ioread32(bo->kmap.virtual + 4*(col + 64*row));
>    201				/* write transparent pixels */
>    202				if (this_colour>>24 == 0x0) {
>    203					this_row[47 - col/8] |= 0x80>>(col%8);
>    204					continue;
>    205				}
>    206	
>    207				/* write colour index here */
>    208				for (i = 0; i < colour_count; i++) {
>    209					if (colour_set[i] == this_colour) {
>    210						if (col % 2)
>    211							this_row[col/2] |= i<<4;
>    212						else
>    213							this_row[col/2] |= i;
>    214						break;
>    215					}
>    216				}
>    217			}
>    218			memcpy_toio(pixels_prev->kmap.virtual + row*48, &this_row[0], 48);
>    219		}
>    220	
>    221		/* Program gpu address of cursor buffer */
>
> ---
> 0-DAY kernel build testing backend              Open Source Technology Center
> http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation


More information about the dri-devel mailing list